From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53E345DB1EC; Mon, 19 Apr 2021 00:17: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 4FNnSG1wRRz4j23; Mon, 19 Apr 2021 00:17: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 30C4B15815; Mon, 19 Apr 2021 00:17: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 13J0H2lH078801; Mon, 19 Apr 2021 00:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H2gN078800; Mon, 19 Apr 2021 00:17:02 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:02 GMT Message-Id: <202104190017.13J0H2gN078800@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: 5232a35f1ed7 - main - bhyve.8: Clean up block storage device backends description 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: 5232a35f1ed7b8fa4f378897598438c2056ef60e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:02 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5232a35f1ed7b8fa4f378897598438c2056ef60e commit 5232a35f1ed7b8fa4f378897598438c2056ef60e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:39:53 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:12 +0000 bhyve.8: Clean up block storage device backends description MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 4eba24455b69..5c73852b422c 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -405,29 +405,33 @@ must comply with .Xr netgraph 4 addressing rules. .Pp -Block storage devices: -.Bl -tag -width 10n -.It Pa /filename Ns Oo , Ns Ar block-device-options Oc -.It Pa /dev/xxx Ns Oo , Ns Ar block-device-options Oc +Block storage device backends: +.Sm off +.Bl -bullet +.It +.Ar /filename Op Cm \&, Ar block-device-options +.It +.Ar /dev/xxx Op Cm \&, Ar block-device-options .El +.Sm on .Pp The .Ar block-device-options are: -.Bl -tag -width 8n -.It Li nocache +.Bl -tag -width 10n +.It Cm nocache Open the file with .Dv O_DIRECT . -.It Li direct +.It Cm direct Open the file using .Dv O_SYNC . -.It Li ro +.It Cm ro Force the file to be opened read-only. -.It Li sectorsize= Ns Ar logical Ns Oo / Ns Ar physical Oc +.It Cm sectorsize= Ns Ar logical Ns Oo Cm \&/ Ns Ar physical Oc Specify the logical and physical sector sizes of the emulated disk. The physical sector size is optional and is equal to the logical sector size if not explicitly specified. -.It Li nodelete +.It Cm nodelete Disable emulation of guest trim requests via .Dv DIOCGDELETE requests. @@ -647,7 +651,6 @@ Playback device, typically Recording device, typically .Ar /dev/dsp0 . .El -.El .It Fl U Ar uuid Set the universally unique identifier .Pq UUID From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7779A5DB48C; Mon, 19 Apr 2021 00:17: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 4FNnSH2rXrz4hrD; Mon, 19 Apr 2021 00:17: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 4FE1015A23; Mon, 19 Apr 2021 00:17: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 13J0H31w078829; Mon, 19 Apr 2021 00:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H39r078828; Mon, 19 Apr 2021 00:17:03 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:03 GMT Message-Id: <202104190017.13J0H39r078828@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: 7c5829c94282 - main - bhyve.8: Clean up SCSI device backends section 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: 7c5829c942822561688c9b8239900773c6d82db4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:03 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7c5829c942822561688c9b8239900773c6d82db4 commit 7c5829c942822561688c9b8239900773c6d82db4 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:49:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:12 +0000 bhyve.8: Clean up SCSI device backends section MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 5c73852b422c..f0109fa3d969 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -437,16 +437,19 @@ Disable emulation of guest trim requests via requests. .El .Pp -SCSI devices: -.Bl -tag -width 10n -.It Pa /dev/cam/ctl Ns Oo Ar pp . Ns Ar vp Oc Ns Oo , Ns Ar scsi-device-options Oc +SCSI device backends: +.Sm off +.Bl -bullet +.It +.Pa /dev/cam/ctl Oo Ar pp Cm \&. Ar vp Oc Oo Cm \&, Ar scsi-device-options Oc .El +.Sm on .Pp The .Ar scsi-device-options are: .Bl -tag -width 10n -.It Li iid= Ns Ar IID +.It Cm iid= Ns Ar IID Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47CBB5DB35B; Mon, 19 Apr 2021 00:17: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 4FNnSJ5WZJz4j0J; Mon, 19 Apr 2021 00:17: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 80AB315816; Mon, 19 Apr 2021 00:17: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 13J0H4X8078850; Mon, 19 Apr 2021 00:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H4a7078849; Mon, 19 Apr 2021 00:17:04 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:04 GMT Message-Id: <202104190017.13J0H4a7078849@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: 2d00b57022f0 - main - bhyve.8: Clean up 9P device backends section 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: 2d00b57022f09561706afef9050e0b527c41314a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:05 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2d00b57022f09561706afef9050e0b527c41314a commit 2d00b57022f09561706afef9050e0b527c41314a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 21:52:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:12 +0000 bhyve.8: Clean up 9P device backends section MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f0109fa3d969..1410769d8a37 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -454,16 +454,19 @@ Initiator ID to use when sending requests to specified CTL port. The default value is 0. .El .Pp -9P devices: -.Bl -tag -width 10n -.It Pa sharename=/path/to/share[,9p-device-options] +9P device backends: +.Sm off +.Bl -bullet +.It +.Ar sharename Cm = Ar /path/to/share Op Cm \&, Ar 9p-device-options .El +.Sm on .Pp The .Ar 9p-device-options are: .Bl -tag -width 10n -.It Li ro +.It Cm ro Expose the share in read-only mode. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F005C5DB2B8; Mon, 19 Apr 2021 00:17: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 4FNnSK5YGtz4htV; Mon, 19 Apr 2021 00:17: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 9E67515817; Mon, 19 Apr 2021 00:17: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 13J0H5dQ078871; Mon, 19 Apr 2021 00:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H5DY078870; Mon, 19 Apr 2021 00:17:05 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:05 GMT Message-Id: <202104190017.13J0H5DY078870@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: 2fda01a1b7e9 - main - bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions 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: 2fda01a1b7e958e6cfffda512954b8d6c40a064e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:06 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2fda01a1b7e958e6cfffda512954b8d6c40a064e commit 2fda01a1b7e958e6cfffda512954b8d6c40a064e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:09:22 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:12 +0000 bhyve.8: Clean up TTY, boot ROM, and pass-through descriptions MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 1410769d8a37..06356a64f596 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -470,28 +470,28 @@ are: Expose the share in read-only mode. .El .Pp -TTY devices: +TTY device backends: .Bl -tag -width 10n -.It Li stdio +.It Cm stdio Connect the serial port to the standard input and output of the .Nm process. -.It Pa /dev/xxx +.It Ar /dev/xxx Use the host TTY device for serial port I/O. .El .Pp -Boot ROM device: +Boot ROM device backends: .Bl -tag -width 10n -.It Pa romfile +.It Ar romfile Map .Ar romfile in the guest address space reserved for boot firmware. .El .Pp -Pass-through devices: +Pass-through device backends: .Bl -tag -width 10n -.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function +.It Ns Ar slot Ns Cm \&/ Ns Ar bus Ns Cm \&/ Ns Ar function Connect to a PCI device on the host at the selector described by .Ar slot , .Ar bus , From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB0475DB51B; Mon, 19 Apr 2021 00: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 4FNnSN3NPPz4hcs; Mon, 19 Apr 2021 00: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 DD73D156C5; Mon, 19 Apr 2021 00:17: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 13J0H7Gm078913; Mon, 19 Apr 2021 00:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H7JG078912; Mon, 19 Apr 2021 00:17:07 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:07 GMT Message-Id: <202104190017.13J0H7JG078912@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: 8b97e97548bd - main - bhyve.8: Improve framebuffer backends description 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: 8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:09 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c commit 8b97e97548bdc74cf3b4939a0b21cfdd27d8c11c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:59:44 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:13 +0000 bhyve.8: Improve framebuffer backends description - Use appropriate mdoc macros - Document that tcp= is a synonym to rfb= (tcp is used in the examples, but never mentioned) - Clarify the IP address specification MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 62 +++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 88be882039c4..afc3a5c615c8 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -540,35 +540,52 @@ resize at present. Emergency write is advertised, but no-op at present. .El .Pp -Framebuffer devices: +Framebuffer devices backends: +.Bl -bullet +.Sm off +.It +.Op Cm rfb= Ar ip-and-port +.Op Cm ,w= Ar width +.Op Cm ,h= Ar height +.Op Cm ,vga= Ar vgaconf +.Op Cm ,wait +.Op Cm ,password= Ar password +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Xo -.Oo rfb= Ns Oo Ar IP\&: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns -.Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns -.Ar password Oc -.Xc -.Bl -tag -width 8n -.It Ar IPv4:port No or Ar [IPv6%zone]:port -An -.Ar IP -address and a +.It Cm rfb= Ns Ar ip-and-port Pq or Cm tcp= Ns Ar ip-and-port +An IP address and a port VNC should listen on. +There are two formats: +.Pp +.Bl -bullet -compact +.It IPv4 +.Sm off +.Op Ar IPv4 Cm \&: .Ar port -VNC should listen on. +.Sm on +.It IPv6 +.Sm off +.Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port +.Sm on +.El +.Pp The default is to listen on localhost IPv4 address and default VNC port 5900. An IPv6 address must be enclosed in square brackets and may contain an optional zone identifier. -.It Ar width No and Ar height +.It Cm w= Ns Ar width No and Cm h= Ns Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. Minimal supported resolution is 640x480 pixels, and maximum is 1920x1200 pixels. -.It Ar vgaconf +.It Cm vga= Ns Ar vgaconf Possible values for this option are -.Dq io +.Cm io (default), -.Dq on +.Cm on , and -.Dq off . +.Cm off . PCI graphics cards have a dual personality in that they are standard PCI devices with BAR addressing, but may also implicitly decode legacy VGA I/O space @@ -576,18 +593,18 @@ implicitly decode legacy VGA I/O space and memory space .Pq 64KB at Ad 0xA0000 . The default -.Dq io +.Cm io option should be used for guests that attempt to issue BIOS calls which result in I/O port queries, and fail to boot if I/O decode is disabled. .Pp The -.Dq on +.Cm on option should be used along with the CSM BIOS capability in UEFI to boot traditional BIOS guests that require the legacy VGA I/O and memory regions to be available. .Pp The -.Dq off +.Cm off option should be used for the UEFI guests that assume that VGA adapter is present if they detect the I/O ports. An example of such a guest is @@ -600,19 +617,18 @@ Please refer to the wiki page .Pq Lk https://wiki.freebsd.org/bhyve for configuration notes of particular guests. -.It wait +.It Cm wait Instruct .Nm to only boot upon the initiation of a VNC connection, simplifying the installation of operating systems that require immediate keyboard input. This can be removed for post-installation use. -.It password +.It Cm password= Ns Ar password This type of authentication is known to be cryptographically weak and is not intended for use on untrusted networks. Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El -.El .Pp xHCI USB devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB4BE5DB492; Mon, 19 Apr 2021 00:17: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 4FNnSM3yjZz4hrL; Mon, 19 Apr 2021 00:17: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 C56E2156C4; Mon, 19 Apr 2021 00:17: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 13J0H6he078892; Mon, 19 Apr 2021 00:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0H6Lw078891; Mon, 19 Apr 2021 00:17:06 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:06 GMT Message-Id: <202104190017.13J0H6Lw078891@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: 3f4c771f64e8 - main - bhyve.8: Clean up virtio console device backends description 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: 3f4c771f64e816750de08ab6fd7e7bf29398f5fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:08 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3f4c771f64e816750de08ab6fd7e7bf29398f5fb commit 3f4c771f64e816750de08ab6fd7e7bf29398f5fb Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 22:23:26 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:13 +0000 bhyve.8: Clean up virtio console device backends description MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 06356a64f596..88be882039c4 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -509,9 +509,14 @@ The host device must have been reserved at boot-time using the loader variable as described in .Xr vmm 4 . .Pp -Virtio console devices: -.Bl -tag -width 10n -.It Li port1= Ns Pa /path/to/port1.sock Ns ,anotherport= Ns Pa ... +Virtio console device backends: +.Bl -bullet +.Sm off +.It +.Cm port1= Ns Ar /path/to/port1.sock Ns Op Cm ,port Ns Ar N Cm \&= Ns Ar /path/to/port2.sock No \~ Ar ... +.Sm on +.El +.Pp A maximum of 16 ports per device can be created. Every port is named and corresponds to a Unix domain socket created by .Nm . @@ -519,7 +524,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset 2n +.Bl -bullet -offset .It Due to lack of destructors in .Nm , @@ -527,12 +532,13 @@ sockets on the filesystem must be cleaned up manually after .Nm exits. .It -There is no way to use the "console port" feature, nor the console port +There is no way to use the +.Dq console port +feature, nor the console port resize at present. .It Emergency write is advertised, but no-op at present. .El -.El .Pp Framebuffer devices: .Bl -tag -width 10n From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 447265DB444; Mon, 19 Apr 2021 00:17: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 4FNnSR3Svtz4j0b; Mon, 19 Apr 2021 00: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 3917E15A25; Mon, 19 Apr 2021 00: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 13J0HBMb078982; Mon, 19 Apr 2021 00: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 13J0HBnQ078981; Mon, 19 Apr 2021 00:17:11 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:11 GMT Message-Id: <202104190017.13J0HBnQ078981@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: 061f37d28097 - main - bhyve: Document the format for HD audio backends 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: 061f37d280976e0f79f823c732fa80825ce48ded Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:12 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=061f37d280976e0f79f823c732fa80825ce48ded commit 061f37d280976e0f79f823c732fa80825ce48ded Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:50:29 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:14 +0000 bhyve: Document the format for HD audio backends - This change is done for consistency with other backend definitions. MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 7bbb663665d7..bf3c792dd235 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -707,12 +707,21 @@ Revision Number with maximum 8 characters. Model Number with maximum 40 characters. .El .Pp -HD Audio devices: +HD Audio device backends: +.Bl -bullet +.It +.Sm off +.Op Cm play= Ar playback +.Op Cm ,rec= Ar recording +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li play +.It Cm play Playback device, typically .Ar /dev/dsp0 . -.It Li rec +.It Cm rec Recording device, typically .Ar /dev/dsp0 . .El From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA1E95DB3A9; Mon, 19 Apr 2021 00:17: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 4FNnSS4mc6z4htt; Mon, 19 Apr 2021 00:17: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 6E23D15A26; Mon, 19 Apr 2021 00:17: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 13J0HCFo079003; Mon, 19 Apr 2021 00:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0HCqH079002; Mon, 19 Apr 2021 00:17:12 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:12 GMT Message-Id: <202104190017.13J0HCqH079002@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: 8d9fefe64334 - main - bhyve.8: Fix mandoc -Tlint issues 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: 8d9fefe64334818a27812658bf9efd0371fbc77c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:14 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8d9fefe64334818a27812658bf9efd0371fbc77c commit 8d9fefe64334818a27812658bf9efd0371fbc77c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:53:06 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:14 +0000 bhyve.8: Fix mandoc -Tlint issues While here, keep network backends section consistent with other sections. MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index bf3c792dd235..79b6d9bfb240 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -56,7 +56,7 @@ .Sm off .Ar memsize .Oo -.Cm K No | Cm k No | Cm M No | Cm m No | Cm G No | Cm g No | Cm T No | Cm t +.Cm K | Cm k | Cm M | Cm m | Cm G | Cm g | Cm T | Cm t .Oc .Sm on .Oc @@ -339,8 +339,7 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network backends formats for -.Ar conf : +Network device backends: .Sm off .Bl -bullet .It @@ -524,7 +523,7 @@ Every port is named and corresponds to a Unix domain socket created by accepts at most one connection per port at a time. .Pp Limitations: -.Bl -bullet -offset +.Bl -bullet .It Due to lack of destructors in .Nm , @@ -560,12 +559,12 @@ An IP address and a port VNC should listen on. There are two formats: .Pp .Bl -bullet -compact -.It IPv4 +.It .Sm off .Op Ar IPv4 Cm \&: .Ar port .Sm on -.It IPv6 +.It .Sm off .Cm \&[ Ar IPv6%zone Cm \&] Cm \&: Ar port .Sm on From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FDDF5DB39C; Mon, 19 Apr 2021 00: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 4FNnSQ20mPz4hnl; Mon, 19 Apr 2021 00: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 18D4515A24; Mon, 19 Apr 2021 00: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 13J0HAdN078961; Mon, 19 Apr 2021 00: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 13J0HAt7078960; Mon, 19 Apr 2021 00:17:10 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:10 GMT Message-Id: <202104190017.13J0HAt7078960@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: d5fcc4b6066e - main - bhyve.8: Improve AHCI backends documentation 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: d5fcc4b6066e878ed70bce7a52d6aca605befde5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:11 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d5fcc4b6066e878ed70bce7a52d6aca605befde5 commit d5fcc4b6066e878ed70bce7a52d6aca605befde5 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:44:23 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:13 +0000 bhyve.8: Improve AHCI backends documentation - Document the backend format. MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index e5eec5288204..7bbb663665d7 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -681,15 +681,29 @@ and .Cm disable . .El .Pp -AHCI devices: +AHCI device backends: +.Bl -bullet +.It +.Sm off +.Op Oo Cm hd\&: | cd\&: Oc Ar path +.Op Cm ,nmrr= Ar nmrr +.Op Cm ,ser= Ar # +.Op Cm ,rev= Ar # +.Op Cm ,model= Ar # +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li nmrr -Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as Solid State Disk. default value is 0, not report. -.It Li ser +.It Cm nmrr +Nominal Media Rotation Rate, known as RPM. +Value 1 will indicate device as Solid State Disk. +Default value is 0, not report. +.It Cm ser Serial Number with maximum 20 characters. -.It Li rev +.It Cm rev Revision Number with maximum 8 characters. -.It Li model +.It Cm model Model Number with maximum 40 characters. .El .Pp From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:17:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A72E05DB43B; Mon, 19 Apr 2021 00: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 4FNnSP1Vn7z4j4W; Mon, 19 Apr 2021 00: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 EEE50156C6; Mon, 19 Apr 2021 00: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 13J0H8NO078940; Mon, 19 Apr 2021 00: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 13J0H8Rl078939; Mon, 19 Apr 2021 00:17:08 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:17:08 GMT Message-Id: <202104190017.13J0H8Rl078939@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: 6eff58acc776 - main - bhyve.8: Improve documentation of NVME backend 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: 6eff58acc776d8308863f49b89664997d4642a4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:17:09 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6eff58acc776d8308863f49b89664997d4642a4e commit 6eff58acc776d8308863f49b89664997d4642a4e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 23:16:51 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 00:16:13 +0000 bhyve.8: Improve documentation of NVME backend - Document the configuration format. - Document two additional configuration options: eui64 and dsm. MFC after: 2 weeks --- usr.sbin/bhyve/bhyve.8 | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index afc3a5c615c8..e5eec5288204 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -630,32 +630,55 @@ Many implementations will want to use stronger security, such as running the session over an encrypted channel provided by IPsec or SSH. .El .Pp -xHCI USB devices: +xHCI USB device backends: .Bl -tag -width 10n -.It Li tablet +.It Cm tablet A USB tablet device which provides precise cursor synchronization when using VNC. .El .Pp -NVMe devices: +NVMe device backends: +.Bl -bullet +.Sm off +.It +.Ar devpath +.Op Cm ,maxq= Ar # +.Op Cm ,qsz= Ar # +.Op Cm ,ioslots= Ar # +.Op Cm ,sectsz= Ar # +.Op Cm ,ser= Ar # +.Op Cm ,eui64= Ar # +.Op Cm ,dsm= Ar opt +.Sm on +.El +.Pp +Configuration options are defined as follows: .Bl -tag -width 10n -.It Li devpath +.It Ar devpath Accepted device paths are: .Ar /dev/blockdev or .Ar /path/to/image or -.Ar ram=size_in_MiB . -.It Li maxq +.Cm ram= Ns Ar size_in_MiB . +.It Cm maxq Max number of queues. -.It Li qsz +.It Cm qsz Max elements in each queue. -.It Li ioslots +.It Cm ioslots Max number of concurrent I/O requests. -.It Li sectsz +.It Cm sectsz Sector size (defaults to blockif sector size). -.It Li ser +.It Cm ser Serial number with maximum 20 characters. +.It Cm eui64 +IEEE Extended Unique Identifier (8 byte value). +.It Cm dsm +DataSet Management support. +Supported values are: +.Cm auto , enable , +and +.Cm disable . .El .Pp AHCI devices: From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:39:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 158035DBF77; Mon, 19 Apr 2021 00:39: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 4FNnyf03xvz4k9J; Mon, 19 Apr 2021 00:39: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 E963E15D90; Mon, 19 Apr 2021 00:39: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 13J0drth005840; Mon, 19 Apr 2021 00:39:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0dr3a005839; Mon, 19 Apr 2021 00:39:53 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:39:53 GMT Message-Id: <202104190039.13J0dr3a005839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: ccd08b9293ca - stable/13 - nfsd: make the server repeat CB_RECALL every couple of seconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ccd08b9293cac51b3c4dcb5e0d261cb7aac0ffef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:39:54 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ccd08b9293cac51b3c4dcb5e0d261cb7aac0ffef commit ccd08b9293cac51b3c4dcb5e0d261cb7aac0ffef Author: Rick Macklem AuthorDate: 2021-04-05 01:15:54 +0000 Commit: Rick Macklem CommitDate: 2021-04-19 00:36:26 +0000 nfsd: make the server repeat CB_RECALL every couple of seconds Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly binding the back channel to a new TCP connection so that it conforms to RFC5661, for NFSv4.1/4.2. An effect of this for the Linux NFS client is that it will do a BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN set in a sequence reply. This will fix the back channel, but the first attempt at a callback like CB_RECALL will already have failed. Without this patch, a CB_RECALL will not be retried and that can result in a 5 minute delay until the delegation times out. This patch modifies the code so that it will retry the CB_RECALL every couple of seconds, often avoiding the 5 minute delay. This is not critical for correct behaviour, but avoids the 5 minute delay for the case where the Linux client re-binds the back channel via BindConnectionToSession. (cherry picked from commit 7a606f280a3e174dcdd12736b7b976903809eb9c) --- sys/fs/nfs/nfsrvstate.h | 2 ++ sys/fs/nfsserver/nfs_nfsdstate.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 2d60e8e8141f..427d5b132281 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -220,6 +220,7 @@ struct nfsstate { time_t expiry; time_t limit; u_int64_t compref; + time_t last; } deleg; } ls_un; struct nfslockfile *ls_lfp; /* Back pointer */ @@ -238,6 +239,7 @@ struct nfsstate { #define ls_delegtime ls_un.deleg.expiry #define ls_delegtimelimit ls_un.deleg.limit #define ls_compref ls_un.deleg.compref +#define ls_lastrecall ls_un.deleg.last /* * Nfs lock structure. diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 1cf0dcee99e9..fa7bb3ba9f56 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -3070,6 +3070,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, new_deleg->ls_stateid), new_deleg, ls_hash); @@ -3191,6 +3192,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; nfsrv_writedelegcnt++; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, @@ -3261,6 +3263,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, new_deleg->ls_stateid), new_deleg, ls_hash); @@ -3339,6 +3342,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, @@ -5265,7 +5269,8 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * - check to see if the delegation has expired * - if so, get the v4root lock and then expire it */ - if (!(stp->ls_flags & NFSLCK_DELEGRECALL)) { + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || stp->ls_lastrecall < + time_uptime) { /* * - do a recall callback, since not yet done * For now, never allow truncate to be set. To use @@ -5280,11 +5285,14 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * will be extended when ops are done on the delegation * stateid, up to the timelimit.) */ - stp->ls_delegtime = NFSD_MONOSEC + (2 * nfsrv_lease) + - NFSRV_LEASEDELTA; - stp->ls_delegtimelimit = NFSD_MONOSEC + (6 * nfsrv_lease) + - NFSRV_LEASEDELTA; - stp->ls_flags |= NFSLCK_DELEGRECALL; + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0) { + stp->ls_delegtime = NFSD_MONOSEC + (2 * nfsrv_lease) + + NFSRV_LEASEDELTA; + stp->ls_delegtimelimit = NFSD_MONOSEC + (6 * + nfsrv_lease) + NFSRV_LEASEDELTA; + stp->ls_flags |= NFSLCK_DELEGRECALL; + } + stp->ls_lastrecall = time_uptime + 1; /* * Loop NFSRV_CBRETRYCNT times while the CBRecall replies From owner-dev-commits-src-all@freebsd.org Mon Apr 19 00:44:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13D645DC7D9; Mon, 19 Apr 2021 00:44: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 4FNp3z036jz4kVn; Mon, 19 Apr 2021 00:44: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 E49D215E28; Mon, 19 Apr 2021 00:44: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 13J0iU01018345; Mon, 19 Apr 2021 00:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J0iUgH018344; Mon, 19 Apr 2021 00:44:30 GMT (envelope-from git) Date: Mon, 19 Apr 2021 00:44:30 GMT Message-Id: <202104190044.13J0iUgH018344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 1efbf1a24cfb - stable/12 - nfsd: make the server repeat CB_RECALL every couple of seconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1efbf1a24cfbfb659712ebb29c92b8589485faff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 00:44:31 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=1efbf1a24cfbfb659712ebb29c92b8589485faff commit 1efbf1a24cfbfb659712ebb29c92b8589485faff Author: Rick Macklem AuthorDate: 2021-04-05 01:15:54 +0000 Commit: Rick Macklem CommitDate: 2021-04-19 00:41:07 +0000 nfsd: make the server repeat CB_RECALL every couple of seconds Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly binding the back channel to a new TCP connection so that it conforms to RFC5661, for NFSv4.1/4.2. An effect of this for the Linux NFS client is that it will do a BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN set in a sequence reply. This will fix the back channel, but the first attempt at a callback like CB_RECALL will already have failed. Without this patch, a CB_RECALL will not be retried and that can result in a 5 minute delay until the delegation times out. This patch modifies the code so that it will retry the CB_RECALL every couple of seconds, often avoiding the 5 minute delay. This is not critical for correct behaviour, but avoids the 5 minute delay for the case where the Linux client re-binds the back channel via BindConnectionToSession. (cherry picked from commit 7a606f280a3e174dcdd12736b7b976903809eb9c) --- sys/fs/nfs/nfsrvstate.h | 2 ++ sys/fs/nfsserver/nfs_nfsdstate.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 2d60e8e8141f..427d5b132281 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -220,6 +220,7 @@ struct nfsstate { time_t expiry; time_t limit; u_int64_t compref; + time_t last; } deleg; } ls_un; struct nfslockfile *ls_lfp; /* Back pointer */ @@ -238,6 +239,7 @@ struct nfsstate { #define ls_delegtime ls_un.deleg.expiry #define ls_delegtimelimit ls_un.deleg.limit #define ls_compref ls_un.deleg.compref +#define ls_lastrecall ls_un.deleg.last /* * Nfs lock structure. diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 09b637c14e52..5aafebf0dd77 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -3071,6 +3071,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, new_deleg->ls_stateid), new_deleg, ls_hash); @@ -3192,6 +3193,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; nfsrv_writedelegcnt++; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, @@ -3262,6 +3264,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, new_deleg->ls_stateid), new_deleg, ls_hash); @@ -3340,6 +3343,7 @@ tryagain: new_deleg->ls_clp = clp; new_deleg->ls_filerev = filerev; new_deleg->ls_compref = nd->nd_compref; + new_deleg->ls_lastrecall = 0; LIST_INSERT_HEAD(&lfp->lf_deleg, new_deleg, ls_file); LIST_INSERT_HEAD(NFSSTATEHASH(clp, @@ -5252,7 +5256,8 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * - check to see if the delegation has expired * - if so, get the v4root lock and then expire it */ - if (!(stp->ls_flags & NFSLCK_DELEGRECALL)) { + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0 || stp->ls_lastrecall < + time_uptime) { /* * - do a recall callback, since not yet done * For now, never allow truncate to be set. To use @@ -5267,11 +5272,14 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, * will be extended when ops are done on the delegation * stateid, up to the timelimit.) */ - stp->ls_delegtime = NFSD_MONOSEC + (2 * nfsrv_lease) + - NFSRV_LEASEDELTA; - stp->ls_delegtimelimit = NFSD_MONOSEC + (6 * nfsrv_lease) + - NFSRV_LEASEDELTA; - stp->ls_flags |= NFSLCK_DELEGRECALL; + if ((stp->ls_flags & NFSLCK_DELEGRECALL) == 0) { + stp->ls_delegtime = NFSD_MONOSEC + (2 * nfsrv_lease) + + NFSRV_LEASEDELTA; + stp->ls_delegtimelimit = NFSD_MONOSEC + (6 * + nfsrv_lease) + NFSRV_LEASEDELTA; + stp->ls_flags |= NFSLCK_DELEGRECALL; + } + stp->ls_lastrecall = time_uptime + 1; /* * Loop NFSRV_CBRETRYCNT times while the CBRecall replies From owner-dev-commits-src-all@freebsd.org Mon Apr 19 01:16:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B38C25DD424 for ; Mon, 19 Apr 2021 01:16: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 4FNpnF4g4Hz4lVt; Mon, 19 Apr 2021 01:16: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 8EB77162AC; Mon, 19 Apr 2021 01:16: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 13J1Gn4M058462; Mon, 19 Apr 2021 01:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J1Gnb5058461; Mon, 19 Apr 2021 01:16:49 GMT (envelope-from git) Date: Mon, 19 Apr 2021 01:16:49 GMT Message-Id: <202104190116.13J1Gnb5058461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: 1737d9dd586f - vendor/less - Vendor import of less v581. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/vendor/less X-Git-Reftype: branch X-Git-Commit: 1737d9dd586fd32916293643b7b06c088f8c22e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 01:16:49 -0000 The branch vendor/less has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1737d9dd586fd32916293643b7b06c088f8c22e7 commit 1737d9dd586fd32916293643b7b06c088f8c22e7 Author: Xin LI AuthorDate: 2021-04-19 01:15:19 +0000 Commit: Xin LI CommitDate: 2021-04-19 01:15:19 +0000 Vendor import of less v581. --- INSTALL | 10 +- Makefile.aut | 18 +- Makefile.wng | 132 +++++++ Makefile.wnm | 2 +- NEWS | 50 ++- README | 38 +- brac.c | 2 +- ch.c | 54 ++- charset.c | 154 ++++---- charset.h | 2 +- cmd.h | 20 +- cmdbuf.c | 87 ++-- command.c | 189 ++++++--- configure | 4 +- configure.ac | 4 +- cvt.c | 12 +- decode.c | 367 ++++++++--------- defines.ds | 2 +- defines.h.in | 12 + defines.o2 | 2 +- defines.o9 | 2 +- defines.wn | 2 +- edit.c | 33 +- filename.c | 29 +- forwback.c | 11 +- funcs.h | 35 +- help.c | 24 +- ifile.c | 39 +- input.c | 45 ++- jump.c | 2 +- less.h | 419 +++++++++++--------- less.hlp | 22 +- less.man | 1244 ++++++++++++++++++++++++++++++++-------------------------- less.nro | 204 ++++++++-- lessecho.c | 14 +- lessecho.man | 6 +- lessecho.nro | 8 +- lesskey.c | 163 ++++---- lesskey.h | 38 +- lesskey.man | 71 ++-- lesskey.nro | 25 +- lglob.h | 110 +++--- line.c | 905 ++++++++++++++++++++++++------------------ linenum.c | 31 +- lsystem.c | 44 ++- main.c | 84 ++-- mark.c | 26 +- mkfuncs.pl | 0 mkfuncs.py | 26 ++ mkhelp.py | 36 ++ optfunc.c | 309 +++++++++++---- option.c | 25 +- option.h | 62 +-- opttbl.c | 154 +++++--- os.c | 94 ++++- output.c | 612 +++++++++++++++-------------- pattern.c | 11 +- pattern.h | 18 +- pckeys.h | 38 +- position.c | 12 +- position.h | 12 +- prompt.c | 88 ++--- regexp.h | 14 +- screen.c | 780 ++++++++++++++++++++++++++---------- scrsize.c | 2 +- search.c | 359 +++++++++++++---- signal.c | 11 +- tags.c | 77 ++-- ttyin.c | 51 ++- version.c | 29 +- 70 files changed, 4716 insertions(+), 2901 deletions(-) diff --git a/INSTALL b/INSTALL index c2ab230e4470..78ae93246d88 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ - This file describes how to build and install less using -the "configure" script. This only works on Unix systems. -To install on other systems, read the README file. +This file contains generic instructions on how to build and +install software using autoconf. For specific instructions +on how to build "less", see the README or README.VER file. Basic Installation @@ -24,8 +24,8 @@ diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change + The file `configure.ac' is used to create `configure' by a program +called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: diff --git a/Makefile.aut b/Makefile.aut index 89309b583e2a..b6f2101cf10f 100644 --- a/Makefile.aut +++ b/Makefile.aut @@ -1,13 +1,21 @@ # Makefile for authoring less. EMAIL = bug-less@gnu.org -HOMEPAGE = http://www.greenwoodsoftware.com/less +HOMEPAGE = https://greenwoodsoftware.com/less SHELL = /bin/sh GIT = git NROFF = nroff -t -man srcdir = . +ifeq ($(USE_PYTHON),1) + MKHELP = mkhelp.py + MKFUNCS = mkfuncs.py +else + MKHELP = mkhelp.pl + MKFUNCS = mkfuncs.pl +endif + SRC = \ main.c screen.c brac.c ch.c charset.c cmdbuf.c \ command.c cvt.c decode.c edit.c filename.c forwback.c \ @@ -19,7 +27,7 @@ DISTFILES_W = \ defines.ds Makefile.dsb Makefile.dsg Makefile.dsu \ defines.o2 Makefile.o2e \ defines.o9 Makefile.o9c Makefile.o9u \ - defines.wn Makefile.wnm Makefile.wnb \ + defines.wn Makefile.wnm Makefile.wnb Makefile.wng \ configure UNICODE_FILES = \ compose.uni fmt.uni ubin.uni wide.uni @@ -33,6 +41,7 @@ DISTFILES = \ less.nro less.man lesskey.nro lesskey.man lessecho.nro lessecho.man \ less.hlp \ mkfuncs.pl mkhelp.pl \ + mkfuncs.py mkhelp.py \ mkutable $(UNICODE_FILES) \ ${DISTFILES_W} @@ -49,7 +58,7 @@ release: .FORCE help.c: less.hlp -mv -f ${srcdir}/help.c ${srcdir}/help.c.old rm -rf help.c - ${srcdir}/mkhelp.pl < less.hlp > help.c + ${srcdir}/${MKHELP} < less.hlp > help.c if cmp -s help.c help.c.old; then mv -f help.c.old help.c; fi ${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac ${srcdir}/Makefile.in @@ -57,7 +66,7 @@ ${srcdir}/configure ${srcdir}/defines.h.in: ${srcdir}/configure.ac ${srcdir}/Mak funcs.h: ${SRC:%=${srcdir}/%} -mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old - perl ${srcdir}/mkfuncs.pl ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h + ${srcdir}/${MKFUNCS} ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h if cmp -s funcs.h funcs.h.old; then mv -f funcs.h.old funcs.h; fi lint: @@ -80,7 +89,6 @@ REPLACE_VERSION = \ sed \ -e "s;@@VERSION@@;$$REL;" \ -e "s;@@DATE@@;$$DT;" \ - -e "s;@@EMAIL@@;${EMAIL};" \ -e "s;@@HOMEPAGE@@;${HOMEPAGE};" >$@ ${srcdir}/README: ${srcdir}/README.VER ${srcdir}/version.c diff --git a/Makefile.wng b/Makefile.wng new file mode 100644 index 000000000000..85686068c57b --- /dev/null +++ b/Makefile.wng @@ -0,0 +1,132 @@ +# Makefile for less using mingw-w64 package: +# http://mingw-w64.org/doku.php +# +# Derived from Makefile.wnm +# +# Usage: mingw32-make -f Makefile.wng [REGEX_PACKAGE={posix|gnu|regcomp-local}] +# +# The optional command line parameter "REGEX_PACKAGE" is used to specify +# a regular expression package for compilation and linking. This parameter +# can assume one of three values. +# +# REGEX_PACKAGE == regcomp-local +# This choice selects the regular expression package written by Henry +# Spencer. It is implemented by the repository file "regexp.c". +# +# REGEX_PACKAGE == posix +# This choice selects the POSIX implementation and is provided by MingW. +# This is the default choice. +# +# REGEX_PACKAGE == gnu +# This choice selects the GNU implementation and is provided by MingW. +# + +#### Start of system configuration section. #### + +CC = gcc + +# Definitions specific to mingw +# +MINGW_DEFINES = -DMINGW -DWIN32 + +# This specifies the "root" directory of the MingW installation. +# It is defined so that the compiler and linker can find the header files +# and library that provide regular expression support. +# +MINGW_ROOT_PATH = /mingw-w64/mingw64 + +# Determine the regular expression package to be used. +# +REGEX_PACKAGE ?= posix +ifeq (${REGEX_PACKAGE},regcomp-local) + MINGW_DEFINES += -DUSE_REGEXP_C +else ifeq (${REGEX_PACKAGE},posix) + MINGW_DEFINES += -DUSE_POSIX_REGCOMP +else ifeq (${REGEX_PACKAGE},gnu) + MINGW_DEFINES += -DUSE_GNU_REGEX +else + $(error REGEX_PACKAGE must be posix, gnu or regcomp-local) +endif + +MINGW_REGEX_IPATH = -I${MINGW_ROOT_PATH}/opt/include +MINGW_REGEX_LPATH = -L${MINGW_ROOT_PATH}/opt/lib +MINGW_REGEX_LIB = -lregex + +CFLAGS_MINGW = ${MINGW_DEFINES} +ifneq (${REGEX_PACKAGE},regcomp-local) +CFLAGS_MINGW += ${MINGW_REGEX_IPATH} +endif + +# MingW may use sh.exe instead of cmd.exe. +# Make sure it does not. +# +SHELL = cmd.exe + +CFLAGS = -O2 ${CFLAGS_MINGW} +ifneq (${REGEX_PACKAGE},regcomp-local) +LDFLAGS = ${MINGW_REGEX_LPATH} +LIBS = ${MINGW_REGEX_LIB} +endif + +#### End of system configuration section. #### + +# This rule allows us to supply the necessary -D options +# in addition to whatever the user asks for. +.c.o: + ${CC} -c -I. ${CFLAGS} $< + +LESS_SRC = brac.c ch.c charset.c cmdbuf.c command.c \ + cvt.c decode.c edit.c filename.c forwback.c \ + ifile.c input.c jump.c line.c linenum.c \ + lsystem.c main.c mark.c optfunc.c option.c \ + opttbl.c os.c output.c pattern.c position.c \ + prompt.c screen.c scrsize.c search.c \ + signal.c tags.c ttyin.c version.c +ifeq (${REGEX_PACKAGE},regcomp-local) +LESS_SRC += regexp.c +endif + +OBJ = \ + main.o screen.o brac.o ch.o charset.o cmdbuf.o \ + command.o cvt.o decode.o edit.o filename.o forwback.o \ + help.o ifile.o input.o jump.o line.o linenum.o \ + lsystem.o mark.o optfunc.o option.o opttbl.o os.o \ + output.o pattern.o position.o prompt.o search.o signal.o \ + tags.o ttyin.o version.o +ifeq (${REGEX_PACKAGE},regcomp-local) +OBJ += regexp.o +endif + + +all: clean less lesskey lessecho + +less: ${OBJ} + ${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS} + +lesskey: lesskey.o version.o + ${CC} ${LDFLAGS} -o $@ lesskey.o version.o + +lessecho: lessecho.o version.o + ${CC} ${LDFLAGS} -o $@ lessecho.o version.o + +defines.h: defines.wn + copy $< $@ + +funcs.h: + perl mkfuncs.pl ${LESS_SRC} > $@ + +help.c: less.hlp + perl mkhelp.pl < $< > $@ + +${OBJ}: less.h defines.h funcs.h + +TAGS: + etags *.c *.h + +clean: + -del *.o + -del *.exe + -del defines.h + -del funcs.h + -del help.c + -if exist TAGS del TAGS diff --git a/Makefile.wnm b/Makefile.wnm index 358fa9fed186..cc084a7c96b9 100644 --- a/Makefile.wnm +++ b/Makefile.wnm @@ -6,7 +6,7 @@ CC = cl # Normal flags -CFLAGS = /nologo /MD /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c +CFLAGS = /nologo /W3 /EHsc /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c LDFLAGS = /nologo /subsystem:console /incremental:no # Debugging flags diff --git a/NEWS b/NEWS index b0644fd2e0de..fd214e62007d 100644 --- a/NEWS +++ b/NEWS @@ -4,10 +4,56 @@ ====================================================================== For the latest news about less, see the "less" Web page: - http://www.greenwoodsoftware.com/less + https://greenwoodsoftware.com/less You can also download the latest version of less from there. - To report bugs, suggestions or comments, send email to bug-less@gnu.org + Report bugs, suggestions or comments at + https://github.com/gwsw/less/issues. + +====================================================================== + + Major changes between "less" versions 563 and 581 + +* Change ESC-u command to toggle, not disable, highlighting per man page. + +* Add ESC-U command. + +* Add ctrl-W search modifier for wrapping search. + +* F command can be interrupted by ^X. + +* Support OSC 8 hyperlinks when -R is in effect. + +* g command with no number will ignore -j and put first line at top of screen. + +* Multiple + or -p command line options are handled better. + +* Add the --incsearch option. + +* Add the --line-num-width option. + +* Add the --status-col-width option. + +* Add the --use-color and --color options. + +* Display -w highlight even if highlighted line is empty. + +* If search result is in a long line, scroll to ensure it is visible. + +* Editing the same file under different names now creates only + one entry in the file list. + +* Make visual bell more visible on some terminals. + +* Ring end-of-file bell no more than once per second. + +* Build can use either Python or Perl for Makefile.aut operations. + +* Fix crash when using the @ search modifier. + +* Fix crash in the 's' command due to duplicate free. + +* Fix realpath crash on Darwin. ====================================================================== diff --git a/README b/README index a6ee1dfa62a4..c99d208960cc 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ - Less, version 563 + Less, version 581 - This is the distribution of less, version 563, released 13 Jun 2020. + This is the distribution of less, version 581, released 06 Apr 2021. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -13,33 +13,29 @@ or 2. The Less License, in the file LICENSE. - Please report any problems to bug-less@gnu.org. - See http://www.greenwoodsoftware.com/less for the latest info. + Please report any problems at https://github.com/gwsw/less/issues. + See https://greenwoodsoftware.com/less for the latest info. Source repository is at https://github.com/gwsw/less.git. ========================================================================= -This is the distribution of "less", a paginator similar to "more" or "pg". - The formatted manual page is in less.man. The manual page nroff source is in less.nro. Major changes made since the last posted version are in NEWS. ======================================================================= -PRE-INSTALLATION (when using git) - -If you are building from a clone of a git repository, -type "make -f Makefile.aut". -If you are building from a numbered release package (a tar or zip file -with a name like less-999.tar.gz or less-999.zip), you should skip this step. - -======================================================================= -INSTALLATION (Unix systems only): +INSTALLATION (Unix & Linux systems only): 1. Move the distributed source to its own directory and unpack it, if you have not already done so. -2. Type "sh configure". +2. If you are building from a clone of a git repository, + type "make -f Makefile.aut". + If you are building from a numbered release package (a tar or + zip file with a name like less-999.tar.gz or less-999.zip downloaded + from greenwoodsoftware.com, not from github), you should skip this step. + +3. Type "sh configure". This will generate a Makefile and a defines.h. Warning: if you have a GNU sed, make sure it is version 2.05 or later. @@ -71,7 +67,7 @@ INSTALLATION (Unix systems only): commands, etc. -3. It is a good idea to look over the generated Makefile and defines.h +4. It is a good idea to look over the generated Makefile and defines.h and make sure they look ok. If you know of any peculiarities of your system that configure might not have detected, you may fix the Makefile now. Take particular notice of the list of "terminal" @@ -85,13 +81,13 @@ INSTALLATION (Unix systems only): to remove the descriptions of the features which you are removing. If you edit less.hlp, you should run "make -f Makefile.aut help.c". -4. Type "make" and watch the fun. +5. Type "make" and watch the fun. -5. If the make succeeds, it will generate the programs "less", +6. If the make succeeds, it will generate the programs "less", "lesskey" and "lessecho" in your current directory. Test the generated programs. -6. When satisfied that it works, if you wish to install it +7. When satisfied that it works, if you wish to install it in a public place, type "make install". The default install destinations are: @@ -100,8 +96,6 @@ INSTALLATION (Unix systems only): If you want to install any of these files elsewhere, define bindir and/or mandir to the appropriate directories. -If you have any problems building or running "less", suggestions, -complaints, etc., you may mail to bug-less@gnu.org. Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. diff --git a/brac.c b/brac.c index db3a2951db08..53ada50aab56 100644 --- a/brac.c +++ b/brac.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. diff --git a/ch.c b/ch.c index 70fad1002dbf..bab0692f7437 100644 --- a/ch.c +++ b/ch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -41,7 +41,7 @@ struct bufnode { struct bufnode *hnext, *hprev; }; -#define LBUFSIZE 8192 +#define LBUFSIZE 8192 struct buf { struct bufnode node; BLOCKNUM block; @@ -54,7 +54,7 @@ struct buf { * The file state is maintained in a filestate structure. * A pointer to the filestate is kept in the ifile structure. */ -#define BUFHASH_SIZE 1024 +#define BUFHASH_SIZE 1024 struct filestate { struct bufnode buflist; struct bufnode hashtbl[BUFHASH_SIZE]; @@ -67,24 +67,24 @@ struct filestate { POSITION fsize; }; -#define ch_bufhead thisfile->buflist.next -#define ch_buftail thisfile->buflist.prev -#define ch_nbufs thisfile->nbufs -#define ch_block thisfile->block -#define ch_offset thisfile->offset -#define ch_fpos thisfile->fpos -#define ch_fsize thisfile->fsize -#define ch_flags thisfile->flags -#define ch_file thisfile->file +#define ch_bufhead thisfile->buflist.next +#define ch_buftail thisfile->buflist.prev +#define ch_nbufs thisfile->nbufs +#define ch_block thisfile->block +#define ch_offset thisfile->offset +#define ch_fpos thisfile->fpos +#define ch_fsize thisfile->fsize +#define ch_flags thisfile->flags +#define ch_file thisfile->file -#define END_OF_CHAIN (&thisfile->buflist) -#define END_OF_HCHAIN(h) (&thisfile->hashtbl[h]) -#define BUFHASH(blk) ((blk) & (BUFHASH_SIZE-1)) +#define END_OF_CHAIN (&thisfile->buflist) +#define END_OF_HCHAIN(h) (&thisfile->hashtbl[h]) +#define BUFHASH(blk) ((blk) & (BUFHASH_SIZE-1)) /* * Macros to manipulate the list of buffers in thisfile->buflist. */ -#define FOR_BUFS(bn) \ +#define FOR_BUFS(bn) \ for (bn = ch_bufhead; bn != END_OF_CHAIN; bn = bn->next) #define BUF_RM(bn) \ @@ -106,15 +106,15 @@ struct filestate { /* * Macros to manipulate the list of buffers in thisfile->hashtbl[n]. */ -#define FOR_BUFS_IN_CHAIN(h,bn) \ +#define FOR_BUFS_IN_CHAIN(h,bn) \ for (bn = thisfile->hashtbl[h].hnext; \ bn != END_OF_HCHAIN(h); bn = bn->hnext) -#define BUF_HASH_RM(bn) \ +#define BUF_HASH_RM(bn) \ (bn)->hnext->hprev = (bn)->hprev; \ (bn)->hprev->hnext = (bn)->hnext; -#define BUF_HASH_INS(bn,h) \ +#define BUF_HASH_INS(bn,h) \ (bn)->hnext = thisfile->hashtbl[h].hnext; \ (bn)->hprev = END_OF_HCHAIN(h); \ thisfile->hashtbl[h].hnext->hprev = (bn); \ @@ -240,12 +240,12 @@ ch_get(VOID_PARAM) return ('?'); if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK) { - error("seek error", NULL_PARG); + error("seek error", NULL_PARG); clear_eol(); return (EOI); - } - ch_fpos = pos; - } + } + ch_fpos = pos; + } /* * Read the block. @@ -311,13 +311,7 @@ ch_get(VOID_PARAM) parg.p_string = wait_message(); ierror("%s", &parg); } -#if !MSDOS_COMPILER - sleep(1); -#else -#if MSDOS_COMPILER==WIN32C - Sleep(1000); -#endif -#endif + sleep_ms(2); /* Reduce system load */ slept = TRUE; #if HAVE_STAT_INO diff --git a/charset.c b/charset.c index 4897cbaf6adc..b37c8a29cbd9 100644 --- a/charset.c +++ b/charset.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -40,27 +40,27 @@ struct charset { int *p_flag; char *desc; } charsets[] = { - { "ascii", NULL, "8bcccbcc18b95.b" }, - { "utf-8", &utf_mode, "8bcccbcc18b95.b126.bb" }, - { "iso8859", NULL, "8bcccbcc18b95.33b." }, - { "latin3", NULL, "8bcccbcc18b95.33b5.b8.b15.b4.b12.b18.b12.b." }, - { "arabic", NULL, "8bcccbcc18b95.33b.3b.7b2.13b.3b.b26.5b19.b" }, - { "greek", NULL, "8bcccbcc18b95.33b4.2b4.b3.b35.b44.b" }, - { "greek2005", NULL, "8bcccbcc18b95.33b14.b35.b44.b" }, - { "hebrew", NULL, "8bcccbcc18b95.33b.b29.32b28.2b2.b" }, - { "koi8-r", NULL, "8bcccbcc18b95.b." }, - { "KOI8-T", NULL, "8bcccbcc18b95.b8.b6.b8.b.b.5b7.3b4.b4.b3.b.b.3b." }, - { "georgianps", NULL, "8bcccbcc18b95.3b11.4b12.2b." }, - { "tcvn", NULL, "b..b...bcccbccbbb7.8b95.b48.5b." }, - { "TIS-620", NULL, "8bcccbcc18b95.b.4b.11b7.8b." }, - { "next", NULL, "8bcccbcc18b95.bb125.bb" }, - { "dos", NULL, "8bcccbcc12bc5b95.b." }, - { "windows-1251", NULL, "8bcccbcc12bc5b95.b24.b." }, - { "windows-1252", NULL, "8bcccbcc12bc5b95.b.b11.b.2b12.b." }, - { "windows-1255", NULL, "8bcccbcc12bc5b95.b.b8.b.5b9.b.4b." }, - { "ebcdic", NULL, "5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b." }, - { "IBM-1047", NULL, "4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc191.b" }, - { NULL, NULL, NULL } + { "ascii", NULL, "8bcccbcc18b95.b" }, + { "utf-8", &utf_mode, "8bcccbcc18b95.b126.bb" }, + { "iso8859", NULL, "8bcccbcc18b95.33b." }, + { "latin3", NULL, "8bcccbcc18b95.33b5.b8.b15.b4.b12.b18.b12.b." }, + { "arabic", NULL, "8bcccbcc18b95.33b.3b.7b2.13b.3b.b26.5b19.b" }, + { "greek", NULL, "8bcccbcc18b95.33b4.2b4.b3.b35.b44.b" }, + { "greek2005", NULL, "8bcccbcc18b95.33b14.b35.b44.b" }, + { "hebrew", NULL, "8bcccbcc18b95.33b.b29.32b28.2b2.b" }, + { "koi8-r", NULL, "8bcccbcc18b95.b." }, + { "KOI8-T", NULL, "8bcccbcc18b95.b8.b6.b8.b.b.5b7.3b4.b4.b3.b.b.3b." }, + { "georgianps", NULL, "8bcccbcc18b95.3b11.4b12.2b." }, + { "tcvn", NULL, "b..b...bcccbccbbb7.8b95.b48.5b." }, + { "TIS-620", NULL, "8bcccbcc18b95.b.4b.11b7.8b." }, + { "next", NULL, "8bcccbcc18b95.bb125.bb" }, + { "dos", NULL, "8bcccbcc12bc5b95.b." }, + { "windows-1251", NULL, "8bcccbcc12bc5b95.b24.b." }, + { "windows-1252", NULL, "8bcccbcc12bc5b95.b.b11.b.2b12.b." }, + { "windows-1255", NULL, "8bcccbcc12bc5b95.b.b8.b.5b9.b.4b." }, + { "ebcdic", NULL, "5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b." }, + { "IBM-1047", NULL, "4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc191.b" }, + { NULL, NULL, NULL } }; /* @@ -70,58 +70,58 @@ struct cs_alias { char *name; char *oname; } cs_aliases[] = { - { "UTF-8", "utf-8" }, - { "utf8", "utf-8" }, - { "UTF8", "utf-8" }, - { "ANSI_X3.4-1968", "ascii" }, - { "US-ASCII", "ascii" }, - { "latin1", "iso8859" }, - { "ISO-8859-1", "iso8859" }, - { "latin9", "iso8859" }, - { "ISO-8859-15", "iso8859" }, - { "latin2", "iso8859" }, - { "ISO-8859-2", "iso8859" }, - { "ISO-8859-3", "latin3" }, - { "latin4", "iso8859" }, - { "ISO-8859-4", "iso8859" }, - { "cyrillic", "iso8859" }, - { "ISO-8859-5", "iso8859" }, - { "ISO-8859-6", "arabic" }, - { "ISO-8859-7", "greek" }, - { "IBM9005", "greek2005" }, - { "ISO-8859-8", "hebrew" }, - { "latin5", "iso8859" }, - { "ISO-8859-9", "iso8859" }, - { "latin6", "iso8859" }, - { "ISO-8859-10", "iso8859" }, - { "latin7", "iso8859" }, - { "ISO-8859-13", "iso8859" }, - { "latin8", "iso8859" }, - { "ISO-8859-14", "iso8859" }, - { "latin10", "iso8859" }, - { "ISO-8859-16", "iso8859" }, - { "IBM437", "dos" }, - { "EBCDIC-US", "ebcdic" }, - { "IBM1047", "IBM-1047" }, - { "KOI8-R", "koi8-r" }, - { "KOI8-U", "koi8-r" }, - { "GEORGIAN-PS", "georgianps" }, - { "TCVN5712-1", "tcvn" }, - { "NEXTSTEP", "next" }, - { "windows", "windows-1252" }, /* backward compatibility */ - { "CP1251", "windows-1251" }, - { "CP1252", "windows-1252" }, - { "CP1255", "windows-1255" }, + { "UTF-8", "utf-8" }, + { "utf8", "utf-8" }, + { "UTF8", "utf-8" }, + { "ANSI_X3.4-1968", "ascii" }, + { "US-ASCII", "ascii" }, + { "latin1", "iso8859" }, + { "ISO-8859-1", "iso8859" }, + { "latin9", "iso8859" }, + { "ISO-8859-15", "iso8859" }, + { "latin2", "iso8859" }, + { "ISO-8859-2", "iso8859" }, + { "ISO-8859-3", "latin3" }, + { "latin4", "iso8859" }, + { "ISO-8859-4", "iso8859" }, + { "cyrillic", "iso8859" }, + { "ISO-8859-5", "iso8859" }, + { "ISO-8859-6", "arabic" }, + { "ISO-8859-7", "greek" }, + { "IBM9005", "greek2005" }, + { "ISO-8859-8", "hebrew" }, + { "latin5", "iso8859" }, + { "ISO-8859-9", "iso8859" }, + { "latin6", "iso8859" }, + { "ISO-8859-10", "iso8859" }, + { "latin7", "iso8859" }, + { "ISO-8859-13", "iso8859" }, + { "latin8", "iso8859" }, + { "ISO-8859-14", "iso8859" }, + { "latin10", "iso8859" }, + { "ISO-8859-16", "iso8859" }, + { "IBM437", "dos" }, + { "EBCDIC-US", "ebcdic" }, + { "IBM1047", "IBM-1047" }, + { "KOI8-R", "koi8-r" }, + { "KOI8-U", "koi8-r" }, + { "GEORGIAN-PS", "georgianps" }, + { "TCVN5712-1", "tcvn" }, + { "NEXTSTEP", "next" }, + { "windows", "windows-1252" }, /* backward compatibility */ + { "CP1251", "windows-1251" }, + { "CP1252", "windows-1252" }, + { "CP1255", "windows-1255" }, { NULL, NULL } }; -#define IS_BINARY_CHAR 01 -#define IS_CONTROL_CHAR 02 +#define IS_BINARY_CHAR 01 +#define IS_CONTROL_CHAR 02 static char chardef[256]; static char *binfmt = NULL; static char *utfbinfmt = NULL; -public int binattr = AT_STANDOUT; +public int binattr = AT_STANDOUT|AT_COLOR_BIN; /* @@ -134,9 +134,9 @@ public int binattr = AT_STANDOUT; * repetition of the letter. * * Each letter is one of: - * . normal character - * b binary character - * c control character + * . normal character + * b binary character + * c control character */ static void ichardef(s) @@ -457,16 +457,16 @@ prchar(c) SNPRINTF1(buf, sizeof(buf), "^%c", /* * This array roughly inverts CONTROL() #defined in less.h, - * and should be kept in sync with CONTROL() and IBM-1047. - */ + * and should be kept in sync with CONTROL() and IBM-1047. + */ "@ABC.I.?...KLMNO" "PQRS.JH.XY.." "\\]^_" "......W[.....EFG" "..V....D....TU.Z"[c]); #else - else if (c < 128 && !control_char(c ^ 0100)) - SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100)); + else if (c < 128 && !control_char(c ^ 0100)) + SNPRINTF1(buf, sizeof(buf), "^%c", (int) (c ^ 0100)); #endif else SNPRINTF1(buf, sizeof(buf), binfmt, c); @@ -484,7 +484,7 @@ prutfchar(ch) if (ch == ESC) strcpy(buf, "ESC"); - else if (ch < 128 && control_char(ch)) + else if (ch < 128 && control_char(ch)) { if (!control_char(ch ^ 0100)) SNPRINTF1(buf, sizeof(buf), "^%c", ((char) ch) ^ 0100); @@ -732,9 +732,9 @@ step_char(pp, dir, limit) */ #define DECLARE_RANGE_TABLE_START(name) \ - static struct wchar_range name##_array[] = { + static struct wchar_range name##_array[] = { #define DECLARE_RANGE_TABLE_END(name) \ - }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; + }; struct wchar_range_table name##_table = { name##_array, sizeof(name##_array)/sizeof(*name##_array) }; DECLARE_RANGE_TABLE_START(compose) #include "compose.uni" diff --git a/charset.h b/charset.h index cc0c3af59e89..3e7ecf73db94 100644 --- a/charset.h +++ b/charset.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. diff --git a/cmd.h b/cmd.h index 95a2e5801717..c51f0bc5c4f3 100644 --- a/cmd.h +++ b/cmd.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -31,7 +31,6 @@ #define A_HELP 19 #define A_NEXT_FILE 20 #define A_PERCENT 21 -#define A_PREFIX 22 #define A_PREV_FILE 23 #define A_QUIT 24 #define A_REPAINT 25 @@ -72,19 +71,19 @@ #define A_CLRMARK 62 #define A_SETMARKBOT 63 #define A_X11MOUSE_IN 64 -#define A_X11MOUSE_IGNORE 65 #define A_F_MOUSE 66 #define A_B_MOUSE 67 /* Note "X116" refers to extended (1006) X11 mouse reporting. */ #define A_X116MOUSE_IN 68 -#define A_X116MOUSE_IGNORE 69 +#define A_CLR_SEARCH 70 +/* These values must not conflict with any A_* or EC_* value. */ #define A_INVALID 100 #define A_NOACTION 101 #define A_UINVALID 102 #define A_END_LIST 103 #define A_SPECIAL_KEY 104 - +#define A_PREFIX 105 #define A_SKIP 127 #define A_EXTRA 0200 @@ -111,15 +110,16 @@ #define EC_B_COMPLETE 18 #define EC_LITERAL 19 #define EC_ABORT 20 +#define EC_X11MOUSE 21 +#define EC_X116MOUSE 22 -#define EC_NOACTION 101 #define EC_UINVALID 102 /* Flags for editchar() */ -#define EC_PEEK 01 -#define EC_NOHISTORY 02 -#define EC_NOCOMPLETE 04 -#define EC_NORIGHTLEFT 010 +#define ECF_PEEK 01 +#define ECF_NOHISTORY 02 +#define ECF_NOCOMPLETE 04 +#define ECF_NORIGHTLEFT 010 /* Environment variable stuff */ #define EV_OK 01 diff --git a/cmdbuf.c b/cmdbuf.c index ed78ded00307..9cc1f3e94977 100644 --- a/cmdbuf.c +++ b/cmdbuf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2020 Mark Nudelman + * Copyright (C) 1984-2021 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -26,12 +26,12 @@ extern int no_hist_dups; extern int marks_modified; static char cmdbuf[CMDBUF_SIZE]; /* Buffer for holding a multi-char command */ -static int cmd_col; /* Current column of the cursor */ -static int prompt_col; /* Column of cursor just after prompt */ -static char *cp; /* Pointer into cmdbuf */ -static int cmd_offset; /* Index into cmdbuf of first displayed char */ -static int literal; /* Next input char should not be interpreted */ -static int updown_match = -1; /* Prefix length in up/down movement */ +static int cmd_col; /* Current column of the cursor */ +static int prompt_col; /* Column of cursor just after prompt */ +static char *cp; /* Pointer into cmdbuf */ +static int cmd_offset; /* Index into cmdbuf of first displayed char */ +static int literal; /* Next input char should not be interpreted */ +static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME static int cmd_complete LESSPARAMS((int action)); @@ -223,7 +223,7 @@ cmd_step_common(p, ch, len, pwidth, bswidth) } } if (pwidth != NULL) - *pwidth = width; + *pwidth = width; if (bswidth != NULL) *bswidth = width; return (pr); @@ -259,17 +259,42 @@ cmd_step_left(pp, pwidth, bswidth) return cmd_step_common(*pp, ch, p - *pp, pwidth, bswidth); } +/* + * Put the cursor at "home" (just after the prompt), + * and set cp to the corresponding char in cmdbuf. + */ + static void +cmd_home(VOID_PARAM) +{ + while (cmd_col > prompt_col) + { + int width, bswidth; + + cmd_step_left(&cp, &width, &bswidth); + while (bswidth-- > 0) + putbs(); + cmd_col -= width; + } + + cp = &cmdbuf[cmd_offset]; +} + /* * Repaint the line from cp onwards. * Then position the cursor just after the char old_cp (a pointer into cmdbuf). */ - static void + public void cmd_repaint(old_cp) constant char *old_cp; { /* * Repaint the line from the current position. */ + if (old_cp == NULL) + { + old_cp = cp; *** 12107 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Apr 19 01:18:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E0295DD5BB for ; Mon, 19 Apr 2021 01:18: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 4FNpqf0RDhz4ldn; Mon, 19 Apr 2021 01:18: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 E714116526; Mon, 19 Apr 2021 01:18: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 13J1IrdI058761; Mon, 19 Apr 2021 01:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J1Ira5058760; Mon, 19 Apr 2021 01:18:53 GMT (envelope-from git) Date: Mon, 19 Apr 2021 01:18:53 GMT Message-Id: <202104190118.13J1Ira5058760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Xin LI Subject: git: 82958ea89209 - Create tag vendor/less/v581 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/tags/vendor/less/v581 X-Git-Reftype: annotated tag X-Git-Commit: 82958ea89209861b3147df66118b20cc49e123e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 01:18:54 -0000 The annotated tag vendor/less/v581 has been created by delphij: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/less/v581 tag vendor/less/v581 Tagger: Xin LI TaggerDate: 2021-04-19 01:18:15 +0000 Tag less v581. commit 1737d9dd586fd32916293643b7b06c088f8c22e7 Author: Xin LI AuthorDate: 2021-04-19 01:15:19 +0000 Commit: Xin LI CommitDate: 2021-04-19 01:15:19 +0000 Vendor import of less v581. From owner-dev-commits-src-all@freebsd.org Mon Apr 19 05:13:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54AF45E1CF1; Mon, 19 Apr 2021 05:13: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 4FNw2h1xTQz3Bq7; Mon, 19 Apr 2021 05:13: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 352B919893; Mon, 19 Apr 2021 05:13: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 13J5DmLU078892; Mon, 19 Apr 2021 05:13:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J5DlD8078891; Mon, 19 Apr 2021 05:13:47 GMT (envelope-from git) Date: Mon, 19 Apr 2021 05:13:47 GMT Message-Id: <202104190513.13J5DlD8078891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 2235c7feac95 - main - less: upgrade to v581. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2235c7feac959bcc9ddfd6a2bc6be32102b1f84c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 05:13:48 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=2235c7feac959bcc9ddfd6a2bc6be32102b1f84c commit 2235c7feac959bcc9ddfd6a2bc6be32102b1f84c Merge: 8d9fefe64334 1737d9dd586f Author: Xin LI AuthorDate: 2021-04-19 02:46:19 +0000 Commit: Xin LI CommitDate: 2021-04-19 02:46:19 +0000 less: upgrade to v581. MFC after: 2 weeks contrib/less/INSTALL | 10 +- contrib/less/NEWS | 50 ++- contrib/less/README | 38 +- contrib/less/brac.c | 2 +- contrib/less/ch.c | 54 ++- contrib/less/charset.c | 154 ++++---- contrib/less/charset.h | 2 +- contrib/less/cmd.h | 20 +- contrib/less/cmdbuf.c | 87 ++--- contrib/less/command.c | 189 +++++++--- contrib/less/cvt.c | 12 +- contrib/less/decode.c | 367 ++++++++++--------- contrib/less/edit.c | 33 +- contrib/less/filename.c | 29 +- contrib/less/forwback.c | 11 +- contrib/less/funcs.h | 35 +- contrib/less/help.c | 24 +- contrib/less/ifile.c | 39 +- contrib/less/input.c | 45 ++- contrib/less/jump.c | 2 +- contrib/less/less.h | 419 +++++++++++---------- contrib/less/less.hlp | 22 +- contrib/less/less.nro | 204 +++++++++-- contrib/less/lessecho.c | 14 +- contrib/less/lessecho.nro | 8 +- contrib/less/lesskey.c | 163 ++++----- contrib/less/lesskey.h | 38 +- contrib/less/lesskey.nro | 25 +- contrib/less/lglob.h | 110 +++--- contrib/less/line.c | 905 ++++++++++++++++++++++++++-------------------- contrib/less/linenum.c | 31 +- contrib/less/lsystem.c | 44 +-- contrib/less/main.c | 85 +++-- contrib/less/mark.c | 26 +- contrib/less/optfunc.c | 309 ++++++++++++---- contrib/less/option.c | 25 +- contrib/less/option.h | 62 ++-- contrib/less/opttbl.c | 154 +++++--- contrib/less/os.c | 94 ++++- contrib/less/output.c | 612 ++++++++++++++++--------------- contrib/less/pattern.c | 11 +- contrib/less/pattern.h | 18 +- contrib/less/pckeys.h | 38 +- contrib/less/position.c | 12 +- contrib/less/position.h | 12 +- contrib/less/prompt.c | 88 ++--- contrib/less/regexp.h | 14 +- contrib/less/screen.c | 780 ++++++++++++++++++++++++++++----------- contrib/less/scrsize.c | 2 +- contrib/less/search.c | 359 +++++++++++++----- contrib/less/signal.c | 14 +- contrib/less/tags.c | 77 ++-- contrib/less/ttyin.c | 51 ++- contrib/less/version.c | 29 +- usr.bin/less/defines.h | 13 +- 55 files changed, 3773 insertions(+), 2298 deletions(-) diff --cc contrib/less/README index 81cb7e091296,000000000000..0c1acfd5d3f6 mode 100644,000000..100644 --- a/contrib/less/README +++ b/contrib/less/README @@@ -1,257 -1,0 +1,251 @@@ +************************************************************************** +************************************************************************** +** ** +** The FreeBSD Project has chosen to redistribute and modify Less under ** +** the 'Less License' (as described in the 'LICENSE' file). ** +** ** +************************************************************************** +************************************************************************** + - Less, version 563 ++ Less, version 581 + - This is the distribution of less, version 563, released 13 Jun 2020. ++ This is the distribution of less, version 581, released 06 Apr 2021. + This program is part of the GNU project (http://www.gnu.org). + + This program is free software. You may redistribute it and/or + modify it under the terms of either: + + 1. The GNU General Public License, as published by the Free + Software Foundation; either version 3, or (at your option) any + later version. A copy of this license is in the file COPYING. + or + 2. The Less License, in the file LICENSE. + - Please report any problems to bug-less@gnu.org. - See http://www.greenwoodsoftware.com/less for the latest info. ++ Please report any problems at https://github.com/gwsw/less/issues. ++ See https://greenwoodsoftware.com/less for the latest info. + Source repository is at https://github.com/gwsw/less.git. + +========================================================================= + - This is the distribution of "less", a paginator similar to "more" or "pg". - +The formatted manual page is in less.man. +The manual page nroff source is in less.nro. +Major changes made since the last posted version are in NEWS. + +======================================================================= - PRE-INSTALLATION (when using git) - - If you are building from a clone of a git repository, - type "make -f Makefile.aut". - If you are building from a numbered release package (a tar or zip file - with a name like less-999.tar.gz or less-999.zip), you should skip this step. - - ======================================================================= - INSTALLATION (Unix systems only): ++INSTALLATION (Unix & Linux systems only): + +1. Move the distributed source to its own directory and unpack it, + if you have not already done so. + - 2. Type "sh configure". ++2. If you are building from a clone of a git repository, ++ type "make -f Makefile.aut". ++ If you are building from a numbered release package (a tar or ++ zip file with a name like less-999.tar.gz or less-999.zip downloaded ++ from greenwoodsoftware.com, not from github), you should skip this step. ++ ++3. Type "sh configure". + This will generate a Makefile and a defines.h. + Warning: if you have a GNU sed, make sure it is version 2.05 or later. + + The file INSTALL describes the usage of the configure program in + general. In addition, these options to configure are supported: + + --with-editor=program + Specifies the default editor program used by the "v" command. + The default is "vi". + + --with-regex=lib + Specifies the regular expression library used by less for pattern + matching. The default is "auto", which means the configure program + finds a regular expression library automatically. Other values are: + gnu Use the GNU regex library. + pcre Use the PCRE library. + pcre2 Use the PCRE2 library. + posix Use the POSIX-compatible regcomp. + regcmp Use the regcmp library. + re_comp Use the re_comp library. + regcomp Use the V8-compatible regcomp. + regcomp-local Use Henry Spencer's V8-compatible regcomp + (source is supplied with less). + none No regular expressions, only simple string matching. + + --with-secure + Builds a "secure" version of less, with some features disabled + to prevent users from viewing other files, accessing shell + commands, etc. + + - 3. It is a good idea to look over the generated Makefile and defines.h ++4. It is a good idea to look over the generated Makefile and defines.h + and make sure they look ok. If you know of any peculiarities of + your system that configure might not have detected, you may fix the + Makefile now. Take particular notice of the list of "terminal" + libraries in the LIBS definition in the Makefile; these may need + to be edited. The terminal libraries will be some subset of + -lncurses -lcurses -ltermcap -ltermlib + + If you wish, you may edit defines.h to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page "less.nro" and the help page "less.hlp" + to remove the descriptions of the features which you are removing. + If you edit less.hlp, you should run "make -f Makefile.aut help.c". + - 4. Type "make" and watch the fun. ++5. Type "make" and watch the fun. + - 5. If the make succeeds, it will generate the programs "less", ++6. If the make succeeds, it will generate the programs "less", + "lesskey" and "lessecho" in your current directory. Test the + generated programs. + - 6. When satisfied that it works, if you wish to install it ++7. When satisfied that it works, if you wish to install it + in a public place, type "make install". + + The default install destinations are: + Executables (less, lesskey, lessecho) in /usr/local/bin + Documentation (less.nro, lesskey.nro) in /usr/local/man/man1 + If you want to install any of these files elsewhere, define + bindir and/or mandir to the appropriate directories. + - If you have any problems building or running "less", suggestions, - complaints, etc., you may mail to bug-less@gnu.org. + +Note to hackers: comments noting possible improvements are enclosed +in double curly brackets {{ like this }}. + +(Note that the above note was originally written at a time when +"hackers" most commonly meant "enthusiastic and dedicated computer +programmers", not "persons who attempt to circumvent computer security".) + + + +======================================================================= +INSTALLATION (MS-DOS systems only, + with Microsoft C, Borland C, or DJGPP) + +1. Move the distributed source to its own directory. + Depending on your compiler, you may need to convert the source + to have CR-LF rather than LF as line terminators. + +2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE. + If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE. + If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE. + +3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR + are correct. CC should be the name of your C compiler and + LIBDIR should be the directory where the C libraries reside (for + Microsoft C only). If these definitions need to be changed, you can + either modify the definitions directly in MAKEFILE, or set your + environment variables CC and/or LIBDIR to override the definitions + in MAKEFILE. + +4. If you wish, you may edit DEFINES.DS to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page LESS.MAN and the help page HELP.C + to remove the descriptions of the features which you are removing. + +5. Run your "make" program and watch the fun. + If your "make" requires a flag to import environment variables, + you should use that flag. + If your compiler runs out of memory, try running "make -n >cmds.bat" + and then run cmds.bat. + +6. If the make succeeds, it will generate the programs "LESS.EXE" and + "LESSKEY.EXE" in your current directory. Test the generated programs. + +7. When satisfied that it works, you may wish to install LESS.EXE and + LESSKEY.EXE in a directory which is included in your PATH. + + + +======================================================================= +INSTALLATION (Windows-95, Windows-98 and Windows-NT systems only, + with Borland C or Microsoft Visual C++) + +1. Move the distributed source to its own directory. + +2. If you are using Borland C, rename Makefile.wnb to Makefile. + If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.wn to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "make" and watch the fun. + +6. If the make succeeds, it will generate the programs "less.exe" and + "lesskey.exe" in your current directory. Test the generated programs. + +7. When satisfied that it works, if you wish to install it + in a public place, type "make install". + See step 6 of the Unix installation instructions for details + on how to change the default installation directories. + + + +======================================================================= +INSTALLATION (OS/2 systems only, + with EMX C) + +1. Move the distributed source to its own directory. + +2. Rename Makefile.o2e to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.o2 to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "make" and watch the fun. + +6. If the make succeeds, it will generate the programs "less.exe" and + "lesskey.exe" in your current directory. Test the generated programs. + +7. Make sure you have the emx runtime installed. You need the emx DLLs + emx.dll and emxlibcs.dll and also the termcap database, termcap.dat. + Make sure you have termcap.dat either in the default location or + somewhere in a directory listed in the PATH or INIT environment + variables. + +8. When satisfied that it works, you may wish to install less.exe, + lesskey.exe and scrsize.exe in a directory which is included in + your PATH. scrsize.exe is required only if you use a terminal + emulator such as xterm or rxvt. + + + +======================================================================= +INSTALLATION (OS-9 systems only, + with Microware C or Ultra C) + +1. Move the distributed source to its own directory. + +2. If you are using Microware C, rename Makefile.o9c to Makefile. + If you are using Ultra C, rename Makefile.o9u to Makefile. + +3. Check the Makefile to make sure the definitions look ok. + +4. If you wish, you may edit defines.o9 to remove some optional features. + If you choose not to include some features in your version, you may + wish to edit the manual page less.man and the help page help.c + to remove the descriptions of the features which you are removing. + +5. Type "dmake" and watch the fun. + The standard OS-9 "make" will probably not work. If you don't + have dmake, you can get a copy from os9archive.rtsi.com. + +6. If the make succeeds, it will generate the programs "less" and + "lesskey" in your current directory. Test the generated programs. + +7. When satisfied that it works, if you wish to install it + in a public place, type "dmake install". + See step 6 of the Unix installation instructions for details + on how to change the default installation directories. + +======================================================================= +ACKNOWLEDGMENTS: + Some versions of the less distribution are packaged using + Info-ZIP's compression utility. + Info-ZIP's software is free and can be obtained as source + code or executables from various anonymous-ftp sites, + including ftp.uu.net:/pub/archiving/zip. diff --cc contrib/less/command.c index 8e0ae4b34d67,000000000000..ae59181c2827 mode 100644,000000..100644 --- a/contrib/less/command.c +++ b/contrib/less/command.c @@@ -1,1987 -1,0 +1,2060 @@@ +/* $FreeBSD$ */ +/* - * Copyright (C) 1984-2020 Mark Nudelman ++ * Copyright (C) 1984-2021 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ + + +/* + * User-level command processor. + */ + +#include "less.h" +#if MSDOS_COMPILER==WIN32C +#include +#endif +#include "position.h" +#include "option.h" +#include "cmd.h" + +extern int erase_char, erase2_char, kill_char; +extern int sigs; +extern int quit_if_one_screen; +extern int squished; +extern int sc_width; +extern int sc_height; +extern char *kent; +extern int swindow; +extern int jump_sline; +extern int quitting; +extern int wscroll; +extern int top_scroll; +extern int ignore_eoi; +extern int secure; +extern int hshift; +extern int bs_mode; +extern int show_attn; +extern int less_is_more; +extern int status_col; +extern POSITION highest_hilite; +extern POSITION start_attnpos; +extern POSITION end_attnpos; +extern char *every_first_cmd; +extern char version[]; +extern struct scrpos initial_scrpos; +extern IFILE curr_ifile; +extern void *ml_search; +extern void *ml_examine; +extern int wheel_lines; +#if SHELL_ESCAPE || PIPEC +extern void *ml_shell; +#endif +#if EDITOR +extern char *editor; +extern char *editproto; +#endif - extern int screen_trashed; /* The screen has been overwritten */ ++extern int screen_trashed; /* The screen has been overwritten */ +extern int shift_count; +extern int oldbot; +extern int forw_prompt; ++extern int incr_search; +#if MSDOS_COMPILER==WIN32C +extern int utf_mode; +#endif + +#if SHELL_ESCAPE - static char *shellcmd = NULL; /* For holding last shell command for "!!" */ ++static char *shellcmd = NULL; /* For holding last shell command for "!!" */ +#endif - static int mca; /* The multicharacter command (action) */ - static int search_type; /* The previous type of search */ - static LINENUM number; /* The number typed by the user */ - static long fraction; /* The fractional part of the number */ ++static int mca; /* The multicharacter command (action) */ ++static int search_type; /* The previous type of search */ ++static LINENUM number; /* The number typed by the user */ ++static long fraction; /* The fractional part of the number */ +static struct loption *curropt; +static int opt_lower; +static int optflag; +static int optgetname; +static POSITION bottompos; +static int save_hshift; +static int save_bs_mode; +#if PIPEC +static char pipec; +#endif + +/* Stack of ungotten chars (via ungetcc) */ +struct ungot { + struct ungot *ug_next; + LWCHAR ug_char; +}; +static struct ungot* ungot = NULL; + +static void multi_search LESSPARAMS((char *pattern, int n, int silent)); + +/* + * Move the cursor to start of prompt line before executing a command. + * This looks nicer if the command takes a long time before + * updating the screen. + */ + static void +cmd_exec(VOID_PARAM) +{ + clear_attn(); + clear_bot(); + flush(); +} + +/* + * Indicate we are reading a multi-character command. + */ + static void +set_mca(action) + int action; +{ + mca = action; - deinit_mouse(); /* we don't want mouse events while entering a cmd */ + clear_bot(); + clear_cmd(); +} + +/* + * Indicate we are not reading a multi-character command. + */ + static void +clear_mca(VOID_PARAM) +{ + if (mca == 0) + return; + mca = 0; - init_mouse(); +} + +/* + * Set up the display to start a new multi-character command. + */ + static void +start_mca(action, prompt, mlist, cmdflags) + int action; + constant char *prompt; + void *mlist; + int cmdflags; +{ + set_mca(action); + cmd_putstr(prompt); + set_mlist(mlist, cmdflags); +} + + public int +in_mca(VOID_PARAM) +{ + return (mca != 0 && mca != A_PREFIX); +} + +/* + * Set up the display to start a new search command. + */ + static void +mca_search(VOID_PARAM) +{ +#if HILITE_SEARCH + if (search_type & SRCH_FILTER) + set_mca(A_FILTER); + else +#endif + if (search_type & SRCH_FORW) + set_mca(A_F_SEARCH); + else + set_mca(A_B_SEARCH); + + if (search_type & SRCH_NO_MATCH) + cmd_putstr("Non-match "); + if (search_type & SRCH_FIRST_FILE) + cmd_putstr("First-file "); + if (search_type & SRCH_PAST_EOF) + cmd_putstr("EOF-ignore "); + if (search_type & SRCH_NO_MOVE) + cmd_putstr("Keep-pos "); + if (search_type & SRCH_NO_REGEX) + cmd_putstr("Regex-off "); ++ if (search_type & SRCH_WRAP) ++ cmd_putstr("Wrap "); + +#if HILITE_SEARCH + if (search_type & SRCH_FILTER) + cmd_putstr("&/"); + else +#endif + if (search_type & SRCH_FORW) + cmd_putstr("/"); + else + cmd_putstr("?"); + forw_prompt = 0; + set_mlist(ml_search, 0); +} + +/* + * Set up the display to start a new toggle-option command. + */ + static void +mca_opt_toggle(VOID_PARAM) +{ + int no_prompt; + int flag; + char *dash; + + no_prompt = (optflag & OPT_NO_PROMPT); + flag = (optflag & ~OPT_NO_PROMPT); + dash = (flag == OPT_NO_TOGGLE) ? "_" : "-"; + + set_mca(A_OPT_TOGGLE); + cmd_putstr(dash); + if (optgetname) + cmd_putstr(dash); + if (no_prompt) + cmd_putstr("(P)"); + switch (flag) + { + case OPT_UNSET: + cmd_putstr("+"); + break; + case OPT_SET: + cmd_putstr("!"); + break; + } + forw_prompt = 0; + set_mlist(NULL, 0); +} + +/* + * Execute a multicharacter command. + */ + static void +exec_mca(VOID_PARAM) +{ + char *cbuf; + + cmd_exec(); + cbuf = get_cmdbuf(); + + switch (mca) + { + case A_F_SEARCH: + case A_B_SEARCH: + multi_search(cbuf, (int) number, 0); + break; +#if HILITE_SEARCH + case A_FILTER: + search_type ^= SRCH_NO_MATCH; + set_filter_pattern(cbuf, search_type); + break; +#endif + case A_FIRSTCMD: + /* + * Skip leading spaces or + signs in the string. + */ + while (*cbuf == '+' || *cbuf == ' ') + cbuf++; + if (every_first_cmd != NULL) + free(every_first_cmd); + if (*cbuf == '\0') + every_first_cmd = NULL; + else + every_first_cmd = save(cbuf); + break; + case A_OPT_TOGGLE: + toggle_option(curropt, opt_lower, cbuf, optflag); + curropt = NULL; + break; + case A_F_BRACKET: + match_brac(cbuf[0], cbuf[1], 1, (int) number); + break; + case A_B_BRACKET: + match_brac(cbuf[1], cbuf[0], 0, (int) number); + break; +#if EXAMINE + case A_EXAMINE: + if (secure) + break; + edit_list(cbuf); +#if TAGS + /* If tag structure is loaded then clean it up. */ + cleantags(); +#endif + break; +#endif +#if SHELL_ESCAPE + case A_SHELL: + /* + * !! just uses whatever is in shellcmd. + * Otherwise, copy cmdbuf to shellcmd, + * expanding any special characters ("%" or "#"). + */ + if (*cbuf != '!') + { + if (shellcmd != NULL) + free(shellcmd); + shellcmd = fexpand(cbuf); + } + + if (secure) + break; + if (shellcmd == NULL) + lsystem("", "!done"); + else + lsystem(shellcmd, "!done"); + break; +#endif +#if PIPEC + case A_PIPE: + if (secure) + break; + (void) pipe_mark(pipec, cbuf); + error("|done", NULL_PARG); + break; +#endif + } +} + +/* + * Is a character an erase or kill char? + */ + static int +is_erase_char(c) + int c; +{ + return (c == erase_char || c == erase2_char || c == kill_char); +} + +/* + * Is a character a carriage return or newline? + */ + static int +is_newline_char(c) + int c; +{ + return (c == '\n' || c == '\r'); +} + +/* + * Handle the first char of an option (after the initial dash). + */ + static int +mca_opt_first_char(c) + int c; +{ + int flag = (optflag & ~OPT_NO_PROMPT); + if (flag == OPT_NO_TOGGLE) + { + switch (c) + { + case '_': + /* "__" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } else + { + switch (c) + { + case '+': + /* "-+" = UNSET. */ + optflag = (flag == OPT_UNSET) ? + OPT_TOGGLE : OPT_UNSET; + mca_opt_toggle(); + return (MCA_MORE); + case '!': + /* "-!" = SET */ + optflag = (flag == OPT_SET) ? + OPT_TOGGLE : OPT_SET; + mca_opt_toggle(); + return (MCA_MORE); + case CONTROL('P'): + optflag ^= OPT_NO_PROMPT; + mca_opt_toggle(); + return (MCA_MORE); + case '-': + /* "--" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } + /* Char was not handled here. */ + return (NO_MCA); +} + +/* + * Add a char to a long option name. + * See if we've got a match for an option name yet. + * If so, display the complete name and stop + * accepting chars until user hits RETURN. + */ + static int +mca_opt_nonfirst_char(c) + int c; +{ + char *p; + char *oname; + int err; + + if (curropt != NULL) + { + /* + * Already have a match for the name. + * Don't accept anything but erase/kill. + */ + if (is_erase_char(c)) + return (MCA_DONE); + return (MCA_MORE); + } + /* + * Add char to cmd buffer and try to match + * the option name. + */ + if (cmd_char(c) == CC_QUIT) + return (MCA_DONE); + p = get_cmdbuf(); + opt_lower = ASCII_IS_LOWER(p[0]); + err = 0; + curropt = findopt_name(&p, &oname, &err); + if (curropt != NULL) + { + /* + * Got a match. + * Remember the option and + * display the full option name. + */ + cmd_reset(); + mca_opt_toggle(); + for (p = oname; *p != '\0'; p++) + { + c = *p; + if (!opt_lower && ASCII_IS_LOWER(c)) + c = ASCII_TO_UPPER(c); + if (cmd_char(c) != CC_OK) + return (MCA_DONE); + } + } else if (err != OPT_AMBIG) + { + bell(); + } + return (MCA_MORE); +} + +/* + * Handle a char of an option toggle command. + */ + static int +mca_opt_char(c) + int c; +{ + PARG parg; + + /* + * This may be a short option (single char), + * or one char of a long option name, + * or one char of the option parameter. + */ + if (curropt == NULL && len_cmdbuf() == 0) + { + int ret = mca_opt_first_char(c); + if (ret != NO_MCA) + return (ret); + } + if (optgetname) + { + /* We're getting a long option name. */ + if (!is_newline_char(c)) + return (mca_opt_nonfirst_char(c)); + if (curropt == NULL) + { + parg.p_string = get_cmdbuf(); + error("There is no --%s option", &parg); + return (MCA_DONE); + } + optgetname = FALSE; + cmd_reset(); + } else + { + if (is_erase_char(c)) + return (NO_MCA); + if (curropt != NULL) + /* We're getting the option parameter. */ + return (NO_MCA); + curropt = findopt(c); + if (curropt == NULL) + { + parg.p_string = propt(c); + error("There is no %s option", &parg); + return (MCA_DONE); + } + opt_lower = ASCII_IS_LOWER(c); + } + /* + * If the option which was entered does not take a + * parameter, toggle the option immediately, + * so user doesn't have to hit RETURN. + */ + if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || + !opt_has_param(curropt)) + { + toggle_option(curropt, opt_lower, "", optflag); + return (MCA_DONE); + } + /* + * Display a prompt appropriate for the option parameter. + */ + start_mca(A_OPT_TOGGLE, opt_prompt(curropt), (void*)NULL, 0); + return (MCA_MORE); +} + +/* + * Handle a char of a search command. + */ + static int +mca_search_char(c) + int c; +{ + int flag = 0; + + /* + * Certain characters as the first char of + * the pattern have special meaning: - * ! Toggle the NO_MATCH flag - * * Toggle the PAST_EOF flag - * @ Toggle the FIRST_FILE flag ++ * ! Toggle the NO_MATCH flag ++ * * Toggle the PAST_EOF flag ++ * @ Toggle the FIRST_FILE flag + */ + if (len_cmdbuf() > 0) + return (NO_MCA); + + switch (c) + { + case '*': + if (less_is_more) + break; + case CONTROL('E'): /* ignore END of file */ + if (mca != A_FILTER) + flag = SRCH_PAST_EOF; + break; + case '@': + if (less_is_more) + break; + case CONTROL('F'): /* FIRST file */ + if (mca != A_FILTER) + flag = SRCH_FIRST_FILE; + break; + case CONTROL('K'): /* KEEP position */ + if (mca != A_FILTER) + flag = SRCH_NO_MOVE; + break; ++ case CONTROL('W'): /* WRAP around */ ++ if (mca != A_FILTER) ++ flag = SRCH_WRAP; ++ break; + case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ + flag = SRCH_NO_REGEX; + break; + case CONTROL('N'): /* NOT match */ + case '!': + flag = SRCH_NO_MATCH; + break; + } + + if (flag != 0) + { - search_type ^= flag; ++ /* Toggle flag, but keep PAST_EOF and WRAP mutually exclusive. */ ++ search_type ^= flag | (search_type & (SRCH_PAST_EOF|SRCH_WRAP)); + mca_search(); + return (MCA_MORE); + } + return (NO_MCA); +} + +/* + * Handle a character of a multi-character command. + */ + static int +mca_char(c) + int c; +{ + int ret; + + switch (mca) + { + case 0: + /* + * We're not in a multicharacter command. + */ + return (NO_MCA); + + case A_PREFIX: + /* + * In the prefix of a command. + * This not considered a multichar command + * (even tho it uses cmdbuf, etc.). + * It is handled in the commands() switch. + */ + return (NO_MCA); + + case A_DIGIT: + /* + * Entering digits of a number. + * Terminated by a non-digit. + */ - if (!((c >= '0' && c <= '9') || c == '.') && - editchar(c, EC_PEEK|EC_NOHISTORY|EC_NOCOMPLETE|EC_NORIGHTLEFT) == A_INVALID) ++ if ((c >= '0' && c <= '9') || c == '.') ++ break; ++ switch (editchar(c, ECF_PEEK|ECF_NOHISTORY|ECF_NOCOMPLETE|ECF_NORIGHTLEFT)) + { ++ case A_NOACTION: ++ /* ++ * Ignore this char and get another one. ++ */ ++ return (MCA_MORE); ++ case A_INVALID: + /* *** 2736 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Apr 19 05:50:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D52C15E2EB1; Mon, 19 Apr 2021 05:50: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 4FNwrp5j0tz3DJy; Mon, 19 Apr 2021 05:50: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 B29AE19E9E; Mon, 19 Apr 2021 05:50: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 13J5oIZY025554; Mon, 19 Apr 2021 05:50:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J5oIoq025547; Mon, 19 Apr 2021 05:50:18 GMT (envelope-from git) Date: Mon, 19 Apr 2021 05:50:18 GMT Message-Id: <202104190550.13J5oIoq025547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: dead34f82219 - main - [ath_hal] ar9300: save TSF across full chip reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dead34f82219b4017effc3a2e50ae3476870f6ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 05:50:18 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=dead34f82219b4017effc3a2e50ae3476870f6ab commit dead34f82219b4017effc3a2e50ae3476870f6ab Author: Adrian Chadd AuthorDate: 2021-03-31 03:30:24 +0000 Commit: Adrian Chadd CommitDate: 2021-04-19 05:49:54 +0000 [ath_hal] ar9300: save TSF across full chip reset This saves the TSF across a a full reset. The TSF is otherwise cleared and subsequent beaconing stops until the TSF catches up to nexttbtt. --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c index 96a0e8741592..97276398c4d4 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c @@ -4538,7 +4538,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz; HAL_BOOL stopped, cal_ret; HAL_BOOL apply_last_iqcorr = AH_FALSE; - + uint64_t tsf; if (OS_REG_READ(ah, AR_IER) == AR_IER_ENABLE) { HALDEBUG(AH_NULL, HAL_DEBUG_UNMASKABLE, "** Reset called with WLAN " @@ -4869,10 +4869,15 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch /* Mark PHY inactive prior to reset, to be undone in ar9300_init_bb () */ ar9300_mark_phy_inactive(ah); + /* Save/restore TSF across a potentially full reset */ + /* XXX TODO: only do this if we do a cold reset */ + tsf = ar9300_get_tsf64(ah); if (!ar9300_chip_reset(ah, chan, reset_type)) { HALDEBUG(ah, HAL_DEBUG_RESET, "%s: chip reset failed\n", __func__); FAIL(HAL_EIO); } + if (tsf != 0) + ar9300_set_tsf64(ah, tsf); OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 05:52:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C0FC5E346B; Mon, 19 Apr 2021 05:52: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 4FNwvj3ZZgz3Dl5; Mon, 19 Apr 2021 05:52: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 6DC6819EC1; Mon, 19 Apr 2021 05:52: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 13J5qnPu031127; Mon, 19 Apr 2021 05:52:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J5qn91031126; Mon, 19 Apr 2021 05:52:49 GMT (envelope-from git) Date: Mon, 19 Apr 2021 05:52:49 GMT Message-Id: <202104190552.13J5qn91031126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: bed90bf8ed5c - main - [ath_hal] Add get/set NAV functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bed90bf8ed5c8fd69822529a839bacad762817a2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 05:52:49 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=bed90bf8ed5c8fd69822529a839bacad762817a2 commit bed90bf8ed5c8fd69822529a839bacad762817a2 Author: Adrian Chadd AuthorDate: 2021-03-31 16:38:15 +0000 Commit: Adrian Chadd CommitDate: 2021-04-19 05:52:31 +0000 [ath_hal] Add get/set NAV functions The NAV (network allocation vector) register reflects the current MAC tracking of NAV - when it will stay quiet before transmitting. Other devices transmit their frame durations in their 802.11 PHY headers and all devices that hear a frame - even if it's one in an encoding they don't understand - will understand the low bitrate PHY header that includes the frame duration. So, they'll set NAV to this value so they'll stay quiet until the transmit completes. Anyway, sometimes the PHY NAV header is garbled and sometimes, notably older broadcom devices, will fake a long NAV so they can get "cleaner" air for local calibration. When this happens, the hardware will stay quiet for quite some time and this can lead to missed/stuck beacons, or (for Very Large Values) a MAC hang. This code just adds the ability to get/set the NAV; the driver will need to take care of using it during transmit hangs and beacon misses to see if it's due to a trash looking NAV. --- .../dev/ath/ath_hal/ar9300/ar9300_freebsd.c | 19 +++++++++++++++ sys/dev/ath/ath_hal/ah.h | 2 ++ sys/dev/ath/ath_hal/ar5210/ar5210.h | 2 ++ sys/dev/ath/ath_hal/ar5210/ar5210_attach.c | 2 ++ sys/dev/ath/ath_hal/ar5210/ar5210_misc.c | 23 ++++++++++++++++++ sys/dev/ath/ath_hal/ar5211/ar5211.h | 2 ++ sys/dev/ath/ath_hal/ar5211/ar5211_attach.c | 2 ++ sys/dev/ath/ath_hal/ar5211/ar5211_misc.c | 23 ++++++++++++++++++ sys/dev/ath/ath_hal/ar5212/ar5212.h | 2 ++ sys/dev/ath/ath_hal/ar5212/ar5212_attach.c | 2 ++ sys/dev/ath/ath_hal/ar5212/ar5212_misc.c | 27 ++++++++++++++++++++++ 11 files changed, 106 insertions(+) diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c index 37e64bc86cdd..68e5f018cc6c 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c @@ -69,6 +69,23 @@ ar9300_get_next_tbtt(struct ath_hal *ah) return (OS_REG_READ(ah, AR_NEXT_TBTT_TIMER)); } +static u_int +ar9300_get_nav(struct ath_hal *ah) +{ + uint32_t reg; + + reg = OS_REG_READ(ah, AR_NAV); + if (reg == 0xdeadbeef) + return 0; + return reg; +} + +static void +ar9300_set_nav(struct ath_hal *ah, u_int nav) +{ + + OS_REG_WRITE(ah, AR_NAV, nav); +} /* * TODO: implement the antenna diversity control for AR9485 and @@ -484,6 +501,8 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah) /* ah_get11nExtBusy */ ah->ah_set11nMac2040 = ar9300_set_11n_mac2040; ah->ah_setChainMasks = ar9300SetChainMasks; + ah->ah_getNav = ar9300_get_nav; + ah->ah_setNav = ar9300_set_nav; /* ah_get11nRxClear */ /* ah_set11nRxClear */ diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index e39ff2b7d03d..4e811a5237ac 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -1404,6 +1404,8 @@ struct ath_hal { HAL_QUIET_FLAG flag); void __ahdecl(*ah_setChainMasks)(struct ath_hal *, uint32_t, uint32_t); + u_int __ahdecl(*ah_getNav)(struct ath_hal*); + void __ahdecl(*ah_setNav)(struct ath_hal*, u_int); /* DFS functions */ void __ahdecl(*ah_enableDfs)(struct ath_hal *ah, diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210.h b/sys/dev/ath/ath_hal/ar5210/ar5210.h index 373c676e25b3..f09e99b1ce9e 100644 --- a/sys/dev/ath/ath_hal/ar5210/ar5210.h +++ b/sys/dev/ath/ath_hal/ar5210/ar5210.h @@ -269,6 +269,8 @@ extern void ar5210SetChainMasks(struct ath_hal *, uint32_t, uint32_t); extern void ar5210EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5210GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val); +extern void ar5210SetNav(struct ath_hal *ah, u_int val); +extern u_int ar5210GetNav(struct ath_hal *ah); extern u_int ar5210GetKeyCacheSize(struct ath_hal *); extern HAL_BOOL ar5210IsKeyCacheEntryValid(struct ath_hal *, uint16_t); diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c b/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c index 22afc12a6dcc..8bbd7e9d600e 100644 --- a/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c +++ b/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c @@ -145,6 +145,8 @@ static const struct ath_hal_private ar5210hal = {{ .ah_getDfsThresh = ar5210GetDfsThresh, /* XXX procRadarEvent */ /* XXX isFastClockEnabled */ + .ah_getNav = ar5210GetNav, + .ah_setNav = ar5210SetNav, /* Key Cache Functions */ .ah_getKeyCacheSize = ar5210GetKeyCacheSize, diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c b/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c index 347ad8891e36..7c4df40a712f 100644 --- a/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c +++ b/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c @@ -710,3 +710,26 @@ ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val) val |= AR_DIAG_SW_DIS_CRYPTO; OS_REG_WRITE(ah, AR_DIAG_SW, val); } + +/* + * Get the current NAV value from the hardware. + */ +u_int +ar5210GetNav(struct ath_hal *ah) +{ + uint32_t reg; + + reg = OS_REG_READ(ah, AR_NAV); + return (reg); +} + +/* + * Set the current NAV value to the hardware. + */ +void +ar5210SetNav(struct ath_hal *ah, u_int val) +{ + + OS_REG_WRITE(ah, AR_NAV, val); +} + diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211.h b/sys/dev/ath/ath_hal/ar5211/ar5211.h index 186e69e9cd84..94a60162cbd8 100644 --- a/sys/dev/ath/ath_hal/ar5211/ar5211.h +++ b/sys/dev/ath/ath_hal/ar5211/ar5211.h @@ -291,6 +291,8 @@ extern uint32_t ar5211Get11nExtBusy(struct ath_hal *); extern HAL_BOOL ar5211GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *); extern void ar5211SetChainMasks(struct ath_hal *ah, uint32_t, uint32_t); +extern void ar5211SetNav(struct ath_hal *ah, u_int); +extern u_int ar5211GetNav(struct ath_hal *ah); extern void ar5211EnableDfs(struct ath_hal *, HAL_PHYERR_PARAM *); extern void ar5211GetDfsThresh(struct ath_hal *, HAL_PHYERR_PARAM *); diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c b/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c index 1914cc3ea4cf..6253e7b8c9c5 100644 --- a/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c +++ b/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c @@ -145,6 +145,8 @@ static const struct ath_hal_private ar5211hal = {{ .ah_getDfsThresh = ar5211GetDfsThresh, /* XXX procRadarEvent */ /* XXX isFastClockEnabled */ + .ah_setNav = ar5211SetNav, + .ah_getNav = ar5211GetNav, /* Key Cache Functions */ .ah_getKeyCacheSize = ar5211GetKeyCacheSize, diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c b/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c index ea1327b11a6a..5bdae89a3055 100644 --- a/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c +++ b/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c @@ -733,3 +733,26 @@ void ar5211GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { } + +/* + * Get the current NAV value from the hardware. + */ +u_int +ar5211GetNav(struct ath_hal *ah) +{ + uint32_t reg; + + reg = OS_REG_READ(ah, AR_NAV); + return (reg); +} + +/* + * Set the current NAV value to the hardware. + */ +void +ar5211SetNav(struct ath_hal *ah, u_int val) +{ + + OS_REG_WRITE(ah, AR_NAV, val); +} + diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h index f80f88c5df85..3a08c1911a1c 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212.h +++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h @@ -529,6 +529,8 @@ extern HAL_STATUS ar5212SetQuiet(struct ath_hal *ah, uint32_t period, extern HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *); extern void ar5212SetChainMasks(struct ath_hal *, uint32_t, uint32_t); +extern u_int ar5212GetNav(struct ath_hal *); +extern void ar5212SetNav(struct ath_hal *, u_int); extern HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip); diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c index 82bc762f75d2..0dd26558506a 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c +++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c @@ -137,6 +137,8 @@ static const struct ath_hal_private ar5212hal = {{ .ah_setQuiet = ar5212SetQuiet, .ah_getMibCycleCounts = ar5212GetMibCycleCounts, .ah_setChainMasks = ar5212SetChainMasks, + .ah_getNav = ar5212GetNav, + .ah_setNav = ar5212SetNav, /* DFS Functions */ .ah_enableDfs = ar5212EnableDfs, diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c index 577e1e7491b3..e6239902d713 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c +++ b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c @@ -1458,3 +1458,30 @@ ar5212SetChainMasks(struct ath_hal *ah, uint32_t tx_chainmask, uint32_t rx_chainmask) { } + +/* + * Get the current NAV value from the hardware. + * + * 0xdeadbeef indicates the hardware is currently powered off. + */ +u_int +ar5212GetNav(struct ath_hal *ah) +{ + uint32_t reg; + + reg = OS_REG_READ(ah, AR_NAV); + + if (reg == 0xdeadbeef) + return (0); + return (reg); +} + +/* + * Set the current NAV value to the hardware. + */ +void +ar5212SetNav(struct ath_hal *ah, u_int val) +{ + + OS_REG_WRITE(ah, AR_NAV, val); +} From owner-dev-commits-src-all@freebsd.org Mon Apr 19 05:59:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F13435E35A4; Mon, 19 Apr 2021 05:59: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 4FNx3V6YNJz3F5Y; Mon, 19 Apr 2021 05:59: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 D377B19E7C; Mon, 19 Apr 2021 05:59: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 13J5xYgL031694; Mon, 19 Apr 2021 05:59:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J5xYeD031693; Mon, 19 Apr 2021 05:59:34 GMT (envelope-from git) Date: Mon, 19 Apr 2021 05:59:34 GMT Message-Id: <202104190559.13J5xYeD031693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 61c83c4e8b6f - main - [ath] Add ath_hal_getnav and ath_hal_setnav so the driver layer can check the NAV as appropriate. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61c83c4e8b6fba915b2261fb019ad77d107c7b2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 05:59:35 -0000 The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=61c83c4e8b6fba915b2261fb019ad77d107c7b2b commit 61c83c4e8b6fba915b2261fb019ad77d107c7b2b Author: Adrian Chadd AuthorDate: 2021-04-01 04:48:59 +0000 Commit: Adrian Chadd CommitDate: 2021-04-19 05:59:28 +0000 [ath] Add ath_hal_getnav and ath_hal_setnav so the driver layer can check the NAV as appropriate. --- sys/dev/ath/if_athvar.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 1d2f842197cd..f36f66f6c3f4 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -1492,6 +1492,10 @@ void ath_intr(void *); ((*(_ah)->ah_setChainMasks)((_ah), (_txchainmask), (_rxchainmask))) #define ath_hal_set_quiet(_ah, _p, _d, _o, _f) \ ((*(_ah)->ah_setQuiet)((_ah), (_p), (_d), (_o), (_f))) +#define ath_hal_getnav(_ah) \ + ((*(_ah)->ah_getNav)((_ah))) +#define ath_hal_setnav(_ah, _val) \ + ((*(_ah)->ah_setNav)((_ah), (_val))) #define ath_hal_spectral_supported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_SPECTRAL_SCAN, 0, NULL) == HAL_OK) From owner-dev-commits-src-all@freebsd.org Mon Apr 19 08:11:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C59535E7189; Mon, 19 Apr 2021 08:11: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 4FNzzB5GHXz3LmP; Mon, 19 Apr 2021 08:11: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 A7AF81BC8C; Mon, 19 Apr 2021 08:11: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 13J8B2mQ014124; Mon, 19 Apr 2021 08:11:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J8B2uF014123; Mon, 19 Apr 2021 08:11:02 GMT (envelope-from git) Date: Mon, 19 Apr 2021 08:11:02 GMT Message-Id: <202104190811.13J8B2uF014123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 6fe60f1d5c39 - main - AMD-vi: Fortify IVHD device_identify process MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fe60f1d5c39c94fc87534e9dd4e9630594e0bec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 08:11:02 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=6fe60f1d5c39c94fc87534e9dd4e9630594e0bec commit 6fe60f1d5c39c94fc87534e9dd4e9630594e0bec Author: Ka Ho Ng AuthorDate: 2021-04-19 08:07:03 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-19 08:08:13 +0000 AMD-vi: Fortify IVHD device_identify process - Use malloc(9) to allocate ivhd_hdrs list. The previous assumption that there are at most 10 IVHDs in a system is not true. A counter example would be a system with 4 IOMMUs, and each IOMMU is related to IVHDs type 10h, 11h and 40h in the ACPI IVRS table. - Always scan through the whole ivhd_hdrs list to find IVHDs that has the same DeviceId but less prioritized IVHD type. Sponsored by: The FreeBSD Foundation MFC with: 74ada297e897 Reviewed by: grehan Approved by: lwhsu (mentor) Differential Revision: https://reviews.freebsd.org/D29525 --- sys/amd64/vmm/amd/ivrs_drv.c | 47 ++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c index 1cd76069d0a2..67b205076cb2 100644 --- a/sys/amd64/vmm/amd/ivrs_drv.c +++ b/sys/amd64/vmm/amd/ivrs_drv.c @@ -57,7 +57,7 @@ int ivhd_count; /* Number of IVHD header. */ * Cached IVHD header list. * Single entry for each IVHD, filtered the legacy one. */ -ACPI_IVRS_HARDWARE1 *ivhd_hdrs[10]; +ACPI_IVRS_HARDWARE1 **ivhd_hdrs; extern int amdvi_ptp_level; /* Page table levels. */ @@ -134,9 +134,11 @@ ivrs_is_ivhd(UINT8 type) static int ivhd_count_iter(ACPI_IVRS_HEADER * ivrs_he, void *arg) { + int *count; + count = (int *)arg; if (ivrs_is_ivhd(ivrs_he->Type)) - ivhd_count++; + (*count)++; return (1); } @@ -339,7 +341,7 @@ ivhd_identify(driver_t *driver, device_t parent) ACPI_TABLE_IVRS *ivrs; ACPI_IVRS_HARDWARE1 *ivhd; ACPI_STATUS status; - int i, count = 0; + int i, j, count = 0; uint32_t ivrs_ivinfo; if (acpi_disabled("ivhd")) @@ -360,32 +362,35 @@ ivhd_identify(driver_t *driver, device_t parent) REG_BITS(ivrs_ivinfo, 7, 5), REG_BITS(ivrs_ivinfo, 22, 22), "\020\001EFRSup"); - ivrs_hdr_iterate_tbl(ivhd_count_iter, NULL); - if (!ivhd_count) + ivrs_hdr_iterate_tbl(ivhd_count_iter, &count); + if (!count) return; - for (i = 0; i < ivhd_count; i++) { + ivhd_hdrs = malloc(sizeof(void *) * count, M_DEVBUF, + M_WAITOK | M_ZERO); + for (i = 0; i < count; i++) { ivhd = ivhd_find_by_index(i); KASSERT(ivhd, ("ivhd%d is NULL\n", i)); - ivhd_hdrs[i] = ivhd; - } - /* - * Scan for presence of legacy and non-legacy device type - * for same AMD-Vi device and override the old one. - */ - for (i = ivhd_count - 1 ; i > 0 ; i--){ - if (ivhd_is_newer(&ivhd_hdrs[i-1]->Header, - &ivhd_hdrs[i]->Header)) { - memmove(&ivhd_hdrs[i-1], &ivhd_hdrs[i], - sizeof(void *) * (ivhd_count - i)); - ivhd_count--; + /* + * Scan for presence of legacy and non-legacy device type + * for same IOMMU device and override the old one. + * + * If there is no existing IVHD to the same IOMMU device, + * the IVHD header pointer is appended. + */ + for (j = 0; j < ivhd_count; j++) { + if (ivhd_is_newer(&ivhd_hdrs[j]->Header, &ivhd->Header)) + break; } + ivhd_hdrs[j] = ivhd; + if (j == ivhd_count) + ivhd_count++; } ivhd_devs = malloc(sizeof(device_t) * ivhd_count, M_DEVBUF, M_WAITOK | M_ZERO); - for (i = 0; i < ivhd_count; i++) { + for (i = 0, j = 0; i < ivhd_count; i++) { ivhd = ivhd_hdrs[i]; KASSERT(ivhd, ("ivhd%d is NULL\n", i)); @@ -407,13 +412,13 @@ ivhd_identify(driver_t *driver, device_t parent) break; } } - count++; + j++; } /* * Update device count in case failed to attach. */ - ivhd_count = count; + ivhd_count = j; } static int From owner-dev-commits-src-all@freebsd.org Mon Apr 19 08:40:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0955E8CE6; Mon, 19 Apr 2021 08:40: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 4FP0cs0DTRz3NmB; Mon, 19 Apr 2021 08:40:13 +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 E043F1BEB8; Mon, 19 Apr 2021 08:40: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 13J8eCXe049488; Mon, 19 Apr 2021 08:40:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J8eC6e049481; Mon, 19 Apr 2021 08:40:12 GMT (envelope-from git) Date: Mon, 19 Apr 2021 08:40:12 GMT Message-Id: <202104190840.13J8eC6e049481@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: 738314e445ce - main - Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations" 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: 738314e445ceac4d3dd6c77c636044141623b8dc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 08:40:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=738314e445ceac4d3dd6c77c636044141623b8dc commit 738314e445ceac4d3dd6c77c636044141623b8dc Author: Alex Richardson AuthorDate: 2021-04-19 08:36:47 +0000 Commit: Alex Richardson CommitDate: 2021-04-19 08:36:47 +0000 Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations" This commit should not have introduced any functional changes, but apparently it did. This appears to have broken LDAP setups. Reverting for now. Will reland once I have fixed the breakage. This reverts commit 5245bf7b92b74e556527b4916a8deba386fe5772. Reported By: Александр Недоцуков, brd MFC after: immediately --- lib/libc/net/nsdispatch.c | 201 +++++++++++++++++----------------------------- 1 file changed, 72 insertions(+), 129 deletions(-) diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index d504a86d524b..b0f80d079b0b 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -77,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -99,52 +97,7 @@ enum _nss_constants { * Global NSS data structures are mostly read-only, but we update * them when we read or re-read the nsswitch.conf. */ -static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; -#ifndef NDEBUG -static void *nss_wlock_owner __guarded_by(nss_lock); -#endif - -static inline /* __lock_annotate(locks_excluded(nss_lock)) */ -__locks_exclusive(nss_lock) int -nss_wlock(void) -{ - int err; - - err = _pthread_rwlock_wrlock(&nss_lock); -#ifndef NDEBUG - assert(nss_wlock_owner == NULL); - nss_wlock_owner = _pthread_self(); -#endif - assert(err == 0 && "Locking should not have failed!"); - return (err); -} - -/* - * XXX: The manpage says already held lock may result in EDEADLK, but - * actually libthr returns always EBUSY, so we need the extra owner - * variable for assertions. - */ -#define ASSERT_NSS_WLOCK_HELD() \ - do { \ - if (__isthreaded) { \ - assert(_pthread_rwlock_trywrlock(&nss_lock) == EBUSY); \ - assert(nss_wlock_owner == _pthread_self()); \ - } \ - } while (0) - -static inline __requires_exclusive(nss_lock) __unlocks(nss_lock) int -nss_wunlock(void) -{ - int err; - - ASSERT_NSS_WLOCK_HELD(); -#ifndef NDEBUG - nss_wlock_owner = NULL; -#endif - err = _pthread_rwlock_unlock(&nss_lock); - assert(err == 0 && "Unlocking should not have failed!"); - return (err); -} +static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; /* * Runtime determination of whether we are dynamically linked or not. @@ -161,12 +114,12 @@ const ns_src __nsdefaultsrc[] = { }; /* Database, source mappings. */ -static unsigned int _nsmapsize __guarded_by(nss_lock); -static ns_dbt *_nsmap __guarded_by(nss_lock); +static unsigned int _nsmapsize; +static ns_dbt *_nsmap = NULL; /* NSS modules. */ -static unsigned int _nsmodsize __guarded_by(nss_lock); -static ns_mod *_nsmod __guarded_by(nss_lock); +static unsigned int _nsmodsize; +static ns_mod *_nsmod; /* Placeholder for builtin modules' dlopen `handle'. */ static int __nss_builtin_handle; @@ -213,7 +166,8 @@ typedef int (*vector_comparison)(const void *, const void *); typedef void (*vector_free_elem)(void *); static void vector_sort(void *, unsigned int, size_t, vector_comparison); -static void _vector_free(void *, unsigned int, size_t, vector_free_elem); +static void vector_free(void *, unsigned int *, size_t, + vector_free_elem); static void *vector_ref(unsigned int, void *, unsigned int, size_t); static void *vector_search(const void *, void *, unsigned int, size_t, vector_comparison); @@ -284,24 +238,22 @@ vector_ref(unsigned int i, void *vec, unsigned int count, size_t esize) } -#define VECTOR_FREE(vec, count, es, fe) do { \ - _vector_free(vec, count, es, fe); \ - vec = NULL; \ - count = 0; \ -} while (0) +#define VECTOR_FREE(v, c, s, f) \ + do { vector_free(v, c, s, f); v = NULL; } while (0) static void -_vector_free(void *vec, unsigned int count, size_t esize, +vector_free(void *vec, unsigned int *count, size_t esize, vector_free_elem free_elem) { unsigned int i; void *elem; - for (i = 0; i < count; i++) { - elem = vector_ref(i, vec, count, esize); + for (i = 0; i < *count; i++) { + elem = vector_ref(i, vec, *count, esize); if (elem != NULL) free_elem(elem); } free(vec); + *count = 0; } /* @@ -330,14 +282,13 @@ mtab_compare(const void *a, const void *b) /* * NSS nsmap management. */ -__requires_exclusive(nss_lock) void +void _nsdbtaddsrc(ns_dbt *dbt, const ns_src *src) { const ns_mod *modp; - ASSERT_NSS_WLOCK_HELD(); - dbt->srclist = vector_append(src, dbt->srclist, - (unsigned int *)&dbt->srclistsize, sizeof(*src)); + dbt->srclist = vector_append(src, dbt->srclist, &dbt->srclistsize, + sizeof(*src)); modp = vector_search(&src->name, _nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); if (modp == NULL) @@ -374,28 +325,26 @@ _nsdbtdump(const ns_dbt *dbt) } #endif -#ifndef NS_REREAD_CONF -static int __guarded_by(nss_lock) already_initialized = 0; -#endif /* * The first time nsdispatch is called (during a process's lifetime, * or after nsswitch.conf has been updated), nss_configure will * prepare global data needed by NSS. */ -static __requires_shared(nss_lock) int -__lock_annotate(no_thread_safety_analysis) /* RWLock upgrade not supported. */ -do_nss_configure(void) +static int +nss_configure(void) { - static time_t __guarded_by(nss_lock) confmod = 0; + static time_t confmod; + static int already_initialized = 0; struct stat statbuf; - int result; + int result, isthreaded; const char *path; #ifdef NS_CACHING void *handle; #endif result = 0; + isthreaded = __isthreaded; #if defined(_NSS_DEBUG) && defined(_NSS_SHOOT_FOOT) /* NOTE WELL: THIS IS A SECURITY HOLE. This must only be built * for debugging purposes and MUST NEVER be used in production. @@ -404,33 +353,36 @@ do_nss_configure(void) if (path == NULL) #endif path = _PATH_NS_CONF; - - result = _pthread_rwlock_unlock(&nss_lock); - if (result != 0) - return (result); - result = nss_wlock(); - if (result != 0) - return (result); #ifndef NS_REREAD_CONF /* - * Another thread could have already run the initialization - * logic while we were waiting for the write lock. Check - * already_initialized to avoid re-initializing. + * Define NS_REREAD_CONF to have nsswitch notice changes + * to nsswitch.conf(5) during runtime. This involves calling + * stat(2) every time, which can result in performance hit. */ if (already_initialized) - goto fin; + return (0); + already_initialized = 1; #endif /* NS_REREAD_CONF */ - ASSERT_NSS_WLOCK_HELD(); if (stat(path, &statbuf) != 0) - goto fin; + return (0); if (statbuf.st_mtime <= confmod) - goto fin; + return (0); + if (isthreaded) { + (void)_pthread_rwlock_unlock(&nss_lock); + result = _pthread_rwlock_wrlock(&nss_lock); + if (result != 0) + return (result); + if (stat(path, &statbuf) != 0) + goto fin; + if (statbuf.st_mtime <= confmod) + goto fin; + } _nsyyin = fopen(path, "re"); if (_nsyyin == NULL) goto fin; - VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), + VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, _nsmodsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); if (confmod == 0) (void)atexit(nss_atexit); @@ -448,42 +400,22 @@ do_nss_configure(void) dlclose(handle); } #endif -#ifndef NS_REREAD_CONF - already_initialized = 1; -#endif fin: - result = nss_wunlock(); - if (result == 0) - result = _pthread_rwlock_rdlock(&nss_lock); - return (result); -} - -static __requires_shared(nss_lock) int -nss_configure(void) -{ - int result; -#ifndef NS_REREAD_CONF - /* - * Define NS_REREAD_CONF to have nsswitch notice changes - * to nsswitch.conf(5) during runtime. This involves calling - * stat(2) every time, which can result in performance hit. - */ - if (already_initialized) - return (0); -#endif /* NS_REREAD_CONF */ - result = do_nss_configure(); + if (isthreaded) { + (void)_pthread_rwlock_unlock(&nss_lock); + if (result == 0) + result = _pthread_rwlock_rdlock(&nss_lock); + } return (result); } -__requires_exclusive(nss_lock) void +void _nsdbtput(const ns_dbt *dbt) { unsigned int i; ns_dbt *p; - ASSERT_NSS_WLOCK_HELD(); - for (i = 0; i < _nsmapsize; i++) { p = vector_ref(i, _nsmap, _nsmapsize, sizeof(*_nsmap)); if (string_compare(&dbt->name, &p->name) == 0) { @@ -546,15 +478,13 @@ nss_load_builtin_modules(void) * argument is non-NULL, assume a built-in module and use reg_fn to * register it. Otherwise, search for a dynamic NSS module. */ -static __requires_exclusive(nss_lock) void +static void nss_load_module(const char *source, nss_module_register_fn reg_fn) { char buf[PATH_MAX]; ns_mod mod; nss_module_register_fn fn; - ASSERT_NSS_WLOCK_HELD(); - memset(&mod, 0, sizeof(mod)); mod.name = strdup(source); if (mod.name == NULL) { @@ -618,9 +548,9 @@ fin: vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); } -static int exiting __guarded_by(nss_lock) = 0; +static int exiting = 0; -static __requires_exclusive(nss_lock) void +static void ns_mod_free(ns_mod *mod) { @@ -639,19 +569,24 @@ ns_mod_free(ns_mod *mod) static void nss_atexit(void) { - (void)nss_wlock(); + int isthreaded; + exiting = 1; - VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), + isthreaded = __isthreaded; + if (isthreaded) + (void)_pthread_rwlock_wrlock(&nss_lock); + VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, _nsmapsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); - (void)nss_wunlock(); + if (isthreaded) + (void)_pthread_rwlock_unlock(&nss_lock); } /* * Finally, the actual implementation. */ -static __requires_shared(nss_lock) nss_method +static nss_method nss_method_lookup(const char *source, const char *database, const char *method, const ns_dtab disp_tab[], void **mdata) { @@ -690,7 +625,7 @@ fb_endstate(void *p) __weak_reference(_nsdispatch, nsdispatch); -__requires_unlocked(nss_lock) int +int _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const char *method_name, const ns_src defaults[], ...) { @@ -699,7 +634,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const ns_src *srclist; nss_method method, fb_method; void *mdata; - int serrno, i, result, srclistsize; + int isthreaded, serrno, i, result, srclistsize; struct fb_state *st; int saved_depth; @@ -712,8 +647,15 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, dbt = NULL; fb_method = NULL; + isthreaded = __isthreaded; serrno = errno; - (void)_pthread_rwlock_rdlock(&nss_lock); + if (isthreaded) { + result = _pthread_rwlock_rdlock(&nss_lock); + if (result != 0) { + result = NS_UNAVAIL; + goto fin; + } + } result = fb_getstate(&st); if (result != 0) { @@ -832,9 +774,10 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, } #endif /* NS_CACHING */ + if (isthreaded) + (void)_pthread_rwlock_unlock(&nss_lock); --st->dispatch_depth; fin: - (void)_pthread_rwlock_unlock(&nss_lock); errno = serrno; return (result); } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 08:53:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F24D15E976F; Mon, 19 Apr 2021 08:53: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 4FP0vz6Xxbz3Q7l; Mon, 19 Apr 2021 08:53: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 D36591C622; Mon, 19 Apr 2021 08:53: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 13J8rJvl070796; Mon, 19 Apr 2021 08:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13J8rJ77070795; Mon, 19 Apr 2021 08:53:19 GMT (envelope-from git) Date: Mon, 19 Apr 2021 08:53:19 GMT Message-Id: <202104190853.13J8rJ77070795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 9012e6f02779 - stable/13 - Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations" 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9012e6f027794ff6b2d9bd947d48eecff1ce6581 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 08:53:20 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9012e6f027794ff6b2d9bd947d48eecff1ce6581 commit 9012e6f027794ff6b2d9bd947d48eecff1ce6581 Author: Alex Richardson AuthorDate: 2021-04-19 08:36:47 +0000 Commit: Alex Richardson CommitDate: 2021-04-19 08:52:55 +0000 Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotations" This commit should not have introduced any functional changes, but apparently it did. This appears to have broken LDAP setups. Reverting for now. Will reland once I have fixed the breakage. This reverts commit 3496971e61dc9f6e725e57fb7b5f0c57631bbfc2. Reported By: Александр Недоцуков, brd (cherry picked from commit 738314e445ceac4d3dd6c77c636044141623b8dc) --- lib/libc/net/nsdispatch.c | 201 +++++++++++++++++----------------------------- 1 file changed, 72 insertions(+), 129 deletions(-) diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index d504a86d524b..b0f80d079b0b 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -77,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -99,52 +97,7 @@ enum _nss_constants { * Global NSS data structures are mostly read-only, but we update * them when we read or re-read the nsswitch.conf. */ -static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; -#ifndef NDEBUG -static void *nss_wlock_owner __guarded_by(nss_lock); -#endif - -static inline /* __lock_annotate(locks_excluded(nss_lock)) */ -__locks_exclusive(nss_lock) int -nss_wlock(void) -{ - int err; - - err = _pthread_rwlock_wrlock(&nss_lock); -#ifndef NDEBUG - assert(nss_wlock_owner == NULL); - nss_wlock_owner = _pthread_self(); -#endif - assert(err == 0 && "Locking should not have failed!"); - return (err); -} - -/* - * XXX: The manpage says already held lock may result in EDEADLK, but - * actually libthr returns always EBUSY, so we need the extra owner - * variable for assertions. - */ -#define ASSERT_NSS_WLOCK_HELD() \ - do { \ - if (__isthreaded) { \ - assert(_pthread_rwlock_trywrlock(&nss_lock) == EBUSY); \ - assert(nss_wlock_owner == _pthread_self()); \ - } \ - } while (0) - -static inline __requires_exclusive(nss_lock) __unlocks(nss_lock) int -nss_wunlock(void) -{ - int err; - - ASSERT_NSS_WLOCK_HELD(); -#ifndef NDEBUG - nss_wlock_owner = NULL; -#endif - err = _pthread_rwlock_unlock(&nss_lock); - assert(err == 0 && "Unlocking should not have failed!"); - return (err); -} +static pthread_rwlock_t nss_lock = PTHREAD_RWLOCK_INITIALIZER; /* * Runtime determination of whether we are dynamically linked or not. @@ -161,12 +114,12 @@ const ns_src __nsdefaultsrc[] = { }; /* Database, source mappings. */ -static unsigned int _nsmapsize __guarded_by(nss_lock); -static ns_dbt *_nsmap __guarded_by(nss_lock); +static unsigned int _nsmapsize; +static ns_dbt *_nsmap = NULL; /* NSS modules. */ -static unsigned int _nsmodsize __guarded_by(nss_lock); -static ns_mod *_nsmod __guarded_by(nss_lock); +static unsigned int _nsmodsize; +static ns_mod *_nsmod; /* Placeholder for builtin modules' dlopen `handle'. */ static int __nss_builtin_handle; @@ -213,7 +166,8 @@ typedef int (*vector_comparison)(const void *, const void *); typedef void (*vector_free_elem)(void *); static void vector_sort(void *, unsigned int, size_t, vector_comparison); -static void _vector_free(void *, unsigned int, size_t, vector_free_elem); +static void vector_free(void *, unsigned int *, size_t, + vector_free_elem); static void *vector_ref(unsigned int, void *, unsigned int, size_t); static void *vector_search(const void *, void *, unsigned int, size_t, vector_comparison); @@ -284,24 +238,22 @@ vector_ref(unsigned int i, void *vec, unsigned int count, size_t esize) } -#define VECTOR_FREE(vec, count, es, fe) do { \ - _vector_free(vec, count, es, fe); \ - vec = NULL; \ - count = 0; \ -} while (0) +#define VECTOR_FREE(v, c, s, f) \ + do { vector_free(v, c, s, f); v = NULL; } while (0) static void -_vector_free(void *vec, unsigned int count, size_t esize, +vector_free(void *vec, unsigned int *count, size_t esize, vector_free_elem free_elem) { unsigned int i; void *elem; - for (i = 0; i < count; i++) { - elem = vector_ref(i, vec, count, esize); + for (i = 0; i < *count; i++) { + elem = vector_ref(i, vec, *count, esize); if (elem != NULL) free_elem(elem); } free(vec); + *count = 0; } /* @@ -330,14 +282,13 @@ mtab_compare(const void *a, const void *b) /* * NSS nsmap management. */ -__requires_exclusive(nss_lock) void +void _nsdbtaddsrc(ns_dbt *dbt, const ns_src *src) { const ns_mod *modp; - ASSERT_NSS_WLOCK_HELD(); - dbt->srclist = vector_append(src, dbt->srclist, - (unsigned int *)&dbt->srclistsize, sizeof(*src)); + dbt->srclist = vector_append(src, dbt->srclist, &dbt->srclistsize, + sizeof(*src)); modp = vector_search(&src->name, _nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); if (modp == NULL) @@ -374,28 +325,26 @@ _nsdbtdump(const ns_dbt *dbt) } #endif -#ifndef NS_REREAD_CONF -static int __guarded_by(nss_lock) already_initialized = 0; -#endif /* * The first time nsdispatch is called (during a process's lifetime, * or after nsswitch.conf has been updated), nss_configure will * prepare global data needed by NSS. */ -static __requires_shared(nss_lock) int -__lock_annotate(no_thread_safety_analysis) /* RWLock upgrade not supported. */ -do_nss_configure(void) +static int +nss_configure(void) { - static time_t __guarded_by(nss_lock) confmod = 0; + static time_t confmod; + static int already_initialized = 0; struct stat statbuf; - int result; + int result, isthreaded; const char *path; #ifdef NS_CACHING void *handle; #endif result = 0; + isthreaded = __isthreaded; #if defined(_NSS_DEBUG) && defined(_NSS_SHOOT_FOOT) /* NOTE WELL: THIS IS A SECURITY HOLE. This must only be built * for debugging purposes and MUST NEVER be used in production. @@ -404,33 +353,36 @@ do_nss_configure(void) if (path == NULL) #endif path = _PATH_NS_CONF; - - result = _pthread_rwlock_unlock(&nss_lock); - if (result != 0) - return (result); - result = nss_wlock(); - if (result != 0) - return (result); #ifndef NS_REREAD_CONF /* - * Another thread could have already run the initialization - * logic while we were waiting for the write lock. Check - * already_initialized to avoid re-initializing. + * Define NS_REREAD_CONF to have nsswitch notice changes + * to nsswitch.conf(5) during runtime. This involves calling + * stat(2) every time, which can result in performance hit. */ if (already_initialized) - goto fin; + return (0); + already_initialized = 1; #endif /* NS_REREAD_CONF */ - ASSERT_NSS_WLOCK_HELD(); if (stat(path, &statbuf) != 0) - goto fin; + return (0); if (statbuf.st_mtime <= confmod) - goto fin; + return (0); + if (isthreaded) { + (void)_pthread_rwlock_unlock(&nss_lock); + result = _pthread_rwlock_wrlock(&nss_lock); + if (result != 0) + return (result); + if (stat(path, &statbuf) != 0) + goto fin; + if (statbuf.st_mtime <= confmod) + goto fin; + } _nsyyin = fopen(path, "re"); if (_nsyyin == NULL) goto fin; - VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), + VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, _nsmodsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); if (confmod == 0) (void)atexit(nss_atexit); @@ -448,42 +400,22 @@ do_nss_configure(void) dlclose(handle); } #endif -#ifndef NS_REREAD_CONF - already_initialized = 1; -#endif fin: - result = nss_wunlock(); - if (result == 0) - result = _pthread_rwlock_rdlock(&nss_lock); - return (result); -} - -static __requires_shared(nss_lock) int -nss_configure(void) -{ - int result; -#ifndef NS_REREAD_CONF - /* - * Define NS_REREAD_CONF to have nsswitch notice changes - * to nsswitch.conf(5) during runtime. This involves calling - * stat(2) every time, which can result in performance hit. - */ - if (already_initialized) - return (0); -#endif /* NS_REREAD_CONF */ - result = do_nss_configure(); + if (isthreaded) { + (void)_pthread_rwlock_unlock(&nss_lock); + if (result == 0) + result = _pthread_rwlock_rdlock(&nss_lock); + } return (result); } -__requires_exclusive(nss_lock) void +void _nsdbtput(const ns_dbt *dbt) { unsigned int i; ns_dbt *p; - ASSERT_NSS_WLOCK_HELD(); - for (i = 0; i < _nsmapsize; i++) { p = vector_ref(i, _nsmap, _nsmapsize, sizeof(*_nsmap)); if (string_compare(&dbt->name, &p->name) == 0) { @@ -546,15 +478,13 @@ nss_load_builtin_modules(void) * argument is non-NULL, assume a built-in module and use reg_fn to * register it. Otherwise, search for a dynamic NSS module. */ -static __requires_exclusive(nss_lock) void +static void nss_load_module(const char *source, nss_module_register_fn reg_fn) { char buf[PATH_MAX]; ns_mod mod; nss_module_register_fn fn; - ASSERT_NSS_WLOCK_HELD(); - memset(&mod, 0, sizeof(mod)); mod.name = strdup(source); if (mod.name == NULL) { @@ -618,9 +548,9 @@ fin: vector_sort(_nsmod, _nsmodsize, sizeof(*_nsmod), string_compare); } -static int exiting __guarded_by(nss_lock) = 0; +static int exiting = 0; -static __requires_exclusive(nss_lock) void +static void ns_mod_free(ns_mod *mod) { @@ -639,19 +569,24 @@ ns_mod_free(ns_mod *mod) static void nss_atexit(void) { - (void)nss_wlock(); + int isthreaded; + exiting = 1; - VECTOR_FREE(_nsmap, _nsmapsize, sizeof(*_nsmap), + isthreaded = __isthreaded; + if (isthreaded) + (void)_pthread_rwlock_wrlock(&nss_lock); + VECTOR_FREE(_nsmap, &_nsmapsize, sizeof(*_nsmap), (vector_free_elem)ns_dbt_free); - VECTOR_FREE(_nsmod, _nsmapsize, sizeof(*_nsmod), + VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); - (void)nss_wunlock(); + if (isthreaded) + (void)_pthread_rwlock_unlock(&nss_lock); } /* * Finally, the actual implementation. */ -static __requires_shared(nss_lock) nss_method +static nss_method nss_method_lookup(const char *source, const char *database, const char *method, const ns_dtab disp_tab[], void **mdata) { @@ -690,7 +625,7 @@ fb_endstate(void *p) __weak_reference(_nsdispatch, nsdispatch); -__requires_unlocked(nss_lock) int +int _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const char *method_name, const ns_src defaults[], ...) { @@ -699,7 +634,7 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, const ns_src *srclist; nss_method method, fb_method; void *mdata; - int serrno, i, result, srclistsize; + int isthreaded, serrno, i, result, srclistsize; struct fb_state *st; int saved_depth; @@ -712,8 +647,15 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, dbt = NULL; fb_method = NULL; + isthreaded = __isthreaded; serrno = errno; - (void)_pthread_rwlock_rdlock(&nss_lock); + if (isthreaded) { + result = _pthread_rwlock_rdlock(&nss_lock); + if (result != 0) { + result = NS_UNAVAIL; + goto fin; + } + } result = fb_getstate(&st); if (result != 0) { @@ -832,9 +774,10 @@ _nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, } #endif /* NS_CACHING */ + if (isthreaded) + (void)_pthread_rwlock_unlock(&nss_lock); --st->dispatch_depth; fin: - (void)_pthread_rwlock_unlock(&nss_lock); errno = serrno; return (result); } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 11:09:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 037595ED1F1; Mon, 19 Apr 2021 11:09: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 4FP3xX6jW3z3mnY; Mon, 19 Apr 2021 11:09: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 D943E1E217; Mon, 19 Apr 2021 11:09: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 13JB9qWd046009; Mon, 19 Apr 2021 11:09:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JB9qGL046008; Mon, 19 Apr 2021 11:09:52 GMT (envelope-from git) Date: Mon, 19 Apr 2021 11:09:52 GMT Message-Id: <202104191109.13JB9qGL046008@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: 156da725d3ef - main - linux(4): bump osrelease to 4.4.0. 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: 156da725d3ef6bbafdb0389aada57cf268f44b1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 11:09:53 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=156da725d3ef6bbafdb0389aada57cf268f44b1e commit 156da725d3ef6bbafdb0389aada57cf268f44b1e Author: Edward Tomasz Napierala AuthorDate: 2021-04-19 10:37:47 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-19 10:37:58 +0000 linux(4): bump osrelease to 4.4.0. This is required for the current Arch Linux binaries to work. PR: 254112 Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29218 --- sys/compat/linux/linux_mib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 0a1baec39826..b3d5949c9630 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -46,8 +46,8 @@ int linux_get_oss_version(struct thread *td); int linux_kernver(struct thread *td); -#define LINUX_KVERSION 3 -#define LINUX_KPATCHLEVEL 17 +#define LINUX_KVERSION 4 +#define LINUX_KPATCHLEVEL 4 #define LINUX_KSUBLEVEL 0 #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) From owner-dev-commits-src-all@freebsd.org Mon Apr 19 12:10:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A5635EFBA4; Mon, 19 Apr 2021 12:10: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 4FP5HW0Jbcz3r2G; Mon, 19 Apr 2021 12:10: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 F170D1EF91; Mon, 19 Apr 2021 12:10: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 13JCAU6R034139; Mon, 19 Apr 2021 12:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JCAUI5034138; Mon, 19 Apr 2021 12:10:30 GMT (envelope-from git) Date: Mon, 19 Apr 2021 12:10:30 GMT Message-Id: <202104191210.13JCAUI5034138@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: 0e4025bffa2b - main - bridgestp: validate timer values in config BPDU 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: 0e4025bffa2bab3461b72b40d0b1468722ff76e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 12:10:31 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0e4025bffa2bab3461b72b40d0b1468722ff76e6 commit 0e4025bffa2bab3461b72b40d0b1468722ff76e6 Author: Jonah Caplan AuthorDate: 2021-04-15 09:28:42 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 10:09:18 +0000 bridgestp: validate timer values in config BPDU IEEE Std 802.1D-2004 Section 17.14 defines permitted ranges for timers. Incoming BPDU messages should be checked against the permitted ranges. The rest of 17.14 appears to be enforced already. PR: 254924 Reviewed by: kp, donner Differential Revision: https://reviews.freebsd.org/D29782 --- sys/net/bridgestp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 9e3a3e14ecda..cf182d2efe7b 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -597,6 +597,23 @@ bstp_received_bpdu(struct bstp_state *bs, struct bstp_port *bp, return; } + /* range checks */ + if (cu->cu_message_age >= cu->cu_max_age) { + return; + } + if (cu->cu_max_age < BSTP_MIN_MAX_AGE || + cu->cu_max_age > BSTP_MAX_MAX_AGE) { + return; + } + if (cu->cu_forward_delay < BSTP_MIN_FORWARD_DELAY || + cu->cu_forward_delay > BSTP_MAX_FORWARD_DELAY) { + return; + } + if (cu->cu_hello_time < BSTP_MIN_HELLO_TIME || + cu->cu_hello_time > BSTP_MAX_HELLO_TIME) { + return; + } + type = bstp_pdu_rcvtype(bp, cu); switch (type) { From owner-dev-commits-src-all@freebsd.org Mon Apr 19 12:10:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4191A5EF98D; Mon, 19 Apr 2021 12:10: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 4FP5HX1GGGz3qg0; Mon, 19 Apr 2021 12:10: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 1C8B81EC37; Mon, 19 Apr 2021 12:10: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 13JCAWZZ034160; Mon, 19 Apr 2021 12:10:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JCAWVE034159; Mon, 19 Apr 2021 12:10:32 GMT (envelope-from git) Date: Mon, 19 Apr 2021 12:10:32 GMT Message-Id: <202104191210.13JCAWVE034159@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: 4ae3a97e127c - main - bridge tests: Test STP config BPDU 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: 4ae3a97e127cea14277b904af31483af7e6e2891 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 12:10:32 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ae3a97e127cea14277b904af31483af7e6e2891 commit 4ae3a97e127cea14277b904af31483af7e6e2891 Author: Kristof Provost AuthorDate: 2021-04-15 12:55:00 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 10:09:35 +0000 bridge tests: Test STP config BPDU validation PR: 254924 Reviewed by: donner Differential Revision: https://reviews.freebsd.org/D29783 --- tests/sys/net/Makefile | 7 ++- tests/sys/net/if_bridge_test.sh | 45 ++++++++++++++++ tests/sys/net/stp.py | 112 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 3941a502a3a6..40b3a5e5fff6 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/net BINDIR= ${TESTSDIR} @@ -20,6 +20,11 @@ TESTS_SUBDIRS+= routing # locked. TEST_METADATA+= is_exclusive=true +${PACKAGE}FILES+= \ + stp.py + +${PACKAGE}FILESMODE_stp.py= 0555 + MAN= PROGS+= randsleep diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 1f10fe325a2c..4703efed46b8 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -408,6 +408,50 @@ inherit_mac_cleanup() vnet_cleanup } +atf_test_case "stp_validation" "cleanup" +stp_validation_head() +{ + atf_set descr 'Check STP validation' + atf_set require.user root + atf_set require.progs scapy +} + +stp_validation_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + ifconfig ${bridge} up + ifconfig ${bridge} addm ${epair_one}a addm ${epair_two}a + ifconfig ${bridge} stp ${epair_one}a stp ${epair_two}a + + ifconfig ${epair_one}a up + ifconfig ${epair_one}b up + ifconfig ${epair_two}a up + ifconfig ${epair_two}b up + + # Wait until the interfaces are no longer discarding + while ifconfig ${bridge} | grep 'state discarding' >/dev/null + do + sleep 1 + done + + # Now inject invalid STP BPDUs on epair_one and see if they're repeated + # on epair_two + atf_check -s exit:0 \ + $(atf_get_srcdir)/stp.py \ + --sendif ${epair_one}b \ + --recvif ${epair_two}b +} + +stp_validation_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -418,4 +462,5 @@ atf_init_test_cases() atf_add_test_case "inherit_mac" atf_add_test_case "delete_with_members" atf_add_test_case "mac_conflict" + atf_add_test_case "stp_validation" } diff --git a/tests/sys/net/stp.py b/tests/sys/net/stp.py new file mode 100644 index 000000000000..4c4c0af4c728 --- /dev/null +++ b/tests/sys/net/stp.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2021 Kristof Provost +# +# 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. +# + +import argparse +import scapy.all as sp +import sys +import os +curdir = os.path.dirname(os.path.realpath(__file__)) +netpfil_common = curdir + "/../netpfil/common" +sys.path.append(netpfil_common) +from sniffer import Sniffer + +def check_stp(args, packet): + stp = packet.getlayer(sp.STP) + if stp is None: + return False + + if stp.rootmac != "00:0c:29:01:01:01": + return False + + # Ensure we don't get confused by valid STP packets generated by if_bridge + if (stp.maxage >= 6 and stp.maxage <= 40) and \ + (stp.hellotime >= 1 and stp.hellotime <= 2) and \ + (stp.fwddelay >= 4 and stp.fwddelay <= 30): + return False + + print("This packet should have been dropped") + print(packet.show()) + return True + +def invalid_stp(send_if): + llc = sp.Ether(src="00:0c:29:0b:91:0a", dst="01:80:C2:00:00:00") \ + / sp.LLC() + + # Bad maxage + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=41, hellotime=2, fwddelay=30) + sp.sendp(stp, iface=send_if, verbose=False) + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=5, hellotime=2, fwddelay=30) + sp.sendp(stp, iface=send_if, verbose=False) + + # Bad hellotime + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=40, hellotime=3, fwddelay=30) + sp.sendp(stp, iface=send_if, verbose=False) + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=40, hellotime=1, fwddelay=30) + sp.sendp(stp, iface=send_if, verbose=False) + + # Bad fwddelay + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=40, hellotime=2, fwddelay=31) + sp.sendp(stp, iface=send_if, verbose=False) + stp = llc / sp.STP(proto=0, rootid=32768, rootmac="00:0c:29:01:01:01", \ + bridgeid=32768, bridgemac="00:0c:29:01:01:01", \ + portid=0x8007, maxage=40, hellotime=2, fwddelay=3) + sp.sendp(stp, iface=send_if, verbose=False) + +def main(): + parser = argparse.ArgumentParser("stp.py", + description="STP test tool") + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet(s) will be sent') + parser.add_argument('--recvif', nargs=1, + help='The interface on which to expect the ICMP echo request') + + args = parser.parse_args() + + sniffer = Sniffer(args, check_stp) + + invalid_stp(args.sendif[0]) + + sniffer.join() + + # The 'correct' packet is a corrupt STP packet, so it shouldn't turn up. + if sniffer.foundCorrectPacket: + sys.exit(1) + +if __name__ == '__main__': + main() From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:09:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EEFC5F182C; Mon, 19 Apr 2021 13:09: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 4FP6bH2GMhz3tYx; Mon, 19 Apr 2021 13:09:15 +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 3C5991FABF; Mon, 19 Apr 2021 13:09: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 13JD9FTH005217; Mon, 19 Apr 2021 13:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JD9FFI005216; Mon, 19 Apr 2021 13:09:15 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:09:15 GMT Message-Id: <202104191309.13JD9FFI005216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 11c690fd843b - stable/13 - genet: Use device_t in preference to struct device * 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 11c690fd843b7ecc6bcd1559950a535bd9311ff3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:09:15 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=11c690fd843b7ecc6bcd1559950a535bd9311ff3 commit 11c690fd843b7ecc6bcd1559950a535bd9311ff3 Author: Mark Johnston AuthorDate: 2021-04-12 13:31:58 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 13:01:58 +0000 genet: Use device_t in preference to struct device * Sponsored by: The FreeBSD Foundation (cherry picked from commit f66a1f40740c63741b6ebe48cb0cbce9e52ef34e) --- sys/arm64/broadcom/genet/if_genet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 0fe9f80f4c21..d0fe2b0d5e71 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -538,7 +538,7 @@ gen_dma_disable(device_t dev) static int gen_bus_dma_init(struct gen_softc *sc) { - struct device *dev = sc->dev; + device_t dev = sc->dev; int i, error; error = bus_dma_tag_create( From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:09:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7271E5F1901; Mon, 19 Apr 2021 13:09: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 4FP6bJ2SvQz3tth; Mon, 19 Apr 2021 13:09: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 47BE81FC8B; Mon, 19 Apr 2021 13:09: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 13JD9GpS005238; Mon, 19 Apr 2021 13:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JD9GSI005237; Mon, 19 Apr 2021 13:09:16 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:09:16 GMT Message-Id: <202104191309.13JD9GSI005237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dba90f9e260b - stable/13 - al_eth: Use device_t in preference to struct device * 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dba90f9e260b214d28611f31134f96d3cfd07fc6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:09:16 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dba90f9e260b214d28611f31134f96d3cfd07fc6 commit dba90f9e260b214d28611f31134f96d3cfd07fc6 Author: Mark Johnston AuthorDate: 2021-04-12 13:32:02 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 13:02:01 +0000 al_eth: Use device_t in preference to struct device * Sponsored by: The FreeBSD Foundation (cherry picked from commit d8b1601d54e94a47af37742420403b16be239ad2) --- sys/dev/al_eth/al_eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/al_eth/al_eth.c b/sys/dev/al_eth/al_eth.c index e2fe8c42603f..bfc94275a21c 100644 --- a/sys/dev/al_eth/al_eth.c +++ b/sys/dev/al_eth/al_eth.c @@ -558,7 +558,7 @@ al_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) } static int -al_dma_alloc_coherent(struct device *dev, bus_dma_tag_t *tag, bus_dmamap_t *map, +al_dma_alloc_coherent(device_t dev, bus_dma_tag_t *tag, bus_dmamap_t *map, bus_addr_t *baddr, void **vaddr, uint32_t size) { int ret; @@ -2295,7 +2295,7 @@ static int al_eth_setup_tx_resources(struct al_eth_adapter *adapter, int qid) { struct al_eth_ring *tx_ring = &adapter->tx_ring[qid]; - struct device *dev = tx_ring->dev; + device_t dev = tx_ring->dev; struct al_udma_q_params *q_params = &tx_ring->q_params; int size; int ret; @@ -2472,7 +2472,7 @@ static int al_eth_setup_rx_resources(struct al_eth_adapter *adapter, unsigned int qid) { struct al_eth_ring *rx_ring = &adapter->rx_ring[qid]; - struct device *dev = rx_ring->dev; + device_t dev = rx_ring->dev; struct al_udma_q_params *q_params = &rx_ring->q_params; int size; int ret; From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:09:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7A175F1451; Mon, 19 Apr 2021 13:09: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 4FP6bK4SJhz3tjr; Mon, 19 Apr 2021 13:09: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 75E241F866; Mon, 19 Apr 2021 13:09: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 13JD9HRO005259; Mon, 19 Apr 2021 13:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JD9Hv4005258; Mon, 19 Apr 2021 13:09:17 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:09:17 GMT Message-Id: <202104191309.13JD9Hv4005258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 07f3c3b50047 - stable/13 - cxgb: Use device_t in preference to struct device * 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 07f3c3b500479d4641cd30d450801470c4031551 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:09:17 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=07f3c3b500479d4641cd30d450801470c4031551 commit 07f3c3b500479d4641cd30d450801470c4031551 Author: Mark Johnston AuthorDate: 2021-04-12 13:32:04 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 13:02:04 +0000 cxgb: Use device_t in preference to struct device * Sponsored by: The FreeBSD Foundation (cherry picked from commit 9771af4942ec735d3f16d0697bb705a911a67266) --- sys/dev/cxgb/common/cxgb_ctl_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgb/common/cxgb_ctl_defs.h b/sys/dev/cxgb/common/cxgb_ctl_defs.h index fe8a4f7defc7..188e54fb0fc2 100644 --- a/sys/dev/cxgb/common/cxgb_ctl_defs.h +++ b/sys/dev/cxgb/common/cxgb_ctl_defs.h @@ -124,7 +124,7 @@ struct rdma_info { unsigned int udbell_len; /* user doorbell region length */ unsigned long udbell_physbase; /* user doorbell physical start addr */ void *kdb_addr; /* kernel doorbell register address */ - struct device *pdev; /* associated PCI device */ + device_t pdev; /* associated PCI device */ }; /* From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:09:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03FCA5F1832; Mon, 19 Apr 2021 13:09: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 4FP6bL5mdTz3tjt; Mon, 19 Apr 2021 13:09: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 9F8731FC8C; Mon, 19 Apr 2021 13:09: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 13JD9Iiv005280; Mon, 19 Apr 2021 13:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JD9Ij1005279; Mon, 19 Apr 2021 13:09:18 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:09:18 GMT Message-Id: <202104191309.13JD9Ij1005279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1d553a9e3a36 - stable/13 - qlnxr: Properly initialize the Linux device 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1d553a9e3a36760a5d366aad07c248570538435f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:09:19 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d553a9e3a36760a5d366aad07c248570538435f commit 1d553a9e3a36760a5d366aad07c248570538435f Author: Mark Johnston AuthorDate: 2021-04-12 13:32:08 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 13:02:06 +0000 qlnxr: Properly initialize the Linux device structure The driver needs to provide a LinuxKPI device structure to register itself with the IB subsystem. It was erroneously using a copy of its FreeBSD device structure for this purpose. Use linux_pci_attach_device() instead, following the example of the Chelsio iwarp driver. Also ensure that we don't leak the faked device during detach. Reviewed by: hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29595 (cherry picked from commit 56cbd386fbaefc009541870ee013b2ff8d096bfc) --- sys/dev/qlnx/qlnxr/qlnxr_def.h | 2 +- sys/dev/qlnx/qlnxr/qlnxr_os.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/qlnx/qlnxr/qlnxr_def.h b/sys/dev/qlnx/qlnxr/qlnxr_def.h index b08eab8a6c46..0d8d33dd2686 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_def.h +++ b/sys/dev/qlnx/qlnxr/qlnxr_def.h @@ -365,7 +365,7 @@ struct qlnxr_dev { struct ecore_dev *cdev; /* Added to extend Applications Support */ - struct pci_dev *pdev; + struct pci_dev pdev; uint32_t dp_module; uint8_t dp_level; diff --git a/sys/dev/qlnx/qlnxr/qlnxr_os.c b/sys/dev/qlnx/qlnxr/qlnxr_os.c index b6b56f58f166..62c0f2091d2f 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_os.c +++ b/sys/dev/qlnx/qlnxr/qlnxr_os.c @@ -257,7 +257,7 @@ qlnxr_register_device(qlnxr_dev_t *dev) ibdev->post_recv = qlnxr_post_recv; ibdev->process_mad = qlnxr_process_mad; - ibdev->dma_device = &dev->pdev->dev; + ibdev->dma_device = &dev->pdev.dev; ibdev->get_link_layer = qlnxr_link_layer; @@ -1097,11 +1097,7 @@ qlnxr_add(void *eth_dev) dev->ha = eth_dev; dev->cdev = &ha->cdev; /* Added to extend Application support */ - dev->pdev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); - - dev->pdev->dev = *(dev->ha->pci_dev); - dev->pdev->device = pci_get_device(dev->ha->pci_dev); - dev->pdev->vendor = pci_get_vendor(dev->ha->pci_dev); + linux_pci_attach_device(dev->ha->pci_dev, NULL, NULL, &dev->pdev); dev->rdma_ctx = &ha->cdev.hwfns[0]; dev->wq_multiplier = wq_multiplier; @@ -1210,6 +1206,8 @@ qlnxr_remove(void *eth_dev, void *qlnx_rdma_dev) qlnxr_remove_sysfiles(dev); ib_dealloc_device(&dev->ibdev); + linux_pci_detach_device(&dev->pdev); + QL_DPRINT12(ha, "exit ha = %p qlnx_rdma_dev = %p\n", ha, qlnx_rdma_dev); return (0); } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:09:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0A35F17D0; Mon, 19 Apr 2021 13:09: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 4FP6bM5rH5z3ttw; Mon, 19 Apr 2021 13:09: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 B9A0F1F9A6; Mon, 19 Apr 2021 13:09: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 13JD9JvY005302; Mon, 19 Apr 2021 13:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JD9JVM005301; Mon, 19 Apr 2021 13:09:19 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:09:19 GMT Message-Id: <202104191309.13JD9JVM005301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5b8039d5ed3e - stable/13 - linuxkpi: Fix pcie_set_readrq() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5b8039d5ed3e390f90a7bf77dd558134a95bc1c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:09:20 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8039d5ed3e390f90a7bf77dd558134a95bc1c1 commit 5b8039d5ed3e390f90a7bf77dd558134a95bc1c1 Author: Mark Johnston AuthorDate: 2021-04-12 13:32:21 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 13:02:09 +0000 linuxkpi: Fix pcie_set_readrq() We were passing a LinuxKPI struct device * to a pci(4) function that expects a device_t. Reviewed by: manu, hselasky, bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29675 (cherry picked from commit 3f322b22e02d6aae147e9948ab50ca1bee9a9dd4) --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index ddb3f0b222a5..4c07edebc796 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -736,7 +736,7 @@ lkpi_pci_restore_state(struct pci_dev *pdev) /* XXX This should not be necessary. */ #define pcix_set_mmrbc(d, v) 0 #define pcix_get_max_mmrbc(d) 0 -#define pcie_set_readrq(d, v) pci_set_max_read_req(&(d)->dev, (v)) +#define pcie_set_readrq(d, v) pci_set_max_read_req((d)->dev.bsddev, (v)) #define PCI_DMA_BIDIRECTIONAL 0 #define PCI_DMA_TODEVICE 1 From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:44:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 428D15F2B90; Mon, 19 Apr 2021 13:44: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 4FP7Md1T9Cz4Qxg; Mon, 19 Apr 2021 13:44:13 +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 2544A20503; Mon, 19 Apr 2021 13:44: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 13JDiDCt056983; Mon, 19 Apr 2021 13:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JDiDv9056982; Mon, 19 Apr 2021 13:44:13 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:44:13 GMT Message-Id: <202104191344.13JDiDv9056982@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: 4f1f67e88853 - main - pf: PFRULE_REFS should not be user-visible 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: 4f1f67e88853ac9e3c2d8897cf6dab6cfda8d16e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:44:13 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f1f67e88853ac9e3c2d8897cf6dab6cfda8d16e commit 4f1f67e88853ac9e3c2d8897cf6dab6cfda8d16e Author: Kristof Provost AuthorDate: 2021-04-15 11:38:56 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 12:31:47 +0000 pf: PFRULE_REFS should not be user-visible Split the PFRULE_REFS flag from the rule_flag field. PFRULE_REFS is a kernel-internal flag and should not be exposed to or read from userspace. MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29778 --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 12 ++++++------ sys/netpfil/pf/pf_ioctl.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 0372dfa65e57..efb9a382511e 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -378,6 +378,7 @@ struct pf_krule { struct pf_rule_gid gid; u_int32_t rule_flag; + uint32_t rule_ref; u_int8_t action; u_int8_t direction; u_int8_t log; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e4bc6447b0d1..a5c4ef6bfbb4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1641,7 +1641,7 @@ pf_purge_expired_src_nodes() pf_unlink_src_node(cur); LIST_INSERT_HEAD(&freelist, cur, entry); } else if (cur->rule.ptr != NULL) - cur->rule.ptr->rule_flag |= PFRULE_REFS; + cur->rule.ptr->rule_ref |= PFRULE_REFS; PF_HASHROW_UNLOCK(sh); } @@ -1783,11 +1783,11 @@ relock: pf_unlink_state(s, PF_ENTER_LOCKED); goto relock; } - s->rule.ptr->rule_flag |= PFRULE_REFS; + s->rule.ptr->rule_ref |= PFRULE_REFS; if (s->nat_rule.ptr != NULL) - s->nat_rule.ptr->rule_flag |= PFRULE_REFS; + s->nat_rule.ptr->rule_ref |= PFRULE_REFS; if (s->anchor.ptr != NULL) - s->anchor.ptr->rule_flag |= PFRULE_REFS; + s->anchor.ptr->rule_ref |= PFRULE_REFS; s->kif->pfik_flags |= PFI_IFLAG_REFS; if (s->rt_kif) s->rt_kif->pfik_flags |= PFI_IFLAG_REFS; @@ -1839,11 +1839,11 @@ pf_purge_unlinked_rules() TAILQ_INIT(&tmpq); PF_UNLNKDRULES_LOCK(); TAILQ_FOREACH_SAFE(r, &V_pf_unlinked_rules, entries, r1) { - if (!(r->rule_flag & PFRULE_REFS)) { + if (!(r->rule_ref & PFRULE_REFS)) { TAILQ_REMOVE(&V_pf_unlinked_rules, r, entries); TAILQ_INSERT_TAIL(&tmpq, r, entries); } else - r->rule_flag &= ~PFRULE_REFS; + r->rule_ref &= ~PFRULE_REFS; } PF_UNLNKDRULES_UNLOCK(); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 152fa9dafca1..e7965b7dcecd 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -426,7 +426,7 @@ pf_unlink_rule(struct pf_krulequeue *rulequeue, struct pf_krule *rule) TAILQ_REMOVE(rulequeue, rule, entries); PF_UNLNKDRULES_LOCK(); - rule->rule_flag |= PFRULE_REFS; + rule->rule_ref |= PFRULE_REFS; TAILQ_INSERT_TAIL(&V_pf_unlinked_rules, rule, entries); PF_UNLNKDRULES_UNLOCK(); } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:44:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73DBE5F2A1A; Mon, 19 Apr 2021 13:44: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 4FP7Mf2ZXdz3wVM; Mon, 19 Apr 2021 13:44: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 48C2D20504; Mon, 19 Apr 2021 13:44: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 13JDiEt9057004; Mon, 19 Apr 2021 13:44:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JDiE7Z057003; Mon, 19 Apr 2021 13:44:14 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:44:14 GMT Message-Id: <202104191344.13JDiE7Z057003@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: 8bb0f1b87b80 - main - pf: Remove PFRULE_REFS from userspace 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: 8bb0f1b87b80fd0a9c9dc388851cb609298d36ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:44:14 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8bb0f1b87b80fd0a9c9dc388851cb609298d36ef commit 8bb0f1b87b80fd0a9c9dc388851cb609298d36ef Author: Kristof Provost AuthorDate: 2021-04-15 11:41:07 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 12:31:47 +0000 pf: Remove PFRULE_REFS from userspace PFRULE_REFS should never be used by userspace, so hide it behind #ifdef _KERNEL. MFC after: never Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29779 --- sys/netpfil/pf/pf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index d7063e70b0af..4192b1a5bc95 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -561,7 +561,10 @@ struct pf_rule { #define PFRULE_NOSYNC 0x0010 #define PFRULE_SRCTRACK 0x0020 /* track source states */ #define PFRULE_RULESRCTRACK 0x0040 /* per rule */ + +#ifdef _KERNEL #define PFRULE_REFS 0x0080 /* rule has references */ +#endif /* scrub flags */ #define PFRULE_NODF 0x0100 From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:44:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5B455F2A1F; Mon, 19 Apr 2021 13:44: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 4FP7Mh52CNz3wXk; Mon, 19 Apr 2021 13:44: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 9828320506; Mon, 19 Apr 2021 13:44: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 13JDiGaM057046; Mon, 19 Apr 2021 13:44:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JDiGXn057045; Mon, 19 Apr 2021 13:44:16 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:44:16 GMT Message-Id: <202104191344.13JDiGXn057045@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: e14d56f37018 - main - pf tests: Test set keepcounters 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: e14d56f370184fdf7ef33ec57883a45f4a220cff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:44:17 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e14d56f370184fdf7ef33ec57883a45f4a220cff commit e14d56f370184fdf7ef33ec57883a45f4a220cff Author: Kristof Provost AuthorDate: 2021-04-15 14:53:16 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 12:31:47 +0000 pf tests: Test set keepcounters MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29781 --- tests/sys/netpfil/pf/rules_counter.sh | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/tests/sys/netpfil/pf/rules_counter.sh b/tests/sys/netpfil/pf/rules_counter.sh index 56dc159f49c8..567bf439b0ef 100644 --- a/tests/sys/netpfil/pf/rules_counter.sh +++ b/tests/sys/netpfil/pf/rules_counter.sh @@ -73,7 +73,89 @@ get_clear_cleanup() pft_cleanup } +atf_test_case "keepcounters" "cleanup" +keepcounters_head() +{ + atf_set descr 'Test keepcounter functionality' + atf_set require.user root +} + +keepcounters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "pass all" + + # Expect zero counters + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: 0[[:space:]]*Packets: 0*[[:space:]]*Bytes: 0*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v + + # Ensure the rule matched packets, so we can verify non-zero counters + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + # Expect non-zero counters + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: [1-9][0-9]*[[:space:]]*Packets: [1-9][0-9]*[[:space:]]*Bytes: [1-9][0-9]*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v + + # As we set the (same) rules again we'd expect the counters to return + # to zero + pft_set_rules noflush alcatraz \ + "pass all" + + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: 0[[:space:]]*Packets: 0*[[:space:]]*Bytes: 0*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v + + # Increment rule counters + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + # Now set new rules with 'keepcounters' set, so we'd expect nonzero + # counters + pft_set_rules noflush alcatraz \ + "set keepcounters" \ + "pass all" + + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: [1-9][0-9]*[[:space:]]*Packets: [1-9][0-9]*[[:space:]]*Bytes: [1-9][0-9]*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v + + # However, if we set a different rule it should return to zero + pft_set_rules noflush alcatraz \ + "set keepcounters" \ + "pass inet all" + + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: 0[[:space:]]*Packets: 0*[[:space:]]*Bytes: 0*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v + + # If we generate traffic and don't set keepcounters we also see zero + # counts when setting new rules + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + pft_set_rules noflush alcatraz \ + "pass inet all" + + atf_check -s exit:0 -e ignore \ + -o match:'Evaluations: 0[[:space:]]*Packets: 0*[[:space:]]*Bytes: 0*[[:space:]]*' \ + jexec alcatraz pfctl -s r -v +} + +keepcounters_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "get_clear" + atf_add_test_case "keepcounters" } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:44:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ED845F2999; Mon, 19 Apr 2021 13:44: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 4FP7Mg4slBz4QqP; Mon, 19 Apr 2021 13:44:15 +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 782B820505; Mon, 19 Apr 2021 13:44: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 13JDiFPN057025; Mon, 19 Apr 2021 13:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JDiFG4057024; Mon, 19 Apr 2021 13:44:15 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:44:15 GMT Message-Id: <202104191344.13JDiFG4057024@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: 42ec75f83aa3 - main - pf: Optionally attempt to preserve rule counter values across ruleset updates 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: 42ec75f83aa321fcea8d2eddc4e9099724f0669e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:44:16 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=42ec75f83aa321fcea8d2eddc4e9099724f0669e commit 42ec75f83aa321fcea8d2eddc4e9099724f0669e Author: Kristof Provost AuthorDate: 2021-04-15 14:12:11 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 12:31:47 +0000 pf: Optionally attempt to preserve rule counter values across ruleset updates Usually rule counters are reset to zero on every update of the ruleset. With keepcounters set pf will attempt to find matching rules between old and new rulesets and preserve the rule counters. MFC after: 4 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29780 --- lib/libpfctl/libpfctl.c | 22 +++++++++++++ lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 6 +++- sbin/pfctl/pfctl.c | 4 +++ sbin/pfctl/pfctl_parser.h | 1 + share/man/man5/pf.conf.5 | 12 +++++-- sys/net/pfvar.h | 3 ++ sys/netpfil/pf/pf_ioctl.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++- 8 files changed, 126 insertions(+), 4 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 8d81248e0229..86117268a9d0 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -569,3 +569,25 @@ int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, return (0); } + +int +pfctl_set_keepcounters(int dev, bool keep) +{ + struct pfioc_nv nv; + nvlist_t *nvl; + int ret; + + nvl = nvlist_create(0); + + nvlist_add_bool(nvl, "keep_counters", keep); + + nv.data = nvlist_pack(nvl, &nv.len); + nv.size = nv.len; + + nvlist_destroy(nvl); + + ret = ioctl(dev, DIOCKEEPCOUNTERS, &nv); + + free(nv.data); + return (ret); +} diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 32d0184f42ed..2c498189a6e4 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -188,5 +188,6 @@ int pfctl_get_clear_rule(int dev, u_int32_t nr, u_int32_t ticket, int pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, const char *anchor_call, u_int32_t ticket, u_int32_t pool_ticket); +int pfctl_set_keepcounters(int dev, bool keep); #endif diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 9eac41fbf66f..e0314241eec3 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -461,7 +461,7 @@ int parseport(char *, struct range *r, int); %token REASSEMBLE FRAGDROP FRAGCROP ANCHOR NATANCHOR RDRANCHOR BINATANCHOR %token SET OPTIMIZATION TIMEOUT LIMIT LOGINTERFACE BLOCKPOLICY FAILPOLICY %token RANDOMID REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID -%token ANTISPOOF FOR INCLUDE +%token ANTISPOOF FOR INCLUDE KEEPCOUNTERS %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY MAPEPORTSET %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME %token UPPERLIMIT QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE TARGET INTERVAL @@ -719,6 +719,9 @@ option : SET OPTIMIZATION STRING { } keep_state_defaults = $3; } + | SET KEEPCOUNTERS { + pf->keep_counters = true; + } ; stringall : STRING { $$ = $1; } @@ -5593,6 +5596,7 @@ lookup(char *s) { "inet6", INET6}, { "interval", INTERVAL}, { "keep", KEEP}, + { "keepcounters", KEEPCOUNTERS}, { "label", LABEL}, { "limit", LIMIT}, { "linkshare", LINKSHARE}, diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 9f6b3d2e36ea..82af047e7571 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1745,6 +1745,10 @@ pfctl_load_options(struct pfctl *pf) if (pfctl_load_hostid(pf, pf->hostid)) error = 1; + /* load keepcounters */ + if (pfctl_set_keepcounters(pf->dev, pf->keep_counters)) + error = 1; + return (error); } diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 43d8488dcab8..0c66d5dda97a 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -98,6 +98,7 @@ struct pfctl { u_int32_t debug; u_int32_t hostid; char *ifname; + bool keep_counters; u_int8_t timeout_set[PFTM_MAX]; u_int8_t limit_set[PF_LIMIT_MAX]; diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 52a7331c7cb2..00fbd4421e7f 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 7, 2019 +.Dd April 19, 2021 .Dt PF.CONF 5 .Os .Sh NAME @@ -618,6 +618,13 @@ Generate debug messages for various errors. .It Ar loud Generate debug messages for common conditions. .El +.It Ar set keepcounters +Preserve rule counters across rule updates. +Usually rule counters are reset to zero on every update of the ruleset. +With +.Ar keepcounters +set pf will attempt to find matching rules between old and new rulesets +and preserve the rule counters. .El .Sh TRAFFIC NORMALIZATION Traffic normalization is used to sanitize packet content in such @@ -2888,7 +2895,8 @@ option = "set" ( [ "timeout" ( timeout | "{" timeout-list "}" ) ] | [ "require-order" ( "yes" | "no" ) ] [ "fingerprints" filename ] | [ "skip on" ifspec ] | - [ "debug" ( "none" | "urgent" | "misc" | "loud" ) ] ) + [ "debug" ( "none" | "urgent" | "misc" | "loud" ) ] + [ "keepcounters" ] ) pf-rule = action [ ( "in" | "out" ) ] [ "log" [ "(" logopts ")"] ] [ "quick" ] diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index efb9a382511e..3a79a281f916 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -996,6 +996,7 @@ struct pf_kstatus { uint32_t hostid; char ifname[IFNAMSIZ]; uint8_t pf_chksum[PF_MD5_DIGEST_LENGTH]; + bool keep_counters; }; struct pf_divert { @@ -1304,6 +1305,8 @@ struct pfioc_iface { #define DIOCSETIFFLAG _IOWR('D', 89, struct pfioc_iface) #define DIOCCLRIFFLAG _IOWR('D', 90, struct pfioc_iface) #define DIOCKILLSRCNODES _IOWR('D', 91, struct pfioc_src_node_kill) +#define DIOCKEEPCOUNTERS _IOWR('D', 92, struct pfioc_nv) + struct pf_ifspeed_v0 { char ifname[IFNAMSIZ]; u_int32_t baudrate; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e7965b7dcecd..917501163264 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -197,6 +197,7 @@ static void pf_clear_states(void); static int pf_clear_tables(void); static void pf_clear_srcnodes(struct pf_ksrc_node *); static void pf_kill_srcnodes(struct pfioc_src_node_kill *); +static int pf_keepcounters(struct pfioc_nv *); static void pf_tbladdr_copyout(struct pf_addr_wrap *); /* @@ -1022,11 +1023,27 @@ pf_hash_rule(MD5_CTX *ctx, struct pf_krule *rule) PF_MD5_UPD(rule, tos); } +static bool +pf_krule_compare(struct pf_krule *a, struct pf_krule *b) +{ + MD5_CTX ctx[2]; + u_int8_t digest[2][PF_MD5_DIGEST_LENGTH]; + + MD5Init(&ctx[0]); + MD5Init(&ctx[1]); + pf_hash_rule(&ctx[0], a); + pf_hash_rule(&ctx[1], b); + MD5Final(digest[0], &ctx[0]); + MD5Final(digest[1], &ctx[1]); + + return (memcmp(digest[0], digest[1], PF_MD5_DIGEST_LENGTH) == 0); +} + static int pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) { struct pf_kruleset *rs; - struct pf_krule *rule, **old_array; + struct pf_krule *rule, **old_array, *tail; struct pf_krulequeue *old_rules; int error; u_int32_t old_rcount; @@ -1058,6 +1075,29 @@ pf_commit_rules(u_int32_t ticket, int rs_num, char *anchor) rs->rules[rs_num].inactive.ptr_array; rs->rules[rs_num].active.rcount = rs->rules[rs_num].inactive.rcount; + + /* Attempt to preserve counter information. */ + if (V_pf_status.keep_counters) { + TAILQ_FOREACH(rule, rs->rules[rs_num].active.ptr, + entries) { + tail = TAILQ_FIRST(old_rules); + while ((tail != NULL) && ! pf_krule_compare(tail, rule)) + tail = TAILQ_NEXT(tail, entries); + if (tail != NULL) { + counter_u64_add(rule->evaluations, + counter_u64_fetch(tail->evaluations)); + counter_u64_add(rule->packets[0], + counter_u64_fetch(tail->packets[0])); + counter_u64_add(rule->packets[1], + counter_u64_fetch(tail->packets[1])); + counter_u64_add(rule->bytes[0], + counter_u64_fetch(tail->bytes[0])); + counter_u64_add(rule->bytes[1], + counter_u64_fetch(tail->bytes[1])); + } + } + } + rs->rules[rs_num].inactive.ptr = old_rules; rs->rules[rs_num].inactive.ptr_array = old_array; rs->rules[rs_num].inactive.rcount = old_rcount; @@ -4948,6 +4988,10 @@ DIOCCHANGEADDR_error: pf_kill_srcnodes((struct pfioc_src_node_kill *)addr); break; + case DIOCKEEPCOUNTERS: + error = pf_keepcounters((struct pfioc_nv *)addr); + break; + case DIOCSETHOSTID: { u_int32_t *hostid = (u_int32_t *)addr; @@ -5227,6 +5271,41 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) psnk->psnk_killed = pf_free_src_nodes(&kill); } +static int +pf_keepcounters(struct pfioc_nv *nv) +{ + nvlist_t *nvl = NULL; + void *nvlpacked = NULL; + int error = 0; + +#define ERROUT(x) do { error = (x); goto on_error; } while (0) + + if (nv->len > pf_ioctl_maxcount) + ERROUT(ENOMEM); + + nvlpacked = malloc(nv->len, M_TEMP, M_WAITOK); + if (nvlpacked == NULL) + ERROUT(ENOMEM); + + error = copyin(nv->data, nvlpacked, nv->len); + if (error) + ERROUT(error); + + nvl = nvlist_unpack(nvlpacked, nv->len, 0); + if (nvl == NULL) + ERROUT(EBADMSG); + + if (! nvlist_exists_bool(nvl, "keep_counters")) + ERROUT(EBADMSG); + + V_pf_status.keep_counters = nvlist_get_bool(nvl, "keep_counters"); + +on_error: + nvlist_destroy(nvl); + free(nvlpacked, M_TEMP); + return (error); +} + /* * XXX - Check for version missmatch!!! */ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 13:47:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAC7C5F2DB2; Mon, 19 Apr 2021 13:47: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 4FP7Rx4JgYz4R9V; Mon, 19 Apr 2021 13:47: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 874F0204CC; Mon, 19 Apr 2021 13:47: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 13JDlv8q057407; Mon, 19 Apr 2021 13:47:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JDlvc2057406; Mon, 19 Apr 2021 13:47:57 GMT (envelope-from git) Date: Mon, 19 Apr 2021 13:47:57 GMT Message-Id: <202104191347.13JDlvc2057406@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: 22b2ba4e22e2 - main - Fix a typo in Gordon's login 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: 22b2ba4e22e208c098857aa8308cfc0a7b92d593 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 13:47:57 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=22b2ba4e22e208c098857aa8308cfc0a7b92d593 commit 22b2ba4e22e208c098857aa8308cfc0a7b92d593 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-19 13:42:31 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-19 13:48:05 +0000 Fix a typo in Gordon's login It's gbe, not bge. Fixes: bffc3fb3c09b Add metor -> mentee information (docs) --- share/misc/committers-doc.dot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/misc/committers-doc.dot b/share/misc/committers-doc.dot index 9c79abb0214a..a4e76cddd9ed 100644 --- a/share/misc/committers-doc.dot +++ b/share/misc/committers-doc.dot @@ -126,8 +126,6 @@ bcr -> "0mp" bcr -> gbe bcr -> debdrup -bge -> fernape - blackend -> ale brueffer -> joel @@ -152,6 +150,8 @@ gabor -> issyl0 gabor -> ebrandi gabor -> carlavilla +gbe -> fernape + gjb -> wblock gjb -> rene gjb -> dru From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:17:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BF6B5FA724; Mon, 19 Apr 2021 18:17: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 4FPFQy2cYqz4hRd; Mon, 19 Apr 2021 18:17: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 4C8DE23D28; Mon, 19 Apr 2021 18:17: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 13JIHUwN020444; Mon, 19 Apr 2021 18:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIHUoa020443; Mon, 19 Apr 2021 18:17:30 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:17:30 GMT Message-Id: <202104191817.13JIHUoa020443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 89a4cc5c8a3d - stable/13 - netmap: don't use linux type struct device * 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 89a4cc5c8a3d916c679436a332bc16f80b073aa6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:17:30 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=89a4cc5c8a3d916c679436a332bc16f80b073aa6 commit 89a4cc5c8a3d916c679436a332bc16f80b073aa6 Author: Vincenzo Maffione AuthorDate: 2021-04-11 21:06:43 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 18:17:08 +0000 netmap: don't use linux type struct device * Such type cannot be used in code that is in common between FreeBSD and Linux. Use the FreeBSD type instead. MFC after: 3 days Reported by: markj Differential Revision: https://reviews.freebsd.org/D29677 (cherry picked from commit 70275a6735df8a514f48be77418491f2f8dba817) --- sys/dev/netmap/netmap_mem2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index 7d798ee5a7fa..9f0bc2f17e53 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -308,7 +308,7 @@ netmap_mem_rings_delete(struct netmap_adapter *na) static int netmap_mem_map(struct netmap_obj_pool *, struct netmap_adapter *); static int netmap_mem_unmap(struct netmap_obj_pool *, struct netmap_adapter *); -static int nm_mem_assign_group(struct netmap_mem_d *, struct device *); +static int nm_mem_assign_group(struct netmap_mem_d *, bus_dma_tag_t); static void nm_mem_release_id(struct netmap_mem_d *); nm_memid_t @@ -725,7 +725,7 @@ netmap_mem_find(nm_memid_t id) } static int -nm_mem_assign_group(struct netmap_mem_d *nmd, struct device *dev) +nm_mem_assign_group(struct netmap_mem_d *nmd, bus_dma_tag_t dev) { int err = 0, id; id = nm_iommu_group_id(dev); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:17:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEBEC5FA4EC; Mon, 19 Apr 2021 18:17: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 4FPFQz4NVLz4hVC; Mon, 19 Apr 2021 18:17: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 83D9423E30; Mon, 19 Apr 2021 18:17: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 13JIHVeL020465; Mon, 19 Apr 2021 18:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIHVcJ020464; Mon, 19 Apr 2021 18:17:31 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:17:31 GMT Message-Id: <202104191817.13JIHVcJ020464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5c00c8224576 - stable/13 - Rename struct device to struct _device 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c00c82245764546b30c7152417cd6470fb16ac5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:17:31 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5c00c82245764546b30c7152417cd6470fb16ac5 commit 5c00c82245764546b30c7152417cd6470fb16ac5 Author: Mark Johnston AuthorDate: 2021-04-12 13:32:30 +0000 Commit: Mark Johnston CommitDate: 2021-04-19 18:17:08 +0000 Rename struct device to struct _device types.h defines device_t as a typedef of struct device *. struct device is defined in subr_bus.c and almost all of the kernel uses device_t. The LinuxKPI also defines a struct device, so type confusion can occur. This causes bugs and ambiguity for debugging tools. Rename the FreeBSD struct device to struct _device. Reviewed by: gbe (man pages) Reviewed by: rpokala, imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29676 (cherry picked from commit dfff37765ce4ea4fd7db4d293b459dc84008f411) --- share/man/man9/device.9 | 2 +- share/man/man9/rman.9 | 6 +++--- sys/kern/subr_bus.c | 15 +++++++++------ sys/powerpc/include/bus_dma.h | 4 +--- sys/sys/pcpu.h | 2 +- sys/sys/systm.h | 4 +--- sys/sys/types.h | 2 +- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/share/man/man9/device.9 b/share/man/man9/device.9 index 40bd3f16d3ee..d5e30f0abefa 100644 --- a/share/man/man9/device.9 +++ b/share/man/man9/device.9 @@ -35,7 +35,7 @@ .Nm device .Nd an abstract representation of a device .Sh SYNOPSIS -.Vt typedef struct device *device_t ; +.Vt typedef struct _device *device_t ; .Sh DESCRIPTION The device object represents a piece of hardware attached to the system such as an expansion card, the bus which that card is plugged diff --git a/share/man/man9/rman.9 b/share/man/man9/rman.9 index 3e03c05f9088..3faea2a014fc 100644 --- a/share/man/man9/rman.9 +++ b/share/man/man9/rman.9 @@ -88,12 +88,12 @@ .Ft "struct resource *" .Fo rman_reserve_resource .Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count" -.Fa "u_int flags" "struct device *dev" +.Fa "u_int flags" "device_t dev" .Fc .Ft "struct resource *" .Fo rman_reserve_resource_bound .Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count" -.Fa "rman_res_t bound" "u_int flags" "struct device *dev" +.Fa "rman_res_t bound" "u_int flags" "device_t dev" .Fc .Ft uint32_t .Fn rman_make_alignment_flags "uint32_t size" @@ -101,7 +101,7 @@ .Fn rman_get_start "struct resource *r" .Ft rman_res_t .Fn rman_get_end "struct resource *r" -.Ft "struct device *" +.Ft "device_t" .Fn rman_get_device "struct resource *r" .Ft rman_res_t .Fn rman_get_size "struct resource *r" diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index ecd6c9685e36..6d5607337ef6 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -95,7 +95,7 @@ struct driverlink { */ typedef TAILQ_HEAD(devclass_list, devclass) devclass_list_t; typedef TAILQ_HEAD(driver_list, driverlink) driver_list_t; -typedef TAILQ_HEAD(device_list, device) device_list_t; +typedef TAILQ_HEAD(device_list, _device) device_list_t; struct devclass { TAILQ_ENTRY(devclass) link; @@ -112,9 +112,12 @@ struct devclass { }; /** - * @brief Implementation of device. + * @brief Implementation of _device. + * + * The structure is named "_device" instead of "device" to avoid type confusion + * caused by other subsystems defining a (struct device). */ -struct device { +struct _device { /* * A device is a kernel object. The first field must be the * current ops table for the object. @@ -124,8 +127,8 @@ struct device { /* * Device hierarchy. */ - TAILQ_ENTRY(device) link; /**< list of devices in parent */ - TAILQ_ENTRY(device) devlink; /**< global device list membership */ + TAILQ_ENTRY(_device) link; /**< list of devices in parent */ + TAILQ_ENTRY(_device) devlink; /**< global device list membership */ device_t parent; /**< parent of this device */ device_list_t children; /**< list of child devices */ @@ -853,7 +856,7 @@ devctl_safe_quote_sb(struct sbuf *sb, const char *src) /* End of /dev/devctl code */ -static TAILQ_HEAD(,device) bus_data_devices; +static struct device_list bus_data_devices; static int bus_data_generation = 1; static kobj_method_t null_methods[] = { diff --git a/sys/powerpc/include/bus_dma.h b/sys/powerpc/include/bus_dma.h index ba4ebdab4c42..947a25819a7e 100644 --- a/sys/powerpc/include/bus_dma.h +++ b/sys/powerpc/include/bus_dma.h @@ -33,8 +33,6 @@ #include #include -struct device; - -int bus_dma_tag_set_iommu(bus_dma_tag_t, struct device *iommu, void *cookie); +int bus_dma_tag_set_iommu(bus_dma_tag_t, device_t iommu, void *cookie); #endif /* _POWERPC_BUS_DMA_H_ */ diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index 43827b1af4fa..cfc8a215707c 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -187,7 +187,7 @@ struct pcpu { STAILQ_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; long pc_cp_time[CPUSTATES]; /* statclock ticks */ - struct device *pc_device; + struct _device *pc_device; /* CPU device handle */ void *pc_netisr; /* netisr SWI cookie */ int pc_unused1; /* unused field */ int pc_domain; /* Memory domain. */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 369b8bdedb51..d13379b0a12f 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -614,9 +614,8 @@ void counted_warning(unsigned *counter, const char *msg); /* * APIs to manage deprecation and obsolescence. */ -struct device; void _gone_in(int major, const char *msg); -void _gone_in_dev(struct device *dev, int major, const char *msg); +void _gone_in_dev(device_t dev, int major, const char *msg); #ifdef NO_OBSOLETE_CODE #define __gone_ok(m, msg) \ _Static_assert(m < P_OSREL_MAJOR(__FreeBSD_version)), \ @@ -629,5 +628,4 @@ void _gone_in_dev(struct device *dev, int major, const char *msg); #endif /* _KERNEL */ __NULLABILITY_PRAGMA_POP - #endif /* !_SYS_SYSTM_H_ */ diff --git a/sys/sys/types.h b/sys/sys/types.h index c026fa023bd0..58abcf00cebb 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -272,7 +272,7 @@ typedef __rman_res_t rman_res_t; #ifdef _KERNEL typedef int boolean_t; -typedef struct device *device_t; +typedef struct _device *device_t; typedef __intfptr_t intfptr_t; /* From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:29:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1582F5FAC40; Mon, 19 Apr 2021 18:29: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 4FPFjL09dPz4j4f; Mon, 19 Apr 2021 18:29: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 ED1DF23EC7; Mon, 19 Apr 2021 18:29: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 13JITvxR033528; Mon, 19 Apr 2021 18:29:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JITv1A033527; Mon, 19 Apr 2021 18:29:57 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:29:57 GMT Message-Id: <202104191829.13JITv1A033527@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: 686cf5468c4a - main - flex: Regen bootstrap files 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: 686cf5468c4a85c2a6385cdbab2383900876a41d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:29:58 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d commit 686cf5468c4a85c2a6385cdbab2383900876a41d Author: Jung-uk Kim AuthorDate: 2021-04-19 18:20:51 +0000 Commit: Jung-uk Kim CommitDate: 2021-04-19 18:20:51 +0000 flex: Regen bootstrap files This also partially reverts r326025 (8a16b7a18f5d). I do not see any point of adding SPDX tag in generated file. MFC after: 3 days Submitted by: Dan McGregor (initial version) Differential Revision: https://reviews.freebsd.org/D28596 --- usr.bin/lex/initparse.c | 17 ++++++++++------- usr.bin/lex/initparse.h | 1 - usr.bin/lex/initscan.c | 5 ++++- usr.bin/lex/initskel.c | 9 ++++----- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/usr.bin/lex/initparse.c b/usr.bin/lex/initparse.c index c723c5b45c40..c95305aa1a91 100644 --- a/usr.bin/lex/initparse.c +++ b/usr.bin/lex/initparse.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* original parser id follows */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ @@ -6,7 +5,7 @@ #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 -#define YYPATCH 20170430 +#define YYPATCH 20200330 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -19,8 +18,6 @@ #define YYPURE 0 #line 35 "parse.y" -/* SPDX-License-Identifier: BSD-2-Clause */ - /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */ @@ -130,6 +127,10 @@ typedef int YYSTYPE; # define YYLEX yylex() #endif +#if !(defined(yylex) || defined(YYSTATE)) +int YYLEX_DECL(); +#endif + /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) @@ -488,13 +489,15 @@ static const char *const yyrule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE @@ -655,7 +658,7 @@ void yyerror( const char *msg ) { (void)msg; } -#line 656 "parse.c" +#line 662 "parse.c" #if YYDEBUG #include /* needed for printf */ @@ -1781,7 +1784,7 @@ case 96: #line 946 "parse.y" { yyval = mkstate( SYM_EPSILON ); } break; -#line 1782 "parse.c" +#line 1788 "parse.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/usr.bin/lex/initparse.h b/usr.bin/lex/initparse.h index fb0742445d55..b630d282c635 100644 --- a/usr.bin/lex/initparse.h +++ b/usr.bin/lex/initparse.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #define CHAR 257 #define NUMBER 258 #define SECTEND 259 diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 46070a4c6dc5..9b6fb4ae5183 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #line 2 "" @@ -4578,7 +4577,11 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) +#ifdef YY_FLEX_LEX_COMPAT return 0; +#else + return EOF; +#endif if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; diff --git a/usr.bin/lex/initskel.c b/usr.bin/lex/initskel.c index a7a69875521d..53a0ae452aa8 100644 --- a/usr.bin/lex/initskel.c +++ b/usr.bin/lex/initskel.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* File created from flex.skl via mkskel.sh */ #include "flexdef.h" @@ -448,11 +447,7 @@ const char *skel[] = { "/* First, we deal with platform-specific or compiler-specific issues. */", "", "#if defined(__FreeBSD__)", - "#ifndef __STDC_LIMIT_MACROS", - "#define __STDC_LIMIT_MACROS", - "#endif", "#include ", - "#include ", "#else", "#define __dead2", "#endif", @@ -2301,7 +2296,11 @@ const char *skel[] = { " case EOB_ACT_END_OF_FILE:", " {", " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )", + "#ifdef YY_FLEX_LEX_COMPAT", " return 0;", + "#else", + " return EOF;", + "#endif", "", " if ( ! YY_G(yy_did_buffer_switch_on_eof) )", " YY_NEW_FILE;", From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:32:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 515655FADA9; Mon, 19 Apr 2021 18:32:22 +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 4FPFm61TkBz4jMh; Mon, 19 Apr 2021 18:32:22 +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 25CF323F73; Mon, 19 Apr 2021 18:32: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 13JIWMdC046051; Mon, 19 Apr 2021 18:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIWMCl046050; Mon, 19 Apr 2021 18:32:22 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:32:22 GMT Message-Id: <202104191832.13JIWMCl046050@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: 578c26f31c0c - main - linkat(2): check NIRES_EMPTYPATH on the first fd arg 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: 578c26f31c0c90c9e6b2f7125a8539c307a51dff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:32:22 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=578c26f31c0c90c9e6b2f7125a8539c307a51dff commit 578c26f31c0c90c9e6b2f7125a8539c307a51dff Author: Konstantin Belousov AuthorDate: 2021-04-19 13:35:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:32:01 +0000 linkat(2): check NIRES_EMPTYPATH on the first fd arg Reported by: arichardson Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29834 --- sys/kern/vfs_syscalls.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 43104a472b5b..26a8d31e4456 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1575,6 +1575,13 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); + if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) { + error = priv_check(td, PRIV_VFS_FHOPEN); + if (error != 0) { + vrele(nd.ni_vp); + return (error); + } + } error = kern_linkat_vp(td, nd.ni_vp, fd2, path2, segflag); } while (error == EAGAIN || error == ERELOOKUP); return (error); @@ -1596,23 +1603,6 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, LOCKPARENT | SAVENAME | AUDITVNODE2 | NOCACHE, segflag, path, fd, &cap_linkat_target_rights, td); if ((error = namei(&nd)) == 0) { - if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) { - error = priv_check(td, PRIV_VFS_FHOPEN); - if (error != 0) { - NDFREE(&nd, NDF_ONLY_PNBUF); - if (nd.ni_vp != NULL) { - if (nd.ni_dvp == nd.ni_vp) - vrele(nd.ni_dvp); - else - vput(nd.ni_dvp); - vrele(nd.ni_vp); - } else { - vput(nd.ni_dvp); - } - vrele(vp); - return (error); - } - } if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp == nd.ni_vp) From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:32:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72D425FAF82; Mon, 19 Apr 2021 18:32: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 4FPFm72glYz4jQD; Mon, 19 Apr 2021 18:32: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 4ACF323D60; Mon, 19 Apr 2021 18:32: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 13JIWNW4046072; Mon, 19 Apr 2021 18:32:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIWNPh046071; Mon, 19 Apr 2021 18:32:23 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:32:23 GMT Message-Id: <202104191832.13JIWNPh046071@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: 4342ba184c15 - main - sysctl_handle_string: do not malloc when SYSCTL_IN cannot fault 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: 4342ba184c15f3b8912e95f93fe313731963f065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:32:23 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4342ba184c15f3b8912e95f93fe313731963f065 commit 4342ba184c15f3b8912e95f93fe313731963f065 Author: Konstantin Belousov AuthorDate: 2021-04-18 16:09:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:32:01 +0000 sysctl_handle_string: do not malloc when SYSCTL_IN cannot fault In particular, this avoids malloc(9) calls when from early tunable handling, with no working malloc yet. Reported and tested by: mav Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_sysctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 011e3f44a124..e46584758c9b 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1785,6 +1785,15 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS) sx_xlock(&sysctlstringlock); ((char *)arg1)[0] = '\0'; sx_xunlock(&sysctlstringlock); + } else if (req->newfunc == sysctl_new_kernel) { + arg2 = req->newlen - req->newidx; + sx_xlock(&sysctlstringlock); + error = SYSCTL_IN(req, arg1, arg2); + if (error == 0) { + ((char *)arg1)[arg2] = '\0'; + req->newidx += arg2; + } + sx_xunlock(&sysctlstringlock); } else { arg2 = req->newlen - req->newidx; tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:32:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0CCD5FAF23; Mon, 19 Apr 2021 18:32: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 4FPFm848xwz4j5f; Mon, 19 Apr 2021 18:32: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 67CAE2421C; Mon, 19 Apr 2021 18:32: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 13JIWOSJ046100; Mon, 19 Apr 2021 18:32:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIWOh2046099; Mon, 19 Apr 2021 18:32:24 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:32:24 GMT Message-Id: <202104191832.13JIWOh2046099@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: ecfbddf0cde3 - main - sysctl vm.objects: report backing object and swap use 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: ecfbddf0cde3d4151217e3eb2d7c5388a423d397 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:32:24 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfbddf0cde3d4151217e3eb2d7c5388a423d397 commit ecfbddf0cde3d4151217e3eb2d7c5388a423d397 Author: Konstantin Belousov AuthorDate: 2021-04-15 09:27:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:32:01 +0000 sysctl vm.objects: report backing object and swap use For anonymous objects, provide a handle kvo_me naming the object, and report the handle of the backing object. This allows userspace to deconstruct the shadow chain. Right now the handle is the address of the object in KVA, but this is not guaranteed. For the same anonymous objects, report the swap space used for actually swapped out pages, in kvo_swapped field. I do not believe that it is useful to report full 64bit counter there, so only uint32_t value is returned, clamped to the max. For kinfo_vmentry, report anonymous object handle backing the entry, so that the shadow chain for the specific mapping can be deconstructed. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29771 --- sys/kern/kern_proc.c | 3 +++ sys/sys/user.h | 20 ++++++++++++++++---- sys/vm/swap_pager.c | 23 +++++++++++++++++++++++ sys/vm/swap_pager.h | 1 + sys/vm/vm_object.c | 13 ++++++++++++- 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 817cb9766bbf..33f168836370 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2538,6 +2538,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) bzero(kve, sizeof(*kve)); obj = entry->object.vm_object; if (obj != NULL) { + if ((obj->flags & OBJ_ANON) != 0) + kve->kve_obj = (uintptr_t)obj; + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { VM_OBJECT_RLOCK(tobj); diff --git a/sys/sys/user.h b/sys/sys/user.h index f882e7dcd699..14471c91572f 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -529,12 +529,17 @@ struct kinfo_vmentry { uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */ uint16_t kve_vn_mode; /* File mode. */ uint16_t kve_status; /* Status flags. */ - uint64_t kve_vn_fsid; /* dev_t of vnode location */ + union { + uint64_t _kve_vn_fsid; /* dev_t of vnode location */ + uint64_t _kve_obj; /* handle of anon obj */ + } kve_type_spec; uint64_t kve_vn_rdev; /* Device id if device. */ int _kve_ispare[8]; /* Space for more stuff. */ /* Truncated before copyout in sysctl */ char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ }; +#define kve_vn_fsid kve_type_spec._kve_vn_fsid +#define kve_obj kve_type_spec._kve_obj /* * The "vm.objects" sysctl provides a list of all VM objects in the system @@ -552,11 +557,18 @@ struct kinfo_vmobject { uint64_t kvo_resident; /* Number of resident pages. */ uint64_t kvo_active; /* Number of active pages. */ uint64_t kvo_inactive; /* Number of inactive pages. */ - uint64_t kvo_vn_fsid; - uint64_t _kvo_qspare[7]; - uint32_t _kvo_ispare[8]; + union { + uint64_t _kvo_vn_fsid; + uint64_t _kvo_backing_obj; /* Handle for the backing obj */ + } kvo_type_spec; /* Type-specific union */ + uint64_t kvo_me; /* Uniq handle for anon obj */ + uint64_t _kvo_qspare[6]; + uint32_t kvo_swapped; /* Number of swapped pages */ + uint32_t _kvo_ispare[7]; char kvo_path[PATH_MAX]; /* Pathname, if any. */ }; +#define kvo_vn_fsid kvo_type_spec._kvo_vn_fsid +#define kvo_backing_obj kvo_type_spec._kvo_backing_obj /* * The KERN_PROC_KSTACK sysctl allows a process to dump the kernel stacks of diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 3789a0217252..888df04741b4 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1763,6 +1763,29 @@ swp_pager_force_dirty(vm_page_t m) vm_page_launder(m); } +u_long +swap_pager_swapped_pages(vm_object_t object) +{ + struct swblk *sb; + vm_pindex_t pi; + u_long res; + int i; + + VM_OBJECT_ASSERT_LOCKED(object); + if (object->type != OBJT_SWAP) + return (0); + + for (res = 0, pi = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pi)) != NULL; + pi = sb->p + SWAP_META_PAGES) { + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + res++; + } + } + return (res); +} + /* * swap_pager_swapoff_object: * diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 80dca93fbf85..59ca2cc2cfdb 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -81,6 +81,7 @@ void swap_pager_swap_init(void); int swap_pager_nswapdev(void); int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_status(int *total, int *used); +u_long swap_pager_swapped_pages(vm_object_t object); void swapoff_all(void); #endif /* _KERNEL */ diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 35ea9cc45fae..1f5194464b69 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2524,6 +2525,7 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) struct vattr va; vm_object_t obj; vm_page_t m; + u_long sp; int count, error; if (req->oldptr == NULL) { @@ -2590,8 +2592,17 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) freepath = NULL; fullpath = ""; kvo->kvo_type = vm_object_kvme_type(obj, &vp); - if (vp != NULL) + if (vp != NULL) { vref(vp); + } else if ((obj->flags & OBJ_ANON) != 0) { + MPASS(kvo->kvo_type == KVME_TYPE_DEFAULT || + kvo->kvo_type == KVME_TYPE_SWAP); + kvo->kvo_me = (uintptr_t)obj; + /* tmpfs objs are reported as vnodes */ + kvo->kvo_backing_obj = (uintptr_t)obj->backing_object; + sp = swap_pager_swapped_pages(obj); + kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; + } VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:38:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 500BB5FB048; Mon, 19 Apr 2021 18:38: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 4FPFtx1q4sz4jTS; Mon, 19 Apr 2021 18:38: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 2D2E824220; Mon, 19 Apr 2021 18:38: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 13JIcH74046890; Mon, 19 Apr 2021 18:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIcHkl046889; Mon, 19 Apr 2021 18:38:17 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:38:17 GMT Message-Id: <202104191838.13JIcHkl046889@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: 4ce1f6162e9e - main - linuxkpi: some style, wrap too long lines 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: 4ce1f6162e9eb576ac40f24b8538f55e83ef5eb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:38:17 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ce1f6162e9eb576ac40f24b8538f55e83ef5eb4 commit 4ce1f6162e9eb576ac40f24b8538f55e83ef5eb4 Author: Konstantin Belousov AuthorDate: 2021-03-11 06:08:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:34:07 +0000 linuxkpi: some style, wrap too long lines Reviewed by: hselasky Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_current.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 611d10df3383..081eab8edab1 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -236,7 +236,8 @@ linux_current_init(void *arg __unused) linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); } -SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_init, NULL); +SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, + linux_current_init, NULL); static void linux_current_uninit(void *arg __unused) @@ -260,4 +261,5 @@ linux_current_uninit(void *arg __unused) EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); lkpi_alloc_current = linux_alloc_current_noop; } -SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); +SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, + linux_current_uninit, NULL); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:38:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BF605FB204; Mon, 19 Apr 2021 18:38: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 4FPFty2Bs3z4jW9; Mon, 19 Apr 2021 18:38: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 3D7602432D; Mon, 19 Apr 2021 18:38: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 13JIcIEe046911; Mon, 19 Apr 2021 18:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIcIC7046910; Mon, 19 Apr 2021 18:38:18 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:38:18 GMT Message-Id: <202104191838.13JIcIC7046910@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: 165ba13fb806 - main - linuxkpi: guarantee allocations of task and mm for interrupt threads 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: 165ba13fb806c8596f868981883631a5ee78d6c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:38:18 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=165ba13fb806c8596f868981883631a5ee78d6c8 commit 165ba13fb806c8596f868981883631a5ee78d6c8 Author: Konstantin Belousov AuthorDate: 2021-03-11 06:34:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:34:08 +0000 linuxkpi: guarantee allocations of task and mm for interrupt threads Create and use zones for task and mm. Reserve items in zones based on the estimation of the max number of interrupts in the system. Use M_USE_RESERVE to allow to take reserved items when allocation occurs from the interrupt thread context. Of course, this would only work first time we allocate the task for interrupt thread. If interrupt is deallocated and allocated anew, creating a new thread, it might be that zone is depleted. It still should be good enough for practical uses. Reviewed by: hselasky Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_current.c | 66 ++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index 081eab8edab1..ef51acc1952e 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -31,14 +31,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include +#include + +#if defined(__i386__) || defined(__amd64__) +extern u_int first_msi_irq, num_msi_irqs; +#endif static eventhandler_tag linuxkpi_thread_dtor_tag; -static MALLOC_DEFINE(M_LINUX_CURRENT, "linuxcurrent", "LinuxKPI task structure"); +static uma_zone_t linux_current_zone; +static uma_zone_t linux_mm_zone; int linux_alloc_current(struct thread *td, int flags) @@ -52,13 +60,23 @@ linux_alloc_current(struct thread *td, int flags) MPASS(td->td_lkpi_task == NULL); - ts = malloc(sizeof(*ts), M_LINUX_CURRENT, flags | M_ZERO); - if (ts == NULL) + if ((td->td_pflags & TDP_ITHREAD) != 0 || !THREAD_CAN_SLEEP()) { + flags &= ~M_WAITOK; + flags |= M_NOWAIT | M_USE_RESERVE; + } + + ts = uma_zalloc(linux_current_zone, flags | M_ZERO); + if (ts == NULL) { + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic("linux_alloc_current: failed to allocate task"); return (ENOMEM); + } - mm = malloc(sizeof(*mm), M_LINUX_CURRENT, flags | M_ZERO); + mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); if (mm == NULL) { - free(ts, M_LINUX_CURRENT); + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic("linux_alloc_current: failed to allocate mm"); + uma_zfree(linux_current_zone, mm); return (ENOMEM); } @@ -111,7 +129,7 @@ linux_alloc_current(struct thread *td, int flags) PROC_UNLOCK(proc); /* free mm_struct pointer, if any */ - free(mm, M_LINUX_CURRENT); + uma_zfree(linux_mm_zone, mm); return (0); } @@ -132,14 +150,14 @@ linux_get_task_mm(struct task_struct *task) void linux_mm_dtor(struct mm_struct *mm) { - free(mm, M_LINUX_CURRENT); + uma_zfree(linux_mm_zone, mm); } void linux_free_current(struct task_struct *ts) { mmput(ts->mm); - free(ts, M_LINUX_CURRENT); + uma_zfree(linux_current_zone, ts); } static void @@ -229,12 +247,42 @@ linux_task_exiting(struct task_struct *task) return (ret); } +static int lkpi_task_resrv; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, task_struct_reserve, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &lkpi_task_resrv, 0, + "Number of struct task and struct mm to reserve for non-sleepable " + "allocations"); + static void linux_current_init(void *arg __unused) { lkpi_alloc_current = linux_alloc_current; linuxkpi_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linuxkpi_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); + + TUNABLE_INT_FETCH("compat.linuxkpi.task_struct_reserve", + &lkpi_task_resrv); + if (lkpi_task_resrv == 0) { +#if defined(__i386__) || defined(__amd64__) + /* + * Number of interrupt threads plus per-cpu callout + * SWI threads. + */ + lkpi_task_resrv = first_msi_irq + num_msi_irqs + MAXCPU; +#else + lkpi_task_resrv = 1024; /* XXXKIB arbitrary */ +#endif + } + linux_current_zone = uma_zcreate("lkpicurr", + sizeof(struct task_struct), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + uma_zone_reserve(linux_current_zone, lkpi_task_resrv); + uma_prealloc(linux_current_zone, lkpi_task_resrv); + linux_mm_zone = uma_zcreate("lkpimm", + sizeof(struct task_struct), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + uma_zone_reserve(linux_mm_zone, lkpi_task_resrv); + uma_prealloc(linux_mm_zone, lkpi_task_resrv); } SYSINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_init, NULL); @@ -260,6 +308,8 @@ linux_current_uninit(void *arg __unused) sx_sunlock(&allproc_lock); EVENTHANDLER_DEREGISTER(thread_dtor, linuxkpi_thread_dtor_tag); lkpi_alloc_current = linux_alloc_current_noop; + uma_zdestroy(linux_current_zone); + uma_zdestroy(linux_mm_zone); } SYSUNINIT(linux_current, SI_SUB_EVENTHANDLER, SI_ORDER_SECOND, linux_current_uninit, NULL); From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:38:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF0425FAFD7; Mon, 19 Apr 2021 18:38: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 4FPFtz4LZFz4jJq; Mon, 19 Apr 2021 18:38: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 72AD124221; Mon, 19 Apr 2021 18:38: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 13JIcJAs046939; Mon, 19 Apr 2021 18:38:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIcJF0046938; Mon, 19 Apr 2021 18:38:19 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:38:19 GMT Message-Id: <202104191838.13JIcJF0046938@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: fad437ba612a - main - linuxkpi: reduce number of stray mm_struct allocations 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: fad437ba612a7c19f5cf1633e2d0d1c44d4dd478 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:38:19 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fad437ba612a7c19f5cf1633e2d0d1c44d4dd478 commit fad437ba612a7c19f5cf1633e2d0d1c44d4dd478 Author: Konstantin Belousov AuthorDate: 2021-03-11 06:48:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-19 18:34:08 +0000 linuxkpi: reduce number of stray mm_struct allocations Only allocate struct_mm after we checked that other threads do not carry useful mm_struct. If they don't, drop process lock, allocate, and recheck. Note that for M_NOWAIT allocations we could avoid dropping process lock, but I do not think that this increased complexity is useful. Reviewed by: hselasky Sponsored by: Mellanox Technologies/NVidia Networking MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_current.c | 85 +++++++++++++++----------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index ef51acc1952e..9bae7ee92e49 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -48,15 +48,35 @@ static eventhandler_tag linuxkpi_thread_dtor_tag; static uma_zone_t linux_current_zone; static uma_zone_t linux_mm_zone; +/* check if another thread already has a mm_struct */ +static struct mm_struct * +find_other_mm(struct proc *p) +{ + struct thread *td; + struct task_struct *ts; + struct mm_struct *mm; + + PROC_LOCK_ASSERT(p, MA_OWNED); + FOREACH_THREAD_IN_PROC(p, td) { + ts = td->td_lkpi_task; + if (ts == NULL) + continue; + mm = ts->mm; + if (mm == NULL) + continue; + /* try to share other mm_struct */ + if (atomic_inc_not_zero(&mm->mm_users)) + return (mm); + } + return (NULL); +} + int linux_alloc_current(struct thread *td, int flags) { struct proc *proc; - struct thread *td_other; struct task_struct *ts; - struct task_struct *ts_other; - struct mm_struct *mm; - struct mm_struct *mm_other; + struct mm_struct *mm, *mm_other; MPASS(td->td_lkpi_task == NULL); @@ -71,14 +91,7 @@ linux_alloc_current(struct thread *td, int flags) panic("linux_alloc_current: failed to allocate task"); return (ENOMEM); } - - mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); - if (mm == NULL) { - if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) - panic("linux_alloc_current: failed to allocate mm"); - uma_zfree(linux_current_zone, mm); - return (ENOMEM); - } + mm = NULL; /* setup new task structure */ atomic_set(&ts->kthread_flags, 0); @@ -93,35 +106,37 @@ linux_alloc_current(struct thread *td, int flags) proc = td->td_proc; - /* check if another thread already has a mm_struct */ PROC_LOCK(proc); - FOREACH_THREAD_IN_PROC(proc, td_other) { - ts_other = td_other->td_lkpi_task; - if (ts_other == NULL) - continue; + mm_other = find_other_mm(proc); - mm_other = ts_other->mm; - if (mm_other == NULL) - continue; + /* use allocated mm_struct as a fallback */ + if (mm_other == NULL) { + PROC_UNLOCK(proc); + mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); + if (mm == NULL) { + if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) + panic( + "linux_alloc_current: failed to allocate mm"); + uma_zfree(linux_current_zone, mm); + return (ENOMEM); + } - /* try to share other mm_struct */ - if (atomic_inc_not_zero(&mm_other->mm_users)) { + PROC_LOCK(proc); + mm_other = find_other_mm(proc); + if (mm_other == NULL) { + /* setup new mm_struct */ + init_rwsem(&mm->mmap_sem); + atomic_set(&mm->mm_count, 1); + atomic_set(&mm->mm_users, 1); /* set mm_struct pointer */ + ts->mm = mm; + /* clear pointer to not free memory */ + mm = NULL; + } else { ts->mm = mm_other; - break; } - } - - /* use allocated mm_struct as a fallback */ - if (ts->mm == NULL) { - /* setup new mm_struct */ - init_rwsem(&mm->mmap_sem); - atomic_set(&mm->mm_count, 1); - atomic_set(&mm->mm_users, 1); - /* set mm_struct pointer */ - ts->mm = mm; - /* clear pointer to not free memory */ - mm = NULL; + } else { + ts->mm = mm_other; } /* store pointer to task struct */ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 18:42:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EADE5FB613; Mon, 19 Apr 2021 18:42: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 4FPFzH3ZYdz4jmX; Mon, 19 Apr 2021 18:42: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 6E183243B3; Mon, 19 Apr 2021 18:42: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 13JIg3NZ059539; Mon, 19 Apr 2021 18:42:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JIg3bg059538; Mon, 19 Apr 2021 18:42:03 GMT (envelope-from git) Date: Mon, 19 Apr 2021 18:42:03 GMT Message-Id: <202104191842.13JIg3bg059538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: d3f0c032fb8b - main - bsdinstall: restore time selection screen MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3f0c032fb8b2d2ee8d491fa95108a3790541662 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 18:42:03 -0000 The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=d3f0c032fb8b2d2ee8d491fa95108a3790541662 commit d3f0c032fb8b2d2ee8d491fa95108a3790541662 Author: Yuri Pankov AuthorDate: 2021-04-19 18:39:59 +0000 Commit: Yuri Pankov CommitDate: 2021-04-19 18:39:59 +0000 bsdinstall: restore time selection screen Apparently new dialog does not like the height of 2 for the timebox widget, use 0 (minimum size) instead. Do the same for calendar widget as it does not change the appearance and to prevent possible future surprises. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D29720 --- usr.sbin/bsdinstall/scripts/time | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/time b/usr.sbin/bsdinstall/scripts/time index 67e539b53658..cccd5999a035 100755 --- a/usr.sbin/bsdinstall/scripts/time +++ b/usr.sbin/bsdinstall/scripts/time @@ -42,7 +42,7 @@ DATE=$(dialog --backtitle 'FreeBSD Installer' \ --cancel-label 'Skip' \ --defaultno \ --date-format '%Y%m%d%H%M.%S' \ - --calendar '' 2 40 \ + --calendar '' 0 40 \ 2>&1 1>&3) && date $DATE exec 3>&- @@ -54,7 +54,7 @@ TIME=$(dialog --backtitle 'FreeBSD Installer' \ --cancel-label 'Skip' \ --defaultno \ --time-format '%H%M.%S' \ - --timebox '' 2 40 \ + --timebox '' 0 40 \ 2>&1 1>&3) && date $TIME exec 3>&- From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:03:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 483B65FBB70; Mon, 19 Apr 2021 19:03: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 4FPGRl1bJnz4kXB; Mon, 19 Apr 2021 19:03:15 +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 29434246BF; Mon, 19 Apr 2021 19:03: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 13JJ3F45086966; Mon, 19 Apr 2021 19:03:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJ3Ffd086965; Mon, 19 Apr 2021 19:03:15 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:03:15 GMT Message-Id: <202104191903.13JJ3Ffd086965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: de703e98e6c8 - stable/13 - Fix direct route installation 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/stable/13 X-Git-Reftype: branch X-Git-Commit: de703e98e6c863874aa6012e3ce1a61eee58c846 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:03:15 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=de703e98e6c863874aa6012e3ce1a61eee58c846 commit de703e98e6c863874aa6012e3ce1a61eee58c846 Author: Alexander V. Chernikov AuthorDate: 2021-04-10 15:25:24 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-19 18:52:57 +0000 Fix direct route installation with net/bird. Slighly relax the gateway validation rules imposed by the 2fe5a79425c7, by requiring only first 8 bytes (everyhing before sdl_data to be present in the AF_LINK gateway. Reported by: olivier PR: 255089 (cherry picked from commit 7f5f3fcc32bfa553faa007579dfcaed84be3b047) --- sys/net/rtsock.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 12e485f917c8..c0996d318fb2 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1381,20 +1381,21 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) #endif case AF_LINK: { - struct sockaddr_dl_short *gw_sdl; + struct sockaddr_dl *gw_sdl; - gw_sdl = (struct sockaddr_dl_short *)gw; - if (gw_sdl->sdl_len < sizeof(struct sockaddr_dl_short)) { + size_t sdl_min_len = offsetof(struct sockaddr_dl, sdl_data); + gw_sdl = (struct sockaddr_dl *)gw; + if (gw_sdl->sdl_len < sdl_min_len) { printf("gw sdl_len too small\n"); return (EINVAL); } const struct sockaddr_dl_short sdl = { .sdl_family = AF_LINK, - .sdl_len = sizeof(struct sockaddr_dl_short), + .sdl_len = sdl_min_len, .sdl_index = gw_sdl->sdl_index, }; - *gw_sdl = sdl; + memcpy(gw_sdl, &sdl, sdl_min_len); break; } } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:19:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0F045FC440 for ; Mon, 19 Apr 2021 19:19: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 4FPGpb4b5Qz4lQF; Mon, 19 Apr 2021 19:19: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 902C624759; Mon, 19 Apr 2021 19:19: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 13JJJZNM000495; Mon, 19 Apr 2021 19:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJJZ7h000494; Mon, 19 Apr 2021 19:19:35 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:19:35 GMT Message-Id: <202104191919.13JJJZ7h000494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: b4125f7d51da - vendor/llvm-project/release-12.x - Vendor import of llvm-project branch release/12.x llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. 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/vendor/llvm-project/release-12.x X-Git-Reftype: branch X-Git-Commit: b4125f7d51da2bb55d3b850dba9a69c201c3422c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:19:35 -0000 The branch vendor/llvm-project/release-12.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=b4125f7d51da2bb55d3b850dba9a69c201c3422c commit b4125f7d51da2bb55d3b850dba9a69c201c3422c Author: Dimitry Andric AuthorDate: 2021-04-19 19:18:04 +0000 Commit: Dimitry Andric CommitDate: 2021-04-19 19:18:04 +0000 Vendor import of llvm-project branch release/12.x llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. --- clang/include/clang/Basic/CodeGenOptions.def | 3 + clang/include/clang/Basic/CodeGenOptions.h | 6 + clang/include/clang/Driver/Options.td | 5 + clang/lib/CodeGen/CGCall.cpp | 5 + clang/lib/CodeGen/CGOpenMPRuntime.cpp | 2 +- clang/lib/CodeGen/CodeGenFunction.h | 11 ++ clang/lib/Driver/ToolChains/Clang.cpp | 3 + clang/lib/Driver/ToolChains/MSVC.cpp | 6 +- clang/lib/Driver/ToolChains/OpenBSD.cpp | 1 + clang/lib/Frontend/CompilerInvocation.cpp | 5 +- clang/lib/Frontend/InitPreprocessor.cpp | 2 +- clang/lib/Sema/SemaCodeComplete.cpp | 21 +++- lld/docs/ReleaseNotes.rst | 88 ++++++++++++- llvm/include/llvm-c/Orc.h | 7 +- llvm/include/llvm/CodeGen/FastISel.h | 5 +- llvm/include/llvm/CodeGen/MachineInstr.h | 7 ++ llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 4 +- llvm/include/llvm/IR/InstrTypes.h | 3 - llvm/include/llvm/IR/Instruction.h | 7 ++ llvm/include/llvm/IR/Metadata.h | 18 +++ llvm/include/llvm/IR/Operator.h | 5 + llvm/include/llvm/ProfileData/ProfileCommon.h | 3 + .../llvm/Transforms/IPO/SampleContextTracker.h | 13 +- .../llvm/Transforms/IPO/SampleProfileProbe.h | 2 +- llvm/include/llvm/Transforms/Utils/Cloning.h | 7 ++ llvm/lib/Analysis/DemandedBits.cpp | 2 +- llvm/lib/Analysis/IVDescriptors.cpp | 5 +- llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 81 ++++++++++++ llvm/lib/Analysis/ValueTracking.cpp | 28 +---- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 5 + llvm/lib/CodeGen/LiveRangeShrink.cpp | 3 +- llvm/lib/CodeGen/MachineInstr.cpp | 3 +- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 15 ++- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 10 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 5 +- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 31 ++++- llvm/lib/CodeGen/StackProtector.cpp | 2 +- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 8 +- llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp | 2 +- llvm/lib/IR/AutoUpgrade.cpp | 42 +++++++ llvm/lib/IR/Instruction.cpp | 14 +++ llvm/lib/IR/Operator.cpp | 20 ++- llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 1 - llvm/lib/ProfileData/ProfileSummaryBuilder.cpp | 34 +++++ llvm/lib/ProfileData/SampleProfReader.cpp | 6 +- llvm/lib/ProfileData/SampleProfWriter.cpp | 11 +- llvm/lib/Support/Windows/Path.inc | 24 +++- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 7 +- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 6 + llvm/lib/Target/RISCV/RISCVInstrInfoV.td | 16 +-- llvm/lib/Target/X86/X86FastISel.cpp | 8 ++ llvm/lib/Target/X86/X86InstrSSE.td | 16 +-- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 10 +- llvm/lib/Transforms/IPO/SampleContextTracker.cpp | 32 +++++ llvm/lib/Transforms/IPO/SampleProfile.cpp | 137 ++++++++++++++++++++- .../Transforms/InstCombine/InstCombineCasts.cpp | 1 + llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 8 +- .../InstCombine/InstCombineSimplifyDemanded.cpp | 8 +- .../InstCombine/InstructionCombining.cpp | 7 +- llvm/lib/Transforms/Scalar/ADCE.cpp | 2 +- llvm/lib/Transforms/Scalar/JumpThreading.cpp | 10 ++ llvm/lib/Transforms/Scalar/SROA.cpp | 38 +++--- llvm/lib/Transforms/Utils/CloneFunction.cpp | 8 ++ llvm/lib/Transforms/Utils/Local.cpp | 33 +++-- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 19 +-- .../Vectorize/LoopVectorizationPlanner.h | 4 + llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 33 +++-- llvm/tools/llvm-dwp/llvm-dwp.cpp | 4 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 30 ++--- llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 7 +- openmp/runtime/src/kmp_runtime.cpp | 15 ++- openmp/runtime/src/kmp_settings.cpp | 7 +- openmp/runtime/src/kmp_tasking.cpp | 3 +- 73 files changed, 864 insertions(+), 196 deletions(-) diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def index 5c8af65326ed..9d53b5b923bb 100644 --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -266,6 +266,9 @@ CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer. CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer. CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate. +/// Treat loops as finite: language, always, never. +ENUM_CODEGENOPT(FiniteLoops, FiniteLoopsKind, 2, FiniteLoopsKind::Language) + /// Attempt to use register sized accesses to bit-fields in structures, when /// possible. CODEGENOPT(UseRegisterSizedBitfieldAccess , 1, 0) diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h index 73d41e3293c6..c550817f0f69 100644 --- a/clang/include/clang/Basic/CodeGenOptions.h +++ b/clang/include/clang/Basic/CodeGenOptions.h @@ -140,6 +140,12 @@ public: All, // Keep all frame pointers. }; + enum FiniteLoopsKind { + Language, // Not specified, use language standard. + Always, // All loops are assumed to be finite. + Never, // No loop is assumed to be finite. + }; + /// The code model to use (-mcmodel). std::string CodeModel; diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 1f6c13d5cc96..817798926650 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2410,6 +2410,11 @@ def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group, defm reroll_loops : BoolFOption<"reroll-loops", CodeGenOpts<"RerollLoops">, DefaultFalse, PosFlag, NegFlag>; +def ffinite_loops: Flag<["-"], "ffinite-loops">, Group, + HelpText<"Assume all loops are finite.">, Flags<[CC1Option]>; +def fno_finite_loops: Flag<["-"], "fno-finite-loops">, Group, + HelpText<"Do not assume that any loop is finite.">, Flags<[CC1Option]>; + def ftrigraphs : Flag<["-"], "ftrigraphs">, Group, HelpText<"Process trigraph sequences">, Flags<[CC1Option]>; def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group, diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 42801372189b..bc7582c67989 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1995,9 +1995,14 @@ void CodeGenModule::ConstructAttributeList( if (TargetDecl->hasAttr()) { FuncAttrs.addAttribute(llvm::Attribute::ReadNone); FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); + // gcc specifies that 'const' functions have greater restrictions than + // 'pure' functions, so they also cannot have infinite loops. + FuncAttrs.addAttribute(llvm::Attribute::WillReturn); } else if (TargetDecl->hasAttr()) { FuncAttrs.addAttribute(llvm::Attribute::ReadOnly); FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); + // gcc specifies that 'pure' functions cannot have infinite loops. + FuncAttrs.addAttribute(llvm::Attribute::WillReturn); } else if (TargetDecl->hasAttr()) { FuncAttrs.addAttribute(llvm::Attribute::ArgMemOnly); FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 57cc2d60e2af..83dfa0780547 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -9892,7 +9892,7 @@ void CGOpenMPRuntime::emitTargetNumIterationsCall( llvm::Value *Args[] = {RTLoc, DeviceID, NumIterations}; CGF.EmitRuntimeCall( OMPBuilder.getOrCreateRuntimeFunction( - CGM.getModule(), OMPRTL___kmpc_push_target_tripcount), + CGM.getModule(), OMPRTL___kmpc_push_target_tripcount_mapper), Args); } }; diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 8eb7adbc8fcb..95c0b7b4d7c0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -507,12 +507,23 @@ public: /// True if the C++ Standard Requires Progress. bool CPlusPlusWithProgress() { + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Never) + return false; + return getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 || getLangOpts().CPlusPlus17 || getLangOpts().CPlusPlus20; } /// True if the C Standard Requires Progress. bool CWithProgress() { + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Always) + return true; + if (CGM.getCodeGenOpts().getFiniteLoops() == + CodeGenOptions::FiniteLoopsKind::Never) + return false; + return getLangOpts().C11 || getLangOpts().C17 || getLangOpts().C2x; } diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index f8e637974662..1976b48e0f6a 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -5620,6 +5620,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (A->getOption().matches(options::OPT_freroll_loops)) CmdArgs.push_back("-freroll-loops"); + Args.AddLastArg(CmdArgs, options::OPT_ffinite_loops, + options::OPT_fno_finite_loops); + Args.AddLastArg(CmdArgs, options::OPT_fwritable_strings); Args.AddLastArg(CmdArgs, options::OPT_funroll_loops, options::OPT_fno_unroll_loops); diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp index f4b7a57e0bb7..13943b6c404a 100644 --- a/clang/lib/Driver/ToolChains/MSVC.cpp +++ b/clang/lib/Driver/ToolChains/MSVC.cpp @@ -11,6 +11,7 @@ #include "Darwin.h" #include "clang/Basic/CharInfo.h" #include "clang/Basic/Version.h" +#include "clang/Config/config.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" #include "clang/Driver/DriverDiagnostic.h" @@ -520,7 +521,10 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA, // translate 'lld' into 'lld-link', and in the case of the regular msvc // linker, we need to use a special search algorithm. llvm::SmallString<128> linkPath; - StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "link"); + StringRef Linker + = Args.getLastArgValue(options::OPT_fuse_ld_EQ, CLANG_DEFAULT_LINKER); + if (Linker.empty()) + Linker = "link"; if (Linker.equals_lower("lld")) Linker = "lld-link"; diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp index f155d74632f9..e162165b2561 100644 --- a/clang/lib/Driver/ToolChains/OpenBSD.cpp +++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp @@ -296,6 +296,7 @@ void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args, CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++"); CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi"); + CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread"); } std::string OpenBSD::getCompilerRT(const ArgList &Args, diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 036388ebd355..5c5cf46150e2 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1037,7 +1037,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.UnrollLoops = Args.hasFlag(OPT_funroll_loops, OPT_fno_unroll_loops, (Opts.OptimizationLevel > 1)); - Opts.BinutilsVersion = std::string(Args.getLastArgValue(OPT_fbinutils_version_EQ)); @@ -1324,6 +1323,10 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true); + if (Args.hasArg(options::OPT_ffinite_loops)) + Opts.FiniteLoops = CodeGenOptions::FiniteLoopsKind::Always; + else if (Args.hasArg(options::OPT_fno_finite_loops)) + Opts.FiniteLoops = CodeGenOptions::FiniteLoopsKind::Never; return Success; } diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index d47ad1b74649..c64a912ce919 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -565,7 +565,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, Builder.defineMacro("__cpp_aggregate_bases", "201603L"); Builder.defineMacro("__cpp_structured_bindings", "201606L"); Builder.defineMacro("__cpp_nontype_template_args", - LangOpts.CPlusPlus20 ? "201911L" : "201411L"); + "201411L"); // (not latest) Builder.defineMacro("__cpp_fold_expressions", "201603L"); Builder.defineMacro("__cpp_guaranteed_copy_elision", "201606L"); Builder.defineMacro("__cpp_nontype_template_parameter_auto", "201606L"); diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index c2785fd60fc2..be04970979b3 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -5158,6 +5158,20 @@ private: llvm::DenseMap Results; }; + +// If \p Base is ParenListExpr, assume a chain of comma operators and pick the +// last expr. We expect other ParenListExprs to be resolved to e.g. constructor +// calls before here. (So the ParenListExpr should be nonempty, but check just +// in case) +Expr *unwrapParenList(Expr *Base) { + if (auto *PLE = llvm::dyn_cast_or_null(Base)) { + if (PLE->getNumExprs() == 0) + return nullptr; + Base = PLE->getExpr(PLE->getNumExprs() - 1); + } + return Base; +} + } // namespace void Sema::CodeCompleteMemberReferenceExpr(Scope *S, Expr *Base, @@ -5165,6 +5179,8 @@ void Sema::CodeCompleteMemberReferenceExpr(Scope *S, Expr *Base, SourceLocation OpLoc, bool IsArrow, bool IsBaseExprStatement, QualType PreferredType) { + Base = unwrapParenList(Base); + OtherOpBase = unwrapParenList(OtherOpBase); if (!Base || !CodeCompleter) return; @@ -5597,12 +5613,13 @@ ProduceSignatureHelp(Sema &SemaRef, Scope *S, QualType Sema::ProduceCallSignatureHelp(Scope *S, Expr *Fn, ArrayRef Args, SourceLocation OpenParLoc) { - if (!CodeCompleter) + Fn = unwrapParenList(Fn); + if (!CodeCompleter || !Fn) return QualType(); // FIXME: Provide support for variadic template functions. // Ignore type-dependent call expressions entirely. - if (!Fn || Fn->isTypeDependent() || anyNullArguments(Args)) + if (Fn->isTypeDependent() || anyNullArguments(Args)) return QualType(); // In presence of dependent args we surface all possible signatures using the // non-dependent args in the prefix. Afterwards we do a post filtering to make diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index ea1403888eba..24ed23bb2b7d 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -24,13 +24,77 @@ Non-comprehensive list of changes in this release ELF Improvements ---------------- -* ``--error-handling-script`` is added to allow for user-defined handlers upon +* ``--dependency-file`` has been added. (Similar to ``cc -M -MF``.) + (`D82437 `_) +* ``--error-handling-script`` has been added to allow for user-defined handlers upon missing libraries. (`D87758 `_) +* ``--exclude-libs`` can now localize defined version symbols and bitcode referenced libcall symbols. + (`D94280 `_) +* ``--gdb-index`` now works with DWARF v5 and ``--icf={safe,all}``. + (`D85579 `_) + (`D89751 `_) +* ``--gdb-index --emit-relocs`` can now be used together. + (`D94354 `_) +* ``--icf={safe,all}`` conservatively no longer fold text sections with LSDA. + Previously ICF on ``-fexceptions`` code could be unsafe. + (`D84610 `_) +* ``--icf={safe,all}`` can now fold two sections with relocations referencing aliased symbols. + (`D88830 `_) +* ``--lto-pseudo-probe-for-profiling`` has been added. + (`D95056 `_) +* ``--no-lto-whole-program-visibility`` has been added. + (`D92060 `_) +* ``--oformat-binary`` has been fixed to respect LMA. + (`D85086 `_) +* ``--reproduce`` includes ``--lto-sample-profile``, ``--just-symbols``, ``--call-graph-ordering-file``, ``--retain-symbols-file`` files. +* ``-r --gc-sections`` is now supported. + (`D84131 `_) +* A ``-u`` specified symbol will no longer change the binding to ``STB_WEAK``. + (`D88945 `_) +* ``--wrap`` support has been improved. + + If ``foo`` is not referenced, there is no longer an undefined symbol ``__wrap_foo``. + + If ``__real_foo`` is not referenced, there is no longer an undefined symbol ``foo``. +* ``SHF_LINK_ORDER`` sections can now have zero ``sh_link`` values. +* ``SHF_LINK_ORDER`` and non-``SHF_LINK_ORDER`` sections can now be mixed within an input section description. + (`D84001 `_) +* ``LOG2CEIL`` is now supported in linker scripts. + (`D84054 `_) +* ``DEFINED`` has been fixed to check whether the symbol is defined. + (`D83758 `_) +* An input section description may now have multiple ``SORT_*``. + The matched sections are ordered by radix sort with the keys being ``(SORT*, --sort-section, input order)``. + (`D91127 `_) +* Users can now provide a GNU style linker script to convert ``.ctors`` into ``.init_array``. + (`D91187 `_) +* An empty output section can now be discarded even if it is assigned to a program header. + (`D92301 `_) +* Non-``SHF_ALLOC`` sections now have larger file offsets than ``SHF_ALLOC`` sections. + (`D85867 `_) +* Some symbol versioning improvements. + + Defined ``foo@@v1`` now resolve undefined ``foo@v1`` (`D92259 `_) + + Undefined ``foo@v1`` now gets an error (`D92260 `_) +* The AArch64 port now has support for ``STO_AARCH64_VARIANT_PCS`` and ``DT_AARCH64_VARIANT_PCS``. + (`D93045 `_) +* The AArch64 port now has support for ``R_AARCH64_LD64_GOTPAGE_LO15``. +* The PowerPC64 port now detects missing R_PPC64_TLSGD/R_PPC64_TLSLD and disables TLS relaxation. + This allows linking with object files produced by very old IBM XL compilers. + (`D92959 `_) +* Many PowerPC PC-relative relocations are now supported. +* ``R_PPC_ADDR24`` and ``R_PPC64_ADDR16_HIGH`` are now supported. +* powerpcle is now supported. Tested with FreeBSD loader and freestanding. + (`D93917 `_) +* RISC-V: the first ``SHT_RISCV_ATTRIBUTES`` section is now retained. + (`D86309 `_) +* LTO pipeline now defaults to the new PM if the CMake variable ``ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER`` is on. + (`D92885 `_) Breaking changes ---------------- -* ... +* A COMMON symbol can now cause the fetch of an archive providing a ``STB_GLOBAL`` definition. + This behavior follows GNU ld newer than December 1999. + If you see ``duplicate symbol`` errors with the new behavior, check out `PR49226 `_. + (`D86142 `_) COFF Improvements ----------------- @@ -58,10 +122,26 @@ MinGW Improvements (`D93950 `_) -MachO Improvements +Mach-O Improvements ------------------ -* Item 1. +We've gotten the new implementation of LLD for Mach-O to the point where it is +able to link large x86_64 programs, and we'd love to get some alpha testing on +it. The new Darwin back-end can be invoked as follows: + +.. code-block:: + clang -fuse-ld=lld.darwinnew /path/to/file.c + +To reach this point, we implemented numerous features, and it's easier to list +the major features we *haven't* yet completed: + +* LTO support +* Stack unwinding for exceptions +* Support for arm64, arm, and i386 architectures + +If you stumble upon an issue and it doesn't fall into one of these categories, +please file a bug report! + WebAssembly Improvements ------------------------ diff --git a/llvm/include/llvm-c/Orc.h b/llvm/include/llvm-c/Orc.h index 183107c148a6..9beef44c89dd 100644 --- a/llvm/include/llvm-c/Orc.h +++ b/llvm/include/llvm-c/Orc.h @@ -339,8 +339,7 @@ LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT); * ownership has not been passed to a JITDylib (e.g. because some error * prevented the client from calling LLVMOrcJITDylibAddGenerator). */ -void LLVMOrcDisposeDefinitionGenerator( - LLVMOrcDefinitionGeneratorRef DG); +void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG); /** * Dispose of a MaterializationUnit. @@ -388,7 +387,9 @@ LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES, * Returns the JITDylib with the given name, or NULL if no such JITDylib * exists. */ -LLVMOrcJITDylibRef LLVMOrcExecutionSessionGetJITDylibByName(const char *Name); +LLVMOrcJITDylibRef +LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES, + const char *Name); /** * Return a reference to a newly created resource tracker associated with JD. diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h index 81c1d6aad49a..26bf4ab2618c 100644 --- a/llvm/include/llvm/CodeGen/FastISel.h +++ b/llvm/include/llvm/CodeGen/FastISel.h @@ -490,7 +490,10 @@ protected: /// - \c Add has a constant operand. bool canFoldAddIntoGEP(const User *GEP, const Value *Add); - /// Test whether the given value has exactly one use. + /// Test whether the register associated with this value has exactly one use, + /// in which case that single use is killing. Note that multiple IR values + /// may map onto the same register, in which case this is not the same as + /// checking that an IR value has one use. bool hasTrivialKill(const Value *V); /// Create a machine mem operand from the given instruction. diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index 6bbe2d03f9e5..f8d97c2c07a6 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -1156,6 +1156,10 @@ public: return getOpcode() == TargetOpcode::CFI_INSTRUCTION; } + bool isPseudoProbe() const { + return getOpcode() == TargetOpcode::PSEUDO_PROBE; + } + // True if the instruction represents a position in the function. bool isPosition() const { return isLabel() || isCFIInstruction(); } @@ -1165,6 +1169,9 @@ public: bool isDebugInstr() const { return isDebugValue() || isDebugLabel() || isDebugRef(); } + bool isDebugOrPseudoInstr() const { + return isDebugInstr() || isPseudoProbe(); + } bool isDebugOffsetImm() const { return getDebugOffset().isImm(); } diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def index 844046167975..75d360bf4237 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def +++ b/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def @@ -375,7 +375,7 @@ __OMP_RTL(__kmpc_init_allocator, false, /* omp_allocator_handle_t */ VoidPtr, __OMP_RTL(__kmpc_destroy_allocator, false, Void, /* Int */ Int32, /* omp_allocator_handle_t */ VoidPtr) -__OMP_RTL(__kmpc_push_target_tripcount, false, Void, IdentPtr, Int64, Int64) +__OMP_RTL(__kmpc_push_target_tripcount_mapper, false, Void, IdentPtr, Int64, Int64) __OMP_RTL(__tgt_target_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32, VoidPtrPtr, VoidPtrPtr, Int64Ptr, Int64Ptr, VoidPtrPtr, VoidPtrPtr) __OMP_RTL(__tgt_target_nowait_mapper, false, Int32, IdentPtr, Int64, VoidPtr, Int32, @@ -844,7 +844,7 @@ __OMP_RTL_ATTRS(__kmpc_free, AllocAttrs, AttributeSet(), {}) __OMP_RTL_ATTRS(__kmpc_init_allocator, DefaultAttrs, ReturnPtrAttrs, {}) __OMP_RTL_ATTRS(__kmpc_destroy_allocator, AllocAttrs, AttributeSet(), {}) -__OMP_RTL_ATTRS(__kmpc_push_target_tripcount, SetterAttrs, AttributeSet(), {}) +__OMP_RTL_ATTRS(__kmpc_push_target_tripcount_mapper, SetterAttrs, AttributeSet(), {}) __OMP_RTL_ATTRS(__tgt_target_mapper, ForkAttrs, AttributeSet(), {}) __OMP_RTL_ATTRS(__tgt_target_nowait_mapper, ForkAttrs, AttributeSet(), {}) __OMP_RTL_ATTRS(__tgt_target_teams_mapper, ForkAttrs, AttributeSet(), {}) diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index f42ef48de6b3..955ac8e537fe 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -1757,9 +1757,6 @@ public: return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly); } - /// Returns true if this function is guaranteed to return. - bool willReturn() const { return hasFnAttr(Attribute::WillReturn); } - void setOnlyReadsMemory() { addAttribute(AttributeList::FunctionIndex, Attribute::ReadOnly); } diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h index d2a55f89fac9..b99dc62bbb9d 100644 --- a/llvm/include/llvm/IR/Instruction.h +++ b/llvm/include/llvm/IR/Instruction.h @@ -633,6 +633,10 @@ public: /// generated program. bool isSafeToRemove() const; + /// Return true if the instruction will return (unwinding is considered as + /// a form of returning control flow here). + bool willReturn() const; + /// Return true if the instruction is a variety of EH-block. bool isEHPad() const { switch (getOpcode()) { @@ -650,6 +654,9 @@ public: /// llvm.lifetime.end marker. bool isLifetimeStartOrEnd() const; + /// Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst. + bool isDebugOrPseudoInst() const; + /// Return a pointer to the next non-debug instruction in the same basic /// block as 'this', or nullptr if no such instruction exists. Skip any pseudo /// operations if \c SkipPseudoOp is true. diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h index 0b87416befe9..9a4480b75a30 100644 --- a/llvm/include/llvm/IR/Metadata.h +++ b/llvm/include/llvm/IR/Metadata.h @@ -667,6 +667,12 @@ struct AAMDNodes { /// The tag specifying the noalias scope. MDNode *NoAlias = nullptr; + // Shift tbaa Metadata node to start off bytes later + static MDNode *ShiftTBAA(MDNode *M, size_t off); + + // Shift tbaa.struct Metadata node to start off bytes later + static MDNode *ShiftTBAAStruct(MDNode *M, size_t off); + /// Given two sets of AAMDNodes that apply to the same pointer, /// give the best AAMDNodes that are compatible with both (i.e. a set of /// nodes whose allowable aliasing conclusions are a subset of those @@ -680,6 +686,18 @@ struct AAMDNodes { Result.NoAlias = Other.NoAlias == NoAlias ? NoAlias : nullptr; return Result; } + + /// Create a new AAMDNode that describes this AAMDNode after applying a + /// constant offset to the start of the pointer + AAMDNodes shift(size_t Offset) { + AAMDNodes Result; + Result.TBAA = TBAA ? ShiftTBAA(TBAA, Offset) : nullptr; + Result.TBAAStruct = + TBAAStruct ? ShiftTBAAStruct(TBAAStruct, Offset) : nullptr; + Result.Scope = Scope; + Result.NoAlias = NoAlias; + return Result; + } }; // Specialize DenseMapInfo for AAMDNodes. diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h index acfacbd6c74e..945f7e46e142 100644 --- a/llvm/include/llvm/IR/Operator.h +++ b/llvm/include/llvm/IR/Operator.h @@ -568,6 +568,11 @@ public: bool accumulateConstantOffset( const DataLayout &DL, APInt &Offset, function_ref ExternalAnalysis = nullptr) const; + + static bool accumulateConstantOffset( + Type *SourceType, ArrayRef Index, const DataLayout &DL, + APInt &Offset, + function_ref ExternalAnalysis = nullptr); }; class PtrToIntOperator diff --git a/llvm/include/llvm/ProfileData/ProfileCommon.h b/llvm/include/llvm/ProfileData/ProfileCommon.h index 6bb5825339ae..55b94b2e690d 100644 --- a/llvm/include/llvm/ProfileData/ProfileCommon.h +++ b/llvm/include/llvm/ProfileData/ProfileCommon.h @@ -17,6 +17,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/IR/ProfileSummary.h" #include "llvm/ProfileData/InstrProf.h" +#include "llvm/ProfileData/SampleProf.h" #include "llvm/Support/Error.h" #include #include @@ -89,6 +90,8 @@ public: void addRecord(const sampleprof::FunctionSamples &FS, bool isCallsiteSample = false); + std::unique_ptr computeSummaryForProfiles( + const StringMap &Profiles); std::unique_ptr getSummary(); }; diff --git a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h index 526e141838c4..da0bdae0eaee 100644 --- a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h +++ b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Analysis/CallGraph.h" #include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/Instructions.h" #include "llvm/ProfileData/SampleProf.h" @@ -90,6 +91,8 @@ private: // calling context and the context is identified by path from root to the node. class SampleContextTracker { public: + using ContextSamplesTy = SmallSet; + SampleContextTracker(StringMap &Profiles); // Query context profile for a specific callee with given name at a given // call-site. The full context is identified by location of call instruction. @@ -103,6 +106,9 @@ public: FunctionSamples *getContextSamplesFor(const DILocation *DIL); // Query context profile for a given sample contxt of a function. FunctionSamples *getContextSamplesFor(const SampleContext &Context); + // Get all context profile for given function. + ContextSamplesTy &getAllContextSamplesFor(const Function &Func); + ContextSamplesTy &getAllContextSamplesFor(StringRef Name); // Query base profile for a given function. A base profile is a merged view // of all context profiles for contexts that are not inlined. FunctionSamples *getBaseSamplesFor(const Function &Func, @@ -113,6 +119,9 @@ public: // This makes sure that inlined context profile will be excluded in // function's base profile. void markContextSamplesInlined(const FunctionSamples *InlinedSamples); + void promoteMergeContextSamplesTree(const Instruction &Inst, + StringRef CalleeName); + void addCallGraphEdges(CallGraph &CG, StringMap &SymbolMap); // Dump the internal context profile trie. void dump(); @@ -126,8 +135,6 @@ private: ContextTrieNode *getTopLevelContextNode(StringRef FName); ContextTrieNode &addTopLevelContextNode(StringRef FName); ContextTrieNode &promoteMergeContextSamplesTree(ContextTrieNode &NodeToPromo); - void promoteMergeContextSamplesTree(const Instruction &Inst, - StringRef CalleeName); void mergeContextNode(ContextTrieNode &FromNode, ContextTrieNode &ToNode, StringRef ContextStrToRemove); ContextTrieNode &promoteMergeContextSamplesTree(ContextTrieNode &FromNode, @@ -135,7 +142,7 @@ private: StringRef ContextStrToRemove); // Map from function name to context profiles (excluding base profile) - StringMap> FuncToCtxtProfileSet; + StringMap FuncToCtxtProfileSet; // Root node for context trie tree ContextTrieNode RootContext; diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h index cab893b50d19..0fd79d8ff7f3 100644 --- a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h +++ b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h @@ -62,7 +62,7 @@ public: private: // Allow a little bias due the rounding to integral factors. - constexpr static float DistributionFactorVariance = 0.02; + constexpr static float DistributionFactorVariance = 0.02f; // Distribution factors from last pass. FuncProbeFactorMap FunctionProbeFactors; diff --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h index 56aaa5d48e2a..aa960c625630 100644 --- a/llvm/include/llvm/Transforms/Utils/Cloning.h +++ b/llvm/include/llvm/Transforms/Utils/Cloning.h @@ -274,6 +274,13 @@ void updateProfileCallee( void identifyNoAliasScopesToClone( ArrayRef BBs, SmallVectorImpl &NoAliasDeclScopes); +/// Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified +/// instruction range and extract their scope. These are candidates for +/// duplication when cloning. +void identifyNoAliasScopesToClone( + BasicBlock::iterator Start, BasicBlock::iterator End, + SmallVectorImpl &NoAliasDeclScopes); + /// Duplicate the specified list of noalias decl scopes. /// The 'Ext' string is added as an extension to the name. /// Afterwards, the ClonedScopes contains the mapping of the original scope diff --git a/llvm/lib/Analysis/DemandedBits.cpp b/llvm/lib/Analysis/DemandedBits.cpp index 461fd7239905..dd11b0b02bf8 100644 --- a/llvm/lib/Analysis/DemandedBits.cpp +++ b/llvm/lib/Analysis/DemandedBits.cpp @@ -80,7 +80,7 @@ void DemandedBitsWrapperPass::print(raw_ostream &OS, const Module *M) const { static bool isAlwaysLive(Instruction *I) { return I->isTerminator() || isa(I) || I->isEHPad() || - I->mayHaveSideEffects(); + I->mayHaveSideEffects() || !I->willReturn(); } void DemandedBits::determineLiveOperandBits( diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp index 7f311d8f9a2b..94a24ccf2155 100644 --- a/llvm/lib/Analysis/IVDescriptors.cpp +++ b/llvm/lib/Analysis/IVDescriptors.cpp @@ -243,11 +243,14 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurKind Kind, if (RecurrenceType->isFloatingPointTy()) { if (!isFloatingPointRecurrenceKind(Kind)) return false; - } else { + } else if (RecurrenceType->isIntegerTy()) { if (!isIntegerRecurrenceKind(Kind)) return false; if (isArithmeticRecurrenceKind(Kind)) Start = lookThroughAnd(Phi, RecurrenceType, VisitedInsts, CastInsts); + } else { + // Pointer min/max may exist, but it is not supported as a reduction op. + return false; } Worklist.push_back(Start); diff --git a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp index 7d97fc5da9b0..268acb682cf1 100644 --- a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp +++ b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp @@ -737,3 +737,84 @@ bool TypeBasedAAWrapperPass::doFinalization(Module &M) { void TypeBasedAAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } + +MDNode *AAMDNodes::ShiftTBAA(MDNode *MD, size_t Offset) { + // Fast path if there's no offset + if (Offset == 0) + return MD; + // Fast path if there's no path tbaa node (and thus scalar) + if (!isStructPathTBAA(MD)) + return MD; + + TBAAStructTagNode Tag(MD); + SmallVector Sub; + Sub.push_back(MD->getOperand(0)); + Sub.push_back(MD->getOperand(1)); + ConstantInt *InnerOffset = mdconst::extract(MD->getOperand(2)); + + if (Tag.isNewFormat()) { + ConstantInt *InnerSize = mdconst::extract(MD->getOperand(3)); + + if (InnerOffset->getZExtValue() + InnerSize->getZExtValue() <= Offset) { + return nullptr; + } + + uint64_t NewSize = InnerSize->getZExtValue(); + uint64_t NewOffset = InnerOffset->getZExtValue() - Offset; + if (InnerOffset->getZExtValue() < Offset) { + NewOffset = 0; + NewSize -= Offset - InnerOffset->getZExtValue(); + } + + Sub.push_back(ConstantAsMetadata::get( + ConstantInt::get(InnerOffset->getType(), NewOffset))); + + Sub.push_back(ConstantAsMetadata::get( + ConstantInt::get(InnerSize->getType(), NewSize))); + + // immutable type + if (MD->getNumOperands() >= 5) + Sub.push_back(MD->getOperand(4)); + } else { + if (InnerOffset->getZExtValue() < Offset) + return nullptr; + + Sub.push_back(ConstantAsMetadata::get(ConstantInt::get( + InnerOffset->getType(), InnerOffset->getZExtValue() - Offset))); + + // immutable type + if (MD->getNumOperands() >= 4) + Sub.push_back(MD->getOperand(3)); + } + return MDNode::get(MD->getContext(), Sub); +} + +MDNode *AAMDNodes::ShiftTBAAStruct(MDNode *MD, size_t Offset) { + // Fast path if there's no offset + if (Offset == 0) + return MD; + SmallVector Sub; + for (size_t i = 0, size = MD->getNumOperands(); i < size; i += 3) { + ConstantInt *InnerOffset = mdconst::extract(MD->getOperand(i)); + ConstantInt *InnerSize = + mdconst::extract(MD->getOperand(i + 1)); + // Don't include any triples that aren't in bounds + if (InnerOffset->getZExtValue() + InnerSize->getZExtValue() <= Offset) + continue; + + uint64_t NewSize = InnerSize->getZExtValue(); + uint64_t NewOffset = InnerOffset->getZExtValue() - Offset; + if (InnerOffset->getZExtValue() < Offset) { + NewOffset = 0; + NewSize -= Offset - InnerOffset->getZExtValue(); + } + + // Shift the offset of the triple + Sub.push_back(ConstantAsMetadata::get( + ConstantInt::get(InnerOffset->getType(), NewOffset))); + Sub.push_back(ConstantAsMetadata::get( + ConstantInt::get(InnerSize->getType(), NewSize))); + Sub.push_back(MD->getOperand(i + 2)); + } + return MDNode::get(MD->getContext(), Sub); +} \ No newline at end of file diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 5600a3b33750..e174c5efe424 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -5018,36 +5018,14 @@ bool llvm::isGuaranteedToTransferExecutionToSuccessor(const Instruction *I) { // arbitrary length of time, but programs aren't allowed to rely on that. // If there is no successor, then execution can't transfer to it. - if (const auto *CRI = dyn_cast(I)) - return !CRI->unwindsToCaller(); - if (const auto *CatchSwitch = dyn_cast(I)) - return !CatchSwitch->unwindsToCaller(); - if (isa(I)) - return false; if (isa(I)) return false; if (isa(I)) return false; - // Calls can throw, or contain an infinite loop, or kill the process. - if (const auto *CB = dyn_cast(I)) { - // Call sites that throw have implicit non-local control flow. - if (!CB->doesNotThrow()) - return false; - - // A function which doens't throw and has "willreturn" attribute will - // always return. - if (CB->hasFnAttr(Attribute::WillReturn)) - return true; - - // FIXME: Temporarily assume that all side-effect free intrinsics will - // return. Remove this workaround once all intrinsics are appropriately - // annotated. - return isa(CB) && CB->onlyReadsMemory(); - } - - // Other instructions return normally. - return true; + // An instruction that returns without throwing must transfer control flow + // to a successor. + return !I->mayThrow() && I->willReturn(); } bool llvm::isGuaranteedToTransferExecutionToSuccessor(const BasicBlock *BB) { diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index e7f40523efaf..3178ee16af2b 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -1063,6 +1063,11 @@ LegalizerHelper::LegalizeResult LegalizerHelper::narrowScalar(MachineInstr &MI, Observer.changedInstr(MI); return Legalized; case TargetOpcode::G_PHI: { + // FIXME: add support for when SizeOp0 isn't an exact multiple of + // NarrowSize. + if (SizeOp0 % NarrowSize != 0) + return UnableToLegalize; + unsigned NumParts = SizeOp0 / NarrowSize; SmallVector DstRegs(NumParts); SmallVector, 2> SrcRegs(MI.getNumOperands() / 2); diff --git a/llvm/lib/CodeGen/LiveRangeShrink.cpp b/llvm/lib/CodeGen/LiveRangeShrink.cpp index 26439a656917..7fa14fd902ef 100644 --- a/llvm/lib/CodeGen/LiveRangeShrink.cpp +++ b/llvm/lib/CodeGen/LiveRangeShrink.cpp @@ -156,7 +156,8 @@ bool LiveRangeShrink::runOnMachineFunction(MachineFunction &MF) { // If MI has side effects, it should become a barrier for code motion. // IOM is rebuild from the next instruction to prevent later // instructions from being moved before this MI. - if (MI.hasUnmodeledSideEffects() && Next != MBB.end()) { + if (MI.hasUnmodeledSideEffects() && !MI.isPseudoProbe() && + Next != MBB.end()) { BuildInstOrderMap(Next, IOM); SawStore = false; } diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 59d98054e3a2..b6cfd7dcbfbc 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1462,7 +1462,8 @@ bool MachineInstr::hasUnmodeledSideEffects() const { } bool MachineInstr::isLoadFoldBarrier() const { - return mayStore() || isCall() || hasUnmodeledSideEffects(); + return mayStore() || isCall() || + (hasUnmodeledSideEffects() && !isPseudoProbe()); } /// allDefsAreDead - Return true if all the defs of this instruction are dead. diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 89670d708264..6a6f83827f72 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -6517,8 +6517,11 @@ static SDValue extractShiftForRotate(SelectionDAG &DAG, SDValue OppShift, // reduces to a rotate in direction shift2 by Pos or (equivalently) a rotate // in direction shift1 by Neg. The range [0, EltSize) means that we only need // to consider shift amounts with defined behavior. +// +// The IsRotate flag should be set when the LHS of both shifts is the same. +// Otherwise if matching a general funnel shift, it should be clear. static bool matchRotateSub(SDValue Pos, SDValue Neg, unsigned EltSize, - SelectionDAG &DAG) { + SelectionDAG &DAG, bool IsRotate) { // If EltSize is a power of 2 then: // // (a) (Pos == 0 ? 0 : EltSize - Pos) == (EltSize - Pos) & (EltSize - 1) @@ -6550,8 +6553,11 @@ static bool matchRotateSub(SDValue Pos, SDValue Neg, unsigned EltSize, // always invokes undefined behavior for 32-bit X. // // Below, Mask == EltSize - 1 when using [A] and is all-ones otherwise. + // + // NOTE: We can only do this when matching an AND and not a general + // funnel shift. unsigned MaskLoBits = 0; - if (Neg.getOpcode() == ISD::AND && isPowerOf2_64(EltSize)) { + if (IsRotate && Neg.getOpcode() == ISD::AND && isPowerOf2_64(EltSize)) { if (ConstantSDNode *NegC = isConstOrConstSplat(Neg.getOperand(1))) { KnownBits Known = DAG.computeKnownBits(Neg.getOperand(0)); unsigned Bits = Log2_64(EltSize); @@ -6641,7 +6647,8 @@ SDValue DAGCombiner::MatchRotatePosNeg(SDValue Shifted, SDValue Pos, // (srl x, (*ext y))) -> // (rotr x, y) or (rotl x, (sub 32, y)) EVT VT = Shifted.getValueType(); - if (matchRotateSub(InnerPos, InnerNeg, VT.getScalarSizeInBits(), DAG)) { + if (matchRotateSub(InnerPos, InnerNeg, VT.getScalarSizeInBits(), DAG, + /*IsRotate*/ true)) { bool HasPos = TLI.isOperationLegalOrCustom(PosOpcode, VT); return DAG.getNode(HasPos ? PosOpcode : NegOpcode, DL, VT, Shifted, HasPos ? Pos : Neg); @@ -6670,7 +6677,7 @@ SDValue DAGCombiner::MatchFunnelPosNeg(SDValue N0, SDValue N1, SDValue Pos, // fold (or (shl x0, (*ext (sub 32, y))), // (srl x1, (*ext y))) -> *** 1517 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:19:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C2B5FC1F5 for ; Mon, 19 Apr 2021 19:19: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 4FPGpc5c7pz4lKd; Mon, 19 Apr 2021 19:19: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 B231924ABC; Mon, 19 Apr 2021 19:19: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 13JJJaaD000520; Mon, 19 Apr 2021 19:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJJalb000519; Mon, 19 Apr 2021 19:19:36 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:19:36 GMT Message-Id: <202104191919.13JJJalb000519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: a433b1d162c6 - Create tag vendor/llvm-project/llvmorg-12.0.0-0-gd28af7c654d8 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/tags/vendor/llvm-project/llvmorg-12.0.0-0-gd28af7c654d8 X-Git-Reftype: annotated tag X-Git-Commit: a433b1d162c66bc2e3e48e2f916cdd0c4e975038 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:19:37 -0000 The annotated tag vendor/llvm-project/llvmorg-12.0.0-0-gd28af7c654d8 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-12.0.0-0-gd28af7c654d8 tag vendor/llvm-project/llvmorg-12.0.0-0-gd28af7c654d8 Tagger: Dimitry Andric TaggerDate: 2021-04-19 19:18:44 +0000 Tag llvm-project branch release/12.x llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. commit b4125f7d51da2bb55d3b850dba9a69c201c3422c Author: Dimitry Andric AuthorDate: 2021-04-19 19:18:04 +0000 Commit: Dimitry Andric CommitDate: 2021-04-19 19:18:04 +0000 Vendor import of llvm-project branch release/12.x llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release. From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C83E5FCB86; Mon, 19 Apr 2021 19:21: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 4FPGs61s9Fz4lxB; Mon, 19 Apr 2021 19:21: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 3169C24D5E; Mon, 19 Apr 2021 19:21: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 13JJLkQU012853; Mon, 19 Apr 2021 19:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLk2q012852; Mon, 19 Apr 2021 19:21:46 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:46 GMT Message-Id: <202104191921.13JJLk2q012852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 41063b40168b - stable/12 - pf: change pf_route so pf only runs when packets enter and leave the stack. 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 41063b40168b69b38e92d8da3af3b45e58fd98ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:46 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=41063b40168b69b38e92d8da3af3b45e58fd98ca commit 41063b40168b69b38e92d8da3af3b45e58fd98ca Author: Kristof Provost AuthorDate: 2021-04-02 10:23:42 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 08:19:06 +0000 pf: change pf_route so pf only runs when packets enter and leave the stack. before this change pf_route operated on the semantic that pf runs when packets go over an interface, so when pf_route changed which interface the packet was on it would run pf_test again. this change changes (restores) the semantic that pf is only supposed to run when packets go in or out of the network stack, even if route-to is responsibly for short circuiting past the network stack. just to be clear, for normal packets (ie, those not touched by route-to/reply-to/dup-to), there isn't a difference between running pf when packets enter or leave the stack, or having pf run when a packet goes over an interface. the main reason for this change is that running the same packet through pf multiple times creates confusion for the state table. by default, pf states are floating, meaning that packets are matched to states regardless of which interface they're going over. if a packet leaving on em0 is rerouted out em1, both traversals will end up using the same state, which at best will make the accounting look weird, or at worst fail some checks in the state and get dropped. another reason for this commit is is to make handling of the changes that route-to makes consistent with other changes that are made to packet. eg, when nat is applied to a packet, we don't run pf_test again with the new addresses. the main caveat with this diff is you can't have one rule that pushes a packet out a different interface, and then have a rule on that second interface that NATs the packet. i'm not convinced this ever worked reliably or was used much anyway, so we don't think it's a big concern. discussed with many, with special thanks to bluhm@, sashan@ and sthen@ for weathering most of that pain. ok claudio@ sashan@ jmatthew@ Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29554 (cherry picked from commit 829a69db855b48ff7e8242b95e193a0783c489d9) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9ad45ff9607e..155d23c9cfe1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5659,7 +5659,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (ifp == NULL) goto bad; - if (oifp != ifp) { + if (dir == PF_IN) { if (pf_test(PF_OUT, 0, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) @@ -5823,7 +5823,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (ifp == NULL) goto bad; - if (oifp != ifp) { + if (dir == PF_IN) { if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B345FCA1F; Mon, 19 Apr 2021 19:21: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 4FPGs737mlz4lWy; Mon, 19 Apr 2021 19:21: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 5D85324C36; Mon, 19 Apr 2021 19:21: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 13JJLloe012874; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLlnT012873; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:47 GMT Message-Id: <202104191921.13JJLlnT012873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c20cdf8c1239 - stable/12 - pf: Add static DTrace probe points 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/stable/12 X-Git-Reftype: branch X-Git-Commit: c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:47 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a commit c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a Author: Kristof Provost AuthorDate: 2021-04-02 13:53:34 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 08:20:09 +0000 pf: Add static DTrace probe points These two have proven to be useful during debugging. We may as well keep them permanently. Others will be added as their utility becomes clear. Reviewed by: gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29555 (cherry picked from commit f4c02909167b6f791df470afddfe31cabf009c4d) --- sys/netpfil/pf/pf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 155d23c9cfe1..2666fd1155ab 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,6 +114,15 @@ __FBSDID("$FreeBSD$"); #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x +SDT_PROVIDER_DEFINE(pf); +SDT_PROBE_DEFINE4(pf, ip, test, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE4(pf, ip, test6, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE5(pf, ip, state, lookup, "struct pfi_kkif *", + "struct pf_state_key_cmp *", "int", "struct pf_pdesc *", + "struct pf_state *"); + /* * Global variables */ @@ -327,6 +337,7 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); #define STATE_LOOKUP(i, k, d, s, pd) \ do { \ (s) = pf_find_state((i), (k), (d)); \ + SDT_PROBE5(pf, ip, state, lookup, i, k, d, pd, (s)); \ if ((s) == NULL) \ return (PF_DROP); \ if (PACKET_LOOPED(pd)) \ @@ -6404,6 +6415,8 @@ done: if (s) PF_STATE_UNLOCK(s); + SDT_PROBE4(pf, ip, test, done, action, reason, r, s); + return (action); } #endif /* INET */ @@ -6815,6 +6828,8 @@ done: (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL) action = pf_refragment6(ifp, m0, mtag); + SDT_PROBE4(pf, ip, test6, done, action, reason, r, s); + return (action); } #endif /* INET6 */ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4589B5FCB16; Mon, 19 Apr 2021 19:21: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 4FPGs82hyPz4m9d; Mon, 19 Apr 2021 19:21: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 308ED24C37; Mon, 19 Apr 2021 19:21: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 13JJLl0J012969; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLlQO012968; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:47 GMT Message-Id: <202104191921.13JJLlQO012968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 71c2e35decdf - stable/13 - pf: change pf_route so pf only runs when packets enter and leave the stack. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 71c2e35decdff685b98af7c0e2907f51bc342009 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:49 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=71c2e35decdff685b98af7c0e2907f51bc342009 commit 71c2e35decdff685b98af7c0e2907f51bc342009 Author: Kristof Provost AuthorDate: 2021-04-02 10:23:42 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 19:19:06 +0000 pf: change pf_route so pf only runs when packets enter and leave the stack. before this change pf_route operated on the semantic that pf runs when packets go over an interface, so when pf_route changed which interface the packet was on it would run pf_test again. this change changes (restores) the semantic that pf is only supposed to run when packets go in or out of the network stack, even if route-to is responsibly for short circuiting past the network stack. just to be clear, for normal packets (ie, those not touched by route-to/reply-to/dup-to), there isn't a difference between running pf when packets enter or leave the stack, or having pf run when a packet goes over an interface. the main reason for this change is that running the same packet through pf multiple times creates confusion for the state table. by default, pf states are floating, meaning that packets are matched to states regardless of which interface they're going over. if a packet leaving on em0 is rerouted out em1, both traversals will end up using the same state, which at best will make the accounting look weird, or at worst fail some checks in the state and get dropped. another reason for this commit is is to make handling of the changes that route-to makes consistent with other changes that are made to packet. eg, when nat is applied to a packet, we don't run pf_test again with the new addresses. the main caveat with this diff is you can't have one rule that pushes a packet out a different interface, and then have a rule on that second interface that NATs the packet. i'm not convinced this ever worked reliably or was used much anyway, so we don't think it's a big concern. discussed with many, with special thanks to bluhm@, sashan@ and sthen@ for weathering most of that pain. ok claudio@ sashan@ jmatthew@ Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29554 (cherry picked from commit 829a69db855b48ff7e8242b95e193a0783c489d9) --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 46731cbf9ee1..25b958696345 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5549,7 +5549,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (ifp == NULL) goto bad; - if (oifp != ifp) { + if (dir == PF_IN) { if (pf_test(PF_OUT, 0, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) @@ -5738,7 +5738,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, if (ifp == NULL) goto bad; - if (oifp != ifp) { + if (dir == PF_IN) { if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, inp) != PF_PASS) goto bad; else if (m0 == NULL) From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02DF65FCC8D; Mon, 19 Apr 2021 19:21: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 4FPGs93N78z4m2X; Mon, 19 Apr 2021 19:21: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 2C62324DB9; Mon, 19 Apr 2021 19:21: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 13JJLmTS013012; Mon, 19 Apr 2021 19:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLmVI013011; Mon, 19 Apr 2021 19:21:48 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:48 GMT Message-Id: <202104191921.13JJLmVI013011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 8601d1baf13d - stable/13 - pf: Add static DTrace probe points 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8601d1baf13da4f4241ecead4854839c076558d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:50 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8601d1baf13da4f4241ecead4854839c076558d5 commit 8601d1baf13da4f4241ecead4854839c076558d5 Author: Kristof Provost AuthorDate: 2021-04-02 13:53:34 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 19:19:06 +0000 pf: Add static DTrace probe points These two have proven to be useful during debugging. We may as well keep them permanently. Others will be added as their utility becomes clear. Reviewed by: gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29555 (cherry picked from commit f4c02909167b6f791df470afddfe31cabf009c4d) --- sys/netpfil/pf/pf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 25b958696345..2429fd97c887 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -112,6 +113,15 @@ __FBSDID("$FreeBSD$"); #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x +SDT_PROVIDER_DEFINE(pf); +SDT_PROBE_DEFINE4(pf, ip, test, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE4(pf, ip, test6, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE5(pf, ip, state, lookup, "struct pfi_kkif *", + "struct pf_state_key_cmp *", "int", "struct pf_pdesc *", + "struct pf_state *"); + /* * Global variables */ @@ -326,6 +336,7 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); #define STATE_LOOKUP(i, k, d, s, pd) \ do { \ (s) = pf_find_state((i), (k), (d)); \ + SDT_PROBE5(pf, ip, state, lookup, i, k, d, pd, (s)); \ if ((s) == NULL) \ return (PF_DROP); \ if (PACKET_LOOPED(pd)) \ @@ -6318,6 +6329,8 @@ done: if (s) PF_STATE_UNLOCK(s); + SDT_PROBE4(pf, ip, test, done, action, reason, r, s); + return (action); } #endif /* INET */ @@ -6726,6 +6739,8 @@ done: (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL) action = pf_refragment6(ifp, m0, mtag); + SDT_PROBE4(pf, ip, test6, done, action, reason, r, s); + return (action); } #endif /* INET6 */ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1DFA5FCD0D; Mon, 19 Apr 2021 19:21: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 4FPGsC6bhHz4m2f; Mon, 19 Apr 2021 19:21:51 +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 73D4224675; Mon, 19 Apr 2021 19:21:51 +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 13JJLptg014053; Mon, 19 Apr 2021 19:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLp04014052; Mon, 19 Apr 2021 19:21:51 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:51 GMT Message-Id: <202104191921.13JJLp04014052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a3ce3d6b1f79 - stable/13 - pf tests: Test multi-wan rdr 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a3ce3d6b1f79d4ddf85772d1a0ace7b976dc1d68 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:53 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a3ce3d6b1f79d4ddf85772d1a0ace7b976dc1d68 commit a3ce3d6b1f79d4ddf85772d1a0ace7b976dc1d68 Author: Kristof Provost AuthorDate: 2021-04-06 11:25:49 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 19:19:06 +0000 pf tests: Test multi-wan rdr This replicates an issue observed on pfSense: https://redmine.pfsense.org/issues/11436 In essence, reply-to is needed to ensure that connections always leave the WAN interface they came in on, but this confused the state tracking. MFC after: 2 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit f37667e2359245ad123fd775c072fd82c81bc476) --- tests/sys/netpfil/pf/route_to.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 97f30bafb413..59b16e35ee6f 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -99,8 +99,91 @@ v6_cleanup() pft_cleanup } +atf_test_case "multiwan" "cleanup" +multiwan_head() +{ + atf_set descr 'Multi-WAN redirection / reply-to test' + atf_set require.user root +} + +multiwan_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + epair_cl_one=$(vnet_mkepair) + epair_cl_two=$(vnet_mkepair) + + vnet_mkjail srv ${epair_one}b ${epair_two}b + vnet_mkjail wan_one ${epair_one}a ${epair_cl_one}b + vnet_mkjail wan_two ${epair_two}a ${epair_cl_two}b + vnet_mkjail client ${epair_cl_one}a ${epair_cl_two}a + + jexec client ifconfig ${epair_cl_one}a 203.0.113.1/25 + jexec wan_one ifconfig ${epair_cl_one}b 203.0.113.2/25 + jexec wan_one ifconfig ${epair_one}a 192.0.2.1/24 up + jexec wan_one sysctl net.inet.ip.forwarding=1 + jexec srv ifconfig ${epair_one}b 192.0.2.2/24 up + jexec client route add 192.0.2.0/24 203.0.113.2 + + jexec client ifconfig ${epair_cl_two}a 203.0.113.128/25 + jexec wan_two ifconfig ${epair_cl_two}b 203.0.113.129/25 + jexec wan_two ifconfig ${epair_two}a 198.51.100.1/24 up + jexec wan_two sysctl net.inet.ip.forwarding=1 + jexec srv ifconfig ${epair_two}b 198.51.100.2/24 up + jexec client route add 198.51.100.0/24 203.0.113.129 + + jexec srv ifconfig lo0 127.0.0.1/8 up + jexec srv route add default 192.0.2.1 + jexec srv sysctl net.inet.ip.forwarding=1 + + # Run echo server in srv jail + jexec srv /usr/sbin/inetd -p multiwan.pid $(atf_get_srcdir)/echo_inetd.conf + + jexec srv pfctl -e + pft_set_rules srv \ + "nat on ${epair_one}b inet from 127.0.0.0/8 to any -> (${epair_one}b)" \ + "nat on ${epair_two}b inet from 127.0.0.0/8 to any -> (${epair_two}b)" \ + "rdr on ${epair_one}b inet proto tcp from any to 192.0.2.2 port 7 -> 127.0.0.1 port 7" \ + "rdr on ${epair_two}b inet proto tcp from any to 198.51.100.2 port 7 -> 127.0.0.1 port 7" \ + "block in" \ + "block out" \ + "pass in quick on ${epair_one}b reply-to (${epair_one}b 192.0.2.1) inet proto tcp from any to 127.0.0.1 port 7" \ + "pass in quick on ${epair_two}b reply-to (${epair_two}b 198.51.100.1) inet proto tcp from any to 127.0.0.1 port 7" + + # These will always succeed, because we don't change interface to route + # correctly here. + result=$(echo "one" | jexec wan_one nc -N -w 3 192.0.2.2 7) + if [ "${result}" != "one" ]; then + atf_fail "Redirect on one failed" + fi + result=$(echo "two" | jexec wan_two nc -N -w 3 198.51.100.2 7) + if [ "${result}" != "two" ]; then + atf_fail "Redirect on two failed" + fi + + result=$(echo "one" | jexec client nc -N -w 3 192.0.2.2 7) + if [ "${result}" != "one" ]; then + atf_fail "Redirect from client on one failed" + fi + + # This should trigger the issue fixed in 829a69db855b48ff7e8242b95e193a0783c489d9 + result=$(echo "two" | jexec client nc -N -w 3 198.51.100.2 7) + if [ "${result}" != "two" ]; then + atf_fail "Redirect from client on two failed" + fi +} + +multiwan_cleanup() +{ + rm -f multiwan.pid + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" + atf_add_test_case "multiwan" } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46B1B5FCA2A; Mon, 19 Apr 2021 19:21: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 4FPGs85Bz4z4lvF; Mon, 19 Apr 2021 19:21: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 85AE724BE5; Mon, 19 Apr 2021 19:21: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 13JJLmIv012991; Mon, 19 Apr 2021 19:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLmmX012990; Mon, 19 Apr 2021 19:21:48 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:48 GMT Message-Id: <202104191921.13JJLmmX012990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a19dad31b150 - stable/12 - pf: Do not short-circuit processing for REPLY_TO 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/stable/12 X-Git-Reftype: branch X-Git-Commit: a19dad31b1503e0ee512e5f1cd21b671143bf5c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:49 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a19dad31b1503e0ee512e5f1cd21b671143bf5c8 commit a19dad31b1503e0ee512e5f1cd21b671143bf5c8 Author: Kristof Provost AuthorDate: 2021-04-07 13:46:44 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 08:20:22 +0000 pf: Do not short-circuit processing for REPLY_TO When we find a state for packets that was created by a reply-to rule we still need to process the packet. The state may require us to modify the packet (e.g. in rdr or nat cases), which we won't do with the shortcut. MFC after: 2 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 6d786845cf63c8bf57174e3e43b0b5c5eca75be3) --- sys/netpfil/pf/pf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2666fd1155ab..a02c9254c714 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -343,10 +343,8 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); if (PACKET_LOOPED(pd)) \ return (PF_PASS); \ if ((d) == PF_OUT && \ - (((s)->rule.ptr->rt == PF_ROUTETO && \ - (s)->rule.ptr->direction == PF_OUT) || \ - ((s)->rule.ptr->rt == PF_REPLYTO && \ - (s)->rule.ptr->direction == PF_IN)) && \ + (s)->rule.ptr->rt == PF_ROUTETO && \ + (s)->rule.ptr->direction == PF_OUT && \ (s)->rt_kif != NULL && \ (s)->rt_kif != (i)) \ return (PF_PASS); \ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FCE75FCC46; Mon, 19 Apr 2021 19:21:50 +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 4FPGs96wj5z4m54; Mon, 19 Apr 2021 19:21: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 A426B24BE6; Mon, 19 Apr 2021 19:21: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 13JJLnLp013299; Mon, 19 Apr 2021 19:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLnXg013285; Mon, 19 Apr 2021 19:21:49 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:49 GMT Message-Id: <202104191921.13JJLnXg013285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 8ca8248886af - stable/12 - pf tests: Test multi-wan rdr 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 8ca8248886af583fa2010badfe03e472d8505db8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:50 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca8248886af583fa2010badfe03e472d8505db8 commit 8ca8248886af583fa2010badfe03e472d8505db8 Author: Kristof Provost AuthorDate: 2021-04-06 11:25:49 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 08:20:33 +0000 pf tests: Test multi-wan rdr This replicates an issue observed on pfSense: https://redmine.pfsense.org/issues/11436 In essence, reply-to is needed to ensure that connections always leave the WAN interface they came in on, but this confused the state tracking. MFC after: 2 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit f37667e2359245ad123fd775c072fd82c81bc476) --- tests/sys/netpfil/pf/route_to.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index a714e0588a9f..33c180ce82cf 100755 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -74,8 +74,91 @@ v6_cleanup() pft_cleanup } +atf_test_case "multiwan" "cleanup" +multiwan_head() +{ + atf_set descr 'Multi-WAN redirection / reply-to test' + atf_set require.user root +} + +multiwan_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + epair_cl_one=$(vnet_mkepair) + epair_cl_two=$(vnet_mkepair) + + vnet_mkjail srv ${epair_one}b ${epair_two}b + vnet_mkjail wan_one ${epair_one}a ${epair_cl_one}b + vnet_mkjail wan_two ${epair_two}a ${epair_cl_two}b + vnet_mkjail client ${epair_cl_one}a ${epair_cl_two}a + + jexec client ifconfig ${epair_cl_one}a 203.0.113.1/25 + jexec wan_one ifconfig ${epair_cl_one}b 203.0.113.2/25 + jexec wan_one ifconfig ${epair_one}a 192.0.2.1/24 up + jexec wan_one sysctl net.inet.ip.forwarding=1 + jexec srv ifconfig ${epair_one}b 192.0.2.2/24 up + jexec client route add 192.0.2.0/24 203.0.113.2 + + jexec client ifconfig ${epair_cl_two}a 203.0.113.128/25 + jexec wan_two ifconfig ${epair_cl_two}b 203.0.113.129/25 + jexec wan_two ifconfig ${epair_two}a 198.51.100.1/24 up + jexec wan_two sysctl net.inet.ip.forwarding=1 + jexec srv ifconfig ${epair_two}b 198.51.100.2/24 up + jexec client route add 198.51.100.0/24 203.0.113.129 + + jexec srv ifconfig lo0 127.0.0.1/8 up + jexec srv route add default 192.0.2.1 + jexec srv sysctl net.inet.ip.forwarding=1 + + # Run echo server in srv jail + jexec srv /usr/sbin/inetd -p multiwan.pid $(atf_get_srcdir)/echo_inetd.conf + + jexec srv pfctl -e + pft_set_rules srv \ + "nat on ${epair_one}b inet from 127.0.0.0/8 to any -> (${epair_one}b)" \ + "nat on ${epair_two}b inet from 127.0.0.0/8 to any -> (${epair_two}b)" \ + "rdr on ${epair_one}b inet proto tcp from any to 192.0.2.2 port 7 -> 127.0.0.1 port 7" \ + "rdr on ${epair_two}b inet proto tcp from any to 198.51.100.2 port 7 -> 127.0.0.1 port 7" \ + "block in" \ + "block out" \ + "pass in quick on ${epair_one}b reply-to (${epair_one}b 192.0.2.1) inet proto tcp from any to 127.0.0.1 port 7" \ + "pass in quick on ${epair_two}b reply-to (${epair_two}b 198.51.100.1) inet proto tcp from any to 127.0.0.1 port 7" + + # These will always succeed, because we don't change interface to route + # correctly here. + result=$(echo "one" | jexec wan_one nc -N -w 3 192.0.2.2 7) + if [ "${result}" != "one" ]; then + atf_fail "Redirect on one failed" + fi + result=$(echo "two" | jexec wan_two nc -N -w 3 198.51.100.2 7) + if [ "${result}" != "two" ]; then + atf_fail "Redirect on two failed" + fi + + result=$(echo "one" | jexec client nc -N -w 3 192.0.2.2 7) + if [ "${result}" != "one" ]; then + atf_fail "Redirect from client on one failed" + fi + + # This should trigger the issue fixed in 829a69db855b48ff7e8242b95e193a0783c489d9 + result=$(echo "two" | jexec client nc -N -w 3 198.51.100.2 7) + if [ "${result}" != "two" ]; then + atf_fail "Redirect from client on two failed" + fi +} + +multiwan_cleanup() +{ + rm -f multiwan.pid + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" + atf_add_test_case "multiwan" } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:21:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BDCF5FCB8D; Mon, 19 Apr 2021 19:21: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 4FPGsB3rzZz4lvH; Mon, 19 Apr 2021 19:21:50 +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 3957124C38; Mon, 19 Apr 2021 19:21:50 +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 13JJLoHK013795; Mon, 19 Apr 2021 19:21:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLoHF013785; Mon, 19 Apr 2021 19:21:50 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:50 GMT Message-Id: <202104191921.13JJLoHF013785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 1a4fc0322225 - stable/13 - pf: Do not short-circuit processing for REPLY_TO 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a4fc03222255f6bcd2662389bebfeec0691cd68 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:52 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1a4fc03222255f6bcd2662389bebfeec0691cd68 commit 1a4fc03222255f6bcd2662389bebfeec0691cd68 Author: Kristof Provost AuthorDate: 2021-04-07 13:46:44 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 19:19:06 +0000 pf: Do not short-circuit processing for REPLY_TO When we find a state for packets that was created by a reply-to rule we still need to process the packet. The state may require us to modify the packet (e.g. in rdr or nat cases), which we won't do with the shortcut. MFC after: 2 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 6d786845cf63c8bf57174e3e43b0b5c5eca75be3) --- sys/netpfil/pf/pf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2429fd97c887..ca8adeba52c3 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -342,10 +342,8 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); if (PACKET_LOOPED(pd)) \ return (PF_PASS); \ if ((d) == PF_OUT && \ - (((s)->rule.ptr->rt == PF_ROUTETO && \ - (s)->rule.ptr->direction == PF_OUT) || \ - ((s)->rule.ptr->rt == PF_REPLYTO && \ - (s)->rule.ptr->direction == PF_IN)) && \ + (s)->rule.ptr->rt == PF_ROUTETO && \ + (s)->rule.ptr->direction == PF_OUT && \ (s)->rt_kif != NULL && \ (s)->rt_kif != (i)) \ return (PF_PASS); \ From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:25:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D20D5FCEC8; Mon, 19 Apr 2021 19:25: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 4FPGxX3zpKz4m4Z; Mon, 19 Apr 2021 19:25: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 778EC24DC7; Mon, 19 Apr 2021 19:25: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 13JJPa64014480; Mon, 19 Apr 2021 19:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJPawQ014479; Mon, 19 Apr 2021 19:25:36 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:25:36 GMT Message-Id: <202104191925.13JJPawQ014479@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: 407abff2b918 - main - Cirrus-CI: use FreeBSD 13.0 image for base system CI build 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: 407abff2b91847e23711625ad7c69c17e99b3d1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:25:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=407abff2b91847e23711625ad7c69c17e99b3d1d commit 407abff2b91847e23711625ad7c69c17e99b3d1d Author: Ed Maste AuthorDate: 2021-04-19 18:36:21 +0000 Commit: Ed Maste CommitDate: 2021-04-19 19:23:14 +0000 Cirrus-CI: use FreeBSD 13.0 image for base system CI build We generally want to build and test on the highest release version, and FreeBSD 13.0 also brings some performance benefits. Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29842 --- .cirrus.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0b1814790071..b29dddc34849 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,9 +1,9 @@ # $FreeBSD$ freebsd_instance: - # image: freebsd-12-1-stable-amd64 - # We need a newer image to install llvm11 - image_family: freebsd-12-1-snap + # Image list available via + # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images + image: freebsd-13-0-release-amd64 cpu: 8 memory: 24G From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:37:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB75D5FD155; Mon, 19 Apr 2021 19:37:50 +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 4FPHCf5QB0z4mgy; Mon, 19 Apr 2021 19:37:50 +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 A814624C6E; Mon, 19 Apr 2021 19:37:50 +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 13JJbo3m027735; Mon, 19 Apr 2021 19:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJbo5J027734; Mon, 19 Apr 2021 19:37:50 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:37:50 GMT Message-Id: <202104191937.13JJbo5J027734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: deecaa144526 - main - ixgbe: Clean up unneeded set in ixgbe_if_multi_set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deecaa144526a5d001aeb99149e2139601388427 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:37:50 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=deecaa144526a5d001aeb99149e2139601388427 commit deecaa144526a5d001aeb99149e2139601388427 Author: Kevin Bowling AuthorDate: 2021-04-19 19:22:22 +0000 Commit: Kevin Bowling CommitDate: 2021-04-19 19:37:30 +0000 ixgbe: Clean up unneeded set in ixgbe_if_multi_set We don't need to set the bits here since the if/else if/else statements fully cover setting these bit pairs. Reported by: markj Reviewed by: markj, erj Approved by: #intel_networking MFC aftter: 1 week Differential Revision: https://reviews.freebsd.org/D29827 --- sys/dev/ixgbe/if_ix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 77ef118493a2..a483fe503c7f 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -3294,7 +3294,7 @@ ixgbe_if_multi_set(if_ctx_t ctx) adapter); fctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); - fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); + if (ifp->if_flags & IFF_PROMISC) fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); else if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES || From owner-dev-commits-src-all@freebsd.org Mon Apr 19 19:51:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F31765FD8E1; Mon, 19 Apr 2021 19:51: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 4FPHWQ6ctZz4nQn; Mon, 19 Apr 2021 19:51: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 D61CD254BC; Mon, 19 Apr 2021 19:51: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 13JJpUa9052302; Mon, 19 Apr 2021 19:51:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJpUud052301; Mon, 19 Apr 2021 19:51:30 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:51:30 GMT Message-Id: <202104191951.13JJpUud052301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 4b38eed76da9 - main - e1000: Correct promisc multicast filter handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b38eed76da9c36f09bff33b5cf15687cd99016f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:51:31 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4b38eed76da9c36f09bff33b5cf15687cd99016f commit 4b38eed76da9c36f09bff33b5cf15687cd99016f Author: Kevin Bowling AuthorDate: 2021-04-16 23:15:50 +0000 Commit: Kevin Bowling CommitDate: 2021-04-19 19:49:55 +0000 e1000: Correct promisc multicast filter handling There are a number of issues in the e1000 multicast filter handling that have been present for a long time. Take the updated approach from ixgbe(4) which does not have the issues. The issues are outlined in the PR, in particular this solves crossing over and under the hardware's filter limit, not programming the hardware filter when we are above its limit, disabling SBP (show bad packets) when the tunable is enabled and exiting promiscuous mode, and an off-by-one error in the em_copy_maddr function. PR: 140647 Reported by: jtl Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29789 --- sys/dev/e1000/if_em.c | 62 +++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 79a617b3342f..2c0c8541d7f2 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -303,7 +303,6 @@ static int em_enable_phy_wakeup(struct adapter *); static void em_disable_aspm(struct adapter *); int em_intr(void *arg); -static void em_disable_promisc(if_ctx_t ctx); /* MSI-X handlers */ static int em_if_msix_intr_assign(if_ctx_t, int); @@ -1641,11 +1640,20 @@ static int em_if_set_promisc(if_ctx_t ctx, int flags) { struct adapter *adapter = iflib_get_softc(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); u32 reg_rctl; - - em_disable_promisc(ctx); + int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); + reg_rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_UPE); + if (flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else + mcnt = min(if_llmaddr_count(ifp), MAX_NUM_MULTICAST_ADDRESSES); + + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~E1000_RCTL_MPE); + E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); if (flags & IFF_PROMISC) { reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); @@ -1661,37 +1669,15 @@ em_if_set_promisc(if_ctx_t ctx, int flags) return (0); } -static void -em_disable_promisc(if_ctx_t ctx) -{ - struct adapter *adapter = iflib_get_softc(ctx); - struct ifnet *ifp = iflib_get_ifp(ctx); - u32 reg_rctl; - int mcnt = 0; - - reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - reg_rctl &= (~E1000_RCTL_UPE); - if (if_getflags(ifp) & IFF_ALLMULTI) - mcnt = MAX_NUM_MULTICAST_ADDRESSES; - else - mcnt = if_llmaddr_count(ifp); - /* Don't disable if in MAX groups */ - if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) - reg_rctl &= (~E1000_RCTL_MPE); - reg_rctl &= (~E1000_RCTL_SBP); - E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); -} - - static u_int -em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) +em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int idx) { u8 *mta = arg; - if (cnt == MAX_NUM_MULTICAST_ADDRESSES) - return (1); + if (idx == MAX_NUM_MULTICAST_ADDRESSES) + return (0); - bcopy(LLADDR(sdl), &mta[cnt * ETHER_ADDR_LEN], ETHER_ADDR_LEN); + bcopy(LLADDR(sdl), &mta[idx * ETHER_ADDR_LEN], ETHER_ADDR_LEN); return (1); } @@ -1702,14 +1688,13 @@ em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) * This routine is called whenever multicast address list is updated. * **********************************************************************/ - static void em_if_multi_set(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); struct ifnet *ifp = iflib_get_ifp(ctx); - u32 reg_rctl = 0; u8 *mta; /* Multicast array memory */ + u32 reg_rctl = 0; int mcnt = 0; IOCTL_DEBUGOUT("em_set_multi: begin"); @@ -1729,11 +1714,20 @@ em_if_multi_set(if_ctx_t ctx) mcnt = if_foreach_llmaddr(ifp, em_copy_maddr, mta); - if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { - reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); + reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); + + if (if_getflags(ifp) & IFF_PROMISC) + reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); + else if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES || + if_getflags(ifp) & IFF_ALLMULTI) { reg_rctl |= E1000_RCTL_MPE; - E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); + reg_rctl &= ~E1000_RCTL_UPE; } else + reg_rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE); + + E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); + + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) e1000_update_mc_addr_list(&adapter->hw, mta, mcnt); if (adapter->hw.mac.type == e1000_82542 && From owner-dev-commits-src-all@freebsd.org Mon Apr 19 20:39:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 390155FE9E2; Mon, 19 Apr 2021 20:39: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 4FPJZK18stz4qZm; Mon, 19 Apr 2021 20:39: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 168A525BE6; Mon, 19 Apr 2021 20:39: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 13JKd4CA007337; Mon, 19 Apr 2021 20:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JKd4k5007336; Mon, 19 Apr 2021 20:39:04 GMT (envelope-from git) Date: Mon, 19 Apr 2021 20:39:04 GMT Message-Id: <202104192039.13JKd4k5007336@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: 37c0f4a20777 - main - Fix typo in rtsock_common.h 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: 37c0f4a2077739e735732374d67525cf6de36d21 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 20:39:05 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=37c0f4a2077739e735732374d67525cf6de36d21 commit 37c0f4a2077739e735732374d67525cf6de36d21 Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:24:42 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-19 20:24:46 +0000 Fix typo in rtsock_common.h MFC after: 3 days --- tests/sys/net/routing/rtsock_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/net/routing/rtsock_common.h b/tests/sys/net/routing/rtsock_common.h index 71476d2b5f3c..ae450ac88ba1 100644 --- a/tests/sys/net/routing/rtsock_common.h +++ b/tests/sys/net/routing/rtsock_common.h @@ -454,7 +454,7 @@ sa_equal_msg_flags(const struct sockaddr *a, const struct sockaddr *b, char *msg b6 = (const struct sockaddr_in6 *)b; if (!IN6_ARE_ADDR_EQUAL(&a6->sin6_addr, &b6->sin6_addr)) { inet_ntop(AF_INET6, &a6->sin6_addr, a_s, sizeof(a_s)); - inet_ntop(AF_INET6, &b6->sin6_addr, a_s, sizeof(a_s)); + inet_ntop(AF_INET6, &b6->sin6_addr, b_s, sizeof(b_s)); snprintf(msg, sz, "addr diff: %s vs %s", a_s, b_s); return 0; } From owner-dev-commits-src-all@freebsd.org Mon Apr 19 20:39:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 710F25FED97; Mon, 19 Apr 2021 20:39: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 4FPJZL2Jvqz4qdX; Mon, 19 Apr 2021 20:39: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 3B2B425D41; Mon, 19 Apr 2021 20:39: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 13JKd6Tm007358; Mon, 19 Apr 2021 20:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JKd6og007357; Mon, 19 Apr 2021 20:39:06 GMT (envelope-from git) Date: Mon, 19 Apr 2021 20:39:06 GMT Message-Id: <202104192039.13JKd6og007357@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: 758c9d54d44f - main - Improve error reporting in rtsock.c 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: 758c9d54d44f8ce957570b8c2ef6d1b3f28a792d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 20:39:06 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=758c9d54d44f8ce957570b8c2ef6d1b3f28a792d commit 758c9d54d44f8ce957570b8c2ef6d1b3f28a792d Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:36:41 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-19 20:36:41 +0000 Improve error reporting in rtsock.c MFC after: 3 days --- sys/net/rtsock.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index c0996d318fb2..5194a2a15c1e 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -126,6 +126,9 @@ struct ifa_msghdrl32 { #endif /* COMPAT_FREEBSD32 */ +#define RTS_PID_PRINTF(_fmt, ...) \ + printf("rtsock:%s(): PID %d: " _fmt "\n", __func__, curproc->p_pid, ## __VA_ARGS__) + MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); /* NB: these are not modified */ @@ -571,7 +574,7 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) sa_family_t saf; if (V_loif == NULL) { - printf("Unable to add blackhole/reject nhop without loopback"); + RTS_PID_PRINTF("Unable to add blackhole/reject nhop without loopback"); return (ENOTSUP); } info->rti_ifp = V_loif; @@ -1360,7 +1363,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) { struct sockaddr_in *gw_sin = (struct sockaddr_in *)gw; if (gw_sin->sin_len < sizeof(struct sockaddr_in)) { - printf("gw sin_len too small\n"); + RTS_PID_PRINTF("gateway sin_len too small: %d", gw->sa_len); return (EINVAL); } fill_sockaddr_inet(gw_sin, gw_sin->sin_addr); @@ -1372,7 +1375,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) { struct sockaddr_in6 *gw_sin6 = (struct sockaddr_in6 *)gw; if (gw_sin6->sin6_len < sizeof(struct sockaddr_in6)) { - printf("gw sin6_len too small\n"); + RTS_PID_PRINTF("gateway sin6_len too small: %d", gw->sa_len); return (EINVAL); } fill_sockaddr_inet6(gw_sin6, &gw_sin6->sin6_addr, 0); @@ -1386,7 +1389,7 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) size_t sdl_min_len = offsetof(struct sockaddr_dl, sdl_data); gw_sdl = (struct sockaddr_dl *)gw; if (gw_sdl->sdl_len < sdl_min_len) { - printf("gw sdl_len too small\n"); + RTS_PID_PRINTF("gateway sdl_len too small: %d", gw_sdl->sdl_len); return (EINVAL); } @@ -1433,7 +1436,7 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info) return (EINVAL); } if (mask_sa && mask_sa->sin_len < sizeof(struct sockaddr_in)) { - printf("mask sin_len too small\n"); + RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); return (EINVAL); } fill_sockaddr_inet(dst_sa, dst); @@ -1466,11 +1469,11 @@ cleanup_xaddrs_inet6(struct rt_addrinfo *info) IN6_MASK_ADDR(&dst_sa->sin6_addr, &mask); if (dst_sa->sin6_len < sizeof(struct sockaddr_in6)) { - printf("dst sin6_len too small\n"); + RTS_PID_PRINTF("prefix dst sin6_len too small: %d", dst_sa->sin6_len); return (EINVAL); } if (mask_sa && mask_sa->sin6_len < sizeof(struct sockaddr_in6)) { - printf("mask sin6_len too small\n"); + RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); return (EINVAL); } fill_sockaddr_inet6(dst_sa, &dst_sa->sin6_addr, 0); @@ -2092,9 +2095,9 @@ rt_dispatch(struct mbuf *m, sa_family_t saf) } /* - * Checks if rte can be exported v.r.t jails/vnets. + * Checks if rte can be exported w.r.t jails/vnets. * - * Returns 1 if it can, 0 otherwise. + * Returns true if it can, false otherwise. */ static bool can_export_rte(struct ucred *td_ucred, bool rt_is_host, From owner-dev-commits-src-all@freebsd.org Mon Apr 19 21:36:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBFA65FFE22; Mon, 19 Apr 2021 21:36: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 4FPKrh6Q7Dz4tBk; Mon, 19 Apr 2021 21:36: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 CEFA726B08; Mon, 19 Apr 2021 21:36: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 13JLaaVi086813; Mon, 19 Apr 2021 21:36:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JLaamq086811; Mon, 19 Apr 2021 21:36:36 GMT (envelope-from git) Date: Mon, 19 Apr 2021 21:36:36 GMT Message-Id: <202104192136.13JLaamq086811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 59690eab572d - main - e1000: Add support for [Tiger, Alder, Meteor] Lake MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59690eab572dde1176886bff7ed0c506df974e5e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 21:36:37 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=59690eab572dde1176886bff7ed0c506df974e5e commit 59690eab572dde1176886bff7ed0c506df974e5e Author: Kevin Bowling AuthorDate: 2021-04-19 02:11:27 +0000 Commit: Kevin Bowling CommitDate: 2021-04-19 21:32:59 +0000 e1000: Add support for [Tiger, Alder, Meteor] Lake Add support for current and future client platform PCI IDs. These are all I219 variants and have no known driver changes versus previous generation client platform I219 variants. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29801 --- sys/dev/e1000/e1000_api.c | 23 +++++++++++++++++++++++ sys/dev/e1000/e1000_hw.h | 17 +++++++++++++++++ sys/dev/e1000/e1000_ich8lan.c | 21 +++++++++++++++++++++ sys/dev/e1000/if_em.c | 23 +++++++++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 4f860166aba4..b1d5ef74c24f 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -327,6 +327,26 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_CMP_I219_V11: mac->type = e1000_pch_cnp; break; + case E1000_DEV_ID_PCH_TGP_I219_LM13: + case E1000_DEV_ID_PCH_TGP_I219_V13: + case E1000_DEV_ID_PCH_TGP_I219_LM14: + case E1000_DEV_ID_PCH_TGP_I219_V14: + case E1000_DEV_ID_PCH_TGP_I219_LM15: + case E1000_DEV_ID_PCH_TGP_I219_V15: + mac->type = e1000_pch_tgp; + break; + case E1000_DEV_ID_PCH_ADL_I219_LM16: + case E1000_DEV_ID_PCH_ADL_I219_V16: + case E1000_DEV_ID_PCH_ADL_I219_LM17: + case E1000_DEV_ID_PCH_ADL_I219_V17: + mac->type = e1000_pch_adp; + break; + case E1000_DEV_ID_PCH_MTP_I219_LM18: + case E1000_DEV_ID_PCH_MTP_I219_V18: + case E1000_DEV_ID_PCH_MTP_I219_LM19: + case E1000_DEV_ID_PCH_MTP_I219_V19: + mac->type = e1000_pch_mtp; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -479,6 +499,9 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index f521c2c8c5e6..b3eb1641cca9 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -161,6 +161,20 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_CMP_I219_V11 0x0D4D #define E1000_DEV_ID_PCH_CMP_I219_LM12 0x0D53 #define E1000_DEV_ID_PCH_CMP_I219_V12 0x0D55 +#define E1000_DEV_ID_PCH_TGP_I219_LM13 0x15FB +#define E1000_DEV_ID_PCH_TGP_I219_V13 0x15FC +#define E1000_DEV_ID_PCH_TGP_I219_LM14 0x15F9 +#define E1000_DEV_ID_PCH_TGP_I219_V14 0x15FA +#define E1000_DEV_ID_PCH_TGP_I219_LM15 0x15F4 +#define E1000_DEV_ID_PCH_TGP_I219_V15 0x15F5 +#define E1000_DEV_ID_PCH_ADL_I219_LM16 0x1A1E +#define E1000_DEV_ID_PCH_ADL_I219_V16 0x1A1F +#define E1000_DEV_ID_PCH_ADL_I219_LM17 0x1A1C +#define E1000_DEV_ID_PCH_ADL_I219_V17 0x1A1D +#define E1000_DEV_ID_PCH_MTP_I219_LM18 0x550A +#define E1000_DEV_ID_PCH_MTP_I219_V18 0x550B +#define E1000_DEV_ID_PCH_MTP_I219_LM19 0x550C +#define E1000_DEV_ID_PCH_MTP_I219_V19 0x550D #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -248,6 +262,9 @@ enum e1000_mac_type { e1000_pch_lpt, e1000_pch_spt, e1000_pch_cnp, + e1000_pch_tgp, + e1000_pch_adp, + e1000_pch_mtp, e1000_82575, e1000_82576, e1000_82580, diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index b4f8b6a2b694..b798bacb37a0 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -346,6 +346,9 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: if (e1000_phy_is_accessible_pchlan(hw)) break; @@ -495,6 +498,9 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: /* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */ @@ -794,6 +800,9 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; @@ -1832,6 +1841,9 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan; break; default: @@ -2288,6 +2300,9 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; break; default: @@ -3408,6 +3423,9 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) switch (hw->mac.type) { case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: bank1_offset = nvm->flash_bank_size; act_offset = E1000_ICH_NVM_SIG_WORD; @@ -4377,6 +4395,9 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: word = NVM_COMPAT; valid_csum_mask = NVM_COMPAT_VALID_CSUM; break; diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 2c0c8541d7f2..6f711196c228 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -180,6 +180,20 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V11, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_LM12, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_CMP_I219_V12, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM13, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V13, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM14, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V14, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_LM15, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_TGP_I219_V15, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM16, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V16, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_LM17, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ADL_I219_V17, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM18, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V18, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_LM19, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_MTP_I219_V19, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; @@ -1218,6 +1232,9 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: case e1000_82574: case e1000_82583: case e1000_80003es2lan: @@ -2516,6 +2533,9 @@ em_reset(if_ctx_t ctx) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: pba = E1000_PBA_26K; break; case e1000_82575: @@ -2626,6 +2646,9 @@ em_reset(if_ctx_t ctx) case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: + case e1000_pch_tgp: + case e1000_pch_adp: + case e1000_pch_mtp: hw->fc.high_water = 0x5C20; hw->fc.low_water = 0x5048; hw->fc.pause_time = 0x0650; From owner-dev-commits-src-all@freebsd.org Mon Apr 19 22:10:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0185D8D15; Mon, 19 Apr 2021 22:10: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 4FPLbZ0Btmz4vJK; Mon, 19 Apr 2021 22:10: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 EDC0027095; Mon, 19 Apr 2021 22:10: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 13JMAHo4033755; Mon, 19 Apr 2021 22:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JMAHe0033748; Mon, 19 Apr 2021 22:10:17 GMT (envelope-from git) Date: Mon, 19 Apr 2021 22:10:17 GMT Message-Id: <202104192210.13JMAHe0033748@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: 2763a0928aee - main - config: style for '\0' and NULL 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: 2763a0928aeedc3c76b0953af9fa7b948026d81b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 22:10:18 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2763a0928aeedc3c76b0953af9fa7b948026d81b commit 2763a0928aeedc3c76b0953af9fa7b948026d81b Author: Warner Losh AuthorDate: 2021-04-19 22:09:42 +0000 Commit: Warner Losh CommitDate: 2021-04-19 22:10:12 +0000 config: style for '\0' and NULL Use NULL for pointers instead of '0' (though hey are the same thing in these cases). Ditto for using the zero character '\0' instead of a naked 0 (ditto). Reviewed by: markj@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29847 --- usr.sbin/config/mkmakefile.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 00eb3422d1d0..4f3bd13ffca3 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -193,7 +193,7 @@ sanitize_envline(char *result, const char *src) /* If there is no '=' it's not a well-formed name=value line. */ if ((eq = strchr(src, '=')) == NULL) { - *result = 0; + *result = '\0'; return; } dst = result; @@ -210,7 +210,7 @@ sanitize_envline(char *result, const char *src) /* If it was all leading space, we don't have a well-formed line. */ if (leading) { - *result = 0; + *result = '\0'; return; } @@ -221,7 +221,7 @@ sanitize_envline(char *result, const char *src) /* Copy chars after the '=', skipping any leading whitespace. */ leading = true; - while ((c = *src++) != 0) { + while ((c = *src++) != '\0') { if (leading && (isspace(c) || c == '"')) continue; *dst++ = c; @@ -230,7 +230,7 @@ sanitize_envline(char *result, const char *src) /* If it was all leading space, it's a valid 'var=' (nil value). */ if (leading) { - *dst = 0; + *dst = '\0'; return; } @@ -238,7 +238,7 @@ sanitize_envline(char *result, const char *src) while (isspace(dst[-1]) || dst[-1] == '"') --dst; - *dst = 0; + *dst = '\0'; } /* @@ -444,10 +444,10 @@ next: compile = 0; match = 1; nreqs = 0; - compilewith = 0; - depends = 0; - clean = 0; - warning = 0; + compilewith = NULL; + depends = NULL; + clean = NULL; + warning = NULL; std = 0; imp_rule = 0; no_ctfconvert = 0; From owner-dev-commits-src-all@freebsd.org Mon Apr 19 22:16:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7590F5D9321; Mon, 19 Apr 2021 22:16:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher 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 "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPLkV1ZPgz3BvF; Mon, 19 Apr 2021 22:16:17 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 13JMGG1u018269 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 19 Apr 2021 15:16:16 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 13JMGG1A018268; Mon, 19 Apr 2021 15:16:16 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 19 Apr 2021 15:16:16 -0700 From: Gleb Smirnoff To: Richard Scheffenegger Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b87cf2bc841b - main - tcp: keep SACK scoreboard sorted when doing rescue retransmission Message-ID: References: <202104182112.13ILCMoW039801@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202104182112.13ILCMoW039801@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4FPLkV1ZPgz3BvF X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 22:16:18 -0000 On Sun, Apr 18, 2021 at 09:12:22PM +0000, Richard Scheffenegger wrote: R> The branch main has been updated by rscheff: R> R> URL: https://cgit.FreeBSD.org/src/commit/?id=b87cf2bc841b2a336b7f0c6cd89573610412a84f R> R> commit b87cf2bc841b2a336b7f0c6cd89573610412a84f R> Author: Richard Scheffenegger R> AuthorDate: 2021-04-18 20:14:14 +0000 R> Commit: Richard Scheffenegger R> CommitDate: 2021-04-18 21:11:10 +0000 R> R> tcp: keep SACK scoreboard sorted when doing rescue retransmission R> R> Reviewed By: tuexen, kbowling, #transport R> MFC after: 3 days R> Sponsored by: NetApp, Inc. R> Differential Revision: https://reviews.freebsd.org/D29825 R> --- R> sys/netinet/tcp_sack.c | 12 ++++++++++-- R> 1 file changed, 10 insertions(+), 2 deletions(-) R> R> diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c R> index a28bb40a8332..fffba2e75045 100644 R> --- a/sys/netinet/tcp_sack.c R> +++ b/sys/netinet/tcp_sack.c R> @@ -497,7 +497,7 @@ static struct sackhole * R> tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, R> struct sackhole *after) R> { R> - struct sackhole *hole; R> + struct sackhole *hole, *tail; R> R> /* Allocate a new SACK hole. */ R> hole = tcp_sackhole_alloc(tp, start, end); R> @@ -508,7 +508,15 @@ tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, R> if (after != NULL) R> TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink); R> else R> - TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); R> + /* R> + * With Rescue Retransmission, new holes may need to R> + * be inserted just before the tail. R> + */ R> + if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole, R> + scblink)) != NULL) && SEQ_LEQ(end, tail->start)) R> + TAILQ_INSERT_BEFORE(tail, hole, scblink); R> + else R> + TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); IMHO, formatting here violates style and also may be misleading. Should be: if (after != NULL) TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink); else if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole, scblink)) != NULL) && SEQ_LEQ(end, tail->start)) /* * With Rescue Retransmission, new holes may need to * be inserted just before the tail. */ TAILQ_INSERT_BEFORE(tail, hole, scblink); else TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); -- Gleb Smirnoff From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:20:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D60D5DBF5E; Tue, 20 Apr 2021 00: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 4FPPV76wzmz3H9m; Tue, 20 Apr 2021 00:20: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 E0DC5B58; Tue, 20 Apr 2021 00:20: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 13K0KlJg006814; Tue, 20 Apr 2021 00:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0KlIM006813; Tue, 20 Apr 2021 00:20:47 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:20:47 GMT Message-Id: <202104200020.13K0KlIM006813@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: faa9ad8a9005 - main - Fix off-by-one error in KASSERT from 02f26e98c7f4. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: faa9ad8a90058cf07e806cea51c0030bf69f88db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:20:48 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=faa9ad8a90058cf07e806cea51c0030bf69f88db commit faa9ad8a90058cf07e806cea51c0030bf69f88db Author: Gleb Smirnoff AuthorDate: 2021-04-20 00:20:19 +0000 Commit: Gleb Smirnoff CommitDate: 2021-04-20 00:20:19 +0000 Fix off-by-one error in KASSERT from 02f26e98c7f4. --- sys/netinet/tcp_hostcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index 25190697bdee..baefa55fd076 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -470,7 +470,7 @@ tcp_hc_insert(struct in_conninfo *inc) */ TAILQ_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); V_tcp_hostcache.hashbase[hash].hch_length++; - KASSERT(V_tcp_hostcache.hashbase[hash].hch_length < + KASSERT(V_tcp_hostcache.hashbase[hash].hch_length <= V_tcp_hostcache.bucket_limit, ("tcp_hostcache: bucket length too high at %u: %u", hash, V_tcp_hostcache.hashbase[hash].hch_length)); From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:46:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9978D5DCB2F; Tue, 20 Apr 2021 00:46: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 4FPQ4M3zHrz3J8D; Tue, 20 Apr 2021 00:46: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 7725A1138; Tue, 20 Apr 2021 00:46: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 13K0kx6d036842; Tue, 20 Apr 2021 00:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0kxqY036841; Tue, 20 Apr 2021 00:46:59 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:46:59 GMT Message-Id: <202104200046.13K0kxqY036841@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: ba1182e26376 - main - bsd.compiler.mk: detect Apple Clang for cross-builds 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: ba1182e26376987fe424707b2abc4d6532b28623 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:46:59 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ba1182e26376987fe424707b2abc4d6532b28623 commit ba1182e26376987fe424707b2abc4d6532b28623 Author: Alex Richardson AuthorDate: 2021-04-20 00:46:36 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 00:46:36 +0000 bsd.compiler.mk: detect Apple Clang for cross-builds Apple clang uses a different versioning scheme, so if we enable or disable certain warnings for Clang 11+, those might not be supported in Apple Clang 11+. This adds 'apple-clang' to COMPILER_FEATURES, so that bootstrap tools Makefiles can avoid warnings on macOS. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D29680 --- share/mk/bsd.compiler.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 0d8f02489f00..97198f70d5b6 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -26,6 +26,12 @@ # mitigation. # - init-all: supports stack variable initialization. # +# When bootstrapping on macOS, 'apple-clang' will be set in COMPILER_FEATURES +# to differentiate Apple's version of Clang. Apple Clang uses a different +# versioning scheme and may not support the same -W/-Wno warning flags. For a +# mapping of Apple Clang versions to upstream clang versions see +# https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_12.x_(since_Free_On-Device_Development) +# # These variables with an X_ prefix will also be provided if XCC is set. # # This file may be included multiple times, but only has effect the first time. @@ -202,6 +208,10 @@ ${X_}COMPILER_TYPE:= gcc .if !defined(${X_}COMPILER_VERSION) ${X_}COMPILER_VERSION!=echo "${_v:M[1-9]*.[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif +# Detect apple clang when bootstrapping to select appropriate warning flags. +.if !defined(${X_}COMPILER_FEATURES) && ${_v:[*]:M*Apple clang version*} +${X_}COMPILER_FEATURES= apple-clang +.endif .undef _v .endif .if !defined(${X_}COMPILER_FREEBSD_VERSION) @@ -218,7 +228,7 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown ${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} -print-resource-dir 2>/dev/null || echo unknown .endif -${X_}COMPILER_FEATURES= c++11 c++14 +${X_}COMPILER_FEATURES+= c++11 c++14 .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000) ${X_}COMPILER_FEATURES+= c++17 From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:47:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11F0F5DC769; Tue, 20 Apr 2021 00:47: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 4FPQ4P6MfXz3JSq; Tue, 20 Apr 2021 00:47: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 B385E1382; Tue, 20 Apr 2021 00:47: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 13K0l1Gp036884; Tue, 20 Apr 2021 00:47:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0l10T036883; Tue, 20 Apr 2021 00:47:01 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:47:01 GMT Message-Id: <202104200047.13K0l10T036883@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: 0b4ad01d91a3 - main - libc/string/bcopy.c: Use intptr_t as the copy type 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: 0b4ad01d91a3b24cea00d54d25beed0f487c0183 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:47:02 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=0b4ad01d91a3b24cea00d54d25beed0f487c0183 commit 0b4ad01d91a3b24cea00d54d25beed0f487c0183 Author: Alex Richardson AuthorDate: 2021-04-19 23:15:57 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 00:46:42 +0000 libc/string/bcopy.c: Use intptr_t as the copy type While most 64-bit architectures have an assembly implementation of this file RISC-V does not. As we now copy 8 bytes instead of 4 it should speed up RISC-V. Using intptr_t instead of int also allows using this file for CHERI pure-capability code since trying to copy pointers using integer loads/stores will invalidate pointers. Reviewed By: kib Obtained from: CheriBSD (partially) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29535 --- lib/libc/string/bcopy.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index 141416d0afec..84715d0432e3 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -40,11 +40,7 @@ __FBSDID("$FreeBSD$"); #include -/* - * sizeof(word) MUST BE A POWER OF TWO - * SO THAT wmask BELOW IS ALL ONES - */ -typedef int word; /* "word" used for optimal copy speed */ +typedef intptr_t word; /* "word" used for optimal copy speed */ #define wsize sizeof(word) #define wmask (wsize - 1) @@ -105,7 +101,8 @@ bcopy(const void *src0, void *dst0, size_t length) * Copy whole words, then mop up any trailing bytes. */ t = length / wsize; - TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize); + TLOOP(*(word *)(void *)dst = *(const word *)(const void *)src; + src += wsize; dst += wsize); t = length & wmask; TLOOP(*dst++ = *src++); } else { @@ -126,7 +123,8 @@ bcopy(const void *src0, void *dst0, size_t length) TLOOP1(*--dst = *--src); } t = length / wsize; - TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src); + TLOOP(src -= wsize; dst -= wsize; + *(word *)(void *)dst = *(const word *)(const void *)src); t = length & wmask; TLOOP(*--dst = *--src); } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:47:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB0845DC768; Tue, 20 Apr 2021 00:47: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 4FPQ4N4dN8z3J8G; Tue, 20 Apr 2021 00:47: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 8B9A01139; Tue, 20 Apr 2021 00:47: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 13K0l0lU036863; Tue, 20 Apr 2021 00:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0l0Fa036862; Tue, 20 Apr 2021 00:47:00 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:47:00 GMT Message-Id: <202104200047.13K0l0Fa036862@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: bbd421cdf6d8 - main - contrib/flex: Drop local __dead2 patch 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: bbd421cdf6d8c6102e6fd3979c5bec21ace3c2e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:47:00 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=bbd421cdf6d8c6102e6fd3979c5bec21ace3c2e3 commit bbd421cdf6d8c6102e6fd3979c5bec21ace3c2e3 Author: Alex Richardson AuthorDate: 2021-04-19 23:05:30 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 00:46:42 +0000 contrib/flex: Drop local __dead2 patch Upstream flex has added a yynoreturn, so this diff is no longer needed. Partially reverts r181269. Also regenerate the pre-generated files that are used for bootstrapping. Reviewed By: jkim Differential Revision: https://reviews.freebsd.org/D29679 --- contrib/flex/src/flex.skl | 8 +- tools/build/bootstrap-m4/inittokenizer.c | 414 ++++++++++++++++--------------- usr.bin/lex/initscan.c | 16 +- usr.bin/lex/initskel.c | 8 +- 4 files changed, 226 insertions(+), 220 deletions(-) diff --git a/contrib/flex/src/flex.skl b/contrib/flex/src/flex.skl index c23b944ea473..304e664e4c62 100644 --- a/contrib/flex/src/flex.skl +++ b/contrib/flex/src/flex.skl @@ -216,12 +216,6 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]], /* First, we deal with platform-specific or compiler-specific issues. */ -#if defined(__FreeBSD__) -#include -#else -#define __dead2 -#endif - /* begin standard C headers. */ %if-c-only #include @@ -653,7 +647,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG); static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG ); -static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ) __dead2; +static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ); ]]) %endif diff --git a/tools/build/bootstrap-m4/inittokenizer.c b/tools/build/bootstrap-m4/inittokenizer.c index 0c07f1ec2275..a014012ad756 100644 --- a/tools/build/bootstrap-m4/inittokenizer.c +++ b/tools/build/bootstrap-m4/inittokenizer.c @@ -1,4 +1,6 @@ +#line 1 "tokenizer.c" +#line 3 "tokenizer.c" #define YY_INT_ALIGNED short int @@ -6,24 +8,14 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ -#if defined(__FreeBSD__) -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif -#include -#include -#else -#define __dead2 -#endif - /* begin standard C headers. */ #include #include @@ -93,65 +85,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -168,15 +156,16 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; +extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -191,7 +180,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -206,12 +194,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -234,7 +222,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -262,7 +250,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -274,7 +262,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) #define yy_current_buffer YY_CURRENT_BUFFER - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -282,11 +269,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -295,85 +282,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap() 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; - int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ) __dead2; +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 14 #define YY_END_OF_BUFFER 15 /* This struct is not used in this scanner, @@ -383,7 +366,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[35] = +static const flex_int16_t yy_accept[35] = { 0, 0, 0, 15, 13, 1, 1, 13, 13, 13, 2, 2, 13, 13, 13, 13, 1, 9, 10, 12, 2, @@ -391,7 +374,7 @@ static yyconst flex_int16_t yy_accept[35] = 2, 0, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -423,13 +406,13 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[19] = +static const YY_CHAR yy_meta[19] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 3, 4, 4, 4, 1 } ; -static yyconst flex_int16_t yy_base[39] = +static const flex_int16_t yy_base[39] = { 0, 0, 0, 48, 49, 17, 19, 35, 41, 39, 16, 0, 14, 32, 15, 25, 27, 49, 49, 49, 27, @@ -437,7 +420,7 @@ static yyconst flex_int16_t yy_base[39] = 0, 0, 0, 49, 39, 29, 34, 36 } ; -static yyconst flex_int16_t yy_def[39] = +static const flex_int16_t yy_def[39] = { 0, 34, 1, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, @@ -445,7 +428,7 @@ static yyconst flex_int16_t yy_def[39] = 37, 38, 38, 0, 34, 34, 34, 34 } ; -static yyconst flex_int16_t yy_nxt[68] = +static const flex_int16_t yy_nxt[68] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 11, 4, 12, 13, 14, 4, 4, 4, 4, 15, 16, 16, @@ -456,7 +439,7 @@ static yyconst flex_int16_t yy_nxt[68] = 34, 34, 34, 34, 34, 34, 34 } ; -static yyconst flex_int16_t yy_chk[68] = +static const flex_int16_t yy_chk[68] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, @@ -481,7 +464,9 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; +#line 1 "tokenizer.l" #define YY_NO_INPUT 1 +#line 3 "tokenizer.l" /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie @@ -516,6 +501,8 @@ int32_t parse_radix(void); extern int yylex(void); #define YY_DECL int yylex(void) +#line 504 "tokenizer.c" +#line 505 "tokenizer.c" #define INITIAL 0 @@ -531,36 +518,36 @@ extern int yylex(void); #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy ( void ); -int yyget_debug (void ); +int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + int yyget_leng ( void ); -char *yyget_text (void ); +char *yyget_text ( void ); -int yyget_lineno (void ); +int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -568,33 +555,41 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); +#endif #endif + +#ifndef YY_NO_UNPUT + #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -602,7 +597,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -613,7 +608,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -626,7 +621,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -681,7 +676,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -695,8 +690,6 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; - - if ( !(yy_init) ) { (yy_init) = 1; @@ -717,13 +710,18 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 48 "tokenizer.l" + +#line 722 "tokenizer.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -749,9 +747,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 49 ); @@ -781,14 +779,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP +#line 49 "tokenizer.l" {/* just skip it */} YY_BREAK case 2: YY_RULE_SETUP +#line 50 "tokenizer.l" { yylval = number(); return(NUMBER); } YY_BREAK case 3: YY_RULE_SETUP +#line 51 "tokenizer.l" { if (mimic_gnu) { yylval = parse_radix(); return(NUMBER); } else { @@ -798,48 +799,60 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP +#line 57 "tokenizer.l" { return(LE); } YY_BREAK case 5: YY_RULE_SETUP +#line 58 "tokenizer.l" { return(GE); } YY_BREAK case 6: YY_RULE_SETUP +#line 59 "tokenizer.l" { return(LSHIFT); } YY_BREAK case 7: YY_RULE_SETUP +#line 60 "tokenizer.l" { return(RSHIFT); } YY_BREAK case 8: YY_RULE_SETUP +#line 61 "tokenizer.l" { return(EQ); } YY_BREAK case 9: YY_RULE_SETUP +#line 62 "tokenizer.l" { return(NE); } YY_BREAK case 10: YY_RULE_SETUP +#line 63 "tokenizer.l" { return(LAND); } YY_BREAK case 11: YY_RULE_SETUP +#line 64 "tokenizer.l" { return(LOR); } YY_BREAK case 12: YY_RULE_SETUP +#line 65 "tokenizer.l" { if (mimic_gnu) { return (EXPONENT); } } YY_BREAK case 13: YY_RULE_SETUP +#line 66 "tokenizer.l" { return yytext[0]; } YY_BREAK case 14: YY_RULE_SETUP +#line 67 "tokenizer.l" ECHO; YY_BREAK +#line 855 "tokenizer.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -917,7 +930,7 @@ case YY_STATE_EOF(INITIAL): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -970,6 +983,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1012,7 +1026,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1025,7 +1039,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1039,7 +1053,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1048,11 +1062,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1080,7 +1095,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -1094,12 +1109,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1132,9 +1150,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1160,14 +1178,18 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 34); return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1192,7 +1214,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1209,14 +1231,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1253,11 +1275,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -1285,7 +1307,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1313,7 +1335,7 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1322,13 +1344,13 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -1347,9 +1369,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -1361,7 +1383,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1404,7 +1426,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1435,7 +1457,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1454,7 +1476,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1472,15 +1494,15 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1489,7 +1511,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc *** 331 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:47:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B6465DCB45; Tue, 20 Apr 2021 00:47: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 4FPQ4S0TX1z3J8S; Tue, 20 Apr 2021 00:47: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 E5900113A; Tue, 20 Apr 2021 00:47: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 13K0l30l036929; Tue, 20 Apr 2021 00:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0l3ij036928; Tue, 20 Apr 2021 00:47:03 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:47:03 GMT Message-Id: <202104200047.13K0l3ij036928@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: 1ad83445fc0f - main - Allow lib/msun/logarithm_test to pass on ld128 platforms 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: 1ad83445fc0f1d2aecd32635f4ae713a057aa091 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:47:04 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1ad83445fc0f1d2aecd32635f4ae713a057aa091 commit 1ad83445fc0f1d2aecd32635f4ae713a057aa091 Author: Alex Richardson AuthorDate: 2021-04-19 23:22:45 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 00:46:43 +0000 Allow lib/msun/logarithm_test to pass on ld128 platforms For some reason the ld128 log1pl() implementation is less accurate than logl(), but does at least guarantee precision >= the ld80 implementation. Mark log1p_accuracy_tests as XFAIL for ld128 and increase the log1p tolerance to the ld80 equivalent in accuracy_tests to avoid losing test coverage for the other functions. PR: 253984 Reviewed By: ngie, dim Differential Revision: https://reviews.freebsd.org/D29039 --- lib/msun/tests/logarithm_test.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/msun/tests/logarithm_test.c b/lib/msun/tests/logarithm_test.c index 48a368765b71..e372e889cb82 100644 --- a/lib/msun/tests/logarithm_test.c +++ b/lib/msun/tests/logarithm_test.c @@ -212,6 +212,17 @@ ATF_TC_BODY(accuracy_tests, tc) }; unsigned i; + long double log1p_ldbl_ulp = LDBL_ULP(); +#if LDBL_MANT_DIG > 64 + /* + * On ld128 platforms the log1p() implementation provides less accuracy, + * but does still match the ld80 precision. Use the ld80 LDBL_ULP() + * value for now to avoid losing test coverage for the other functions. + * Reported as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253984 + */ + log1p_ldbl_ulp = ldexpl(1.0, 1 - 64); +#endif + for (i = 0; i < nitems(tests); i++) { test_tol(log2, tests[i].x, tests[i].log2x, DBL_ULP()); test_tol(log2f, tests[i].x, tests[i].log2x, FLT_ULP()); @@ -228,7 +239,7 @@ ATF_TC_BODY(accuracy_tests, tc) test_tol(log1pf, tests[i].x - 1, tests[i].logex, FLT_ULP()); test_tol(log1pl, tests[i].x - 1, tests[i].logex, - LDBL_ULP()); + log1p_ldbl_ulp); } } } @@ -236,6 +247,11 @@ ATF_TC_BODY(accuracy_tests, tc) ATF_TC_WITHOUT_HEAD(log1p_accuracy_tests); ATF_TC_BODY(log1p_accuracy_tests, tc) { +#if LDBL_MANT_DIG > 64 + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_expect_fail("https://bugs.freebsd.org/253984"); +#endif + test_tol(log1pf, 0x0.333333p0F, 1.82321546859847114303367992804596800640e-1L, FLT_ULP()); test_tol(log1p, 0x0.3333333333333p0, From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:47:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6700B5DCAF8; Tue, 20 Apr 2021 00:47: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 4FPQ4R29BHz3JHw; Tue, 20 Apr 2021 00:47: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 C8D1D1383; Tue, 20 Apr 2021 00:47: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 13K0l2lc036905; Tue, 20 Apr 2021 00:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0l22f036904; Tue, 20 Apr 2021 00:47:02 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:47:02 GMT Message-Id: <202104200047.13K0l22f036904@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: ab147542b7c0 - main - libc/string/memset.c: Use unsigned long for stores 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: ab147542b7c0bbc41f7f0499b16933bd8f3f31d7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:47:03 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=ab147542b7c0bbc41f7f0499b16933bd8f3f31d7 commit ab147542b7c0bbc41f7f0499b16933bd8f3f31d7 Author: Alex Richardson AuthorDate: 2021-04-19 23:19:20 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 00:46:43 +0000 libc/string/memset.c: Use unsigned long for stores While most 64-bit architectures have an assembly implementation of this file, RISC-V does not. As we now store 8 bytes instead of 4 it should speed up RISC-V. Reviewed By: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29536 --- lib/libc/string/memset.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index 7d9909a76083..e2d4027eea0c 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include -#define wsize sizeof(u_int) +#define wsize sizeof(u_long) #define wmask (wsize - 1) #ifdef BZERO @@ -67,7 +67,7 @@ memset(void *dst0, int c0, size_t length) { size_t t; #ifndef BZERO - u_int c; + u_long c; #endif u_char *dst; @@ -84,6 +84,9 @@ memset(void *dst0, int c0, size_t length) * * but we use a minimum of 3 here since the overhead of the code * to do word writes is substantial. + * + * TODO: This threshold might not be sensible for 64-bit u_long. + * We should benchmark and revisit this decision. */ if (length < 3 * wsize) { while (length != 0) { @@ -95,12 +98,12 @@ memset(void *dst0, int c0, size_t length) #ifndef BZERO if ((c = (u_char)c0) != 0) { /* Fill the word. */ - c = (c << 8) | c; /* u_int is 16 bits. */ -#if UINT_MAX > 0xffff - c = (c << 16) | c; /* u_int is 32 bits. */ + c = (c << 8) | c; /* u_long is 16 bits. */ +#if ULONG_MAX > 0xffff + c = (c << 16) | c; /* u_long is 32 bits. */ #endif -#if UINT_MAX > 0xffffffff - c = (c << 32) | c; /* u_int is 64 bits. */ +#if ULONG_MAX > 0xffffffff + c = (c << 32) | c; /* u_long is 64 bits. */ #endif } #endif @@ -116,7 +119,7 @@ memset(void *dst0, int c0, size_t length) /* Fill words. Length was >= 2*words so we know t >= 1 here. */ t = length / wsize; do { - *(u_int *)dst = WIDEVAL; + *(u_long *)(void *)dst = WIDEVAL; dst += wsize; } while (--t != 0); From owner-dev-commits-src-all@freebsd.org Tue Apr 20 00:57:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FBA35DD4C6; Tue, 20 Apr 2021 00:57: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 4FPQJj00C3z3KG8; Tue, 20 Apr 2021 00:57: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 DC2F212B4; Tue, 20 Apr 2021 00:57:40 +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 13K0vepq050213; Tue, 20 Apr 2021 00:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K0vedV050212; Tue, 20 Apr 2021 00:57:40 GMT (envelope-from git) Date: Tue, 20 Apr 2021 00:57:40 GMT Message-Id: <202104200057.13K0vedV050212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 5a89498d1986 - main - nfsd: fix stripe size reply for the File Layout pNFS server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a89498d19863d0c4cb074f9b93862a70040bf1b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 00:57:41 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5a89498d19863d0c4cb074f9b93862a70040bf1b commit 5a89498d19863d0c4cb074f9b93862a70040bf1b Author: Rick Macklem AuthorDate: 2021-04-20 00:51:07 +0000 Commit: Rick Macklem CommitDate: 2021-04-20 00:54:54 +0000 nfsd: fix stripe size reply for the File Layout pNFS server At a recent testing event I found out that I had misinterpreted RFC5661 where it describes the stripe size in the File Layout's nfl_util field. This patch fixes the pNFS File Layout server so that it returns the correct value to the NFSv4.1/4.2 pNFS enabled client. This affects almost no one, since pNFS server configurations are rare and the extant pNFS aware NFS clients seemed to function correctly despite the erroneous stripe size. It *might* be needed for correct behaviour if a recent Linux client mounts a FreeBSD pNFS server configuration that is using File Layout (non-mirrored configuration). MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdstate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index fa7bb3ba9f56..60647ab288d8 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -6873,14 +6873,8 @@ nfsrv_filelayout(struct nfsrv_descript *nd, int iomode, fhandle_t *fhp, NFSBCOPY(devid, tl, NFSX_V4DEVICEID); /* Device ID. */ tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); - /* - * Make the stripe size as many 64K blocks as will fit in the stripe - * mask. Since there is only one stripe, the stripe size doesn't really - * matter, except that the Linux client will only handle an exact - * multiple of their PAGE_SIZE (usually 4K). I chose 64K as a value - * that should cover most/all arches w.r.t. PAGE_SIZE. - */ - *tl++ = txdr_unsigned(NFSFLAYUTIL_STRIPE_MASK & ~0xffff); + /* Set the stripe size to the maximum I/O size. */ + *tl++ = txdr_unsigned(NFS_SRVMAXIO & NFSFLAYUTIL_STRIPE_MASK); *tl++ = 0; /* 1st stripe index. */ pattern_offset = 0; txdr_hyper(pattern_offset, tl); tl += 2; /* Pattern offset. */ From owner-dev-commits-src-all@freebsd.org Tue Apr 20 01:01:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 527115DDA55; Tue, 20 Apr 2021 01:01: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 4FPQPC1vzHz3KhG; Tue, 20 Apr 2021 01:01: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 34B4B1717; Tue, 20 Apr 2021 01:01: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 13K11Zlp063237; Tue, 20 Apr 2021 01:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K11ZF6063231; Tue, 20 Apr 2021 01:01:35 GMT (envelope-from git) Date: Tue, 20 Apr 2021 01:01:35 GMT Message-Id: <202104200101.13K11ZF6063231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: abc1489bcb55 - stable/13 - usr.sbin/uefisign: prevent specifying certificate, key or output multiple times. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abc1489bcb55698028585d7667166a4a4192e298 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 01:01:35 -0000 The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=abc1489bcb55698028585d7667166a4a4192e298 commit abc1489bcb55698028585d7667166a4a4192e298 Author: Xin LI AuthorDate: 2021-03-21 17:12:34 +0000 Commit: Xin LI CommitDate: 2021-04-20 00:59:58 +0000 usr.sbin/uefisign: prevent specifying certificate, key or output multiple times. (cherry picked from commit 6234a0bfc8630fc556295812c15d72bde0f6427a) --- usr.sbin/uefisign/uefisign.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/usr.sbin/uefisign/uefisign.c b/usr.sbin/uefisign/uefisign.c index aa2a7621998d..149e90ba0e67 100644 --- a/usr.sbin/uefisign/uefisign.c +++ b/usr.sbin/uefisign/uefisign.c @@ -350,13 +350,22 @@ main(int argc, char **argv) Vflag = true; break; case 'c': - certpath = checked_strdup(optarg); + if (certpath == NULL) + certpath = checked_strdup(optarg); + else + err(1, "-c can only be specified once"); break; case 'k': - keypath = checked_strdup(optarg); + if (keypath == NULL) + keypath = checked_strdup(optarg); + else + err(1, "-k can only be specified once"); break; case 'o': - outpath = checked_strdup(optarg); + if (outpath == NULL) + outpath = checked_strdup(optarg); + else + err(1, "-o can only be specified once"); break; case 'v': vflag = true; @@ -402,7 +411,7 @@ main(int argc, char **argv) err(1, "fork"); if (pid == 0) - return (child(inpath, outpath, pipefds[1], Vflag, vflag)); + exit(child(inpath, outpath, pipefds[1], Vflag, vflag)); if (!Vflag) { certfp = checked_fopen(certpath, "r"); @@ -422,5 +431,5 @@ main(int argc, char **argv) sign(cert, key, pipefds[0]); } - return (wait_for_child(pid)); + exit(wait_for_child(pid)); } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 01:01:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D1C95DD9CA; Tue, 20 Apr 2021 01:01: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 4FPQPD30R1z3KXb; Tue, 20 Apr 2021 01:01: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 582ED1785; Tue, 20 Apr 2021 01:01: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 13K11akO063428; Tue, 20 Apr 2021 01:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K11a8M063427; Tue, 20 Apr 2021 01:01:36 GMT (envelope-from git) Date: Tue, 20 Apr 2021 01:01:36 GMT Message-Id: <202104200101.13K11a8M063427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 26f2ebfbd9ce - stable/13 - usr.sbin/services_mkdb: diff reduction against NetBSD. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 26f2ebfbd9ceb608cba74ae84306fcc1de1646a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 01:01:36 -0000 The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=26f2ebfbd9ceb608cba74ae84306fcc1de1646a7 commit 26f2ebfbd9ceb608cba74ae84306fcc1de1646a7 Author: Xin LI AuthorDate: 2021-03-21 17:22:50 +0000 Commit: Xin LI CommitDate: 2021-04-20 01:00:09 +0000 usr.sbin/services_mkdb: diff reduction against NetBSD. (cherry picked from commit 57b9a062d147563ecda72227f0bb051f60eff608) --- usr.sbin/services_mkdb/uniq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/services_mkdb/uniq.c b/usr.sbin/services_mkdb/uniq.c index 43e66b95979d..c78b01ef27c5 100644 --- a/usr.sbin/services_mkdb/uniq.c +++ b/usr.sbin/services_mkdb/uniq.c @@ -90,6 +90,7 @@ uniq(const char *fname) break; case -1: err(1, "put"); + /* NOTREACHED */ default: abort(); break; From owner-dev-commits-src-all@freebsd.org Tue Apr 20 01:56:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 753BE5DF5B2; Tue, 20 Apr 2021 01:56: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 4FPRd52xy6z3MpW; Tue, 20 Apr 2021 01:56: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 57D9E21E9; Tue, 20 Apr 2021 01:56: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 13K1uvNX029407; Tue, 20 Apr 2021 01:56:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K1uvbI029406; Tue, 20 Apr 2021 01:56:57 GMT (envelope-from git) Date: Tue, 20 Apr 2021 01:56:57 GMT Message-Id: <202104200156.13K1uvbI029406@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: 32231805fbe2 - main - linker_set: fix globl/weak symbol redefinitions to work on clang 12 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: 32231805fbe2b9438c2de50c229b43c016207a08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 01:56:57 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=32231805fbe2b9438c2de50c229b43c016207a08 commit 32231805fbe2b9438c2de50c229b43c016207a08 Author: Greg V AuthorDate: 2021-04-20 00:47:15 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 01:56:24 +0000 linker_set: fix globl/weak symbol redefinitions to work on clang 12 In clang 12.0.0.rc2, going from weak to global is now a hard error: ``` /usr/src/stand/libsa/amd64/_setjmp.S:67:25: error: _longjmp changed binding to STB_GLOBAL .text; .p2align 4,0x90; .globl _longjmp; .type _longjmp,@function; _longjmp:; .cfi_startproc ``` And the other way is a warning, but we have -Werror: ``` error: __start_set_Xcommand_set changed binding to STB_WEAK [-Werror,-Winline-asm] error: __stop_set_Xcommand_set changed binding to STB_WEAK [-Werror,-Winline-asm] ``` ref: https://reviews.llvm.org/D90108 Reviewed By: arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29159 --- sys/sys/cdefs.h | 4 ++-- sys/sys/linker_set.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 1d1fe2965c69..ff461db9ec2e 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -563,8 +563,8 @@ #endif /* __STDC__ */ #endif /* __GNUC__ */ -#define __GLOBL1(sym) __asm__(".globl " #sym) -#define __GLOBL(sym) __GLOBL1(sym) +#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym)) +#define __WEAK(sym) __asm__(".weak " __XSTRING(sym)) #if defined(__GNUC__) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index 6169a3499dad..f957858ada04 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -60,8 +60,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET_QV(set, sym, qv) \ - __GLOBL(__CONCAT(__start_set_,set)); \ - __GLOBL(__CONCAT(__stop_set_,set)); \ + __WEAK(__CONCAT(__start_set_,set)); \ + __WEAK(__CONCAT(__stop_set_,set)); \ static void const * qv \ __set_##set##_sym_##sym __section("set_" #set) \ __nosanitizeaddress \ From owner-dev-commits-src-all@freebsd.org Tue Apr 20 03:12:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B95F35E1CC9; Tue, 20 Apr 2021 03:12:50 +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 4FPTJf4tptz3h1h; Tue, 20 Apr 2021 03:12:50 +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 9A9EC328B; Tue, 20 Apr 2021 03:12:50 +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 13K3Coav036329; Tue, 20 Apr 2021 03:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K3CooK036328; Tue, 20 Apr 2021 03:12:50 GMT (envelope-from git) Date: Tue, 20 Apr 2021 03:12:50 GMT Message-Id: <202104200312.13K3CooK036328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 78ffcb86d98f - main - nfscommon: fix function name in comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78ffcb86d98fc9c27ac7a723c65621667036c42d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 03:12:50 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=78ffcb86d98fc9c27ac7a723c65621667036c42d commit 78ffcb86d98fc9c27ac7a723c65621667036c42d Author: Rick Macklem AuthorDate: 2021-04-20 03:09:46 +0000 Commit: Rick Macklem CommitDate: 2021-04-20 03:09:46 +0000 nfscommon: fix function name in comment MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 4afa4c2d9ab4..a30ee458e06c 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4614,7 +4614,7 @@ nfsmout: * Handle an NFSv4.1 Sequence request for the session. * If reply != NULL, use it to return the cached reply, as required. * The client gets a cached reply via this call for callbacks, however the - * server gets a cached reply via the nfsv4_seqsess_cachereply() call. + * server gets a cached reply via the nfsv4_seqsess_cacherep() call. */ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, From owner-dev-commits-src-all@freebsd.org Tue Apr 20 04:18:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 129F35E328E; Tue, 20 Apr 2021 04:18: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 4FPVlz01PPz3kQt; Tue, 20 Apr 2021 04:18: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 E1C7F3F95; Tue, 20 Apr 2021 04:18: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 13K4I6SK015889; Tue, 20 Apr 2021 04:18:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K4I6kE015888; Tue, 20 Apr 2021 04:18:06 GMT (envelope-from git) Date: Tue, 20 Apr 2021 04:18:06 GMT Message-Id: <202104200418.13K4I6kE015888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brandon Bergren Subject: git: ac42b63648b1 - stable/13 - powerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745x MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac42b63648b1f33daa45352cc6d795ebd9e4071b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 04:18:07 -0000 The branch stable/13 has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=ac42b63648b1f33daa45352cc6d795ebd9e4071b commit ac42b63648b1f33daa45352cc6d795ebd9e4071b Author: Justin Hibbits AuthorDate: 2021-03-31 16:54:11 +0000 Commit: Brandon Bergren CommitDate: 2021-04-20 04:13:41 +0000 powerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745x Rename cpu_sleep() to mpc745x_sleep() to denote what it's actually intended for. This function is very G4-specific, and will not work on any other CPU. This will afterward eliminate a platform_smp_timebase_sync() call by directly updating the timebase instead. (cherry picked from commit b6d8f3b517dec010f3dfad1b33e9945eaa606be5) --- sys/powerpc/aim/aim_machdep.c | 4 +++- sys/powerpc/include/cpu.h | 6 +++++- sys/powerpc/powermac/platform_powermac.c | 13 ++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c index 0ce7cf03403f..b09089069c28 100644 --- a/sys/powerpc/aim/aim_machdep.c +++ b/sys/powerpc/aim/aim_machdep.c @@ -721,8 +721,9 @@ flush_disable_caches(void) mtmsr(msr); } +#ifndef __powerpc64__ void -cpu_sleep() +mpc745x_sleep() { static u_quad_t timebase = 0; static register_t sprgs[4]; @@ -785,3 +786,4 @@ cpu_sleep() enable_vec(curthread); powerpc_sync(); } +#endif diff --git a/sys/powerpc/include/cpu.h b/sys/powerpc/include/cpu.h index 9ae18e13900a..256e6d3eabf0 100644 --- a/sys/powerpc/include/cpu.h +++ b/sys/powerpc/include/cpu.h @@ -144,10 +144,14 @@ extern register_t lpcr; void cpu_halt(void); void cpu_reset(void); -void cpu_sleep(void); void flush_disable_caches(void); void fork_trampoline(void); void swi_vm(void *); int cpu_machine_check(struct thread *, struct trapframe *, int *); + +#ifndef __powerpc64__ +void mpc745x_sleep(void); +#endif + #endif /* _MACHINE_CPU_H_ */ diff --git a/sys/powerpc/powermac/platform_powermac.c b/sys/powerpc/powermac/platform_powermac.c index d08b3fe9181c..7f78bc63c1ab 100644 --- a/sys/powerpc/powermac/platform_powermac.c +++ b/sys/powerpc/powermac/platform_powermac.c @@ -68,7 +68,9 @@ static int powermac_smp_get_bsp(platform_t, struct cpuref *cpuref); static int powermac_smp_start_cpu(platform_t, struct pcpu *cpu); static void powermac_smp_timebase_sync(platform_t, u_long tb, int ap); static void powermac_reset(platform_t); +#ifndef __powerpc64__ static void powermac_sleep(platform_t); +#endif static platform_method_t powermac_methods[] = { PLATFORMMETHOD(platform_probe, powermac_probe), @@ -83,7 +85,9 @@ static platform_method_t powermac_methods[] = { PLATFORMMETHOD(platform_smp_timebase_sync, powermac_smp_timebase_sync), PLATFORMMETHOD(platform_reset, powermac_reset), +#ifndef __powerpc64__ PLATFORMMETHOD(platform_sleep, powermac_sleep), +#endif PLATFORMMETHOD_END }; @@ -404,10 +408,17 @@ powermac_reset(platform_t platform) OF_reboot(); } +#ifndef __powerpc64__ void powermac_sleep(platform_t platform) { + /* Only supports MPC745x for now. */ + if (!MPC745X_P(mfspr(SPR_PVR) >> 16)) { + printf("sleep only supported for G4 PowerMac hardware.\n"); + return; + } *(unsigned long *)0x80 = 0x100; - cpu_sleep(); + mpc745x_sleep(); } +#endif From owner-dev-commits-src-all@freebsd.org Tue Apr 20 04:18:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2002F5E319F; Tue, 20 Apr 2021 04:18: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 4FPVm00KlMz3k9N; Tue, 20 Apr 2021 04:18: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 F0E664188; Tue, 20 Apr 2021 04:18: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 13K4I7ns015910; Tue, 20 Apr 2021 04:18:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K4I7UG015909; Tue, 20 Apr 2021 04:18:07 GMT (envelope-from git) Date: Tue, 20 Apr 2021 04:18:07 GMT Message-Id: <202104200418.13K4I7UG015909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brandon Bergren Subject: git: cf8bf3edf8ee - stable/13 - powerpc/aim: Update timebase directly on resume instead of through platform MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdragon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cf8bf3edf8ee41bcd21336e197a6195d4d455ea9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 04:18:08 -0000 The branch stable/13 has been updated by bdragon: URL: https://cgit.FreeBSD.org/src/commit/?id=cf8bf3edf8ee41bcd21336e197a6195d4d455ea9 commit cf8bf3edf8ee41bcd21336e197a6195d4d455ea9 Author: Justin Hibbits AuthorDate: 2021-03-31 16:54:27 +0000 Commit: Brandon Bergren CommitDate: 2021-04-20 04:13:56 +0000 powerpc/aim: Update timebase directly on resume instead of through platform This only works on single-CPU G4 systems, and more work is needed for dual-CPU systems. That said, platform sleep does not work, and this is currently only used for PMU-based CPU speed change. The elimination of the platform_smp_timebase_sync() call is so that the timebase sync rendezvous can be enhanced to perform better synchronization, which requires a full rendezvous. This would be impossible to do on this single-threaded run. (cherry picked from commit 921716186f121a2f6a27178cb302415f37412a79) --- sys/powerpc/aim/aim_machdep.c | 3 ++- sys/powerpc/aim/mp_cpudep.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c index b09089069c28..784207e9a70d 100644 --- a/sys/powerpc/aim/aim_machdep.c +++ b/sys/powerpc/aim/aim_machdep.c @@ -768,7 +768,8 @@ mpc745x_sleep() while (1) mtmsr(msr); } - platform_smp_timebase_sync(timebase, 0); + /* XXX: The mttb() means this *only* works on single-CPU systems. */ + mttb(timebase); PCPU_SET(curthread, curthread); PCPU_SET(curpcb, curthread->td_pcb); pmap_activate(curthread); diff --git a/sys/powerpc/aim/mp_cpudep.c b/sys/powerpc/aim/mp_cpudep.c index b5931786f8f7..33aae520c4b2 100644 --- a/sys/powerpc/aim/mp_cpudep.c +++ b/sys/powerpc/aim/mp_cpudep.c @@ -311,9 +311,6 @@ cpudep_ap_setup() vers = mfpvr() >> 16; - /* The following is needed for restoring from sleep. */ - platform_smp_timebase_sync(0, 1); - switch(vers) { case IBM970: case IBM970FX: From owner-dev-commits-src-all@freebsd.org Tue Apr 20 05:59:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64D795E5360; Tue, 20 Apr 2021 05:59: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 4FPY0r2Qctz3pK8; Tue, 20 Apr 2021 05:59: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 45D725460; Tue, 20 Apr 2021 05:59: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 13K5xOiw047641; Tue, 20 Apr 2021 05:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K5xOk2047640; Tue, 20 Apr 2021 05:59:24 GMT (envelope-from git) Date: Tue, 20 Apr 2021 05:59:24 GMT Message-Id: <202104200559.13K5xOk2047640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: b94b7f317594 - stable/13 - development(7): mention the Git mirror list in the manual page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b94b7f317594deea9baf4e0fa7036f14adf00954 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 05:59:24 -0000 The branch stable/13 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=b94b7f317594deea9baf4e0fa7036f14adf00954 commit b94b7f317594deea9baf4e0fa7036f14adf00954 Author: Evgeniy Khramtsov AuthorDate: 2021-03-19 12:52:21 +0000 Commit: Li-Wen Hsu CommitDate: 2021-04-20 05:57:04 +0000 development(7): mention the Git mirror list in the manual page MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D29234 (cherry picked from commit 8ef03ce6db330fcc20e800c4d15a9f4915c56c43) --- share/man/man7/development.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 3feb133e0534..032161030f1f 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2021 +.Dd March 19, 2021 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -67,9 +67,9 @@ The push URL is: .Pp .Lk ssh://git@gitrepo.FreeBSD.org/src.git .Pp -There is also a public, read-only GitHub mirror at: +There is also a list of public, read-only Git mirrors at: .Pp -.Lk https://github.com/freebsd/freebsd-src +.Lk https://docs.FreeBSD.org/en/books/handbook/mirrors/#_external_mirrors .Pp The .Ql main From owner-dev-commits-src-all@freebsd.org Tue Apr 20 06:56:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 633025E7078; Tue, 20 Apr 2021 06:56:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPZGw0YBgz3rdk; Tue, 20 Apr 2021 06:56:38 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13K6uZQw069495; Mon, 19 Apr 2021 23:56:35 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13K6uZPZ069494; Mon, 19 Apr 2021 23:56:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104200656.13K6uZPZ069494@gndrsh.dnsmgr.net> Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files In-Reply-To: <202104191829.13JITv1A033527@gitrepo.freebsd.org> To: Jung-uk Kim Date: Mon, 19 Apr 2021 23:56:35 -0700 (PDT) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FPZGw0YBgz3rdk 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 06:56:40 -0000 > The branch main has been updated by jkim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > > commit 686cf5468c4a85c2a6385cdbab2383900876a41d > Author: Jung-uk Kim > AuthorDate: 2021-04-19 18:20:51 +0000 > Commit: Jung-uk Kim > CommitDate: 2021-04-19 18:20:51 +0000 > > flex: Regen bootstrap files > > This also partially reverts r326025 (8a16b7a18f5d). I do not see any > point of adding SPDX tag in generated file. The SPDX identifies the copyright that follows it, so please put this back. > > MFC after: 3 days > Submitted by: Dan McGregor (initial version) > Differential Revision: https://reviews.freebsd.org/D28596 > --- > usr.bin/lex/initparse.c | 17 ++++++++++------- > usr.bin/lex/initparse.h | 1 - > usr.bin/lex/initscan.c | 5 ++++- > usr.bin/lex/initskel.c | 9 ++++----- > 4 files changed, 18 insertions(+), 14 deletions(-) > > diff --git a/usr.bin/lex/initparse.c b/usr.bin/lex/initparse.c > index c723c5b45c40..c95305aa1a91 100644 > --- a/usr.bin/lex/initparse.c > +++ b/usr.bin/lex/initparse.c > @@ -1,4 +1,3 @@ > -/* $FreeBSD$ */ > /* original parser id follows */ > /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ > /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ > @@ -6,7 +5,7 @@ > #define YYBYACC 1 > #define YYMAJOR 1 > #define YYMINOR 9 > -#define YYPATCH 20170430 > +#define YYPATCH 20200330 > > #define YYEMPTY (-1) > #define yyclearin (yychar = YYEMPTY) > @@ -19,8 +18,6 @@ > #define YYPURE 0 > > #line 35 "parse.y" > -/* SPDX-License-Identifier: BSD-2-Clause */ > - > /* Copyright (c) 1990 The Regents of the University of California. */ > /* All rights reserved. */ > > @@ -130,6 +127,10 @@ typedef int YYSTYPE; > # define YYLEX yylex() > #endif > > +#if !(defined(yylex) || defined(YYSTATE)) > +int YYLEX_DECL(); > +#endif > + > /* Parameters sent to yyerror. */ > #ifndef YYERROR_DECL > #define YYERROR_DECL() yyerror(const char *s) > @@ -488,13 +489,15 @@ static const char *const yyrule[] = { > }; > #endif > > +#if YYDEBUG > int yydebug; > -int yynerrs; > +#endif > > int yyerrflag; > int yychar; > YYSTYPE yyval; > YYSTYPE yylval; > +int yynerrs; > > /* define the initial stack-sizes */ > #ifdef YYSTACKSIZE > @@ -655,7 +658,7 @@ void yyerror( const char *msg ) > { > (void)msg; > } > -#line 656 "parse.c" > +#line 662 "parse.c" > > #if YYDEBUG > #include /* needed for printf */ > @@ -1781,7 +1784,7 @@ case 96: > #line 946 "parse.y" > { yyval = mkstate( SYM_EPSILON ); } > break; > -#line 1782 "parse.c" > +#line 1788 "parse.c" > } > yystack.s_mark -= yym; > yystate = *yystack.s_mark; > diff --git a/usr.bin/lex/initparse.h b/usr.bin/lex/initparse.h > index fb0742445d55..b630d282c635 100644 > --- a/usr.bin/lex/initparse.h > +++ b/usr.bin/lex/initparse.h > @@ -1,4 +1,3 @@ > -/* $FreeBSD$ */ > #define CHAR 257 > #define NUMBER 258 > #define SECTEND 259 > diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c > index 46070a4c6dc5..9b6fb4ae5183 100644 > --- a/usr.bin/lex/initscan.c > +++ b/usr.bin/lex/initscan.c > @@ -1,4 +1,3 @@ > -/* $FreeBSD$ */ > > #line 2 "" > > @@ -4578,7 +4577,11 @@ static int yy_get_next_buffer (void) > case EOB_ACT_END_OF_FILE: > { > if ( yywrap( ) ) > +#ifdef YY_FLEX_LEX_COMPAT > return 0; > +#else > + return EOF; > +#endif > > if ( ! (yy_did_buffer_switch_on_eof) ) > YY_NEW_FILE; > diff --git a/usr.bin/lex/initskel.c b/usr.bin/lex/initskel.c > index a7a69875521d..53a0ae452aa8 100644 > --- a/usr.bin/lex/initskel.c > +++ b/usr.bin/lex/initskel.c > @@ -1,4 +1,3 @@ > -/* $FreeBSD$ */ > /* File created from flex.skl via mkskel.sh */ > > #include "flexdef.h" > @@ -448,11 +447,7 @@ const char *skel[] = { > "/* First, we deal with platform-specific or compiler-specific issues. */", > "", > "#if defined(__FreeBSD__)", > - "#ifndef __STDC_LIMIT_MACROS", > - "#define __STDC_LIMIT_MACROS", > - "#endif", > "#include ", > - "#include ", > "#else", > "#define __dead2", > "#endif", > @@ -2301,7 +2296,11 @@ const char *skel[] = { > " case EOB_ACT_END_OF_FILE:", > " {", > " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )", > + "#ifdef YY_FLEX_LEX_COMPAT", > " return 0;", > + "#else", > + " return EOF;", > + "#endif", > "", > " if ( ! YY_G(yy_did_buffer_switch_on_eof) )", > " YY_NEW_FILE;", > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:08:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3D455EAC24; Tue, 20 Apr 2021 08:08: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 4FPbsJ4Y5Rz4QqG; Tue, 20 Apr 2021 08:08: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 8F1246CD7; Tue, 20 Apr 2021 08:08: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 13K884Kp019723; Tue, 20 Apr 2021 08:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K884DI019722; Tue, 20 Apr 2021 08:08:04 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:08:04 GMT Message-Id: <202104200808.13K884DI019722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 643758d2c260 - stable/13 - Explain the newfs naming convention 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 643758d2c26058a153c191128a4f7efe7c6cf820 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:08:04 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=643758d2c26058a153c191128a4f7efe7c6cf820 commit 643758d2c26058a153c191128a4f7efe7c6cf820 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-01-20 10:40:20 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-20 08:07:25 +0000 Explain the newfs naming convention It might be unclear why newfs and newfs_msdos should cross-reference each other. Add a note explaining it. This is a follow-up to 74bd20769706041108a573601cf0b61c755bdc56. Reported by: kib Reviewed by: imp, kib, rpokala MFC after: 3 days (cherry picked from commit 5b9b65e92fb40703038cbcf61feb4616c42e0b6e) --- sbin/newfs/newfs.8 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 0cc1d7ce12cf..5213e4109363 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd January 7, 2021 +.Dd April 17, 2021 .Dt NEWFS 8 .Os .Sh NAME @@ -291,6 +291,14 @@ to find the alternate superblocks if the standard superblock is lost. .It Fl S Ar sector-size The size of a sector in bytes (almost never anything but 512). .El +.Sh NOTES ON THE NAMING +.Dq newfs +is a common name prefix for utilities creating filesystems, with the suffix +indicating the type of the filesystem, for instance +.Xr newfs_msdos 8 . +The +.Nm +utility is a special case which predates that convention. .Sh EXAMPLES .Dl newfs /dev/ada3s1a .Pp From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:21:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F1445EB31A; Tue, 20 Apr 2021 08:21: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 4FPc9K002Rz4Rs3; Tue, 20 Apr 2021 08:21: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 E733072DF; Tue, 20 Apr 2021 08:21: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 13K8Lu8N043472; Tue, 20 Apr 2021 08:21:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K8Lubj043471; Tue, 20 Apr 2021 08:21:56 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:21:56 GMT Message-Id: <202104200821.13K8Lubj043471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5d42c19f1fe2 - stable/12 - Explain the newfs naming convention 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 5d42c19f1fe2f0745869a6b7b269a747f203362c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:21:57 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5d42c19f1fe2f0745869a6b7b269a747f203362c commit 5d42c19f1fe2f0745869a6b7b269a747f203362c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-01-20 10:40:20 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-20 08:21:33 +0000 Explain the newfs naming convention It might be unclear why newfs and newfs_msdos should cross-reference each other. Add a note explaining it. This is a follow-up to 74bd20769706041108a573601cf0b61c755bdc56. Reported by: kib Reviewed by: imp, kib, rpokala MFC after: 3 days (cherry picked from commit 5b9b65e92fb40703038cbcf61feb4616c42e0b6e) --- sbin/newfs/newfs.8 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 985d0557044e..e64bdeb367f4 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd January 29, 2019 +.Dd April 17, 2021 .Dt NEWFS 8 .Os .Sh NAME @@ -291,6 +291,14 @@ to find the alternate superblocks if the standard superblock is lost. .It Fl S Ar sector-size The size of a sector in bytes (almost never anything but 512). .El +.Sh NOTES ON THE NAMING +.Dq newfs +is a common name prefix for utilities creating filesystems, with the suffix +indicating the type of the filesystem, for instance +.Xr newfs_msdos 8 . +The +.Nm +utility is a special case which predates that convention. .Sh EXAMPLES .Dl newfs /dev/ada3s1a .Pp From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:25:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C025EB4F7; Tue, 20 Apr 2021 08:25: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 4FPcFL4m0Vz4Rcf; Tue, 20 Apr 2021 08:25: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 961AD7421; Tue, 20 Apr 2021 08:25: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 13K8PQ4L045500; Tue, 20 Apr 2021 08:25:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K8PQ72045499; Tue, 20 Apr 2021 08:25:26 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:25:26 GMT Message-Id: <202104200825.13K8PQ72045499@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: ca904beafd92 - main - fork.2: Fix a typo in an example 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: ca904beafd925719af998a86cd67a9c787f44255 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:25:26 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ca904beafd925719af998a86cd67a9c787f44255 commit ca904beafd925719af998a86cd67a9c787f44255 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-20 08:24:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-20 08:24:21 +0000 fork.2: Fix a typo in an example Reported by: rpokala MFC with: c4207d867c201a726aa3157e09262f72166c89c4 --- lib/libc/sys/fork.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index d43ade6a483e..9ea0a6afb96f 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 17, 2021 +.Dd April 20, 2021 .Dt FORK 2 .Os .Sh NAME @@ -132,7 +132,7 @@ main(void) .Pp The output of such a program is along the lines of: .Bd -literal -offset indent -Hello from parent (child's PID: 27804)! +Hello from parent process (child's PID: 27804)! Hello from child process! .Ed .Sh ERRORS From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:38:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA0E75EBB37; Tue, 20 Apr 2021 08:38: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 4FPcXt5L9Qz4SK1; Tue, 20 Apr 2021 08:38: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 AA6767962; Tue, 20 Apr 2021 08:38: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 13K8csPs059417; Tue, 20 Apr 2021 08:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K8csEH059416; Tue, 20 Apr 2021 08:38:54 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:38:54 GMT Message-Id: <202104200838.13K8csEH059416@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: ef0ba6bccef3 - main - c.7: Fix some typos 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: ef0ba6bccef34f414f54760747b54ee9ec2f6786 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:38:54 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ef0ba6bccef34f414f54760747b54ee9ec2f6786 commit ef0ba6bccef34f414f54760747b54ee9ec2f6786 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-20 08:33:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-20 08:33:34 +0000 c.7: Fix some typos Those misspellings were not picked up by igor because they are not present in its list of common spelling errors. Reported by: rpokala --- share/man/man7/c.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man7/c.7 b/share/man/man7/c.7 index c9f7fc3c93b3..f8943cd9ca29 100644 --- a/share/man/man7/c.7 +++ b/share/man/man7/c.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2021 +.Dd April 20, 2021 .Dt C 7 .Os .Sh NAME @@ -181,7 +181,7 @@ additional strftime conversion specifiers .El .Pp Later in 2011, the third edition of the standard, ISO/IEC 1989:2011, -commonly reffered to as C11 (formerly C1x), came out and replaced the +commonly referred to as C11 (formerly C1x), came out and replaced the second edition by ISO/IEC 9899:1999/COR1:2001, ISO/IEC 9899:1999/COR2:2004, and ISO/IEC 9899:1999/COR3:2007. The improvements include (but are not limited to) the following: @@ -213,7 +213,7 @@ It incorporates the Technical Corrigendum 1 (ISO/IEC 9899:2011/COR1:2012) which was published in 2012. It addressed defects and deficiencies in C11 without introducing new features, only corrections and clarifications. -Since there were no major changes in C17, the current standrad for +Since there were no major changes in C17, the current standard for Programming Language C, is still considered C11 \(em ISO/IEC 9899:2011, published 2011-12-08. .Pp From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:51:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E7515EC3BC; Tue, 20 Apr 2021 08:51: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 4FPcql2gygz4T0K; Tue, 20 Apr 2021 08:51: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 4F56F75CD; Tue, 20 Apr 2021 08:51: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 13K8plMH080945; Tue, 20 Apr 2021 08:51:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K8plLl080931; Tue, 20 Apr 2021 08:51:47 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:51:47 GMT Message-Id: <202104200851.13K8plLl080931@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: 6bc0bb2936a4 - main - Enable GitHub actions CI for stable/13 as well 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: 6bc0bb2936a41674bc992887ba17fddfa928ac90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:51:47 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6bc0bb2936a41674bc992887ba17fddfa928ac90 commit 6bc0bb2936a41674bc992887ba17fddfa928ac90 Author: Alex Richardson AuthorDate: 2021-04-20 08:50:36 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 08:51:33 +0000 Enable GitHub actions CI for stable/13 as well All cross-building patches have been merged to stable/13 so it should also build fine on macOS+Linux. Reviewed By: uqs MFC after: immediately Differential Revision: https://reviews.freebsd.org/D29831 --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 65db86de3a97..f002cb0fbbe2 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -2,7 +2,7 @@ name: Cross-build Kernel on: push: - branches: [ main ] + branches: [ main, 'stable/13' ] pull_request: branches: [ main ] From owner-dev-commits-src-all@freebsd.org Tue Apr 20 08:52:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AE385EC4A2; Tue, 20 Apr 2021 08:52: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 4FPcrc43Sqz4T5t; Tue, 20 Apr 2021 08:52: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 7E25E747A; Tue, 20 Apr 2021 08:52: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 13K8qWIT084939; Tue, 20 Apr 2021 08:52:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K8qWW2084938; Tue, 20 Apr 2021 08:52:32 GMT (envelope-from git) Date: Tue, 20 Apr 2021 08:52:32 GMT Message-Id: <202104200852.13K8qWW2084938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: b24f2d6d34e4 - stable/13 - Enable GitHub actions CI for stable/13 as well 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b24f2d6d34e48705c3c3e0cd58e8ebfdd2ef7c4f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 08:52:32 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b24f2d6d34e48705c3c3e0cd58e8ebfdd2ef7c4f commit b24f2d6d34e48705c3c3e0cd58e8ebfdd2ef7c4f Author: Alex Richardson AuthorDate: 2021-04-20 08:50:36 +0000 Commit: Alex Richardson CommitDate: 2021-04-20 08:52:11 +0000 Enable GitHub actions CI for stable/13 as well All cross-building patches have been merged to stable/13 so it should also build fine on macOS+Linux. Reviewed By: uqs MFC after: immediately Differential Revision: https://reviews.freebsd.org/D29831 (cherry picked from commit 6bc0bb2936a41674bc992887ba17fddfa928ac90) --- .github/workflows/cross-bootstrap-tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-bootstrap-tools.yml b/.github/workflows/cross-bootstrap-tools.yml index 65db86de3a97..f002cb0fbbe2 100644 --- a/.github/workflows/cross-bootstrap-tools.yml +++ b/.github/workflows/cross-bootstrap-tools.yml @@ -2,7 +2,7 @@ name: Cross-build Kernel on: push: - branches: [ main ] + branches: [ main, 'stable/13' ] pull_request: branches: [ main ] From owner-dev-commits-src-all@freebsd.org Tue Apr 20 09:22:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A081E5ED916; Tue, 20 Apr 2021 09:22: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 4FPdVt49zgz4Vmg; Tue, 20 Apr 2021 09:22: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 781611015A; Tue, 20 Apr 2021 09:22: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 13K9ME3o022602; Tue, 20 Apr 2021 09:22:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13K9ME2h022601; Tue, 20 Apr 2021 09:22:14 GMT (envelope-from git) Date: Tue, 20 Apr 2021 09:22:14 GMT Message-Id: <202104200922.13K9ME2h022601@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: 33f8d79d7652 - main - assert.3: Document static_assert and _Static_assert 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: 33f8d79d765230e3189876dec9f0dad2d768de1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 09:22:14 -0000 The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=33f8d79d765230e3189876dec9f0dad2d768de1a commit 33f8d79d765230e3189876dec9f0dad2d768de1a Author: Faraz Vahedi AuthorDate: 2021-04-20 08:50:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-20 09:17:44 +0000 assert.3: Document static_assert and _Static_assert Reviewed by: imp, 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29833 --- share/man/man3/Makefile | 1 + share/man/man3/assert.3 | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index d33c0d63ea0d..ea82f04c7825 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -72,6 +72,7 @@ MLINKS= arb.3 ARB8_ENTRY.3 \ arb.3 ARB_RIGHT.3 \ arb.3 ARB_RIGHTIDX.3 \ arb.3 ARB_ROOT.3 +MLINKS+= assert.3 static_assert.3 MLINKS+= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ diff --git a/share/man/man3/assert.3 b/share/man/man3/assert.3 index 8bdf076233c8..cc23f96360f0 100644 --- a/share/man/man3/assert.3 +++ b/share/man/man3/assert.3 @@ -28,15 +28,18 @@ .\" @(#)assert.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd May 31, 2018 +.Dd April 20, 2021 .Dt ASSERT 3 .Os .Sh NAME -.Nm assert +.Nm assert , +.Nm static_assert .Nd expression verification macro .Sh SYNOPSIS .In assert.h .Fn assert expression +.Fn static_assert expression +.Fn static_assert expression message .Sh DESCRIPTION The .Fn assert @@ -81,6 +84,21 @@ The macro should only be used for ensuring the developer's expectations hold true. It is not appropriate for regular run-time error detection. +.Pp +The +.Fn static_assert +macro expands to +.Fn _Static_assert , +and, contrarily to +.Fn assert , +makes assertions at compile-time. +Once the constraint is violated, the compiler produces a diagnostic +message including the string literal message, if provided. +The initial form of the +.Fn _Static_assert +containing a string literal message was introduced in C11 standard, and +the other form with no string literal is to be implemented by C2x and +some compilers may lack its adoption at present. .Sh EXAMPLES The assertion: .Dl "assert(1 == 0);" @@ -95,14 +113,29 @@ indicate a bug. Second, the code will disappear if .Dv NDEBUG is defined, changing the semantics of the program. +.Pp +The following asserts that the size of the S structure is 16. +Otherwise, it produces a diagnostic message which points at the +constraint and includes the provided string literal: +.Dl "static_assert(sizeof(struct S) == 16, ""size mismatch"");" +If none is provided, it only points at the constraint. .Sh SEE ALSO .Xr abort2 2 , .Xr abort 3 .Sh STANDARDS +.Rs The .Fn assert macro conforms to .St -isoC-99 . +.Re +.Pp +.Rs +The +.Fn static_assert +macro conforms to +.St -isoC-2011 . +.Re .Sh HISTORY An .Nm From owner-dev-commits-src-all@freebsd.org Tue Apr 20 09:58:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B2ED5EEBBB; Tue, 20 Apr 2021 09:58:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPfJz2cXjz4XSv; Tue, 20 Apr 2021 09:58:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13K9wXDZ014654 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 20 Apr 2021 12:58:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13K9wXDZ014654 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13K9wXHG014653; Tue, 20 Apr 2021 12:58:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Apr 2021 12:58:33 +0300 From: Konstantin Belousov To: Mateusz Piotrowski <0mp@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c4207d867c20 - main - fork.2: Add a simple use pattern Message-ID: References: <202104172113.13HLD6UI014137@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202104172113.13HLD6UI014137@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FPfJz2cXjz4XSv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-1.51 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; 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]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.49)[0.487]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RBL_SENDERSCORE_FAIL(0.00)[2001:470:d5e7:1::1:server fail]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 09:58:45 -0000 On Sat, Apr 17, 2021 at 09:13:06PM +0000, Mateusz Piotrowski wrote: > The branch main has been updated by 0mp (doc, ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=c4207d867c201a726aa3157e09262f72166c89c4 > > commit c4207d867c201a726aa3157e09262f72166c89c4 > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > AuthorDate: 2021-04-17 21:10:48 +0000 > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > CommitDate: 2021-04-17 21:12:06 +0000 > > fork.2: Add a simple use pattern > > It seems to be a nice idea to show how fork() is usually used in > practice. This may act as a guide to developers who want to quickly > recall how to use the fork() function. > > Reviewed by: bcr, yuripv > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D27626 > --- > lib/libc/sys/fork.2 | 38 +++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > > diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 > index 3e55530827c5..d43ade6a483e 100644 > --- a/lib/libc/sys/fork.2 > +++ b/lib/libc/sys/fork.2 > @@ -28,7 +28,7 @@ > .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" > -.Dd December 1, 2017 > +.Dd April 17, 2021 > .Dt FORK 2 > .Os > .Sh NAME > @@ -99,6 +99,42 @@ to the parent process, no child process is created, and the global > variable > .Va errno > is set to indicate the error. > +.Sh EXAMPLES > +The following example shows a common pattern of how > +.Fn fork > +is used in practice. > +.Bd -literal -offset indent > +#include > +#include > +#include > +#include > + > +int > +main(void) > +{ > + pid_t pid; > + > + switch (pid = fork()) { > + case -1: > + err(1, "Failed to fork"); > + case 0: > + printf("Hello from child process!\en"); > + exit(0); > + default: > + break; > + } > + > + printf("Hello from parent process (child's PID: %d)!\en", pid); > + > + return (0); > +} > +.Ed > +.Pp > +The output of such a program is along the lines of: > +.Bd -literal -offset indent > +Hello from parent (child's PID: 27804)! > +Hello from child process! > +.Ed > .Sh ERRORS > The > .Fn fork Using printf around fork is not the best idea, and definitely should not be provided as a guiding example in the man page. Using stdio safely around fork() requires at least flushing buffers and ensuring that opened FILEs are in some consistent state right at fork. It would work by chance in your example, mostly because you did not used anything in stdio before fork, but any further changes would result in very puzzling bugs (for beginners, who are the target of this example). From owner-dev-commits-src-all@freebsd.org Tue Apr 20 11:22:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 223575F125B; Tue, 20 Apr 2021 11:22: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 4FPhBB0Wpdz4cPP; Tue, 20 Apr 2021 11:22: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 04D8811DB1; Tue, 20 Apr 2021 11:22: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 13KBMvOA086447; Tue, 20 Apr 2021 11:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KBMvEk086446; Tue, 20 Apr 2021 11:22:57 GMT (envelope-from git) Date: Tue, 20 Apr 2021 11:22:57 GMT Message-Id: <202104201122.13KBMvEk086446@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: 586aab9e0aa6 - main - pf: Refactor state killing 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: 586aab9e0aa6c811758c19fb03831fc1e7305252 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 11:22:58 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=586aab9e0aa6c811758c19fb03831fc1e7305252 commit 586aab9e0aa6c811758c19fb03831fc1e7305252 Author: Kristof Provost AuthorDate: 2021-04-16 14:34:21 +0000 Commit: Kristof Provost CommitDate: 2021-04-20 07:30:23 +0000 pf: Refactor state killing Extract the state killing code from pfioctl() and rephrase the filtering conditions for readability. No functional change intended. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29795 --- sys/netpfil/pf/pf_ioctl.c | 122 ++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 917501163264..6158a6c9b0c6 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2522,6 +2522,72 @@ errout_unlocked: return (error); } +static int +pf_killstates_row(struct pfioc_state_kill *psk, struct pf_idhash *ih) +{ + struct pf_state *s; + struct pf_state_key *sk; + struct pf_addr *srcaddr, *dstaddr; + int killed = 0; + u_int16_t srcport, dstport; + +relock_DIOCKILLSTATES: + PF_HASHROW_LOCK(ih); + LIST_FOREACH(s, &ih->states, entry) { + sk = s->key[PF_SK_WIRE]; + if (s->direction == PF_OUT) { + srcaddr = &sk->addr[1]; + dstaddr = &sk->addr[0]; + srcport = sk->port[1]; + dstport = sk->port[0]; + } else { + srcaddr = &sk->addr[0]; + dstaddr = &sk->addr[1]; + srcport = sk->port[0]; + dstport = sk->port[1]; + } + + if (psk->psk_af && sk->af != psk->psk_af) + continue; + + if (psk->psk_proto && psk->psk_proto != sk->proto) + continue; + + if (! PF_MATCHA(psk->psk_src.neg, &psk->psk_src.addr.v.a.addr, + &psk->psk_src.addr.v.a.mask, srcaddr, sk->af)) + continue; + + if (! PF_MATCHA(psk->psk_dst.neg, &psk->psk_dst.addr.v.a.addr, + &psk->psk_dst.addr.v.a.mask, dstaddr, sk->af)) + continue; + + if (psk->psk_src.port_op != 0 && + ! pf_match_port(psk->psk_src.port_op, + psk->psk_src.port[0], psk->psk_src.port[1], srcport)) + continue; + + if (psk->psk_dst.port_op != 0 && + ! pf_match_port(psk->psk_dst.port_op, + psk->psk_dst.port[0], psk->psk_dst.port[1], dstport)) + continue; + + if (psk->psk_label[0] && (! s->rule.ptr->label[0] || + strcmp(psk->psk_label, s->rule.ptr->label))) + continue; + + if (psk->psk_ifname[0] && strcmp(psk->psk_ifname, + s->kif->pfik_name)) + continue; + + pf_unlink_state(s, PF_ENTER_LOCKED); + killed++; + goto relock_DIOCKILLSTATES; + } + PF_HASHROW_UNLOCK(ih); + + return (killed); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -3218,9 +3284,6 @@ relock_DIOCCLRSTATES: case DIOCKILLSTATES: { struct pf_state *s; - struct pf_state_key *sk; - struct pf_addr *srcaddr, *dstaddr; - u_int16_t srcport, dstport; struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; u_int i, killed = 0; @@ -3235,58 +3298,9 @@ relock_DIOCCLRSTATES: break; } - for (i = 0; i <= pf_hashmask; i++) { - struct pf_idhash *ih = &V_pf_idhash[i]; + for (i = 0; i <= pf_hashmask; i++) + killed += pf_killstates_row(psk, &V_pf_idhash[i]); -relock_DIOCKILLSTATES: - PF_HASHROW_LOCK(ih); - LIST_FOREACH(s, &ih->states, entry) { - sk = s->key[PF_SK_WIRE]; - if (s->direction == PF_OUT) { - srcaddr = &sk->addr[1]; - dstaddr = &sk->addr[0]; - srcport = sk->port[1]; - dstport = sk->port[0]; - } else { - srcaddr = &sk->addr[0]; - dstaddr = &sk->addr[1]; - srcport = sk->port[0]; - dstport = sk->port[1]; - } - - if ((!psk->psk_af || sk->af == psk->psk_af) - && (!psk->psk_proto || psk->psk_proto == - sk->proto) && - PF_MATCHA(psk->psk_src.neg, - &psk->psk_src.addr.v.a.addr, - &psk->psk_src.addr.v.a.mask, - srcaddr, sk->af) && - PF_MATCHA(psk->psk_dst.neg, - &psk->psk_dst.addr.v.a.addr, - &psk->psk_dst.addr.v.a.mask, - dstaddr, sk->af) && - (psk->psk_src.port_op == 0 || - pf_match_port(psk->psk_src.port_op, - psk->psk_src.port[0], psk->psk_src.port[1], - srcport)) && - (psk->psk_dst.port_op == 0 || - pf_match_port(psk->psk_dst.port_op, - psk->psk_dst.port[0], psk->psk_dst.port[1], - dstport)) && - (!psk->psk_label[0] || - (s->rule.ptr->label[0] && - !strcmp(psk->psk_label, - s->rule.ptr->label))) && - (!psk->psk_ifname[0] || - !strcmp(psk->psk_ifname, - s->kif->pfik_name))) { - pf_unlink_state(s, PF_ENTER_LOCKED); - killed++; - goto relock_DIOCKILLSTATES; - } - } - PF_HASHROW_UNLOCK(ih); - } psk->psk_killed = killed; break; } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 11:22:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E8A25F171F; Tue, 20 Apr 2021 11:22: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 4FPhBC0lcNz4c7Q; Tue, 20 Apr 2021 11:22: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 0D18712082; Tue, 20 Apr 2021 11:22: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 13KBMwfx086474; Tue, 20 Apr 2021 11:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KBMwMl086473; Tue, 20 Apr 2021 11:22:58 GMT (envelope-from git) Date: Tue, 20 Apr 2021 11:22:58 GMT Message-Id: <202104201122.13KBMwMl086473@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: 065b5c7fb26e - main - pf tests: Test cases for the 'kill state(s)' feature 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: 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 11:22:59 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=065b5c7fb26eb4239e9bd513dde5a55ef78e45c4 commit 065b5c7fb26eb4239e9bd513dde5a55ef78e45c4 Author: Kristof Provost AuthorDate: 2021-04-16 15:33:17 +0000 Commit: Kristof Provost CommitDate: 2021-04-20 07:30:27 +0000 pf tests: Test cases for the 'kill state(s)' feature MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29796 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/killstate.sh | 175 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 5cf11da76faf..2478cefbc4a6 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -12,6 +12,7 @@ ATF_TESTS_SH+= altq \ forward \ fragmentation \ icmp \ + killstate \ map_e \ names \ nat \ diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh new file mode 100644 index 000000000000..994ce130a814 --- /dev/null +++ b/tests/sys/netpfil/pf/killstate.sh @@ -0,0 +1,175 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'Test killing states by IPv4 address' + atf_set require.user root + atf_set require.progs scapy +} + +v4_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "block all" \ + "pass in proto icmp" + + # Sanity check & establish state + # Note: use pft_ping so we always use the same ID, so pf considers all + # echo requests part of the same flow. + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Change rules to now deny the ICMP traffic + pft_set_rules noflush alcatraz "block all" + + # Established state means we can still ping alcatraz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with the wrong IP doesn't affect our state + jexec alcatraz pfctl -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with one correct address and one incorrect doesn't kill the state + jexec alcatraz pfctl -k 192.0.2.1 -k 192.0.2.3 + + # So we can still ping + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing with correct address does remove the state + jexec alcatraz pfctl -k 192.0.2.1 + + # Now the ping fails + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "label" "cleanup" +label_head() +{ + atf_set descr 'Test killing states by label' + atf_set require.user root + atf_set require.progs scapy +} + +label_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "block all" \ + "pass in proto tcp label bar" \ + "pass in proto icmp label foo" + + # Sanity check & establish state + # Note: use pft_ping so we always use the same ID, so pf considers all + # echo requests part of the same flow. + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Change rules to now deny the ICMP traffic + pft_set_rules noflush alcatraz "block all" + + # Established state means we can still ping alcatraz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing a label on a different rules keeps the state + jexec alcatraz pfctl -k label -k bar + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing a non-existing label keeps the state + jexec alcatraz pfctl -k label -k baz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a + + # Killing the correct label kills the state + jexec alcatraz pfctl -k label -k foo + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 192.0.2.2 \ + --replyif ${epair}a +} + +label_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" + atf_add_test_case "label" +} From owner-dev-commits-src-all@freebsd.org Tue Apr 20 11:23:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3EF85F152B; Tue, 20 Apr 2021 11:23: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 4FPhBD3ZW6z4c7b; Tue, 20 Apr 2021 11:23: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 4DC6E11CE7; Tue, 20 Apr 2021 11:23: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 13KBN0VO086496; Tue, 20 Apr 2021 11:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KBN09Z086495; Tue, 20 Apr 2021 11:23:00 GMT (envelope-from git) Date: Tue, 20 Apr 2021 11:23:00 GMT Message-Id: <202104201123.13KBN09Z086495@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: 9af2317423f3 - main - pf tests: IPv6 test case for the 'kill state(s)' feature 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: 9af2317423f399b30ff028e078d01eef553efc7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 11:23:00 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9af2317423f399b30ff028e078d01eef553efc7f commit 9af2317423f399b30ff028e078d01eef553efc7f Author: Kristof Provost AuthorDate: 2021-04-16 15:47:47 +0000 Commit: Kristof Provost CommitDate: 2021-04-20 07:30:39 +0000 pf tests: IPv6 test case for the 'kill state(s)' feature Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29797 --- tests/sys/netpfil/common/pft_ping.py | 28 +++++++++++++- tests/sys/netpfil/pf/killstate.sh | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 916a019d2f4a..de673f026c77 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -116,7 +116,10 @@ def check_ping6_request(args, packet): return True def check_ping_reply(args, packet): - return check_ping4_reply(args, packet) + if args.ip6: + return check_ping6_reply(args, packet) + else: + return check_ping4_reply(args, packet) def check_ping4_reply(args, packet): """ @@ -144,6 +147,29 @@ def check_ping4_reply(args, packet): return True +def check_ping6_reply(args, packet): + """ + Check that this is a reply to the ping request we sent + """ + dst_ip = args.to[0] + + ip = packet.getlayer(sp.IPv6) + if not ip: + return False + if ip.src != dst_ip: + return False + + icmp = packet.getlayer(sp.ICMPv6EchoReply) + if not icmp: + print("No echo reply!") + return False + + if icmp.data != PAYLOAD_MAGIC: + print("data mismatch") + return False + + return True + def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index 994ce130a814..d54858d5452c 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -101,6 +101,78 @@ v4_cleanup() pft_cleanup } +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Test killing states by IPv6 address' + atf_set require.user root + atf_set require.progs scapy +} + +v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::1/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::2/64 up no_dad + jexec alcatraz pfctl -e + + pft_set_rules alcatraz "block all" \ + "pass in proto icmp6" + + # Sanity check & establish state + # Note: use pft_ping so we always use the same ID, so pf considers all + # echo requests part of the same flow. + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Change rules to now deny the ICMP traffic + pft_set_rules noflush alcatraz "block all" + + # Established state means we can still ping alcatraz + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with the wrong IP doesn't affect our state + jexec alcatraz pfctl -k 2001:db8::3 + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with one correct address and one incorrect doesn't kill the state + jexec alcatraz pfctl -k 2001:db8::1 -k 2001:db8::3 + atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + + # Killing with correct address does remove the state + jexec alcatraz pfctl -k 2001:db8::1 + atf_check -s exit:1 -o ignore ${common_dir}/pft_ping.py \ + --ip6 \ + --sendif ${epair}a \ + --to 2001:db8::2 \ + --replyif ${epair}a + +} + +v6_cleanup() +{ + pft_cleanup +} + atf_test_case "label" "cleanup" label_head() { @@ -171,5 +243,6 @@ label_cleanup() atf_init_test_cases() { atf_add_test_case "v4" + atf_add_test_case "v6" atf_add_test_case "label" } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 11:36:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E165F5F1964; Tue, 20 Apr 2021 11: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 4FPhVM64VLz4ckB; Tue, 20 Apr 2021 11:36: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 C35A611F6C; Tue, 20 Apr 2021 11:36: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 13KBaxXJ000171; Tue, 20 Apr 2021 11:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KBaxeL000170; Tue, 20 Apr 2021 11:36:59 GMT (envelope-from git) Date: Tue, 20 Apr 2021 11:36:59 GMT Message-Id: <202104201136.13KBaxeL000170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 3dbd5ecfe887 - main - Add myself (khng) as src committer. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dbd5ecfe8872c19483f1ce767efeaa7a118fe26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 11:36:59 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=3dbd5ecfe8872c19483f1ce767efeaa7a118fe26 commit 3dbd5ecfe8872c19483f1ce767efeaa7a118fe26 Author: Ka Ho Ng AuthorDate: 2021-04-20 11:27:52 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-20 11:33:36 +0000 Add myself (khng) as src committer. Approved by: lwhsu (mentor), philip (mentor) --- share/misc/committers-src.dot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 46df10579784..ba9df7968c53 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -237,6 +237,7 @@ ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevans [label="Kyle Evans\nkevans@FreeBSD.org\n2017/06/20"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] +khng [label="Ka Ho Ng\nkhng@FreeBSD.org\n2021/03/15"] kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kibab [label="Ilya Bakulin\nkibab@FreeBSD.org\n2017/09/02"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] @@ -711,6 +712,8 @@ kmacy -> lstewart kp -> donner kp -> nick +lwhsu -> khng + marcel -> allanjude marcel -> art marcel -> arun @@ -785,6 +788,7 @@ philip -> benl philip -> donner philip -> ed philip -> jls +philip -> khng philip -> matteo philip -> uqs philip -> kp From owner-dev-commits-src-all@freebsd.org Tue Apr 20 11:41:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C220F5F1FD6; Tue, 20 Apr 2021 11:41: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 4FPhbn58lVz4d4W; Tue, 20 Apr 2021 11:41: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 A41D5121C7; Tue, 20 Apr 2021 11:41: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 13KBffo2010485; Tue, 20 Apr 2021 11:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KBffDT010483; Tue, 20 Apr 2021 11:41:41 GMT (envelope-from git) Date: Tue, 20 Apr 2021 11:41:41 GMT Message-Id: <202104201141.13KBffDT010483@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: 9ca874cf740e - main - Add TCP LRO support for VLAN and VxLAN. 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: 9ca874cf740ee68c5742df8b5f9e20910085c011 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 11:41:41 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9ca874cf740ee68c5742df8b5f9e20910085c011 commit 9ca874cf740ee68c5742df8b5f9e20910085c011 Author: Hans Petter Selasky AuthorDate: 2021-03-31 10:36:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-20 11:36:22 +0000 Add TCP LRO support for VLAN and VxLAN. This change makes the TCP LRO code more generic and flexible with regards to supporting multiple different TCP encapsulation protocols and in general lays the ground for broader TCP LRO support. The main job of the TCP LRO code is to merge TCP packets for the same flow, to reduce the number of calls to upper layers. This reduces CPU and increases performance, due to being able to send larger TSO offloaded data chunks at a time. Basically the TCP LRO makes it possible to avoid per-packet interaction by the host CPU. Because the current TCP LRO code was tightly bound and optimized for TCP/IP over ethernet only, several larger changes were needed. Also a minor bug was fixed in the flushing mechanism for inactive entries, where the expire time, "le->mtime" was not always properly set. To avoid having to re-run time consuming regression tests for every change, it was chosen to squash the following list of changes into a single commit: - Refactor parsing of all address information into the "lro_parser" structure. This easily allows to reuse parsing code for inner headers. - Speedup header data comparison. Don't compare field by field, but instead use an unsigned long array, where the fields get packed. - Refactor the IPv4/TCP/UDP checksum computations, so that they may be computed recursivly, only applying deltas as the result of updating payload data. - Make smaller inline functions doing one operation at a time instead of big functions having repeated code. - Refactor the TCP ACK compression code to only execute once per TCP LRO flush. This gives a minor performance improvement and keeps the code simple. - Use sbintime() for all time-keeping. This change also fixes flushing of inactive entries. - Try to shrink the size of the LRO entry, because it is frequently zeroed. - Removed unused TCP LRO macros. - Cleanup unused TCP LRO statistics counters while at it. - Try to use __predict_true() and predict_false() to optimise CPU branch predictions. Bump the __FreeBSD_version due to changing the "lro_ctrl" structure. Tested by: Netflix Reviewed by: rrs (transport) Differential Revision: https://reviews.freebsd.org/D29564 MFC after: 2 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_lro.c | 2282 ++++++++++++++++++++++-------------------------- sys/netinet/tcp_lro.h | 124 +-- sys/netinet/tcp_subr.c | 5 - sys/netinet/tcp_var.h | 5 - sys/sys/mbuf.h | 7 +- sys/sys/param.h | 2 +- 6 files changed, 1107 insertions(+), 1318 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 62f6ad57c0f5..61c6f218e513 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -4,7 +4,7 @@ * Copyright (c) 2007, Myricom Inc. * Copyright (c) 2008, Intel Corporation. * Copyright (c) 2012 The FreeBSD Foundation - * Copyright (c) 2016 Mellanox Technologies. + * Copyright (c) 2016-2021 Mellanox Technologies. * All rights reserved. * * Portions of this software were developed by Bjoern Zeeb @@ -68,39 +68,39 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include static MALLOC_DEFINE(M_LRO, "LRO", "LRO control structures"); -#define TCP_LRO_UPDATE_CSUM 1 -#ifndef TCP_LRO_UPDATE_CSUM -#define TCP_LRO_INVALID_CSUM 0x0000 -#endif +#define TCP_LRO_TS_OPTION \ + ntohl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | \ + (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP) static void tcp_lro_rx_done(struct lro_ctrl *lc); -static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, - uint32_t csum, int use_hash); +static int tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, + uint32_t csum, bool use_hash); + +#ifdef TCPHPTS +static bool do_bpf_strip_and_compress(struct inpcb *, struct lro_ctrl *, + struct lro_entry *, struct mbuf **, struct mbuf **, struct mbuf **, bool *, bool); + +#endif SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP LRO"); -static long tcplro_stacks_wanting_mbufq = 0; +static long tcplro_stacks_wanting_mbufq; counter_u64_t tcp_inp_lro_direct_queue; counter_u64_t tcp_inp_lro_wokeup_queue; counter_u64_t tcp_inp_lro_compressed; -counter_u64_t tcp_inp_lro_single_push; counter_u64_t tcp_inp_lro_locks_taken; -counter_u64_t tcp_inp_lro_sack_wake; counter_u64_t tcp_extra_mbuf; counter_u64_t tcp_would_have_but; counter_u64_t tcp_comp_total; counter_u64_t tcp_uncomp_total; -counter_u64_t tcp_csum_hardware; -counter_u64_t tcp_csum_hardware_w_ph; -counter_u64_t tcp_csum_software; - static unsigned tcp_lro_entries = TCP_LRO_ENTRIES; SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, @@ -113,28 +113,16 @@ SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, wokeup, CTLFLAG_RD, &tcp_inp_lro_wokeup_queue, "Number of lro's where we woke up transport via hpts"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, compressed, CTLFLAG_RD, &tcp_inp_lro_compressed, "Number of lro's compressed and sent to transport"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, single, CTLFLAG_RD, - &tcp_inp_lro_single_push, "Number of lro's sent with single segment"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, lockcnt, CTLFLAG_RD, &tcp_inp_lro_locks_taken, "Number of lro's inp_wlocks taken"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, sackwakeups, CTLFLAG_RD, - &tcp_inp_lro_sack_wake, "Number of wakeups caused by sack/fin"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, extra_mbuf, CTLFLAG_RD, &tcp_extra_mbuf, "Number of times we had an extra compressed ack dropped into the tp"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, would_have_but, CTLFLAG_RD, - &tcp_would_have_but, "Number of times we would have had an extra compressed but out of room"); + &tcp_would_have_but, "Number of times we would have had an extra compressed, but mget failed"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, with_m_ackcmp, CTLFLAG_RD, &tcp_comp_total, "Number of mbufs queued with M_ACKCMP flags set"); SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, without_m_ackcmp, CTLFLAG_RD, &tcp_uncomp_total, "Number of mbufs queued without M_ACKCMP"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, csum_hw, CTLFLAG_RD, - &tcp_csum_hardware, "Number of checksums processed in hardware"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, csum_hw_ph, CTLFLAG_RD, - &tcp_csum_hardware_w_ph, "Number of checksums processed in hardware with pseudo header"); -SYSCTL_COUNTER_U64(_net_inet_tcp_lro, OID_AUTO, csum_sw, CTLFLAG_RD, - &tcp_csum_software, "Number of checksums processed in software"); - - void tcp_lro_reg_mbufq(void) @@ -226,34 +214,230 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, return (0); } -static struct tcphdr * -tcp_lro_get_th(struct lro_entry *le, struct mbuf *m) +struct vxlan_header { + uint32_t vxlh_flags; + uint32_t vxlh_vni; +}; + +static inline void * +tcp_lro_low_level_parser(void *ptr, struct lro_parser *parser, bool update_data, bool is_vxlan) { - struct ether_header *eh; - struct tcphdr *th = NULL; -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ -#endif + const struct ether_vlan_header *eh; + void *old; + uint16_t eth_type; + + if (update_data) + memset(parser, 0, sizeof(*parser)); + + old = ptr; + + if (is_vxlan) { + const struct vxlan_header *vxh; + vxh = ptr; + ptr = (uint8_t *)ptr + sizeof(*vxh); + if (update_data) { + parser->data.vxlan_vni = + vxh->vxlh_vni & htonl(0xffffff00); + } + } + + eh = ptr; + if (__predict_false(eh->evl_encap_proto == htons(ETHERTYPE_VLAN))) { + eth_type = eh->evl_proto; + if (update_data) { + /* strip priority and keep VLAN ID only */ + parser->data.vlan_id = eh->evl_tag & htons(EVL_VLID_MASK); + } + /* advance to next header */ + ptr = (uint8_t *)ptr + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + } else { + eth_type = eh->evl_encap_proto; + /* advance to next header */ + ptr = (uint8_t *)ptr + ETHER_HDR_LEN; + } + + switch (eth_type) { #ifdef INET - struct ip *ip4 = NULL; /* Keep compiler happy. */ + case htons(ETHERTYPE_IP): + parser->ip4 = ptr; + /* Ensure there are no IPv4 options. */ + if ((parser->ip4->ip_hl << 2) != sizeof (*parser->ip4)) + break; + /* .. and the packet is not fragmented. */ + if (parser->ip4->ip_off & htons(IP_MF|IP_OFFMASK)) + break; + ptr = (uint8_t *)ptr + (parser->ip4->ip_hl << 2); + if (update_data) { + parser->data.s_addr.v4 = parser->ip4->ip_src; + parser->data.d_addr.v4 = parser->ip4->ip_dst; + } + switch (parser->ip4->ip_p) { + case IPPROTO_UDP: + parser->udp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV4_UDP; + parser->data.s_port = parser->udp->uh_sport; + parser->data.d_port = parser->udp->uh_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV4_UDP); + } + ptr = ((uint8_t *)ptr + sizeof(*parser->udp)); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + case IPPROTO_TCP: + parser->tcp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV4_TCP; + parser->data.s_port = parser->tcp->th_sport; + parser->data.d_port = parser->tcp->th_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV4_TCP); + } + ptr = (uint8_t *)ptr + (parser->tcp->th_off << 2); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + default: + break; + } + break; #endif - - eh = mtod(m, struct ether_header *); - switch (le->eh_type) { #ifdef INET6 - case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(eh + 1); - th = (struct tcphdr *)(ip6 + 1); + case htons(ETHERTYPE_IPV6): + parser->ip6 = ptr; + ptr = (uint8_t *)ptr + sizeof(*parser->ip6); + if (update_data) { + parser->data.s_addr.v6 = parser->ip6->ip6_src; + parser->data.d_addr.v6 = parser->ip6->ip6_dst; + } + switch (parser->ip6->ip6_nxt) { + case IPPROTO_UDP: + parser->udp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV6_UDP; + parser->data.s_port = parser->udp->uh_sport; + parser->data.d_port = parser->udp->uh_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV6_UDP); + } + ptr = (uint8_t *)ptr + sizeof(*parser->udp); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + case IPPROTO_TCP: + parser->tcp = ptr; + if (update_data) { + parser->data.lro_type = LRO_TYPE_IPV6_TCP; + parser->data.s_port = parser->tcp->th_sport; + parser->data.d_port = parser->tcp->th_dport; + } else { + MPASS(parser->data.lro_type == LRO_TYPE_IPV6_TCP); + } + ptr = (uint8_t *)ptr + (parser->tcp->th_off << 2); + parser->total_hdr_len = (uint8_t *)ptr - (uint8_t *)old; + return (ptr); + default: + break; + } break; #endif + default: + break; + } + /* Invalid packet - cannot parse */ + return (NULL); +} + +static const int vxlan_csum = CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID; + +static inline struct lro_parser * +tcp_lro_parser(struct mbuf *m, struct lro_parser *po, struct lro_parser *pi, bool update_data) +{ + void *data_ptr; + + /* Try to parse outer headers first. */ + data_ptr = tcp_lro_low_level_parser(m->m_data, po, update_data, false); + if (data_ptr == NULL || po->total_hdr_len > m->m_len) + return (NULL); + + if (update_data) { + /* Store VLAN ID, if any. */ + if (__predict_false(m->m_flags & M_VLANTAG)) { + po->data.vlan_id = + htons(m->m_pkthdr.ether_vtag) & htons(EVL_VLID_MASK); + } + } + + switch (po->data.lro_type) { + case LRO_TYPE_IPV4_UDP: + case LRO_TYPE_IPV6_UDP: + /* Check for VXLAN headers. */ + if ((m->m_pkthdr.csum_flags & vxlan_csum) != vxlan_csum) + break; + + /* Try to parse inner headers. */ + data_ptr = tcp_lro_low_level_parser(data_ptr, pi, update_data, true); + if (data_ptr == NULL || pi->total_hdr_len > m->m_len) + break; + + /* Verify supported header types. */ + switch (pi->data.lro_type) { + case LRO_TYPE_IPV4_TCP: + case LRO_TYPE_IPV6_TCP: + return (pi); + default: + break; + } + break; + case LRO_TYPE_IPV4_TCP: + case LRO_TYPE_IPV6_TCP: + if (update_data) + memset(pi, 0, sizeof(*pi)); + return (po); + default: + break; + } + return (NULL); +} + +static inline int +tcp_lro_trim_mbuf_chain(struct mbuf *m, const struct lro_parser *po) +{ + int len; + + switch (po->data.lro_type) { #ifdef INET - case ETHERTYPE_IP: - ip4 = (struct ip *)(eh + 1); - th = (struct tcphdr *)(ip4 + 1); + case LRO_TYPE_IPV4_TCP: + len = ((uint8_t *)po->ip4 - (uint8_t *)m->m_data) + + ntohs(po->ip4->ip_len); break; #endif +#ifdef INET6 + case LRO_TYPE_IPV6_TCP: + len = ((uint8_t *)po->ip6 - (uint8_t *)m->m_data) + + ntohs(po->ip6->ip6_plen) + sizeof(*po->ip6); + break; +#endif + default: + return (TCP_LRO_CANNOT); + } + + /* + * If the frame is padded beyond the end of the IP packet, + * then trim the extra bytes off: + */ + if (__predict_true(m->m_pkthdr.len == len)) { + return (0); + } else if (m->m_pkthdr.len > len) { + m_adj(m, len - m->m_pkthdr.len); + return (0); } - return (th); + return (TCP_LRO_CANNOT); +} + +static struct tcphdr * +tcp_lro_get_th(struct mbuf *m) +{ + return ((struct tcphdr *)((uint8_t *)m->m_data + m->m_pkthdr.lro_tcp_h_off)); } static void @@ -300,86 +484,67 @@ tcp_lro_free(struct lro_ctrl *lc) } static uint16_t -tcp_lro_csum_th(struct tcphdr *th) +tcp_lro_rx_csum_tcphdr(const struct tcphdr *th) { - uint32_t ch; - uint16_t *p, l; - - ch = th->th_sum = 0x0000; - l = th->th_off; - p = (uint16_t *)th; - while (l > 0) { - ch += *p; - p++; - ch += *p; - p++; - l--; + const uint16_t *ptr; + uint32_t csum; + uint16_t len; + + csum = -th->th_sum; /* exclude checksum field */ + len = th->th_off; + ptr = (const uint16_t *)th; + while (len--) { + csum += *ptr; + ptr++; + csum += *ptr; + ptr++; } - while (ch > 0xffff) - ch = (ch >> 16) + (ch & 0xffff); + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); - return (ch & 0xffff); + return (csum); } static uint16_t -tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th, - uint16_t tcp_data_len, uint16_t csum) +tcp_lro_rx_csum_data(const struct lro_parser *pa, uint16_t tcp_csum) { uint32_t c; uint16_t cs; - c = csum; + c = tcp_csum; - /* Remove length from checksum. */ - switch (le->eh_type) { + switch (pa->data.lro_type) { #ifdef INET6 - case ETHERTYPE_IPV6: - { - struct ip6_hdr *ip6; - - ip6 = (struct ip6_hdr *)l3hdr; - if (le->append_cnt == 0) - cs = ip6->ip6_plen; - else { - uint32_t cx; - - cx = ntohs(ip6->ip6_plen); - cs = in6_cksum_pseudo(ip6, cx, ip6->ip6_nxt, 0); - } + case LRO_TYPE_IPV6_TCP: + /* Compute full pseudo IPv6 header checksum. */ + cs = in6_cksum_pseudo(pa->ip6, ntohs(pa->ip6->ip6_plen), pa->ip6->ip6_nxt, 0); break; - } #endif #ifdef INET - case ETHERTYPE_IP: - { - struct ip *ip4; - - ip4 = (struct ip *)l3hdr; - if (le->append_cnt == 0) - cs = ip4->ip_len; - else { - cs = in_addword(ntohs(ip4->ip_len) - sizeof(*ip4), - IPPROTO_TCP); - cs = in_pseudo(ip4->ip_src.s_addr, ip4->ip_dst.s_addr, - htons(cs)); - } + case LRO_TYPE_IPV4_TCP: + /* Compute full pseudo IPv4 header checsum. */ + cs = in_addword(ntohs(pa->ip4->ip_len) - sizeof(*pa->ip4), IPPROTO_TCP); + cs = in_pseudo(pa->ip4->ip_src.s_addr, pa->ip4->ip_dst.s_addr, htons(cs)); break; - } #endif default: cs = 0; /* Keep compiler happy. */ + break; } + /* Complement checksum. */ cs = ~cs; c += cs; - /* Remove TCP header csum. */ - cs = ~tcp_lro_csum_th(th); + /* Remove TCP header checksum. */ + cs = ~tcp_lro_rx_csum_tcphdr(pa->tcp); c += cs; + + /* Compute checksum remainder. */ while (c > 0xffff) c = (c >> 16) + (c & 0xffff); - return (c & 0xffff); + return (c); } static void @@ -397,84 +562,51 @@ void tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) { struct lro_entry *le, *le_tmp; - struct timeval tv; + sbintime_t sbt; if (LIST_EMPTY(&lc->lro_active)) return; - getmicrouptime(&tv); - timevalsub(&tv, timeout); + /* get timeout time */ + sbt = getsbinuptime() - tvtosbt(*timeout); + LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { - if (timevalcmp(&tv, &le->mtime, >=)) { + if (sbt >= le->alloc_time) { tcp_lro_active_remove(le); tcp_lro_flush(lc, le); } } } -#ifdef INET6 -static int -tcp_lro_rx_ipv6(struct lro_ctrl *lc, struct mbuf *m, struct ip6_hdr *ip6, - struct tcphdr **th) -{ - - /* XXX-BZ we should check the flow-label. */ - - /* XXX-BZ We do not yet support ext. hdrs. */ - if (ip6->ip6_nxt != IPPROTO_TCP) - return (TCP_LRO_NOT_SUPPORTED); - - /* Find the TCP header. */ - *th = (struct tcphdr *)(ip6 + 1); - - return (0); -} -#endif - #ifdef INET static int -tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4, - struct tcphdr **th) +tcp_lro_rx_ipv4(struct lro_ctrl *lc, struct mbuf *m, struct ip *ip4) { - int csum_flags; uint16_t csum; - if (ip4->ip_p != IPPROTO_TCP) - return (TCP_LRO_NOT_SUPPORTED); - - /* Ensure there are no options. */ - if ((ip4->ip_hl << 2) != sizeof (*ip4)) - return (TCP_LRO_CANNOT); - - /* .. and the packet is not fragmented. */ - if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) - return (TCP_LRO_CANNOT); - /* Legacy IP has a header checksum that needs to be correct. */ - csum_flags = m->m_pkthdr.csum_flags; - if (csum_flags & CSUM_IP_CHECKED) { - if (__predict_false((csum_flags & CSUM_IP_VALID) == 0)) { + if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) { + if (__predict_false((m->m_pkthdr.csum_flags & CSUM_IP_VALID) == 0)) { lc->lro_bad_csum++; return (TCP_LRO_CANNOT); } } else { csum = in_cksum_hdr(ip4); - if (__predict_false((csum) != 0)) { + if (__predict_false(csum != 0)) { lc->lro_bad_csum++; return (TCP_LRO_CANNOT); } } - /* Find the TCP header (we assured there are no IP options). */ - *th = (struct tcphdr *)(ip4 + 1); return (0); } #endif #ifdef TCPHPTS static void -tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, - struct lro_entry *le, struct mbuf *m, int frm, int32_t tcp_data_len, - uint32_t th_seq , uint32_t th_ack, uint16_t th_win) +tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc, + const struct lro_entry *le, const struct mbuf *m, + int frm, int32_t tcp_data_len, uint32_t th_seq, + uint32_t th_ack, uint16_t th_win) { if (tp->t_logstate != TCP_LOG_STATE_OFF) { union tcp_log_stackspecific log; @@ -489,8 +621,8 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, log.u_bbr.flex2 = m->m_pkthdr.len; else log.u_bbr.flex2 = 0; - log.u_bbr.flex3 = le->append_cnt; - log.u_bbr.flex4 = le->p_len; + log.u_bbr.flex3 = le->m_head->m_pkthdr.lro_nsegs; + log.u_bbr.flex4 = le->m_head->m_pkthdr.lro_tcp_d_len; if (le->m_head) { log.u_bbr.flex5 = le->m_head->m_pkthdr.len; log.u_bbr.delRate = le->m_head->m_flags; @@ -505,11 +637,9 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, log.u_bbr.cwnd_gain = le->window; log.u_bbr.cur_del_rate = (uintptr_t)m; log.u_bbr.bw_inuse = (uintptr_t)le->m_head; - log.u_bbr.pkts_out = le->mbuf_cnt; /* Total mbufs added */ - log.u_bbr.applimited = le->ulp_csum; - log.u_bbr.lost = le->mbuf_appended; - log.u_bbr.pkt_epoch = le->cmp_ack_cnt; - log.u_bbr.flex6 = tcp_tv_to_usectick(&lc->lro_last_flush); + log.u_bbr.flex6 = sbttous(lc->lro_last_queue_time); + log.u_bbr.flex7 = le->compressed; + log.u_bbr.pacing_gain = le->uncompressed; if (in_epoch(net_epoch_preempt)) log.u_bbr.inhpts = 1; else @@ -523,198 +653,292 @@ tcp_lro_log(struct tcpcb *tp, struct lro_ctrl *lc, } #endif -static void -tcp_flush_out_le(struct tcpcb *tp, struct lro_ctrl *lc, struct lro_entry *le) +static inline void +tcp_lro_assign_and_checksum_16(uint16_t *ptr, uint16_t value, uint16_t *psum) { - if (le->append_cnt > 1) { - struct tcphdr *th; - uint16_t p_len; + uint32_t csum; - p_len = htons(le->p_len); - switch (le->eh_type) { -#ifdef INET6 - case ETHERTYPE_IPV6: - { - struct ip6_hdr *ip6; + csum = 0xffff - *ptr + value; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + *ptr = value; + *psum = csum; +} + +static uint16_t +tcp_lro_update_checksum(const struct lro_parser *pa, const struct lro_entry *le, + uint16_t payload_len, uint16_t delta_sum) +{ + uint32_t csum; + uint16_t tlen; + uint16_t temp[5] = {}; + + switch (pa->data.lro_type) { + case LRO_TYPE_IPV4_TCP: + /* Compute new IPv4 length. */ + tlen = (pa->ip4->ip_hl << 2) + (pa->tcp->th_off << 2) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_len, htons(tlen), &temp[0]); + + /* Subtract delta from current IPv4 checksum. */ + csum = pa->ip4->ip_sum + 0xffff - temp[0]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_sum, csum, &temp[1]); + goto update_tcp_header; + + case LRO_TYPE_IPV6_TCP: + /* Compute new IPv6 length. */ + tlen = (pa->tcp->th_off << 2) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip6->ip6_plen, htons(tlen), &temp[0]); + goto update_tcp_header; + + case LRO_TYPE_IPV4_UDP: + /* Compute new IPv4 length. */ + tlen = (pa->ip4->ip_hl << 2) + sizeof(*pa->udp) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_len, htons(tlen), &temp[0]); + + /* Subtract delta from current IPv4 checksum. */ + csum = pa->ip4->ip_sum + 0xffff - temp[0]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + tcp_lro_assign_and_checksum_16(&pa->ip4->ip_sum, csum, &temp[1]); + goto update_udp_header; + + case LRO_TYPE_IPV6_UDP: + /* Compute new IPv6 length. */ + tlen = sizeof(*pa->udp) + payload_len; + tcp_lro_assign_and_checksum_16(&pa->ip6->ip6_plen, htons(tlen), &temp[0]); + goto update_udp_header; + + default: + return (0); + } + +update_tcp_header: + /* Compute current TCP header checksum. */ + temp[2] = tcp_lro_rx_csum_tcphdr(pa->tcp); + + /* Incorporate the latest ACK into the TCP header. */ + pa->tcp->th_ack = le->ack_seq; + pa->tcp->th_win = le->window; + + /* Incorporate latest timestamp into the TCP header. */ + if (le->timestamp != 0) { + uint32_t *ts_ptr; + + ts_ptr = (uint32_t *)(pa->tcp + 1); + ts_ptr[1] = htonl(le->tsval); + ts_ptr[2] = le->tsecr; + } + + /* Compute new TCP header checksum. */ + temp[3] = tcp_lro_rx_csum_tcphdr(pa->tcp); + + /* Compute new TCP checksum. */ + csum = pa->tcp->th_sum + 0xffff - delta_sum + + 0xffff - temp[0] + 0xffff - temp[3] + temp[2]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Assign new TCP checksum. */ + tcp_lro_assign_and_checksum_16(&pa->tcp->th_sum, csum, &temp[4]); + + /* Compute all modififications affecting next checksum. */ + csum = temp[0] + temp[1] + 0xffff - temp[2] + + temp[3] + temp[4] + delta_sum; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Return delta checksum to next stage, if any. */ + return (csum); + +update_udp_header: + tlen = sizeof(*pa->udp) + payload_len; + /* Assign new UDP length and compute checksum delta. */ + tcp_lro_assign_and_checksum_16(&pa->udp->uh_ulen, htons(tlen), &temp[2]); + + /* Check if there is a UDP checksum. */ + if (__predict_false(pa->udp->uh_sum != 0)) { + /* Compute new UDP checksum. */ + csum = pa->udp->uh_sum + 0xffff - delta_sum + + 0xffff - temp[0] + 0xffff - temp[2]; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + /* Assign new UDP checksum. */ + tcp_lro_assign_and_checksum_16(&pa->udp->uh_sum, csum, &temp[3]); + } - ip6 = le->le_ip6; - ip6->ip6_plen = p_len; - th = (struct tcphdr *)(ip6 + 1); + /* Compute all modififications affecting next checksum. */ + csum = temp[0] + temp[1] + temp[2] + temp[3] + delta_sum; + while (csum > 0xffff) + csum = (csum >> 16) + (csum & 0xffff); + + /* Return delta checksum to next stage, if any. */ + return (csum); +} + +static void +tcp_flush_out_entry(struct lro_ctrl *lc, struct lro_entry *le) +{ + /* Check if we need to recompute any checksums. */ + if (le->m_head->m_pkthdr.lro_nsegs > 1) { + uint16_t csum; + + switch (le->inner.data.lro_type) { + case LRO_TYPE_IPV4_TCP: + csum = tcp_lro_update_checksum(&le->inner, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + csum = tcp_lro_update_checksum(&le->outer, NULL, + le->m_head->m_pkthdr.lro_tcp_d_len + + le->inner.total_hdr_len, csum); le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - le->p_len += ETHER_HDR_LEN + sizeof(*ip6); + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->m_head->m_pkthdr.csum_data = 0xffff; break; - } -#endif -#ifdef INET - case ETHERTYPE_IP: - { - struct ip *ip4; - uint32_t cl; - uint16_t c; - - ip4 = le->le_ip4; - /* Fix IP header checksum for new length. */ - c = ~ip4->ip_sum; - cl = c; - c = ~ip4->ip_len; - cl += c + p_len; - while (cl > 0xffff) - cl = (cl >> 16) + (cl & 0xffff); - c = cl; - ip4->ip_sum = ~c; - ip4->ip_len = p_len; - th = (struct tcphdr *)(ip4 + 1); + case LRO_TYPE_IPV6_TCP: + csum = tcp_lro_update_checksum(&le->inner, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + csum = tcp_lro_update_checksum(&le->outer, NULL, + le->m_head->m_pkthdr.lro_tcp_d_len + + le->inner.total_hdr_len, csum); le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | - CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; - le->p_len += ETHER_HDR_LEN; + CSUM_PSEUDO_HDR; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + case LRO_TYPE_NONE: + switch (le->outer.data.lro_type) { + case LRO_TYPE_IPV4_TCP: + csum = tcp_lro_update_checksum(&le->outer, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + case LRO_TYPE_IPV6_TCP: + csum = tcp_lro_update_checksum(&le->outer, le, + le->m_head->m_pkthdr.lro_tcp_d_len, + le->m_head->m_pkthdr.lro_tcp_d_csum); + le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + le->m_head->m_pkthdr.csum_data = 0xffff; + break; + default: + break; + } break; - } -#endif default: - th = NULL; /* Keep compiler happy. */ - } - le->m_head->m_pkthdr.csum_data = 0xffff; - le->m_head->m_pkthdr.len = le->p_len; - - /* Incorporate the latest ACK into the TCP header. */ - th->th_ack = le->ack_seq; - th->th_win = le->window; - /* Incorporate latest timestamp into the TCP header. */ - if (le->timestamp != 0) { - uint32_t *ts_ptr; - - ts_ptr = (uint32_t *)(th + 1); - ts_ptr[1] = htonl(le->tsval); - ts_ptr[2] = le->tsecr; + break; } - /* Update the TCP header checksum. */ - le->ulp_csum += p_len; - le->ulp_csum += tcp_lro_csum_th(th); - while (le->ulp_csum > 0xffff) - le->ulp_csum = (le->ulp_csum >> 16) + - (le->ulp_csum & 0xffff); - th->th_sum = (le->ulp_csum & 0xffff); - th->th_sum = ~th->th_sum; } + /* * Break any chain, this is not set to NULL on the singleton * case m_nextpkt points to m_head. Other case set them * m_nextpkt to NULL in push_and_replace. */ le->m_head->m_nextpkt = NULL; - le->m_head->m_pkthdr.lro_nsegs = le->append_cnt; + lc->lro_queued += le->m_head->m_pkthdr.lro_nsegs; (*lc->ifp->if_input)(lc->ifp, le->m_head); - lc->lro_queued += le->append_cnt; } static void -tcp_set_le_to_m(struct lro_ctrl *lc, struct lro_entry *le, struct mbuf *m) +tcp_set_entry_to_mbuf(struct lro_ctrl *lc, struct lro_entry *le, + struct mbuf *m, struct tcphdr *th) { - struct ether_header *eh; - void *l3hdr = NULL; /* Keep compiler happy. */ - struct tcphdr *th; -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ -#endif -#ifdef INET - struct ip *ip4 = NULL; /* Keep compiler happy. */ -#endif uint32_t *ts_ptr; - int error, l, ts_failed = 0; uint16_t tcp_data_len; - uint16_t csum; + uint16_t tcp_opt_len; - error = -1; - eh = mtod(m, struct ether_header *); - /* - * We must reset the other pointers since the mbuf - * we were pointing too is about to go away. - */ - switch (le->eh_type) { -#ifdef INET6 - case ETHERTYPE_IPV6: - l3hdr = ip6 = (struct ip6_hdr *)(eh + 1); - error = tcp_lro_rx_ipv6(lc, m, ip6, &th); - le->le_ip6 = ip6; - le->source_ip6 = ip6->ip6_src; - le->dest_ip6 = ip6->ip6_dst; - le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN - sizeof(*ip6); - break; -#endif -#ifdef INET - case ETHERTYPE_IP: - l3hdr = ip4 = (struct ip *)(eh + 1); - error = tcp_lro_rx_ipv4(lc, m, ip4, &th); - le->le_ip4 = ip4; - le->source_ip4 = ip4->ip_src.s_addr; - le->dest_ip4 = ip4->ip_dst.s_addr; - le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN; - break; -#endif - } - KASSERT(error == 0, ("%s: le=%p tcp_lro_rx_xxx failed\n", - __func__, le)); ts_ptr = (uint32_t *)(th + 1); - l = (th->th_off << 2); - l -= sizeof(*th); - if (l != 0 && - (__predict_false(l != TCPOLEN_TSTAMP_APPA) || - (*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16| - TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)))) { - /* We have failed to find a timestamp some other option? */ - ts_failed = 1; - } - if ((l != 0) && (ts_failed == 0)) { + tcp_opt_len = (th->th_off << 2); + tcp_opt_len -= sizeof(*th); + + /* Check if there is a timestamp option. */ + if (tcp_opt_len == 0 || + __predict_false(tcp_opt_len != TCPOLEN_TSTAMP_APPA || + *ts_ptr != TCP_LRO_TS_OPTION)) { + /* We failed to find the timestamp option. */ + le->timestamp = 0; + } else { le->timestamp = 1; le->tsval = ntohl(*(ts_ptr + 1)); le->tsecr = *(ts_ptr + 2); - } else *** 2084 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Apr 20 12:56:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6131B5F4F70; Tue, 20 Apr 2021 12:56: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 4FPkG626CHz4hpJ; Tue, 20 Apr 2021 12:56: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 3B39612CFE; Tue, 20 Apr 2021 12:56: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 13KCuUkj005597; Tue, 20 Apr 2021 12:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KCuU63005596; Tue, 20 Apr 2021 12:56:30 GMT (envelope-from git) Date: Tue, 20 Apr 2021 12:56:30 GMT Message-Id: <202104201256.13KCuU63005596@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: a649f1f6fd7a - main - tcp: Deal with DSACKs, and adjust rescue hole on success. 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: a649f1f6fd7a098ab173a69fe87916c04a8c6f8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 12:56:30 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=a649f1f6fd7a098ab173a69fe87916c04a8c6f8d commit a649f1f6fd7a098ab173a69fe87916c04a8c6f8d Author: Richard Scheffenegger AuthorDate: 2021-04-20 12:53:56 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-20 12:54:28 +0000 tcp: Deal with DSACKs, and adjust rescue hole on success. When a rescue retransmission is successful, rather than inserting new holes to the left of it, adjust the old rescue entry to cover the missed sequence space. Also, as snd_fack may be stale by that point, pull it forward in order to never create a hole left of snd_una/th_ack. Finally, with DSACKs, tcp_sack_doack() may be called with new full ACKs but a DSACK block. Account for this eventuality properly to keep sacked_bytes >= 0. MFC after: 3 days Reviewed By: kbowling, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29835 --- sys/netinet/tcp_sack.c | 76 +++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index fffba2e75045..bfe40854c76b 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -497,7 +497,7 @@ static struct sackhole * tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, struct sackhole *after) { - struct sackhole *hole, *tail; + struct sackhole *hole; /* Allocate a new SACK hole. */ hole = tcp_sackhole_alloc(tp, start, end); @@ -508,15 +508,7 @@ tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, if (after != NULL) TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink); else - /* - * With Rescue Retransmission, new holes may need to - * be inserted just before the tail. - */ - if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole, - scblink)) != NULL) && SEQ_LEQ(end, tail->start)) - TAILQ_INSERT_BEFORE(tail, hole, scblink); - else - TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); + TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); /* Update SACK hint. */ if (tp->sackhint.nexthole == NULL) @@ -573,6 +565,15 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) left_edge_delta = th_ack - tp->snd_una; sack_blocks[num_sack_blks].start = tp->snd_una; sack_blocks[num_sack_blks++].end = th_ack; + /* + * Pulling snd_fack forward if we got here + * due to DSACK blocks + */ + if (SEQ_LT(tp->snd_fack, th_ack)) { + delivered_data += th_ack - tp->snd_una; + tp->snd_fack = th_ack; + sack_changed = 1; + } } /* * Append received valid SACK blocks to sack_blocks[], but only if we @@ -642,35 +643,52 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) tp->sackhint.last_sack_ack = sblkp->end; if (SEQ_LT(tp->snd_fack, sblkp->start)) { /* - * The highest SACK block is beyond fack. Append new SACK - * hole at the tail. If the second or later highest SACK - * blocks are also beyond the current fack, they will be - * inserted by way of hole splitting in the while-loop below. + * The highest SACK block is beyond fack. First, + * check if there was a successful Rescue Retransmission, + * and move this hole left. With normal holes, snd_fack + * is always to the right of the end. */ - temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL); - if (temp != NULL) { + if (((temp = TAILQ_LAST(&tp->snd_holes, sackhole_head)) != NULL) && + SEQ_LEQ(tp->snd_fack,temp->end)) { + temp->start = SEQ_MAX(tp->snd_fack, SEQ_MAX(tp->snd_una, th_ack)); + temp->end = sblkp->start; + temp->rxmit = temp->start; delivered_data += sblkp->end - sblkp->start; tp->snd_fack = sblkp->end; - /* Go to the previous sack block. */ sblkp--; sack_changed = 1; } else { /* - * We failed to add a new hole based on the current - * sack block. Skip over all the sack blocks that - * fall completely to the right of snd_fack and - * proceed to trim the scoreboard based on the - * remaining sack blocks. This also trims the - * scoreboard for th_ack (which is sack_blocks[0]). + * Append a new SACK hole at the tail. If the + * second or later highest SACK blocks are also + * beyond the current fack, they will be inserted + * by way of hole splitting in the while-loop below. */ - while (sblkp >= sack_blocks && - SEQ_LT(tp->snd_fack, sblkp->start)) - sblkp--; - if (sblkp >= sack_blocks && - SEQ_LT(tp->snd_fack, sblkp->end)) { - delivered_data += sblkp->end - tp->snd_fack; + temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL); + if (temp != NULL) { + delivered_data += sblkp->end - sblkp->start; tp->snd_fack = sblkp->end; + /* Go to the previous sack block. */ + sblkp--; sack_changed = 1; + } else { + /* + * We failed to add a new hole based on the current + * sack block. Skip over all the sack blocks that + * fall completely to the right of snd_fack and + * proceed to trim the scoreboard based on the + * remaining sack blocks. This also trims the + * scoreboard for th_ack (which is sack_blocks[0]). + */ + while (sblkp >= sack_blocks && + SEQ_LT(tp->snd_fack, sblkp->start)) + sblkp--; + if (sblkp >= sack_blocks && + SEQ_LT(tp->snd_fack, sblkp->end)) { + delivered_data += sblkp->end - tp->snd_fack; + tp->snd_fack = sblkp->end; + sack_changed = 1; + } } } } else if (SEQ_LT(tp->snd_fack, sblkp->end)) { From owner-dev-commits-src-all@freebsd.org Tue Apr 20 15:19:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F226B5DAFB1; Tue, 20 Apr 2021 15:19:51 +0000 (UTC) (envelope-from markjdb@gmail.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 4FPnRW27Ldz4rtm; Tue, 20 Apr 2021 15:19:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x731.google.com with SMTP id z2so2680594qkb.9; Tue, 20 Apr 2021 08:19:50 -0700 (PDT) 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=qUSs71Gmi388ciFd3Hzs+kKYVnzXBAiZFpJYEyLnp8Q=; b=I6GZm8VX9SByhk/Q+2+CreoEExUsrzGI2I0WXwV9Ooj1X2RCR/rHeujHVx/a/6Y22v 9p919QkGvmIB363QAg1U2qw++8xe1AZ/i93NeLKhe9jCa4Hqtf37NTxXtmOlNP3Ye6uU pHLka8jMSpe9XuIBFjbGamh74QrFcoXWZ9osy6lGHv2Pj71XUlW7+6KB9/8ZCujv8t0o sI/K+GRlyISa3fkneHMo509fshydntvjHQAxe2bcXbMEQ2JD7lbO/fJiWn0nDygr+UXH DQ2Ev802ccLxRnZKbK3a3y3ai+Yyh2Jodo1Gv66y9x9fajOmAfFcjXZ1hu4GUBxpMbm2 1usw== 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=qUSs71Gmi388ciFd3Hzs+kKYVnzXBAiZFpJYEyLnp8Q=; b=AcG8z4RspMI/4lBAcr01MBAxiMsO8olg92PR1DNFBNRPQE5cvM38aYJd6yAIC1Na5J YkPrru3oxluuJz1P6F5NoFsoGFA81oNcYGxl70p5WdKxq5NYnaldDcQsG6w/92FdLW7E SLrMkvZQpkQIqFqoh69Gl3yW/pTqe7/sDgMa1guudicqRc2xWf63v9g+JZCLBOfT2EHK 9neMZiPSkHvBiOwMIBw67g4S5vS5XMyXZOn4kk2gk+qrsBox98MaujgXmkcTXjdElLA6 cjRZXv0pE5SCxXHzDMpaq86rTMOw3lX6xulLVrWoBuK+H2YXQnbHnycGAU7IBdVNOkDf s+Gg== X-Gm-Message-State: AOAM530bw7r2yM0fWlT7TzeFZeIRGFH8rmr7lFqf35bHT3FQYSm2TxuA H5fewxg/59pt0e5FOBOlPvw= X-Google-Smtp-Source: ABdhPJxuI2ZfRsCRrsksV67k+navDX5KrFshsZP2NMo2FSZj9iBK38Ae6KZSiIyWTsOn/5LsT0V9Jg== X-Received: by 2002:a37:7043:: with SMTP id l64mr17730500qkc.358.1618931990202; Tue, 20 Apr 2021 08:19:50 -0700 (PDT) Received: from nuc ([142.126.164.150]) by smtp.gmail.com with ESMTPSA id x85sm8233556qkb.44.2021.04.20.08.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 08:19:49 -0700 (PDT) Sender: Mark Johnston Date: Tue, 20 Apr 2021 11:19:50 -0400 From: Mark Johnston To: Warner Losh Cc: John Baldwin , Alex Richardson , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 73c14cc76b5f - main - Remove history.immutable from .arcconfig Message-ID: References: <202104131138.13DBcgrt085662@gitrepo.freebsd.org> <9e0d4574-bcad-b24c-78ad-c172d6d2c221@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4FPnRW27Ldz4rtm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=I6GZm8VX; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::731 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::731:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; 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]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::731:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 15:19:52 -0000 On Tue, Apr 13, 2021 at 01:53:07PM -0600, Warner Losh wrote: > On Tue, Apr 13, 2021 at 9:23 AM John Baldwin wrote: > > > On 4/13/21 4:38 AM, Alex Richardson wrote: > > > The branch main has been updated by arichardson: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=73c14cc76b5f815c6b1bd93089ebafdd9269d343 > > > > > > commit 73c14cc76b5f815c6b1bd93089ebafdd9269d343 > > > Author: Alex Richardson > > > AuthorDate: 2021-04-13 11:36:24 +0000 > > > Commit: Alex Richardson > > > CommitDate: 2021-04-13 11:36:25 +0000 > > > > > > Remove history.immutable from .arcconfig > > > > > > The `history.immutable` setting prevents arcanist from updating > > > the commit messages with the Differential URL and therefore > > > makes updating patches awkward with a rebase workflow. > > > > > > In case this new behaviour is not wanted the old one can be restored > > > by running `arc set-config --local history.immutable true`. > > > > > > Test Plan: `arc diff --create HEAD^` adds the metadata now. > > > > > > Reviewed By: #phabric-admin, imp, lwhsu > > > Differential Revision: https://reviews.freebsd.org/D27971 > > > > FYI, this might break git arc since arc will now start rewriting commits > > rather than leaving them alone. Empirically, arc does not do this when git-arc is used. One of the options passed to arc diff --create apparently inhibits that behaviour, though I'm having trouble figuring out exactly why from reading the arcanist sources. > > If so, we can look use 'arc diff' > > with --head to turn off some of its magic. It would also avoid having > > 'git arc' have to adjust the working copy. > > > > I'd honestly rather have 'git arc create' stamp this in from the git go. > I really dislike having it not there until just before I go to commit. This is pretty easy to do if the commit is currently checked out. The question is what we should do when uploading a series of patches. Rewriting history would make child branches stale, so one would have to go through them and manually rebase --onto the rewritten branch. I'm not sure if this is a problem for most developers. In general it seems there is a preference for rewriting history to add reviewers and differential revision tags over the current approach, which avoids rewriting history. From owner-dev-commits-src-all@freebsd.org Tue Apr 20 15:24:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13B35DB4A4; Tue, 20 Apr 2021 15:24:55 +0000 (UTC) (envelope-from jkim@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 4FPnYM4kbLz4s90; Tue, 20 Apr 2021 15:24:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7D957D13B; Tue, 20 Apr 2021 15:24:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202104200656.13K6uZPZ069494@gndrsh.dnsmgr.net> From: Jung-uk Kim Organization: FreeBSD.org Message-ID: <5dcdd0e7-2bb4-36ae-ec45-404e421cf180@FreeBSD.org> Date: Tue, 20 Apr 2021 11:24:54 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <202104200656.13K6uZPZ069494@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 15:24:55 -0000 On 21. 4. 20., Rodney W. Grimes wrote: >> The branch main has been updated by jkim: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d >> >> commit 686cf5468c4a85c2a6385cdbab2383900876a41d >> Author: Jung-uk Kim >> AuthorDate: 2021-04-19 18:20:51 +0000 >> Commit: Jung-uk Kim >> CommitDate: 2021-04-19 18:20:51 +0000 >> >> flex: Regen bootstrap files >> >> This also partially reverts r326025 (8a16b7a18f5d). I do not see any >> point of adding SPDX tag in generated file. > > The SPDX identifies the copyright that follows it, so please put this back. It is a generated file. If you really think it is necessary, you need to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. However, I don't see much sense in automatically adding BSD license in every generated file in the first place. In fact, I think it should not appear on generated file at all. It may say something along the line of "generated by flex" instead but IANAL. Jung-uk Kim From owner-dev-commits-src-all@freebsd.org Tue Apr 20 16:10:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE1EF5DD89B; Tue, 20 Apr 2021 16:10:07 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPpYW4Zjbz4vRF; Tue, 20 Apr 2021 16:10:07 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13KG9wQo071569; Tue, 20 Apr 2021 09:09:58 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13KG9w0e071568; Tue, 20 Apr 2021 09:09:58 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104201609.13KG9w0e071568@gndrsh.dnsmgr.net> Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files In-Reply-To: <5dcdd0e7-2bb4-36ae-ec45-404e421cf180@FreeBSD.org> To: Jung-uk Kim Date: Tue, 20 Apr 2021 09:09:58 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FPpYW4Zjbz4vRF 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 16:10:07 -0000 > On 21. 4. 20., Rodney W. Grimes wrote: > >> The branch main has been updated by jkim: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > >> > >> commit 686cf5468c4a85c2a6385cdbab2383900876a41d > >> Author: Jung-uk Kim > >> AuthorDate: 2021-04-19 18:20:51 +0000 > >> Commit: Jung-uk Kim > >> CommitDate: 2021-04-19 18:20:51 +0000 > >> > >> flex: Regen bootstrap files > >> > >> This also partially reverts r326025 (8a16b7a18f5d). I do not see any > >> point of adding SPDX tag in generated file. > > > > The SPDX identifies the copyright that follows it, so please put this back. > > It is a generated file. If you really think it is necessary, you need > to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. Just because it is a generated file does not change the fact that its contents are copyrighted. Leaving the copyright out at best defaults to Bern convention, so the fact of the mater is the contents is copyrighted, and it is best to explicitly state that it is. > > However, I don't see much sense in automatically adding BSD license in > every generated file in the first place. In fact, I think it should not > appear on generated file at all. It may say something along the line of > "generated by flex" instead but IANAL. Well, someone before you did see since in it, and hence put that SPDX in it. > Jung-uk Kim -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Apr 20 16:24:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD6825DE3D5; Tue, 20 Apr 2021 16:24:39 +0000 (UTC) (envelope-from jkim@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 4FPptH5x9wz3CYK; Tue, 20 Apr 2021 16:24:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A8D12DAED; Tue, 20 Apr 2021 16:24:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202104201609.13KG9w0e071568@gndrsh.dnsmgr.net> From: Jung-uk Kim Organization: FreeBSD.org Message-ID: <782d3c7b-fb30-d013-0426-692cc1ead645@FreeBSD.org> Date: Tue, 20 Apr 2021 12:24:35 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <202104201609.13KG9w0e071568@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 16:24:39 -0000 On 21. 4. 20., Rodney W. Grimes wrote: >> On 21. 4. 20., Rodney W. Grimes wrote: >>>> The branch main has been updated by jkim: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d >>>> >>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d >>>> Author: Jung-uk Kim >>>> AuthorDate: 2021-04-19 18:20:51 +0000 >>>> Commit: Jung-uk Kim >>>> CommitDate: 2021-04-19 18:20:51 +0000 >>>> >>>> flex: Regen bootstrap files >>>> >>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see any >>>> point of adding SPDX tag in generated file. >>> >>> The SPDX identifies the copyright that follows it, so please put this back. >> >> It is a generated file. If you really think it is necessary, you need >> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. > > Just because it is a generated file does not change the fact that > its contents are copyrighted. Leaving the copyright out at best > defaults to Bern convention, so the fact of the mater is the contents > is copyrighted, and it is best to explicitly state that it is. Of course, it is copyrighted. My point was parse.y should have been patched, not the generated file, if necessary. >> However, I don't see much sense in automatically adding BSD license in >> every generated file in the first place. In fact, I think it should not >> appear on generated file at all. It may say something along the line of >> "generated by flex" instead but IANAL. > > Well, someone before you did see since in it, and hence put that SPDX in it. Let me put it in another way. Do we really want to tag contrib code? Jung-uk Kim From owner-dev-commits-src-all@freebsd.org Tue Apr 20 16:44:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C60495DF031 for ; Tue, 20 Apr 2021 16:44:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 4FPqKL51Vmz3Dmf for ; Tue, 20 Apr 2021 16:44:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id s5so31210834qkj.5 for ; Tue, 20 Apr 2021 09:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5/SHM99+BddDQYVEyl19MxIwMTYeUMC3oX+GURfGMYE=; b=me9QGcPgT32CAOXGJjmptK77AUj7K3+n2Y4Gg/6vSIOH8iOwveTaIKYgzyhT/d2upN hwRgNm2rRZrDteW38r+eBhXxt2DWlNZoQHafp84drB0Sf8TUntm0wP91WMXWlWGDMVhp vb74m0CyNB5uZJ59SHAs4qk8YWWakAdxA4ouCsqF2uGrin84F5qKE499WCOtrku+fou8 NuN8yFKr7nrpFZUc8oMEcgi4uMtV9OZWJ8mlu5bMY8LDk0Ddk/amgWUrx0q15fFR/Ogu BOIMqfnimNHOaewVaSUg4Dkgy/vV6mIcVmv5ME51mVc+eEXlOOG6s+PphvU5Q35lZkXT cadA== 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=5/SHM99+BddDQYVEyl19MxIwMTYeUMC3oX+GURfGMYE=; b=a0IrgAQkb0DQs5LuCswW7kc1xCUNieslNbTRT6eXWdcv8oBWd+RHc85u4hXqY9f4n3 Qu0khOMAXozJ9s5zhaW7uPliVzWrFeAkMpXy03+v4QKgIfDEWnpTeQuw2eSpl/QQ124n 9AX3b00ch0zobQor50UUfUqVfZYG7s0tGfbLwegCF/3JVYfCLapcbM17ZqAg2lqYLZ0t uG1TqAVEp6kCiNi23dE5A5XCwDXG6uCNriMtppzbjv4JytBO6FFPqd+losUhzOGmWHPU Jtexa7UasQLJEwuRh8V9vTYJ6ugsz0OP6gUJVp+DW6FHWOWecgvOv7aZoUy7Vmb8ybiS Df4Q== X-Gm-Message-State: AOAM533HEEvlOcY97d2uMljcHoK38DbU+CeIqQv3hknAg1uXzGGU6wsP QhZrrbsQYJCqv+CF6efvEy+OgF823m8MuZTDUFiiPw== X-Google-Smtp-Source: ABdhPJzgBRZhabBcYa4op9eaUL13/su08MVSO1V6aNnIqmqjMbWdYIJltEhCyUqjVDjSl9m2ObShI8n83NzTHw1EnCk= X-Received: by 2002:a37:6492:: with SMTP id y140mr9752605qkb.89.1618937077033; Tue, 20 Apr 2021 09:44:37 -0700 (PDT) MIME-Version: 1.0 References: <202104201609.13KG9w0e071568@gndrsh.dnsmgr.net> <782d3c7b-fb30-d013-0426-692cc1ead645@FreeBSD.org> In-Reply-To: <782d3c7b-fb30-d013-0426-692cc1ead645@FreeBSD.org> From: Warner Losh Date: Tue, 20 Apr 2021 10:44:26 -0600 Message-ID: Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files To: Jung-uk Kim Cc: "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4FPqKL51Vmz3Dmf 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 16:44:38 -0000 On Tue, Apr 20, 2021 at 10:24 AM Jung-uk Kim wrote: > On 21. 4. 20., Rodney W. Grimes wrote: > >> On 21. 4. 20., Rodney W. Grimes wrote: > >>>> The branch main has been updated by jkim: > >>>> > >>>> URL: > https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > >>>> > >>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d > >>>> Author: Jung-uk Kim > >>>> AuthorDate: 2021-04-19 18:20:51 +0000 > >>>> Commit: Jung-uk Kim > >>>> CommitDate: 2021-04-19 18:20:51 +0000 > >>>> > >>>> flex: Regen bootstrap files > >>>> > >>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see > any > >>>> point of adding SPDX tag in generated file. > >>> > >>> The SPDX identifies the copyright that follows it, so please put this > back. > >> > >> It is a generated file. If you really think it is necessary, you need > >> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. > > > > Just because it is a generated file does not change the fact that > > its contents are copyrighted. Leaving the copyright out at best > > defaults to Bern convention, so the fact of the mater is the contents > > is copyrighted, and it is best to explicitly state that it is. > > Of course, it is copyrighted. My point was parse.y should have been > patched, not the generated file, if necessary. > Yes. It was a mistake to put it into the generated file. > >> However, I don't see much sense in automatically adding BSD license in > >> every generated file in the first place. In fact, I think it should not > >> appear on generated file at all. It may say something along the line of > >> "generated by flex" instead but IANAL. > > > > Well, someone before you did see since in it, and hence put that SPDX in > it. > > Let me put it in another way. Do we really want to tag contrib code? > I tend to agree. I tend to agree because the SPDX tags are generally only looked at in the source tree by existing tools. The generated code won't be looked at typically. We should work to get this upstream, imho. By itself, the SPDX tag is just information. There's no legal requirement in copyright law to have it. Current project policy states they are just informative, though there's some desire to have a good framework to allow code with just a copyright and a SDPX tag into the tree, so long as that framework can be used to know what the license is for any file in a clear and unambiguous way. Warner From owner-dev-commits-src-all@freebsd.org Tue Apr 20 16:58:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A15965DFBAB; Tue, 20 Apr 2021 16:58:44 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPqdc0dx3z3FFB; Tue, 20 Apr 2021 16:58:43 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13KGwgkm071813; Tue, 20 Apr 2021 09:58:42 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13KGwgnh071812; Tue, 20 Apr 2021 09:58:42 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104201658.13KGwgnh071812@gndrsh.dnsmgr.net> Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files In-Reply-To: <782d3c7b-fb30-d013-0426-692cc1ead645@FreeBSD.org> To: Jung-uk Kim Date: Tue, 20 Apr 2021 09:58:42 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FPqdc0dx3z3FFB 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 16:58:44 -0000 > On 21. 4. 20., Rodney W. Grimes wrote: > >> On 21. 4. 20., Rodney W. Grimes wrote: > >>>> The branch main has been updated by jkim: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > >>>> > >>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d > >>>> Author: Jung-uk Kim > >>>> AuthorDate: 2021-04-19 18:20:51 +0000 > >>>> Commit: Jung-uk Kim > >>>> CommitDate: 2021-04-19 18:20:51 +0000 > >>>> > >>>> flex: Regen bootstrap files > >>>> > >>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see any > >>>> point of adding SPDX tag in generated file. > >>> > >>> The SPDX identifies the copyright that follows it, so please put this back. > >> > >> It is a generated file. If you really think it is necessary, you need > >> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. > > > > Just because it is a generated file does not change the fact that > > its contents are copyrighted. Leaving the copyright out at best > > defaults to Bern convention, so the fact of the mater is the contents > > is copyrighted, and it is best to explicitly state that it is. > > Of course, it is copyrighted. My point was parse.y should have been > patched, not the generated file, if necessary. My complaint was ABOUT the change to parse.y that REMOVED the SPDX tag. This is NOT a generated file, it IS the right place to put the SPDX, immediatly before the copyright it refers to. > >> However, I don't see much sense in automatically adding BSD license in > >> every generated file in the first place. In fact, I think it should not > >> appear on generated file at all. It may say something along the line of > >> "generated by flex" instead but IANAL. > > > > Well, someone before you did see since in it, and hence put that SPDX in it. > > Let me put it in another way. Do we really want to tag contrib code? Now that is a seperate discussion, but again, someone did infact decide to do this in the past. I am simply asking that the tag be put back. > Jung-uk Kim -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Apr 20 17:02:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9509E5DFE5E; Tue, 20 Apr 2021 17:02:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPqjf1W70z3Fs9; Tue, 20 Apr 2021 17:02:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13KH2B25071848; Tue, 20 Apr 2021 10:02:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13KH2BEF071847; Tue, 20 Apr 2021 10:02:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104201702.13KH2BEF071847@gndrsh.dnsmgr.net> Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files In-Reply-To: To: Warner Losh Date: Tue, 20 Apr 2021 10:02:11 -0700 (PDT) CC: Jung-uk Kim , "Rodney W. Grimes" , src-committers , "" , dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FPqjf1W70z3Fs9 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 17:02:14 -0000 [ Charset UTF-8 unsupported, converting... ] > On Tue, Apr 20, 2021 at 10:24 AM Jung-uk Kim wrote: > > > On 21. 4. 20., Rodney W. Grimes wrote: > > >> On 21. 4. 20., Rodney W. Grimes wrote: > > >>>> The branch main has been updated by jkim: > > >>>> > > >>>> URL: > > https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > > >>>> > > >>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d > > >>>> Author: Jung-uk Kim > > >>>> AuthorDate: 2021-04-19 18:20:51 +0000 > > >>>> Commit: Jung-uk Kim > > >>>> CommitDate: 2021-04-19 18:20:51 +0000 > > >>>> > > >>>> flex: Regen bootstrap files > > >>>> > > >>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see > > any > > >>>> point of adding SPDX tag in generated file. > > >>> > > >>> The SPDX identifies the copyright that follows it, so please put this > > back. > > >> > > >> It is a generated file. If you really think it is necessary, you need > > >> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. > > > > > > Just because it is a generated file does not change the fact that > > > its contents are copyrighted. Leaving the copyright out at best > > > defaults to Bern convention, so the fact of the mater is the contents > > > is copyrighted, and it is best to explicitly state that it is. > > > > Of course, it is copyrighted. My point was parse.y should have been > > patched, not the generated file, if necessary. > > > > Yes. It was a mistake to put it into the generated file. He removed the SPDX from parse.y, now says that is the right place to put the SPDX. You agree. So can we have this undone? > > >> However, I don't see much sense in automatically adding BSD license in > > >> every generated file in the first place. In fact, I think it should not > > >> appear on generated file at all. It may say something along the line of > > >> "generated by flex" instead but IANAL. > > > > > > Well, someone before you did see since in it, and hence put that SPDX in > > it. > > > > Let me put it in another way. Do we really want to tag contrib code? > > > > I tend to agree. > > I tend to agree because the SPDX tags are generally only looked at in the > source tree by existing tools. The generated code won't be looked at > typically. > We should work to get this upstream, imho. Is parse.y not a source file? What am I missing? > By itself, the SPDX tag is just information. There's no legal requirement in > copyright law to have it. Current project policy states they are just > informative, > though there's some desire to have a good framework to allow code with > just a copyright and a SDPX tag into the tree, so long as that framework > can be used to know what the license is for any file in a clear and > unambiguous > way. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Tue Apr 20 17:06:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD8715E0514; Tue, 20 Apr 2021 17:06: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 4FPqpg5pk8z3Fb6; Tue, 20 Apr 2021 17:06: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 BA76D16A8F; Tue, 20 Apr 2021 17:06: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 13KH6Z4m039565; Tue, 20 Apr 2021 17:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KH6ZNk039564; Tue, 20 Apr 2021 17:06:35 GMT (envelope-from git) Date: Tue, 20 Apr 2021 17:06:35 GMT Message-Id: <202104201706.13KH6ZNk039564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 7b5053ce2296 - main - tcp_input: remove comments and assertions about tcpbinfo locking MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b5053ce2296e0fd96f162e308beb344b4ee654c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 17:06:35 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=7b5053ce2296e0fd96f162e308beb344b4ee654c commit 7b5053ce2296e0fd96f162e308beb344b4ee654c Author: Gleb Smirnoff AuthorDate: 2021-04-16 21:39:19 +0000 Commit: Gleb Smirnoff CommitDate: 2021-04-20 17:02:20 +0000 tcp_input: remove comments and assertions about tcpbinfo locking They aren't valid since d40c0d47cd2. --- sys/netinet/tcp_input.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 8592f3313725..cac67024705e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -984,16 +984,6 @@ findpcb: * or duplicate segments arriving late. If this segment was a * legitimate new connection attempt, the old INPCB gets removed and * we can try again to find a listening socket. - * - * At this point, due to earlier optimism, we may hold only an inpcb - * lock, and not the inpcbinfo write lock. If so, we need to try to - * acquire it, or if that fails, acquire a reference on the inpcb, - * drop all locks, acquire a global write lock, and then re-acquire - * the inpcb lock. We may at that point discover that another thread - * has tried to free the inpcb, in which case we need to loop back - * and try to find a new inpcb to deliver to. - * - * XXXRW: It may be time to rethink timewait locking. */ if (inp->inp_flags & INP_TIMEWAIT) { tcp_dooptions(&to, optp, optlen, @@ -1361,7 +1351,6 @@ tfo_socket_result: * Entry added to syncache and mbuf consumed. * Only the listen socket is unlocked by syncache_add(). */ - INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); return (IPPROTO_DONE); } else if (tp->t_state == TCPS_LISTEN) { /* @@ -1414,7 +1403,6 @@ dropunlock: INP_UNLOCK(inp); drop: - INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); if (s != NULL) free(s, M_TCPLOG); if (m != NULL) From owner-dev-commits-src-all@freebsd.org Tue Apr 20 17:06:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FE3A5E04B9; Tue, 20 Apr 2021 17:06: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 4FPqpj01vHz3G0l; Tue, 20 Apr 2021 17:06: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 DEC39166E9; Tue, 20 Apr 2021 17:06: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 13KH6ajK039586; Tue, 20 Apr 2021 17:06:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KH6aMh039585; Tue, 20 Apr 2021 17:06:36 GMT (envelope-from git) Date: Tue, 20 Apr 2021 17:06:36 GMT Message-Id: <202104201706.13KH6aMh039585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1db08fbe3ffa - main - tcp_input: always request read-locking of PCB for any pure SYN segment. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1db08fbe3ffad1be59c9449628ee867b50f6be6f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 17:06:37 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1db08fbe3ffad1be59c9449628ee867b50f6be6f commit 1db08fbe3ffad1be59c9449628ee867b50f6be6f Author: Gleb Smirnoff AuthorDate: 2021-04-16 21:56:14 +0000 Commit: Gleb Smirnoff CommitDate: 2021-04-20 17:02:20 +0000 tcp_input: always request read-locking of PCB for any pure SYN segment. This is further rework of 08d9c920275. Now we carry the knowledge of lock type all the way through tcp_input() and also into tcp_twcheck(). Ideally the rlocking for pure SYNs should propagate all the way into the alternative TCP stacks, but not yet today. This should close a race when socket is bind(2)-ed but not yet listen(2)-ed and a SYN-packet arrives racing with listen(2), discovered recently by pho@. --- sys/netinet/in_pcb.c | 14 ++++---------- sys/netinet/in_pcb.h | 3 +-- sys/netinet/tcp_input.c | 16 +++++++++++++--- sys/netinet/tcp_timewait.c | 29 ++++++++++++++++++++++++----- sys/netinet6/in6_pcb.c | 13 +++---------- 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 43cd469e0fcf..43eb31c4e31d 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2524,12 +2524,6 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, INP_WLOCK(inp); } else if (lookupflags & INPLOOKUP_RLOCKPCB) { INP_RLOCK(inp); - } else if (lookupflags & INPLOOKUP_RLOCKLISTEN) { - if (inp->inp_socket != NULL && - SOLISTENING(inp->inp_socket)) - INP_RLOCK(inp); - else - INP_WLOCK(inp); } else panic("%s: locking bug", __func__); if (__predict_false(inp->inp_flags2 & INP_FREED)) { @@ -2557,8 +2551,8 @@ in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); - KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB | - INPLOOKUP_RLOCKLISTEN)) != 0, ("%s: LOCKPCB not set", __func__)); + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, + ("%s: LOCKPCB not set", __func__)); /* * When not using RSS, use connection groups in preference to the @@ -2593,8 +2587,8 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in_addr faddr, KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); - KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB | - INPLOOKUP_RLOCKLISTEN)) != 0, ("%s: LOCKPCB not set", __func__)); + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, + ("%s: LOCKPCB not set", __func__)); #ifdef PCBGROUP /* diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 4959fc238dfb..923c5ba4edff 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -761,10 +761,9 @@ int inp_so_options(const struct inpcb *inp); #define INPLOOKUP_WILDCARD 0x00000001 /* Allow wildcard sockets. */ #define INPLOOKUP_RLOCKPCB 0x00000002 /* Return inpcb read-locked. */ #define INPLOOKUP_WLOCKPCB 0x00000004 /* Return inpcb write-locked. */ -#define INPLOOKUP_RLOCKLISTEN 0x00000008 /* Rlock if listening, W if !.*/ #define INPLOOKUP_MASK (INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB | \ - INPLOOKUP_WLOCKPCB | INPLOOKUP_RLOCKLISTEN) + INPLOOKUP_WLOCKPCB) #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index cac67024705e..9d45c5ab42dc 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -834,11 +834,12 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); /* - * For initial SYN packets arriving on listening socket, - * we don't need write lock. + * For initial SYN packets we don't need write lock on matching + * PCB, be it a listening one or a synchronized one. The packet + * shall not modify its state. */ lookupflag = (thflags & (TH_ACK|TH_SYN)) == TH_SYN ? - INPLOOKUP_RLOCKLISTEN : INPLOOKUP_WLOCKPCB; + INPLOOKUP_RLOCKPCB : INPLOOKUP_WLOCKPCB; findpcb: #ifdef INET6 if (isipv6 && fwd_tag != NULL) { @@ -1380,7 +1381,16 @@ tfo_socket_result: * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later * state. tcp_do_segment() always consumes the mbuf chain, unlocks * the inpcb, and unlocks pcbinfo. + * + * XXXGL: in case of a pure SYN arriving on existing connection + * TCP stacks won't need to modify the PCB, they would either drop + * the segment silently, or send a challenge ACK. However, we try + * to upgrade the lock, because calling convention for stacks is + * write-lock on PCB. If upgrade fails, drop the SYN. */ + if (lookupflag == INPLOOKUP_RLOCKPCB && INP_TRY_UPGRADE(inp) == 0) + goto dropunlock; + tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos); return (IPPROTO_DONE); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index b62386ddca05..695ec4413ac9 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -377,7 +377,9 @@ tcp_twstart(struct tcpcb *tp) /* * Returns 1 if the TIME_WAIT state was killed and we should start over, * looking for a pcb in the listen state. Returns 0 otherwise. - * It be called with to == NULL only for pure SYN-segments. + * + * For pure SYN-segments the PCB shall be read-locked and the tcpopt pointer + * may be NULL. For the rest write-lock and valid tcpopt. */ int tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, @@ -388,7 +390,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, tcp_seq seq; NET_EPOCH_ASSERT(); - INP_WLOCK_ASSERT(inp); + INP_LOCK_ASSERT(inp); /* * XXXRW: Time wait state for inpcb has been recycled, but inpcb is @@ -401,8 +403,16 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, goto drop; thflags = th->th_flags; - KASSERT(to != NULL || (thflags & (TH_SYN | TH_ACK)) == TH_SYN, - ("tcp_twcheck: called without options on a non-SYN segment")); +#ifdef INVARIANTS + if ((thflags & (TH_SYN | TH_ACK)) == TH_SYN) + INP_RLOCK_ASSERT(inp); + else { + INP_WLOCK_ASSERT(inp); + KASSERT(to != NULL, + ("%s: called without options on a non-SYN segment", + __func__)); + } +#endif /* * NOTE: for FIN_WAIT_2 (to be added later), @@ -442,6 +452,13 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, * Allow UDP port number changes in this case. */ if ((thflags & TH_SYN) && SEQ_GT(th->th_seq, tw->rcv_nxt)) { + /* + * In case we can't upgrade our lock just pretend we have + * lost this packet. + */ + if (((thflags & (TH_SYN | TH_ACK)) == TH_SYN) && + INP_TRY_UPGRADE(inp) == 0) + goto drop; tcp_twclose(tw, 0); return (1); } @@ -471,6 +488,8 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, if ((thflags & TH_ACK) == 0) goto drop; + INP_WLOCK_ASSERT(inp); + /* * If timestamps were negotiated during SYN/ACK and a * segment without a timestamp is received, silently drop @@ -503,7 +522,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, drop: TCP_PROBE5(receive, NULL, NULL, m, NULL, th); dropnoprobe: - INP_WUNLOCK(inp); + INP_UNLOCK(inp); m_freem(m); return (0); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 96be795d5757..4cdd2a8f152f 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1299,12 +1299,6 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, INP_WLOCK(inp); } else if (lookupflags & INPLOOKUP_RLOCKPCB) { INP_RLOCK(inp); - } else if (lookupflags & INPLOOKUP_RLOCKLISTEN) { - if (inp->inp_socket != NULL && - SOLISTENING(inp->inp_socket)) - INP_RLOCK(inp); - else - INP_WLOCK(inp); } else panic("%s: locking bug", __func__); if (__predict_false(inp->inp_flags2 & INP_FREED)) { @@ -1331,8 +1325,8 @@ in6_pcblookup(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport, KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); - KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB | - INPLOOKUP_RLOCKLISTEN)) != 0, ("%s: LOCKPCB not set", __func__)); + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, + ("%s: LOCKPCB not set", __func__)); /* * When not using RSS, use connection groups in preference to the @@ -1367,8 +1361,7 @@ in6_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); - KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB | - INPLOOKUP_RLOCKLISTEN)) != 0, + KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, ("%s: LOCKPCB not set", __func__)); #ifdef PCBGROUP From owner-dev-commits-src-all@freebsd.org Tue Apr 20 17:06:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E8285E043B; Tue, 20 Apr 2021 17:06: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 4FPqpk16J1z3G2H; Tue, 20 Apr 2021 17:06:38 +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 F348016A90; Tue, 20 Apr 2021 17:06: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 13KH6bWY039607; Tue, 20 Apr 2021 17:06:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KH6b2Y039606; Tue, 20 Apr 2021 17:06:37 GMT (envelope-from git) Date: Tue, 20 Apr 2021 17:06:37 GMT Message-Id: <202104201706.13KH6b2Y039606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d554522f6e68 - main - tcp_hostcache: use SMR for lookups, mutex(9) for updates. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d554522f6e687a365ebe935010298024fa2c1c9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 17:06:38 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d554522f6e687a365ebe935010298024fa2c1c9d commit d554522f6e687a365ebe935010298024fa2c1c9d Author: Gleb Smirnoff AuthorDate: 2021-03-22 22:32:57 +0000 Commit: Gleb Smirnoff CommitDate: 2021-04-20 17:02:20 +0000 tcp_hostcache: use SMR for lookups, mutex(9) for updates. In certain cases, e.g. a SYN-flood from a limited set of hosts, the TCP hostcache becomes the main contention point. To solve that, this change introduces lockless lookups on the hostcache. The cache remains a hash, however buckets are now CK_SLIST. For updates a bucket mutex is obtained, for read an SMR section is entered. Reviewed by: markj, rscheff Differential revision: https://reviews.freebsd.org/D29729 --- sys/netinet/tcp_hostcache.c | 463 ++++++++++++++++++++++---------------------- 1 file changed, 233 insertions(+), 230 deletions(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index baefa55fd076..6d05bfc667e7 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2002 Andre Oppermann, Internet Business Solutions AG + * Copyright (c) 2021 Gleb Smirnoff * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,18 +46,18 @@ * more lightwight and only carries information related to packet forwarding. * * tcp_hostcache is designed for multiple concurrent access in SMP - * environments and high contention. All bucket rows have their own lock and - * thus multiple lookups and modifies can be done at the same time as long as - * they are in different bucket rows. If a request for insertion of a new - * record can't be satisfied, it simply returns an empty structure. Nobody - * and nothing outside of tcp_hostcache.c will ever point directly to any - * entry in the tcp_hostcache. All communication is done in an - * object-oriented way and only functions of tcp_hostcache will manipulate - * hostcache entries. Otherwise, we are unable to achieve good behaviour in - * concurrent access situations. Since tcp_hostcache is only caching - * information, there are no fatal consequences if we either can't satisfy - * any particular request or have to drop/overwrite an existing entry because - * of bucket limit memory constrains. + * environments and high contention. It is a straight hash. Each bucket row + * is protected by its own lock for modification. Readers are protected by + * SMR. This puts certain restrictions on writers, e.g. a writer shall only + * insert a fully populated entry into a row. Writer can't reuse least used + * entry if a hash is full. Value updates for an entry shall be atomic. + * + * TCP stack(s) communication with tcp_hostcache() is done via KBI functions + * tcp_hc_*() and the hc_metrics_lite structure. + * + * Since tcp_hostcache is only caching information, there are no fatal + * consequences if we either can't allocate a new entry or have to drop + * an existing entry, or return somewhat stale information. */ /* @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -92,18 +94,15 @@ __FBSDID("$FreeBSD$"); #include -TAILQ_HEAD(hc_qhead, hc_metrics); - struct hc_head { - struct hc_qhead hch_bucket; + CK_SLIST_HEAD(hc_qhead, hc_metrics) hch_bucket; u_int hch_length; struct mtx hch_mtx; }; struct hc_metrics { /* housekeeping */ - TAILQ_ENTRY(hc_metrics) rmx_q; - struct hc_head *rmx_head; /* head of bucket tail queue */ + CK_SLIST_ENTRY(hc_metrics) rmx_q; struct in_addr ip4; /* IP address */ struct in6_addr ip6; /* IP6 address */ uint32_t ip6_zoneid; /* IPv6 scope zone id */ @@ -126,6 +125,7 @@ struct hc_metrics { struct tcp_hostcache { struct hc_head *hashbase; uma_zone_t zone; + smr_t smr; u_int hashsize; u_int hashmask; u_int hashsalt; @@ -149,8 +149,7 @@ VNET_DEFINE_STATIC(struct tcp_hostcache, tcp_hostcache); VNET_DEFINE_STATIC(struct callout, tcp_hc_callout); #define V_tcp_hc_callout VNET(tcp_hc_callout) -static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *, bool); -static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); +static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS); static int sysctl_tcp_hc_histo(SYSCTL_HANDLER_ARGS); static int sysctl_tcp_hc_purgenow(SYSCTL_HANDLER_ARGS); @@ -213,14 +212,13 @@ SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, purgenow, static MALLOC_DEFINE(M_HOSTCACHE, "hostcache", "TCP hostcache"); /* Use jenkins_hash32(), as in other parts of the tcp stack */ -#define HOSTCACHE_HASH(ip) \ - (jenkins_hash32((uint32_t *)(ip), 1, V_tcp_hostcache.hashsalt) & \ - V_tcp_hostcache.hashmask) - -#define HOSTCACHE_HASH6(ip6) \ - (jenkins_hash32((uint32_t *)&((ip6)->s6_addr32[0]), 4, \ - V_tcp_hostcache.hashsalt) & \ - V_tcp_hostcache.hashmask) +#define HOSTCACHE_HASH(inc) \ + ((inc)->inc_flags & INC_ISIPV6) ? \ + (jenkins_hash32((inc)->inc6_faddr.s6_addr32, 4, \ + V_tcp_hostcache.hashsalt) & V_tcp_hostcache.hashmask) \ + : \ + (jenkins_hash32(&(inc)->inc_faddr.s_addr, 1, \ + V_tcp_hostcache.hashsalt) & V_tcp_hostcache.hashmask) #define THC_LOCK(h) mtx_lock(&(h)->hch_mtx) #define THC_UNLOCK(h) mtx_unlock(&(h)->hch_mtx) @@ -270,7 +268,7 @@ tcp_hc_init(void) * Initialize the hash buckets. */ for (i = 0; i < V_tcp_hostcache.hashsize; i++) { - TAILQ_INIT(&V_tcp_hostcache.hashbase[i].hch_bucket); + CK_SLIST_INIT(&V_tcp_hostcache.hashbase[i].hch_bucket); V_tcp_hostcache.hashbase[i].hch_length = 0; mtx_init(&V_tcp_hostcache.hashbase[i].hch_mtx, "tcp_hc_entry", NULL, MTX_DEF); @@ -281,8 +279,9 @@ tcp_hc_init(void) */ V_tcp_hostcache.zone = uma_zcreate("hostcache", sizeof(struct hc_metrics), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_SMR); uma_zone_set_max(V_tcp_hostcache.zone, V_tcp_hostcache.cache_limit); + V_tcp_hostcache.smr = uma_zone_get_smr(V_tcp_hostcache.zone); /* * Set up periodic cache cleanup. @@ -313,169 +312,58 @@ tcp_hc_destroy(void) #endif /* - * Internal function: look up an entry in the hostcache or return NULL. - * - * If an entry has been returned, the caller becomes responsible for - * unlocking the bucket row after he is done reading/modifying the entry. + * Internal function: compare cache entry to a connection. */ -static struct hc_metrics * -tcp_hc_lookup(struct in_conninfo *inc, bool update) +static bool +tcp_hc_cmp(struct hc_metrics *hc_entry, struct in_conninfo *inc) { - int hash; - struct hc_head *hc_head; - struct hc_metrics *hc_entry; - - KASSERT(inc != NULL, ("%s: NULL in_conninfo", __func__)); - - /* - * Hash the foreign ip address. - */ - if (inc->inc_flags & INC_ISIPV6) - hash = HOSTCACHE_HASH6(&inc->inc6_faddr); - else - hash = HOSTCACHE_HASH(&inc->inc_faddr); - hc_head = &V_tcp_hostcache.hashbase[hash]; - - /* - * Acquire lock for this bucket row; we release the lock if we don't - * find an entry, otherwise the caller has to unlock after he is - * done. - */ - THC_LOCK(hc_head); - - /* - * Iterate through entries in bucket row looking for a match. - */ - TAILQ_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) { - if (inc->inc_flags & INC_ISIPV6) { - /* XXX: check ip6_zoneid */ - if (memcmp(&inc->inc6_faddr, &hc_entry->ip6, - sizeof(inc->inc6_faddr)) == 0) - goto found; - } else { - if (memcmp(&inc->inc_faddr, &hc_entry->ip4, - sizeof(inc->inc_faddr)) == 0) - goto found; - } + if (inc->inc_flags & INC_ISIPV6) { + /* XXX: check ip6_zoneid */ + if (memcmp(&inc->inc6_faddr, &hc_entry->ip6, + sizeof(inc->inc6_faddr)) == 0) + return (true); + } else { + if (memcmp(&inc->inc_faddr, &hc_entry->ip4, + sizeof(inc->inc_faddr)) == 0) + return (true); } - /* - * We were unsuccessful and didn't find anything. - */ - THC_UNLOCK(hc_head); - return (NULL); - -found: -#ifdef TCP_HC_COUNTERS - if (update) - hc_entry->rmx_updates++; - else - hc_entry->rmx_hits++; -#endif - hc_entry->rmx_expire = V_tcp_hostcache.expire; - - return (hc_entry); + return (false); } /* - * Internal function: insert an entry into the hostcache or return NULL if - * unable to allocate a new one. - * - * If an entry has been returned, the caller becomes responsible for - * unlocking the bucket row after he is done reading/modifying the entry. + * Internal function: look up an entry in the hostcache for read. + * On success returns in SMR section. */ static struct hc_metrics * -tcp_hc_insert(struct in_conninfo *inc) +tcp_hc_lookup(struct in_conninfo *inc) { - int hash; struct hc_head *hc_head; struct hc_metrics *hc_entry; KASSERT(inc != NULL, ("%s: NULL in_conninfo", __func__)); - /* - * Hash the foreign ip address. - */ - if (inc->inc_flags & INC_ISIPV6) - hash = HOSTCACHE_HASH6(&inc->inc6_faddr); - else - hash = HOSTCACHE_HASH(&inc->inc_faddr); - - hc_head = &V_tcp_hostcache.hashbase[hash]; + hc_head = &V_tcp_hostcache.hashbase[HOSTCACHE_HASH(inc)]; /* - * Acquire lock for this bucket row; we release the lock if we don't - * find an entry, otherwise the caller has to unlock after he is - * done. - */ - THC_LOCK(hc_head); - - /* - * If the bucket limit is reached, reuse the least-used element. + * Iterate through entries in bucket row looking for a match. */ - if (hc_head->hch_length >= V_tcp_hostcache.bucket_limit || - atomic_load_int(&V_tcp_hostcache.cache_count) >= V_tcp_hostcache.cache_limit) { - hc_entry = TAILQ_LAST(&hc_head->hch_bucket, hc_qhead); - /* - * At first we were dropping the last element, just to - * reacquire it in the next two lines again, which isn't very - * efficient. Instead just reuse the least used element. - * We may drop something that is still "in-use" but we can be - * "lossy". - * Just give up if this bucket row is empty and we don't have - * anything to replace. - */ - if (hc_entry == NULL) { - THC_UNLOCK(hc_head); - return (NULL); - } - TAILQ_REMOVE(&hc_head->hch_bucket, hc_entry, rmx_q); - KASSERT(V_tcp_hostcache.hashbase[hash].hch_length > 0 && - V_tcp_hostcache.hashbase[hash].hch_length <= - V_tcp_hostcache.bucket_limit, - ("tcp_hostcache: bucket length range violated at %u: %u", - hash, V_tcp_hostcache.hashbase[hash].hch_length)); - V_tcp_hostcache.hashbase[hash].hch_length--; - atomic_subtract_int(&V_tcp_hostcache.cache_count, 1); - TCPSTAT_INC(tcps_hc_bucketoverflow); -#if 0 - uma_zfree(V_tcp_hostcache.zone, hc_entry); + smr_enter(V_tcp_hostcache.smr); + CK_SLIST_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) + if (tcp_hc_cmp(hc_entry, inc)) + break; + + if (hc_entry != NULL) { + if (atomic_load_int(&hc_entry->rmx_expire) != + V_tcp_hostcache.expire) + atomic_store_int(&hc_entry->rmx_expire, + V_tcp_hostcache.expire); +#ifdef TCP_HC_COUNTERS + hc_entry->rmx_hits++; #endif - } else { - /* - * Allocate a new entry, or balk if not possible. - */ - hc_entry = uma_zalloc(V_tcp_hostcache.zone, M_NOWAIT); - if (hc_entry == NULL) { - THC_UNLOCK(hc_head); - return (NULL); - } - } - - /* - * Initialize basic information of hostcache entry. - */ - bzero(hc_entry, sizeof(*hc_entry)); - if (inc->inc_flags & INC_ISIPV6) { - hc_entry->ip6 = inc->inc6_faddr; - hc_entry->ip6_zoneid = inc->inc6_zoneid; } else - hc_entry->ip4 = inc->inc_faddr; - hc_entry->rmx_head = hc_head; - hc_entry->rmx_expire = V_tcp_hostcache.expire; - - /* - * Put it upfront. - */ - TAILQ_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); - V_tcp_hostcache.hashbase[hash].hch_length++; - KASSERT(V_tcp_hostcache.hashbase[hash].hch_length <= - V_tcp_hostcache.bucket_limit, - ("tcp_hostcache: bucket length too high at %u: %u", - hash, V_tcp_hostcache.hashbase[hash].hch_length)); - atomic_add_int(&V_tcp_hostcache.cache_count, 1); - TCPSTAT_INC(tcps_hc_added); + smr_exit(V_tcp_hostcache.smr); return (hc_entry); } @@ -498,7 +386,7 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_lite *hc_metrics_lite) /* * Find the right bucket. */ - hc_entry = tcp_hc_lookup(inc, false); + hc_entry = tcp_hc_lookup(inc); /* * If we don't have an existing object. @@ -508,18 +396,15 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_lite *hc_metrics_lite) return; } - hc_metrics_lite->rmx_mtu = hc_entry->rmx_mtu; - hc_metrics_lite->rmx_ssthresh = hc_entry->rmx_ssthresh; - hc_metrics_lite->rmx_rtt = hc_entry->rmx_rtt; - hc_metrics_lite->rmx_rttvar = hc_entry->rmx_rttvar; - hc_metrics_lite->rmx_cwnd = hc_entry->rmx_cwnd; - hc_metrics_lite->rmx_sendpipe = hc_entry->rmx_sendpipe; - hc_metrics_lite->rmx_recvpipe = hc_entry->rmx_recvpipe; + hc_metrics_lite->rmx_mtu = atomic_load_32(&hc_entry->rmx_mtu); + hc_metrics_lite->rmx_ssthresh = atomic_load_32(&hc_entry->rmx_ssthresh); + hc_metrics_lite->rmx_rtt = atomic_load_32(&hc_entry->rmx_rtt); + hc_metrics_lite->rmx_rttvar = atomic_load_32(&hc_entry->rmx_rttvar); + hc_metrics_lite->rmx_cwnd = atomic_load_32(&hc_entry->rmx_cwnd); + hc_metrics_lite->rmx_sendpipe = atomic_load_32(&hc_entry->rmx_sendpipe); + hc_metrics_lite->rmx_recvpipe = atomic_load_32(&hc_entry->rmx_recvpipe); - /* - * Unlock bucket row. - */ - THC_UNLOCK(hc_entry->rmx_head); + smr_exit(V_tcp_hostcache.smr); } /* @@ -536,13 +421,14 @@ tcp_hc_getmtu(struct in_conninfo *inc) if (!V_tcp_use_hostcache) return (0); - hc_entry = tcp_hc_lookup(inc, false); + hc_entry = tcp_hc_lookup(inc); if (hc_entry == NULL) { return (0); } - mtu = hc_entry->rmx_mtu; - THC_UNLOCK(hc_entry->rmx_head); + mtu = atomic_load_32(&hc_entry->rmx_mtu); + smr_exit(V_tcp_hostcache.smr); + return (mtu); } @@ -565,75 +451,175 @@ tcp_hc_updatemtu(struct in_conninfo *inc, uint32_t mtu) void tcp_hc_update(struct in_conninfo *inc, struct hc_metrics_lite *hcml) { - struct hc_metrics *hc_entry; + struct hc_head *hc_head; + struct hc_metrics *hc_entry, *hc_prev; + uint32_t v; + bool new; if (!V_tcp_use_hostcache) return; - hc_entry = tcp_hc_lookup(inc, true); - if (hc_entry == NULL) { - hc_entry = tcp_hc_insert(inc); - if (hc_entry == NULL) + hc_head = &V_tcp_hostcache.hashbase[HOSTCACHE_HASH(inc)]; + hc_prev = NULL; + + THC_LOCK(hc_head); + CK_SLIST_FOREACH(hc_entry, &hc_head->hch_bucket, rmx_q) { + if (tcp_hc_cmp(hc_entry, inc)) + break; + if (CK_SLIST_NEXT(hc_entry, rmx_q) != NULL) + hc_prev = hc_entry; + } + + if (hc_entry != NULL) { + if (atomic_load_int(&hc_entry->rmx_expire) != + V_tcp_hostcache.expire) + atomic_store_int(&hc_entry->rmx_expire, + V_tcp_hostcache.expire); +#ifdef TCP_HC_COUNTERS + hc_entry->rmx_updates++; +#endif + new = false; + } else { + /* + * Try to allocate a new entry. If the bucket limit is + * reached, delete the least-used element, located at the end + * of the CK_SLIST. During lookup we saved the pointer to + * the second to last element, in case if list has at least 2 + * elements. This will allow to delete last element without + * extra traversal. + * + * Give up if the row is empty. + */ + if (hc_head->hch_length >= V_tcp_hostcache.bucket_limit || + atomic_load_int(&V_tcp_hostcache.cache_count) >= + V_tcp_hostcache.cache_limit) { + if (hc_prev != NULL) { + hc_entry = CK_SLIST_NEXT(hc_prev, rmx_q); + KASSERT(CK_SLIST_NEXT(hc_entry, rmx_q) == NULL, + ("%s: %p is not one to last", + __func__, hc_prev)); + CK_SLIST_REMOVE_AFTER(hc_prev, rmx_q); + } else if ((hc_entry = + CK_SLIST_FIRST(&hc_head->hch_bucket)) != NULL) { + KASSERT(CK_SLIST_NEXT(hc_entry, rmx_q) == NULL, + ("%s: %p is not the only element", + __func__, hc_entry)); + CK_SLIST_REMOVE_HEAD(&hc_head->hch_bucket, + rmx_q); + } else { + THC_UNLOCK(hc_head); + return; + } + KASSERT(hc_head->hch_length > 0 && + hc_head->hch_length <= V_tcp_hostcache.bucket_limit, + ("tcp_hostcache: bucket length violated at %p", + hc_head)); + hc_head->hch_length--; + atomic_subtract_int(&V_tcp_hostcache.cache_count, 1); + TCPSTAT_INC(tcps_hc_bucketoverflow); + uma_zfree_smr(V_tcp_hostcache.zone, hc_entry); + } + + /* + * Allocate a new entry, or balk if not possible. + */ + hc_entry = uma_zalloc_smr(V_tcp_hostcache.zone, M_NOWAIT); + if (hc_entry == NULL) { + THC_UNLOCK(hc_head); return; + } + + /* + * Initialize basic information of hostcache entry. + */ + bzero(hc_entry, sizeof(*hc_entry)); + if (inc->inc_flags & INC_ISIPV6) { + hc_entry->ip6 = inc->inc6_faddr; + hc_entry->ip6_zoneid = inc->inc6_zoneid; + } else + hc_entry->ip4 = inc->inc_faddr; + hc_entry->rmx_expire = V_tcp_hostcache.expire; + new = true; } + /* + * Fill in data. Use atomics, since an existing entry is + * accessible by readers in SMR section. + */ if (hcml->rmx_mtu != 0) { - hc_entry->rmx_mtu = hcml->rmx_mtu; + atomic_store_32(&hc_entry->rmx_mtu, hcml->rmx_mtu); } if (hcml->rmx_rtt != 0) { if (hc_entry->rmx_rtt == 0) - hc_entry->rmx_rtt = hcml->rmx_rtt; + v = hcml->rmx_rtt; else - hc_entry->rmx_rtt = ((uint64_t)hc_entry->rmx_rtt + + v = ((uint64_t)hc_entry->rmx_rtt + (uint64_t)hcml->rmx_rtt) / 2; + atomic_store_32(&hc_entry->rmx_rtt, v); TCPSTAT_INC(tcps_cachedrtt); } if (hcml->rmx_rttvar != 0) { - if (hc_entry->rmx_rttvar == 0) - hc_entry->rmx_rttvar = hcml->rmx_rttvar; + if (hc_entry->rmx_rttvar == 0) + v = hcml->rmx_rttvar; else - hc_entry->rmx_rttvar = ((uint64_t)hc_entry->rmx_rttvar + + v = ((uint64_t)hc_entry->rmx_rttvar + (uint64_t)hcml->rmx_rttvar) / 2; + atomic_store_32(&hc_entry->rmx_rttvar, v); TCPSTAT_INC(tcps_cachedrttvar); } if (hcml->rmx_ssthresh != 0) { if (hc_entry->rmx_ssthresh == 0) - hc_entry->rmx_ssthresh = hcml->rmx_ssthresh; + v = hcml->rmx_ssthresh; else - hc_entry->rmx_ssthresh = - (hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2; + v = (hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2; + atomic_store_32(&hc_entry->rmx_ssthresh, v); TCPSTAT_INC(tcps_cachedssthresh); } if (hcml->rmx_cwnd != 0) { if (hc_entry->rmx_cwnd == 0) - hc_entry->rmx_cwnd = hcml->rmx_cwnd; + v = hcml->rmx_cwnd; else - hc_entry->rmx_cwnd = ((uint64_t)hc_entry->rmx_cwnd + + v = ((uint64_t)hc_entry->rmx_cwnd + (uint64_t)hcml->rmx_cwnd) / 2; + atomic_store_32(&hc_entry->rmx_cwnd, v); /* TCPSTAT_INC(tcps_cachedcwnd); */ } if (hcml->rmx_sendpipe != 0) { if (hc_entry->rmx_sendpipe == 0) - hc_entry->rmx_sendpipe = hcml->rmx_sendpipe; + v = hcml->rmx_sendpipe; else - hc_entry->rmx_sendpipe = - ((uint64_t)hc_entry->rmx_sendpipe + + v = ((uint64_t)hc_entry->rmx_sendpipe + (uint64_t)hcml->rmx_sendpipe) /2; + atomic_store_32(&hc_entry->rmx_sendpipe, v); /* TCPSTAT_INC(tcps_cachedsendpipe); */ } if (hcml->rmx_recvpipe != 0) { if (hc_entry->rmx_recvpipe == 0) - hc_entry->rmx_recvpipe = hcml->rmx_recvpipe; + v = hcml->rmx_recvpipe; else - hc_entry->rmx_recvpipe = - ((uint64_t)hc_entry->rmx_recvpipe + + v = ((uint64_t)hc_entry->rmx_recvpipe + (uint64_t)hcml->rmx_recvpipe) /2; + atomic_store_32(&hc_entry->rmx_recvpipe, v); /* TCPSTAT_INC(tcps_cachedrecvpipe); */ } - TAILQ_REMOVE(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); - TAILQ_INSERT_HEAD(&hc_entry->rmx_head->hch_bucket, hc_entry, rmx_q); - THC_UNLOCK(hc_entry->rmx_head); + /* + * Put it upfront. + */ + if (new) { + CK_SLIST_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); + hc_head->hch_length++; + KASSERT(hc_head->hch_length <= V_tcp_hostcache.bucket_limit, + ("tcp_hostcache: bucket length too high at %p", hc_head)); + atomic_add_int(&V_tcp_hostcache.cache_count, 1); + TCPSTAT_INC(tcps_hc_added); + } else if (hc_entry != CK_SLIST_FIRST(&hc_head->hch_bucket)) { + KASSERT(CK_SLIST_NEXT(hc_prev, rmx_q) == hc_entry, + ("%s: %p next is not %p", __func__, hc_prev, hc_entry)); + CK_SLIST_REMOVE_AFTER(hc_prev, rmx_q); + CK_SLIST_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, rmx_q); + } + THC_UNLOCK(hc_head); } /* @@ -683,8 +669,8 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) #define msec(u) (((u) + 500) / 1000) for (i = 0; i < V_tcp_hostcache.hashsize; i++) { THC_LOCK(&V_tcp_hostcache.hashbase[i]); - TAILQ_FOREACH(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket, - rmx_q) { + CK_SLIST_FOREACH(hc_entry, + &V_tcp_hostcache.hashbase[i].hch_bucket, rmx_q) { sbuf_printf(&sb, "%-15s %5u %8u %6lums %6lums %8u %8u %8u " #ifdef TCP_HC_COUNTERS @@ -770,29 +756,46 @@ sysctl_tcp_hc_histo(SYSCTL_HANDLER_ARGS) static void tcp_hc_purge_internal(int all) { - struct hc_metrics *hc_entry, *hc_next; + struct hc_head *head; + struct hc_metrics *hc_entry, *hc_next, *hc_prev; int i; for (i = 0; i < V_tcp_hostcache.hashsize; i++) { - THC_LOCK(&V_tcp_hostcache.hashbase[i]); - TAILQ_FOREACH_SAFE(hc_entry, - &V_tcp_hostcache.hashbase[i].hch_bucket, rmx_q, hc_next) { - KASSERT(V_tcp_hostcache.hashbase[i].hch_length > 0 && - V_tcp_hostcache.hashbase[i].hch_length <= + head = &V_tcp_hostcache.hashbase[i]; + hc_prev = NULL; + THC_LOCK(head); + CK_SLIST_FOREACH_SAFE(hc_entry, &head->hch_bucket, rmx_q, + hc_next) { + KASSERT(head->hch_length > 0 && head->hch_length <= V_tcp_hostcache.bucket_limit, ("tcp_hostcache: " - "bucket length out of range at %u: %u", - i, V_tcp_hostcache.hashbase[i].hch_length)); - if (all || hc_entry->rmx_expire <= 0) { - TAILQ_REMOVE( - &V_tcp_hostcache.hashbase[i].hch_bucket, - hc_entry, rmx_q); - uma_zfree(V_tcp_hostcache.zone, hc_entry); - V_tcp_hostcache.hashbase[i].hch_length--; + "bucket length out of range at %u: %u", i, + head->hch_length)); + if (all || + atomic_load_int(&hc_entry->rmx_expire) <= 0) { + if (hc_prev != NULL) { + KASSERT(hc_entry == + CK_SLIST_NEXT(hc_prev, rmx_q), + ("%s: %p is not next to %p", + __func__, hc_entry, hc_prev)); + CK_SLIST_REMOVE_AFTER(hc_prev, rmx_q); + } else { + KASSERT(hc_entry == + CK_SLIST_FIRST(&head->hch_bucket), + ("%s: %p is not first", + __func__, hc_entry)); + CK_SLIST_REMOVE_HEAD(&head->hch_bucket, + rmx_q); + } + uma_zfree_smr(V_tcp_hostcache.zone, hc_entry); + head->hch_length--; atomic_subtract_int(&V_tcp_hostcache.cache_count, 1); - } else - hc_entry->rmx_expire -= V_tcp_hostcache.prune; + } else { + atomic_subtract_int(&hc_entry->rmx_expire, + V_tcp_hostcache.prune); + hc_prev = hc_entry; + } } - THC_UNLOCK(&V_tcp_hostcache.hashbase[i]); + THC_UNLOCK(head); } } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 17:24:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B083E5E0E88; Tue, 20 Apr 2021 17:24:55 +0000 (UTC) (envelope-from jkim@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 4FPrCq4jlDz3GNs; Tue, 20 Apr 2021 17:24:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 7CDBFE29A; Tue, 20 Apr 2021 17:24:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files To: rgrimes@freebsd.org, Warner Losh Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202104201702.13KH2BEF071847@gndrsh.dnsmgr.net> From: Jung-uk Kim Organization: FreeBSD.org Message-ID: <1b95e1cc-0461-f7ef-9f29-e992c5d1e6d9@FreeBSD.org> Date: Tue, 20 Apr 2021 13:24:51 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <202104201702.13KH2BEF071847@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 17:24:55 -0000 On 21. 4. 20., Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Tue, Apr 20, 2021 at 10:24 AM Jung-uk Kim wrote: >> >>> On 21. 4. 20., Rodney W. Grimes wrote: >>>>> On 21. 4. 20., Rodney W. Grimes wrote: >>>>>>> The branch main has been updated by jkim: >>>>>>> >>>>>>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d >>>>>>> >>>>>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d >>>>>>> Author: Jung-uk Kim >>>>>>> AuthorDate: 2021-04-19 18:20:51 +0000 >>>>>>> Commit: Jung-uk Kim >>>>>>> CommitDate: 2021-04-19 18:20:51 +0000 >>>>>>> >>>>>>> flex: Regen bootstrap files >>>>>>> >>>>>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see >>> any >>>>>>> point of adding SPDX tag in generated file. >>>>>> >>>>>> The SPDX identifies the copyright that follows it, so please put this >>> back. >>>>> >>>>> It is a generated file. If you really think it is necessary, you need >>>>> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. >>>> >>>> Just because it is a generated file does not change the fact that >>>> its contents are copyrighted. Leaving the copyright out at best >>>> defaults to Bern convention, so the fact of the mater is the contents >>>> is copyrighted, and it is best to explicitly state that it is. >>> >>> Of course, it is copyrighted. My point was parse.y should have been >>> patched, not the generated file, if necessary. >>> >> >> Yes. It was a mistake to put it into the generated file. > > He removed the SPDX from parse.y, now says that is the right place > to put the SPDX. You agree. So can we have this undone? > >>>>> However, I don't see much sense in automatically adding BSD license in >>>>> every generated file in the first place. In fact, I think it should not >>>>> appear on generated file at all. It may say something along the line of >>>>> "generated by flex" instead but IANAL. >>>> >>>> Well, someone before you did see since in it, and hence put that SPDX in >>> it. >>> >>> Let me put it in another way. Do we really want to tag contrib code? >>> >> >> I tend to agree. >> >> I tend to agree because the SPDX tags are generally only looked at in the >> source tree by existing tools. The generated code won't be looked at >> typically. >> We should work to get this upstream, imho. > > Is parse.y not a source file? What am I missing? I guess you're confused somehow. 686cf5468c4a85c2a6385cdbab2383900876a41d did not touch parse.y. https://cgit.freebsd.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d parse.y never had the tag from the day 1. https://cgit.freebsd.org/src/log/contrib/flex/src/parse.y Jung-uk Kim >> By itself, the SPDX tag is just information. There's no legal requirement in >> copyright law to have it. Current project policy states they are just >> informative, >> though there's some desire to have a good framework to allow code with >> just a copyright and a SDPX tag into the tree, so long as that framework >> can be used to know what the license is for any file in a clear and >> unambiguous >> way. >> >> Warner From owner-dev-commits-src-all@freebsd.org Tue Apr 20 18:13:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70BF65E22E3; Tue, 20 Apr 2021 18:13: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 4FPsHY2KRRz3JwP; Tue, 20 Apr 2021 18:13:13 +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 42A1F179A0; Tue, 20 Apr 2021 18:13: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 13KIDDsV032116; Tue, 20 Apr 2021 18:13:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KIDDnw032115; Tue, 20 Apr 2021 18:13:13 GMT (envelope-from git) Date: Tue, 20 Apr 2021 18:13:13 GMT Message-Id: <202104201813.13KIDDnw032115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sofian Brabez Subject: git: 561d34d70596 - main - iwnstats: fix build with clang and allow install under /usr/local/sbin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 561d34d70596b455c6a513431f8ad007076f90c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 18:13:13 -0000 The branch main has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=561d34d70596b455c6a513431f8ad007076f90c5 commit 561d34d70596b455c6a513431f8ad007076f90c5 Author: Sofian Brabez AuthorDate: 2021-04-20 17:58:46 +0000 Commit: Sofian Brabez CommitDate: 2021-04-20 18:07:56 +0000 iwnstats: fix build with clang and allow install under /usr/local/sbin iwnstats was not compiling because of some issues raised by the clang compiler due to -Werror. As a tool it is not connected to world build. Add missing field "barker_mrc" initialization in struct iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused pointer *is on iwn_stats_*_print functions and unused variables for -Wunused-parameter and -Wunused-variable. The value for field "barker_mrc" of struct iwn2030_sensitivity_limits was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115 .barker_corr_th_min_mrc = 390). Also set BINDIR in Makefile to make it possible to install under /usr/local/sbin/iwnstats as it require super user. Reviewed by: adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29800 --- sys/dev/iwn/if_iwnreg.h | 3 ++- tools/tools/iwn/iwnstats/Makefile | 2 ++ tools/tools/iwn/iwnstats/main.c | 26 +++++++++++--------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index e53343cfbf4a..54945f63df16 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -2267,7 +2267,8 @@ static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = { 160,310, 97, 97, - 110 + 110, + 390 }; /* Map TID to TX scheduler's FIFO. */ diff --git a/tools/tools/iwn/iwnstats/Makefile b/tools/tools/iwn/iwnstats/Makefile index b35530c324b0..685e40759fb2 100644 --- a/tools/tools/iwn/iwnstats/Makefile +++ b/tools/tools/iwn/iwnstats/Makefile @@ -15,6 +15,8 @@ PROG= iwnstats # to not compile, use gcc for now. #CC= gcc +BINDIR?=/usr/local/sbin + SRCS= main.c iwn_ioctl.c # CFLAGS.clang+= -fbracket-depth=512 diff --git a/tools/tools/iwn/iwnstats/main.c b/tools/tools/iwn/iwnstats/main.c index b047e11ce6b8..8717bc48f824 100644 --- a/tools/tools/iwn/iwnstats/main.c +++ b/tools/tools/iwn/iwnstats/main.c @@ -72,8 +72,7 @@ iwnstats_new(const char *ifname) } static void -iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, - const char *prefix) +iwn_stats_phy_print(struct iwn_rx_phy_stats *rxphy, const char *prefix) { printf("%s: %s: ina=%d, fina=%d, bad_plcp=%d, bad_crc32=%d, overrun=%d, eoverrun=%d\n", @@ -108,7 +107,7 @@ iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, } static void -iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) +iwn_stats_rx_general_print(struct iwn_rx_general_stats *g) { printf("%s: bad_cts=%d, bad_ack=%d, not_bss=%d, filtered=%d, bad_chan=%d, beacons=%d\n", @@ -147,7 +146,7 @@ iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) } static void -iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) +iwn_stats_tx_print(struct iwn_tx_stats *tx) { printf("%s: preamble=%d, rx_detected=%d, bt_defer=%d, bt_kill=%d, short_len=%d\n", @@ -191,7 +190,7 @@ iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) } static void -iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) +iwn_stats_ht_phy_print(struct iwn_rx_ht_phy_stats *ht) { printf("%s: bad_plcp=%d, overrun=%d, eoverrun=%d, good_crc32=%d, bad_crc32=%d\n", @@ -212,7 +211,7 @@ iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) static void -iwn_stats_general_print(struct iwnstats *is, struct iwn_stats *stats) +iwn_stats_general_print(struct iwn_stats *stats) { /* General */ @@ -249,16 +248,16 @@ iwn_print(struct iwnstats *is) gettimeofday(&tv, NULL); printf("time=%ld.%.6ld\n", (long)tv.tv_sec, (long)tv.tv_usec); - iwn_stats_general_print(is, s); + iwn_stats_general_print(s); /* RX */ - iwn_stats_phy_print(is, &s->rx.ofdm, "ofdm"); - iwn_stats_phy_print(is, &s->rx.cck, "cck"); - iwn_stats_ht_phy_print(is, &s->rx.ht); - iwn_stats_rx_general_print(is, &s->rx.general); + iwn_stats_phy_print(&s->rx.ofdm, "ofdm"); + iwn_stats_phy_print(&s->rx.cck, "cck"); + iwn_stats_ht_phy_print(&s->rx.ht); + iwn_stats_rx_general_print(&s->rx.general); /* TX */ - iwn_stats_tx_print(is, &s->tx); + iwn_stats_tx_print(&s->tx); printf("--\n"); } @@ -278,9 +277,6 @@ main(int argc, char *argv[]) int ch; char *ifname; bool first; - char *sysctlname; - size_t len; - int ret; ifname = strdup(IWN_DEFAULT_IF); From owner-dev-commits-src-all@freebsd.org Tue Apr 20 19:23:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E3F15E4A4C; Tue, 20 Apr 2021 19:23: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 4FPtr81Jycz3NFq; Tue, 20 Apr 2021 19:23: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 1FD1F1887B; Tue, 20 Apr 2021 19:23: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 13KJN4E8024314; Tue, 20 Apr 2021 19:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KJN40G024313; Tue, 20 Apr 2021 19:23:04 GMT (envelope-from git) Date: Tue, 20 Apr 2021 19:23:04 GMT Message-Id: <202104201923.13KJN40G024313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: fc9780fd41e7 - main - mprutil: add big endian support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc9780fd41e7b29db04e9cb843cb5034b88ae662 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 19:23:04 -0000 The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=fc9780fd41e7b29db04e9cb843cb5034b88ae662 commit fc9780fd41e7b29db04e9cb843cb5034b88ae662 Author: Alfredo Dal'Ava Junior AuthorDate: 2021-04-17 01:01:38 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2021-04-20 22:19:47 +0000 mprutil: add big endian support This fix mprutil on big endian platforms, as follow up of D25785. Flash operations are still not working, such as MPI2_FUNCTION_FW_UPLOAD failing due to timeout. Firmware version used during tests: 16.00.01.00 Submitted by: Andre Fernando da Silva Reviewed by: luporl, Sreekanth Reddy (by e-mail) Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26040 --- usr.sbin/mpsutil/mps_cmd.c | 61 +++++++++++++++++++++++++++++++++++--------- usr.sbin/mpsutil/mps_flash.c | 9 ++++--- usr.sbin/mpsutil/mps_show.c | 59 +++++++++++++++++++++--------------------- usr.sbin/mpsutil/mps_slot.c | 4 ++- usr.sbin/mpsutil/mpsutil.8 | 3 +++ 5 files changed, 90 insertions(+), 46 deletions(-) diff --git a/usr.sbin/mpsutil/mps_cmd.c b/usr.sbin/mpsutil/mps_cmd.c index f0ff98c2442b..a9cb269abc5f 100644 --- a/usr.sbin/mpsutil/mps_cmd.c +++ b/usr.sbin/mpsutil/mps_cmd.c @@ -41,6 +41,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -241,6 +242,8 @@ struct mprs_btdh_mapping { uint16_t Reserved; }; +static void adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts); + const char * mps_ioc_status(U16 IOCStatus) { @@ -296,7 +299,7 @@ mps_set_slot_status(int fd, U16 handle, U16 slot, U32 status) NULL, 0, NULL, 0, 30) != 0) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) return (EIO); return (0); } @@ -319,7 +322,7 @@ mps_read_config_page_header(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, NULL, 0, NULL, 0, 30)) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; return (EIO); @@ -342,15 +345,15 @@ mps_read_ext_config_page_header(int fd, U8 ExtPageType, U8 PageNumber, U32 PageA req.Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; req.ExtPageType = ExtPageType; req.Header.PageNumber = PageNumber; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply), NULL, 0, NULL, 0, 30)) return (errno); - if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { + if (!IOC_STATUS_SUCCESS(le16toh(reply.IOCStatus))) { if (IOCStatus != NULL) - *IOCStatus = reply.IOCStatus; + *IOCStatus = le16toh(reply.IOCStatus); return (EIO); } if ((header == NULL) || (ExtPageLength == NULL)) @@ -381,7 +384,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, bzero(&req, sizeof(req)); req.Function = MPI2_FUNCTION_CONFIG; req.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); req.Header = header; if (req.Header.PageLength == 0) req.Header.PageLength = 4; @@ -395,6 +398,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, errno = error; return (NULL); } + reply.IOCStatus = le16toh(reply.IOCStatus); if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; @@ -432,14 +436,14 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, bzero(&req, sizeof(req)); req.Function = MPI2_FUNCTION_CONFIG; req.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; - req.PageAddress = PageAddress; + req.PageAddress = htole32(PageAddress); req.Header = header; if (pagelen == 0) - pagelen = 4; + pagelen = htole16(4); req.ExtPageLength = pagelen; req.ExtPageType = ExtPageType; - len = pagelen * 4; + len = le16toh(pagelen) * 4; buf = malloc(len); if (mps_pass_command(fd, &req, sizeof(req), &reply, sizeof(reply), buf, len, NULL, 0, 30)) { @@ -448,6 +452,7 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, errno = error; return (NULL); } + reply.IOCStatus = le16toh(reply.IOCStatus); if (!IOC_STATUS_SUCCESS(reply.IOCStatus)) { if (IOCStatus != NULL) *IOCStatus = reply.IOCStatus; @@ -471,7 +476,7 @@ mps_firmware_send(int fd, unsigned char *fw, uint32_t len, bool bios) bzero(&reply, sizeof(reply)); req.Function = MPI2_FUNCTION_FW_DOWNLOAD; req.ImageType = bios ? MPI2_FW_DOWNLOAD_ITYPE_BIOS : MPI2_FW_DOWNLOAD_ITYPE_FW; - req.TotalImageSize = len; + req.TotalImageSize = htole32(len); req.MsgFlags = MPI2_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT; if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply), @@ -502,7 +507,7 @@ mps_firmware_get(int fd, unsigned char **firmware, bool bios) return (-1); } - size = reply.ActualImageSize; + size = le32toh(reply.ActualImageSize); *firmware = calloc(size, sizeof(unsigned char)); if (*firmware == NULL) { warn("calloc"); @@ -571,6 +576,7 @@ mps_read_config_page(int fd, U8 PageType, U8 PageNumber, U32 PageAddress, errno = error; return (NULL); } + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -598,9 +604,10 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, req.header.PageVersion = PageVersion; req.header.PageNumber = PageNumber; req.header.ExtPageType = ExtPageType; - req.page_address = PageAddress; + req.page_address = htole32(PageAddress); if (ioctl(fd, MPSIO_READ_EXT_CFG_HEADER, &req) < 0) return (NULL); + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -620,6 +627,7 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, errno = error; return (NULL); } + req.ioc_status = le16toh(req.ioc_status); if (!IOC_STATUS_SUCCESS(req.ioc_status)) { if (IOCStatus != NULL) *IOCStatus = req.ioc_status; @@ -761,6 +769,35 @@ mps_get_iocfacts(int fd) errno = EINVAL; return (NULL); } + adjust_iocfacts_endianness(facts); return (facts); } +static void +adjust_iocfacts_endianness(MPI2_IOC_FACTS_REPLY *facts) +{ + facts->MsgVersion = le16toh(facts->MsgVersion); + facts->HeaderVersion = le16toh(facts->HeaderVersion); + facts->Reserved1 = le16toh(facts->Reserved1); + facts->IOCExceptions = le16toh(facts->IOCExceptions); + facts->IOCStatus = le16toh(facts->IOCStatus); + facts->IOCLogInfo = le32toh(facts->IOCLogInfo); + facts->RequestCredit = le16toh(facts->RequestCredit); + facts->ProductID = le16toh(facts->ProductID); + facts->IOCCapabilities = le32toh(facts->IOCCapabilities); + facts->IOCRequestFrameSize = + le16toh(facts->IOCRequestFrameSize); + facts->FWVersion.Word = le32toh(facts->FWVersion.Word); + facts->MaxInitiators = le16toh(facts->MaxInitiators); + facts->MaxTargets = le16toh(facts->MaxTargets); + facts->MaxSasExpanders = le16toh(facts->MaxSasExpanders); + facts->MaxEnclosures = le16toh(facts->MaxEnclosures); + facts->ProtocolFlags = le16toh(facts->ProtocolFlags); + facts->HighPriorityCredit = le16toh(facts->HighPriorityCredit); + facts->MaxReplyDescriptorPostQueueDepth = + le16toh(facts->MaxReplyDescriptorPostQueueDepth); + facts->MaxDevHandle = le16toh(facts->MaxDevHandle); + facts->MaxPersistentEntries = + le16toh(facts->MaxPersistentEntries); + facts->MinDevHandle = le16toh(facts->MinDevHandle); +} diff --git a/usr.sbin/mpsutil/mps_flash.c b/usr.sbin/mpsutil/mps_flash.c index 22beaae79bb0..a0cc4a877b7d 100644 --- a/usr.sbin/mpsutil/mps_flash.c +++ b/usr.sbin/mpsutil/mps_flash.c @@ -29,6 +29,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -203,21 +204,21 @@ flash_update(int argc, char **argv) } } else { fwheader = (MPI2_FW_IMAGE_HEADER *)mem; - if (fwheader->VendorID != MPI2_MFGPAGE_VENDORID_LSI) { + if (le16toh(fwheader->VendorID) != MPI2_MFGPAGE_VENDORID_LSI) { warnx("Invalid firmware:"); warnx(" Expected Vendor ID: %04x", MPI2_MFGPAGE_VENDORID_LSI); - warnx(" Image Vendor ID: %04x", fwheader->VendorID); + warnx(" Image Vendor ID: %04x", le16toh(fwheader->VendorID)); munmap(mem, st.st_size); close(fd); free(facts); return (1); } - if (fwheader->ProductID != facts->ProductID) { + if (le16toh(fwheader->ProductID) != facts->ProductID) { warnx("Invalid image:"); warnx(" Expected Product ID: %04x", facts->ProductID); - warnx(" Image Product ID: %04x", fwheader->ProductID); + warnx(" Image Product ID: %04x", le16toh(fwheader->ProductID)); munmap(mem, st.st_size); close(fd); free(facts); diff --git a/usr.sbin/mpsutil/mps_show.c b/usr.sbin/mpsutil/mps_show.c index bb790fe21229..620bb5e27f89 100644 --- a/usr.sbin/mpsutil/mps_show.c +++ b/usr.sbin/mpsutil/mps_show.c @@ -36,6 +36,7 @@ __RCSID("$FreeBSD$"); #include #include +#include #include #include #include @@ -105,7 +106,7 @@ show_adapter(int ac, char **av) warn("Failed to get BIOS page 3 info"); return (error); } - v = bios3->BiosVersion; + v = le32toh(bios3->BiosVersion); printf(" BIOS Revision: %d.%02d.%02d.%02d\n", ((v & 0xff000000) >> 24), ((v &0xff0000) >> 16), ((v & 0xff00) >> 8), (v & 0xff)); @@ -172,12 +173,12 @@ show_adapter(int ac, char **av) minspeed = get_device_speed(phy1->MaxMinLinkRate); maxspeed = get_device_speed(phy1->MaxMinLinkRate >> 4); - type = get_device_type(phy0->ControllerPhyDeviceInfo); + type = get_device_type(le32toh(phy0->ControllerPhyDeviceInfo)); - if (phy0->AttachedDevHandle != 0) { - snprintf(devhandle, 5, "%04x", phy0->AttachedDevHandle); + if (le16toh(phy0->AttachedDevHandle) != 0) { + snprintf(devhandle, 5, "%04x", le16toh(phy0->AttachedDevHandle)); snprintf(ctrlhandle, 5, "%04x", - phy0->ControllerDevHandle); + le16toh(phy0->ControllerDevHandle)); speed = get_device_speed(phy0->NegotiatedLinkRate); } else { snprintf(devhandle, 5, " "); @@ -520,7 +521,7 @@ show_devices(int ac, char **av) close(fd); return (error); } - handle = device->DevHandle; + handle = le16toh(device->DevHandle); if (device->ParentDevHandle == 0x0) { free(device); @@ -539,7 +540,7 @@ show_devices(int ac, char **av) else snprintf(bt, sizeof(bt), "%02d %02d", bus, target); - type = get_device_type(device->DeviceInfo); + type = get_device_type(le32toh(device->DeviceInfo)); if (device->PhyNum < nphys) { phydata = &sas0->PhyData[device->PhyNum]; @@ -551,7 +552,7 @@ show_devices(int ac, char **av) MPI2_SAS_EXPAND_PGAD_FORM_HNDL_PHY_NUM | (device->PhyNum << MPI2_SAS_EXPAND_PGAD_PHYNUM_SHIFT) | - device->ParentDevHandle, &IOCStatus); + le16toh(device->ParentDevHandle), &IOCStatus); if (exp1 == NULL) { if (IOCStatus != MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) { error = errno; @@ -570,19 +571,19 @@ show_devices(int ac, char **av) speed = " "; if (device->EnclosureHandle != 0) { - snprintf(enchandle, 5, "%04x", device->EnclosureHandle); - snprintf(slot, 3, "%02d", device->Slot); + snprintf(enchandle, 5, "%04x", le16toh(device->EnclosureHandle)); + snprintf(slot, 3, "%02d", le16toh(device->Slot)); } else { snprintf(enchandle, 5, " "); snprintf(slot, 3, " "); } printf("%-10s", bt); - snprintf(buf, sizeof(buf), "%08x%08x", device->SASAddress.High, - device->SASAddress.Low); + snprintf(buf, sizeof(buf), "%08x%08x", le32toh(device->SASAddress.High), + le32toh(device->SASAddress.Low)); printf("%-17s", buf); - snprintf(buf, sizeof(buf), "%04x", device->DevHandle); + snprintf(buf, sizeof(buf), "%04x", le16toh(device->DevHandle)); printf("%-8s", buf); - snprintf(buf, sizeof(buf), "%04x", device->ParentDevHandle); + snprintf(buf, sizeof(buf), "%04x", le16toh(device->ParentDevHandle)); printf("%-10s", buf); printf("%-14s%-6s%-5s%-6s%d\n", type, speed, enchandle, slot, device->MaxPortConnections); @@ -626,16 +627,16 @@ show_enclosures(int ac, char **av) close(fd); return (error); } - type = get_enc_type(enc->Flags, &issep); + type = get_enc_type(le16toh(enc->Flags), &issep); if (issep == 0) snprintf(sepstr, 5, " "); else - snprintf(sepstr, 5, "%04x", enc->SEPDevHandle); + snprintf(sepstr, 5, "%04x", le16toh(enc->SEPDevHandle)); printf(" %.2d %08x%08x %s %04x %s\n", - enc->NumSlots, enc->EnclosureLogicalID.High, - enc->EnclosureLogicalID.Low, sepstr, enc->EnclosureHandle, + le16toh(enc->NumSlots), le32toh(enc->EnclosureLogicalID.High), + le32toh(enc->EnclosureLogicalID.Low), sepstr, le16toh(enc->EnclosureHandle), type); - handle = enc->EnclosureHandle; + handle = le16toh(enc->EnclosureHandle); free(enc); } printf("\n"); @@ -679,19 +680,19 @@ show_expanders(int ac, char **av) } nphys = exp0->NumPhys; - handle = exp0->DevHandle; + handle = le16toh(exp0->DevHandle); if (exp0->EnclosureHandle == 0x00) snprintf(enchandle, 5, " "); else - snprintf(enchandle, 5, "%04d", exp0->EnclosureHandle); + snprintf(enchandle, 5, "%04d", le16toh(exp0->EnclosureHandle)); if (exp0->ParentDevHandle == 0x0) snprintf(parent, 5, " "); else - snprintf(parent, 5, "%04x", exp0->ParentDevHandle); + snprintf(parent, 5, "%04x", le16toh(exp0->ParentDevHandle)); printf(" %02d %08x%08x %04x %s %s %d\n", - exp0->NumPhys, exp0->SASAddress.High, exp0->SASAddress.Low, - exp0->DevHandle, parent, enchandle, exp0->SASLevel); + exp0->NumPhys, le32toh(exp0->SASAddress.High), le32toh(exp0->SASAddress.Low), + le16toh(exp0->DevHandle), parent, enchandle, exp0->SASLevel); printf("\n"); printf(" Phy RemotePhy DevHandle Speed Min Max Device\n"); @@ -708,8 +709,8 @@ show_expanders(int ac, char **av) warn("Error retrieving expander pg 1"); continue; } - type = get_device_type(exp1->AttachedDeviceInfo); - if ((exp1->AttachedDeviceInfo &0x7) == 0) { + type = get_device_type(le32toh(exp1->AttachedDeviceInfo)); + if ((le32toh(exp1->AttachedDeviceInfo) &0x7) == 0) { speed = " "; snprintf(rphy, 3, " "); snprintf(rhandle, 5, " "); @@ -719,7 +720,7 @@ show_expanders(int ac, char **av) snprintf(rphy, 3, "%02d", exp1->AttachedPhyIdentifier); snprintf(rhandle, 5, "%04x", - exp1->AttachedDevHandle); + le16toh(exp1->AttachedDevHandle)); } min = get_device_speed(exp1->HwLinkRate); max = get_device_speed(exp1->HwLinkRate >> 4); @@ -762,7 +763,7 @@ show_cfgpage(int ac, char **av) switch (ac) { case 4: - addr = (uint32_t)strtoul(av[3], NULL, 0); + addr = htole32((uint32_t)strtoul(av[3], NULL, 0)); case 3: num = (uint8_t)strtoul(av[2], NULL, 0); case 2: @@ -789,7 +790,7 @@ show_cfgpage(int ac, char **av) if (page >= 0x10) { ehdr = data; - len = ehdr->ExtPageLength * 4; + len = le16toh(ehdr->ExtPageLength) * 4; page = ehdr->ExtPageType; attrs = ehdr->PageType >> 4; } else { diff --git a/usr.sbin/mpsutil/mps_slot.c b/usr.sbin/mpsutil/mps_slot.c index 1879d699067a..bb4a7324c461 100644 --- a/usr.sbin/mpsutil/mps_slot.c +++ b/usr.sbin/mpsutil/mps_slot.c @@ -31,6 +31,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -99,7 +100,8 @@ slot_set(int argc, char **argv) return (error); } - if (mps_set_slot_status(fd, handle, slot, status) != 0) { + if (mps_set_slot_status(fd, htole16(handle), htole16(slot), + htole32(status)) != 0) { warnx("Failed to set status"); close(fd); return (1); diff --git a/usr.sbin/mpsutil/mpsutil.8 b/usr.sbin/mpsutil/mpsutil.8 index 1dd4f0509174..1bb7c4d5eaec 100644 --- a/usr.sbin/mpsutil/mpsutil.8 +++ b/usr.sbin/mpsutil/mpsutil.8 @@ -163,3 +163,6 @@ The .Nm utility first appeared in .Fx 11.0 . +.Sh TODO +Flash operations (save/update) are not supported on big-endian architectures. +.Pp From owner-dev-commits-src-all@freebsd.org Tue Apr 20 19:32:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5BB55E5A8B; Tue, 20 Apr 2021 19:32: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 4FPv3T5mRqz3PQc; Tue, 20 Apr 2021 19:32: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 B8D9D1899A; Tue, 20 Apr 2021 19:32: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 13KJWrAH037839; Tue, 20 Apr 2021 19:32:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KJWrfN037838; Tue, 20 Apr 2021 19:32:53 GMT (envelope-from git) Date: Tue, 20 Apr 2021 19:32:53 GMT Message-Id: <202104201932.13KJWrfN037838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sofian Brabez Subject: git: b8be8094958a - main - wlanstats: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8be8094958a01255f5430bd6a36ff936bdd53c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 19:32:53 -0000 The branch main has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b8be8094958a01255f5430bd6a36ff936bdd53c3 commit b8be8094958a01255f5430bd6a36ff936bdd53c3 Author: Sofian Brabez AuthorDate: 2021-04-20 18:31:48 +0000 Commit: Sofian Brabez CommitDate: 2021-04-20 19:31:44 +0000 wlanstats: fix build Add -Wno-cast-align to the CFLAGS to fix the build of wlanstats Approved by: adrian MFC after: 1 week --- tools/tools/net80211/wlanstats/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile index 2d23932a62a5..f4384c6d0709 100644 --- a/tools/tools/net80211/wlanstats/Makefile +++ b/tools/tools/net80211/wlanstats/Makefile @@ -10,6 +10,6 @@ CFLAGS+=-I${.CURDIR}/../../../../lib/libbsdstat/ SRCS= wlanstats.c main.c -CFLAGS.clang+= -fbracket-depth=512 +CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align .include From owner-dev-commits-src-all@freebsd.org Tue Apr 20 19:44:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 961B15E60EB; Tue, 20 Apr 2021 19:44: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 4FPvKP3s8Yz3QQd; Tue, 20 Apr 2021 19:44: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 7735818BAC; Tue, 20 Apr 2021 19:44: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 13KJivvH051158; Tue, 20 Apr 2021 19:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KJivFd051157; Tue, 20 Apr 2021 19:44:57 GMT (envelope-from git) Date: Tue, 20 Apr 2021 19:44:57 GMT Message-Id: <202104201944.13KJivFd051157@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: dd559118ab3f - main - Fix leak in libc NFSv4 flags parsing 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: dd559118ab3f065ae230b324c3fe4bb1c9b7ca56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 19:44:57 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=dd559118ab3f065ae230b324c3fe4bb1c9b7ca56 commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56 Author: Andrew Walker AuthorDate: 2021-04-20 19:34:44 +0000 Commit: Ryan Moeller CommitDate: 2021-04-20 19:39:56 +0000 Fix leak in libc NFSv4 flags parsing Free memory allocated by strdup() in parse_flags_verbose(). Submitted by: Andrew Walker Reported by: valgrind Reviewed by: allanjude, freqlabs, rpokala MFC after: 3 days Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29871 --- lib/libc/posix1e/acl_support_nfs4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/posix1e/acl_support_nfs4.c b/lib/libc/posix1e/acl_support_nfs4.c index 3962eaa6daa8..92ec666b2313 100644 --- a/lib/libc/posix1e/acl_support_nfs4.c +++ b/lib/libc/posix1e/acl_support_nfs4.c @@ -142,9 +142,10 @@ parse_flags_verbose(const char *strp, uint32_t *var, int *try_compact) { int i, found, ever_found = 0; - char *str, *flag; + char *str, *flag, *to_free; str = strdup(strp); + to_free = str; *try_compact = 0; *var = 0; @@ -166,12 +167,12 @@ parse_flags_verbose(const char *strp, uint32_t *var, "invalid flag \"%s\"", flags_name, flag); else *try_compact = 1; - free(str); + free(to_free); return (-1); } } - free(str); + free(to_free); return (0); } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 20:23:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01DA25E7994; Tue, 20 Apr 2021 20: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 4FPw9y6fSJz3hhv; Tue, 20 Apr 2021 20: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 D7086191B2; Tue, 20 Apr 2021 20:23: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 13KKNYdt004233; Tue, 20 Apr 2021 20: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 13KKNY7n004232; Tue, 20 Apr 2021 20:23:34 GMT (envelope-from git) Date: Tue, 20 Apr 2021 20:23:34 GMT Message-Id: <202104202023.13KKNY7n004232@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: 0611aec3cf3a - main - etcupdate: Always extract to a temporary tree. 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: 0611aec3cf3a373e6a06f103699dbc91c3d6d472 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 20:23:35 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0611aec3cf3a373e6a06f103699dbc91c3d6d472 commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472 Author: John Baldwin AuthorDate: 2021-04-20 20:21:42 +0000 Commit: John Baldwin CommitDate: 2021-04-20 20:21:42 +0000 etcupdate: Always extract to a temporary tree. etcupdate has had a somewhat nasty race condition since its creation in that its state machine can get very confused if it is interrupted while building the tree to compare against. This is exacerbated by the fact that etcupdate doesn't emit any output while building the tree which can take several seconds (especially in recent years with the addition of the tree-wide buildconfig/installconfig passes). To mitigate this, always install a new tree into a temporary directory created via mktemp as was previously done only for dry-runs via -n. The existing trees are only rotated and the new tree installed as /var/db/etcupdate/current after the update command has completed. Reported by: dim, np (and many others) Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29843 --- usr.sbin/etcupdate/etcupdate.sh | 148 +++++++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 87d269f2ca69..72fa3e9d524d 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -226,9 +226,11 @@ build_tree() return 0 } -# Generate a new NEWTREE tree. If tarball is set, then the tree is +# Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a # source tree. +# +# $1 - directory to store new tree in extract_tree() { local files @@ -239,16 +241,16 @@ extract_tree() if [ -n "$preworld" ]; then files="$PREWORLD_FILES" fi - if ! (mkdir -p $NEWTREE && tar xf $tarball -C $NEWTREE $files) \ + if ! (mkdir -p $1 && tar xf $tarball -C $1 $files) \ >&3 2>&1; then echo "Failed to extract new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi else - if ! build_tree $NEWTREE; then + if ! build_tree $1; then echo "Failed to build new tree." - remove_tree $NEWTREE + remove_tree $1 exit 1 fi fi @@ -1353,14 +1355,28 @@ extract_cmd() log "extract command: tarball=$tarball" + # Create a temporary directory to hold the tree + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi + + extract_tree $dir + if [ -d $NEWTREE ]; then if ! remove_tree $NEWTREE; then echo "Unable to remove current tree." + remove_tree $dir exit 1 fi fi - extract_tree + if ! mv $dir $NEWTREE >&3 2>&1; then + echo "Unable to rename temp tree to current tree." + remove_tree $dir + exit 1 + fi } # Resolve conflicts left from an earlier merge. @@ -1420,7 +1436,7 @@ status_cmd() # source tree. update_cmd() { - local dir + local dir new old if [ $# -ne 0 ]; then usage @@ -1449,60 +1465,44 @@ update_cmd() exit 1 fi + # Save tree names to use for rotation later. + old=$OLDTREE + new=$NEWTREE if [ -z "$rerun" ]; then - # For a dryrun that is not a rerun, do not rotate the existing - # stock tree. Instead, extract a tree to a temporary directory - # and use that for the comparison. - if [ -n "$dryrun" ]; then - dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` - if [ $? -ne 0 ]; then - echo "Unable to create temporary directory." - exit 1 - fi - - # A pre-world dryrun has already set OLDTREE to - # point to the current stock tree. - if [ -z "$preworld" ]; then - OLDTREE=$NEWTREE - fi - NEWTREE=$dir - - # For a pre-world update, blow away any pre-existing - # NEWTREE. - elif [ -n "$preworld" ]; then - if ! remove_tree $NEWTREE; then - echo "Unable to remove pre-world tree." - exit 1 - fi + # Extract the new tree to a temporary directory. The + # trees are only rotated after a successful update to + # avoid races if an update command is interrupted + # before it completes. + dir=`mktemp -d $WORKDIR/etcupdate-XXXXXXX` + if [ $? -ne 0 ]; then + echo "Unable to create temporary directory." + exit 1 + fi - # Rotate the existing stock tree to the old tree. - elif [ -d $NEWTREE ]; then - # First, delete the previous old tree if it exists. - if ! remove_tree $OLDTREE; then - echo "Unable to remove old tree." - exit 1 - fi + # Populate the new tree. + extract_tree $dir - # Move the current stock tree. - if ! mv $NEWTREE $OLDTREE >&3 2>&1; then - echo "Unable to rename current stock tree." - exit 1 - fi + # Compare the new tree against the previous tree. For + # the preworld case OLDTREE already points to the + # current stock tree. + if [ -z "$preworld" ]; then + OLDTREE=$NEWTREE fi + NEWTREE=$dir + fi - if ! [ -d $OLDTREE ]; then - cat <&3 2>&1; then + echo "Unable to rename old tree." + exit 1 + fi + fi + + # Rotate the new tree. Remove a previous pre-world + # tree if it exists. + if [ -d $new ]; then + if [ -z "$preworld" ]; then + panic "New tree should be rotated to old" + fi + if ! remove_tree $old; then + echo "Unable to remove previous pre-world tree." + exit 1 + fi + fi + + if ! mv $NEWTREE $new >&3 2>&1; then + echo "Unable to rename current tree." + exit 1 + fi fi } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 20:23:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58A065E7995; Tue, 20 Apr 2021 20: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 4FPwB01Zvlz3hNZ; Tue, 20 Apr 2021 20: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 181BB19609; Tue, 20 Apr 2021 20:23: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 13KKNZnS004254; Tue, 20 Apr 2021 20:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KKNZdM004253; Tue, 20 Apr 2021 20:23:35 GMT (envelope-from git) Date: Tue, 20 Apr 2021 20:23:35 GMT Message-Id: <202104202023.13KKNZdM004253@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: 1f7afa936480 - main - etcupdate: Gracefully handle SIGINT when building trees. 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: 1f7afa9364805a912270c9d6a70dc4a889d47a4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 20:23:36 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7afa9364805a912270c9d6a70dc4a889d47a4e commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e Author: John Baldwin AuthorDate: 2021-04-20 20:22:11 +0000 Commit: John Baldwin CommitDate: 2021-04-20 20:22:11 +0000 etcupdate: Gracefully handle SIGINT when building trees. Run the 'build_tree' function inside of a subshell and trap SIGINT to return an error to the caller. This allows callers to gracefully cleanup a partially created tree. While here, redirect stdout/stderr of the subshell to the log file instead of applying redirections individually to each command executed while building the tree. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29844 --- usr.sbin/etcupdate/etcupdate.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 72fa3e9d524d..d0c27805562e 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -179,17 +179,21 @@ always_install() return 1 } -# Build a new tree +# Build a new tree. This runs inside a subshell to trap SIGINT. # # $1 - directory to store new tree in build_tree() -{ +( local destdir dir file make make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" - mkdir -p $1/usr/obj >&3 2>&1 + + exec >&3 2>&1 + trap 'return 1' INT + + mkdir -p $1/usr/obj destdir=`realpath $1` if [ -n "$preworld" ]; then @@ -197,34 +201,33 @@ build_tree() # crucial to installworld. for file in $PREWORLD_FILES; do name=$(basename $file) - mkdir -p $1/etc >&3 2>&1 || return 1 + mkdir -p $1/etc || return 1 cp -p $SRCDIR/$file $1/etc/$name || return 1 done elif ! [ -n "$nobuild" ]; then (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) \ - >&3 2>&1 || return 1 + MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ + return 1 else (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) >&3 2>&1 || return 1 + $make DESTDIR=$destdir distribution) || return 1 fi - chflags -R noschg $1 >&3 2>&1 || return 1 - rm -rf $1/usr/obj >&3 2>&1 || return 1 + chflags -R noschg $1 || return 1 + rm -rf $1/usr/obj || return 1 # Purge auto-generated files. Only the source files need to # be updated after which these files are regenerated. - rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db >&3 2>&1 || \ - return 1 + rm -f $1/etc/*.db $1/etc/passwd $1/var/db/services.db || return 1 # Remove empty files. These just clutter the output of 'diff'. - find $1 -type f -size 0 -delete >&3 2>&1 || return 1 + find $1 -type f -size 0 -delete || return 1 # Trim empty directories. - find -d $1 -type d -empty -delete >&3 2>&1 || return 1 + find -d $1 -type d -empty -delete || return 1 return 0 -} +) # Generate a new tree. If tarball is set, then the tree is # extracted from the tarball. Otherwise the tree is built from a From owner-dev-commits-src-all@freebsd.org Tue Apr 20 20:23:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 875CB5E7A15; Tue, 20 Apr 2021 20:23: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 4FPwB22xY7z3hRQ; Tue, 20 Apr 2021 20:23:38 +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 4D0BF19590; Tue, 20 Apr 2021 20:23:38 +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 13KKNcjj004296; Tue, 20 Apr 2021 20:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KKNcJ4004295; Tue, 20 Apr 2021 20:23:38 GMT (envelope-from git) Date: Tue, 20 Apr 2021 20:23:38 GMT Message-Id: <202104202023.13KKNcJ4004295@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: ba30215ae0ef - main - etcupdate: Add a revert mode to restore one or more stock files. 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: ba30215ae0efeb49e5e9ca2469d95edaea78680d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 20:23:38 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ba30215ae0efeb49e5e9ca2469d95edaea78680d commit ba30215ae0efeb49e5e9ca2469d95edaea78680d Author: John Baldwin AuthorDate: 2021-04-20 20:22:35 +0000 Commit: John Baldwin CommitDate: 2021-04-20 20:23:08 +0000 etcupdate: Add a revert mode to restore one or more stock files. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29846 --- usr.sbin/etcupdate/etcupdate.8 | 24 ++++++++++++-------- usr.sbin/etcupdate/etcupdate.sh | 49 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 24afbca12951..5f13ed1d6733 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 27, 2018 +.Dd April 20, 2021 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -69,6 +69,12 @@ .Op Fl D Ar destdir .Op Fl L Ar logfile .Nm +.Cm revert +.Op Fl d Ar workdir +.Op Fl D Ar destdir +.Op Fl L Ar logfile +.Ar +.Nm .Cm status .Op Fl d Ar workdir .Op Fl D Ar destdir @@ -342,6 +348,14 @@ tree and discard any local changes made to the file. .It (h) help Display the list of commands. .El +.Ss Revert Mode +The +.Cm revert +mode is used to restore the stock versions of files. +In this mode, +.Nm +installs the stock version of requested files. +This mode cannot be used to restore directories, only individual files. .Ss Status Mode The .Cm status @@ -880,14 +894,6 @@ For example, one can imagine a syntax along the lines of .Pp to resolve a specific conflict in an automated fashion. .Pp -It might be nice to have something like a -.Sq revert -command to replace a locally modified version of a file with the stock -version of the file. -For example: -.Pp -.Dl "etcupdate revert /etc/mail/freebsd.cf" -.Pp Bootstrapping .Nm often results in gratuitous diffs in diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 2b14b3a4d71b..bb9eb00bc646 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -58,7 +58,6 @@ # TODO: # - automatable conflict resolution -# - a 'revert' command to make a file "stock" usage() { @@ -72,6 +71,7 @@ usage: etcupdate [-npBF] [-d workdir] [-r | -s source | -t tarball] etcupdate extract [-B] [-d workdir] [-s source | -t tarball] [-L logfile] [-M options] etcupdate resolve [-p] [-d workdir] [-D destdir] [-L logfile] + etcupdate revert [-d workdir] [-D destdir] [-L logfile] file ... etcupdate status [-d workdir] [-D destdir] EOF exit 1 @@ -1415,6 +1415,47 @@ resolve_cmd() fi } +# Restore files to the stock version. Only files with a local change +# are restored from the stock version. +revert_cmd() +{ + local cmp file + + if [ $# -eq 0 ]; then + usage + fi + + for file; do + log "revert $file" + + if ! [ -e $NEWTREE/$file ]; then + echo "File $file does not exist in the current tree." + exit 1 + fi + if [ -d $NEWTREE/$file ]; then + echo "File $file is a directory." + exit 1 + fi + + compare $DESTDIR/$file $NEWTREE/$file + cmp=$? + if [ $cmp -eq $COMPARE_EQUAL ]; then + continue + fi + + if update_unmodified $file; then + # If this file had a conflict, clean up the + # conflict. + if [ -e $CONFLICTS/$file ]; then + if ! rm $CONFLICTS/$file >&3 2>&1; then + echo "Failed to remove conflict " \ + "for $file". + fi + fi + fi + done +} + # Report a summary of the previous merge. Specifically, list any # remaining conflicts followed by any warnings from the previous # update. @@ -1622,7 +1663,7 @@ EOF command="update" if [ $# -gt 0 ]; then case "$1" in - build|diff|extract|status|resolve) + build|diff|extract|status|resolve|revert) command="$1" shift ;; @@ -1801,7 +1842,7 @@ case $command in usage fi ;; - build|diff|status) + build|diff|status|revert) if [ -n "$dryrun" -o -n "$rerun" -o -n "$tarball" -o \ -n "$preworld" ]; then usage @@ -1835,7 +1876,7 @@ if ! mkdir -p $WORKDIR 2>/dev/null; then fi case $command in - diff|resolve|status) + diff|resolve|revert|status) exec 3>>$LOGFILE ;; *) From owner-dev-commits-src-all@freebsd.org Tue Apr 20 20:23:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E6AD5E7A14; Tue, 20 Apr 2021 20: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 4FPwB12j4Gz3hYf; Tue, 20 Apr 2021 20:23: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 2F9FA19423; Tue, 20 Apr 2021 20:23: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 13KKNbga004275; Tue, 20 Apr 2021 20:23:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KKNbPR004274; Tue, 20 Apr 2021 20:23:37 GMT (envelope-from git) Date: Tue, 20 Apr 2021 20:23:37 GMT Message-Id: <202104202023.13KKNbPR004274@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: ada7fd17d57f - main - etcupdate: Trim trailing whitespace. 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: ada7fd17d57fac3dbafff5a1b3268afb872c8b0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 20:23:37 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ada7fd17d57fac3dbafff5a1b3268afb872c8b0b commit ada7fd17d57fac3dbafff5a1b3268afb872c8b0b Author: John Baldwin AuthorDate: 2021-04-20 20:22:24 +0000 Commit: John Baldwin CommitDate: 2021-04-20 20:22:24 +0000 etcupdate: Trim trailing whitespace. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29845 --- usr.sbin/etcupdate/etcupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index d0c27805562e..2b14b3a4d71b 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -442,7 +442,7 @@ empty_destdir() # # $1 - first tree # $2 - second tree -# $3 - node name +# $3 - node name # $4 - label for first tree # $5 - label for second tree diffnode() @@ -867,7 +867,7 @@ merge_file() # $1 - pathname of the file to resolve (relative to DESTDIR) has_conflicts() { - + egrep -q '^(<{7}|\|{7}|={7}|>{7}) ' $CONFLICTS/$1 } @@ -1526,7 +1526,7 @@ EOF if [ -n "$preworld" ]; then > $WORKDIR/removed.files fi - + # The order for the following sections is important. In the # odd case that a directory is converted into a file, the # existing subfiles need to be removed if possible before the From owner-dev-commits-src-all@freebsd.org Tue Apr 20 20:34:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4F185E815E; Tue, 20 Apr 2021 20:34: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 4FPwQh5hRQz3jJW; Tue, 20 Apr 2021 20:34: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 B65C91995B; Tue, 20 Apr 2021 20:34: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 13KKYaZd018208; Tue, 20 Apr 2021 20:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KKYa3f018207; Tue, 20 Apr 2021 20:34:36 GMT (envelope-from git) Date: Tue, 20 Apr 2021 20:34:36 GMT Message-Id: <202104202034.13KKYa3f018207@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: e15bf05e0abc - main - bhyve: Be explicit that setting config.dump will not start a VM. 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: e15bf05e0abcf4435a09edb8ff8d7e38d1508bb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 20:34:36 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e15bf05e0abcf4435a09edb8ff8d7e38d1508bb2 commit e15bf05e0abcf4435a09edb8ff8d7e38d1508bb2 Author: John Baldwin AuthorDate: 2021-04-20 20:33:28 +0000 Commit: John Baldwin CommitDate: 2021-04-20 20:34:07 +0000 bhyve: Be explicit that setting config.dump will not start a VM. Suggested by: rpokala Reviewed by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D29738 --- usr.sbin/bhyve/bhyve_config.5 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index d65040513cb0..1a77b1bbacb4 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 24, 2021 +.Dd April 20, 2021 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -143,11 +143,13 @@ the host's hostname and the VM name. Use MSI-X interrupts for PCI VirtIO devices. If set to false, MSI interrupts are used instead. .It Va config.dump Ta bool Ta false Ta -If this value is set to true, +If this value is set to true after +.Xr bhyve 8 +has finished parsing command line options, then .Xr bhyve 8 -will write all of its configuration variables to stdout and exit -after it has finished parsing command line options. +will write all of its configuration variables to stdout and exit. +No VM will be started. .El .Ss x86-Specific Settings .Bl -column "x86.vmexit_on_pause" "integer" "Default" From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:10:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 223CA5E925B; Tue, 20 Apr 2021 21:10: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 4FPxD30Tl8z3kr1; Tue, 20 Apr 2021 21:10: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 038B319BF3; Tue, 20 Apr 2021 21:10: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 13KLAQrh067242; Tue, 20 Apr 2021 21:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLAQBd067241; Tue, 20 Apr 2021 21:10:26 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:10:26 GMT Message-Id: <202104202110.13KLAQBd067241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 83223eb58bf7 - main - Fixup ObsoleteFiles after 76681661be28. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83223eb58bf79270a84b34254679ff2c2adc304e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:10:27 -0000 The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=83223eb58bf79270a84b34254679ff2c2adc304e commit 83223eb58bf79270a84b34254679ff2c2adc304e Author: Dmitry Chagin AuthorDate: 2021-04-20 21:06:16 +0000 Commit: Dmitry Chagin CommitDate: 2021-04-20 21:06:16 +0000 Fixup ObsoleteFiles after 76681661be28. --- ObsoleteFiles.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 5035017ade9e..6f4cf3e2b5da 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -44,11 +44,11 @@ OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz # 20210412: Remove kernel asymmetric crypto -OLD_FILES+=usr/share/man/man9/crypto_asym.9 -OLD_FILES+=usr/share/man/man9/crypto_kdispatch.9 -OLD_FILES+=usr/share/man/man9/crypto_kdone.9 -OLD_FILES+=usr/share/man/man9/crypto_kregister.9 -OLD_FILES+=usr/share/man/man9/CRYPTODEV_KPROCESS.9 +OLD_FILES+=usr/share/man/man9/crypto_asym.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kdispatch.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kdone.9.gz +OLD_FILES+=usr/share/man/man9/crypto_kregister.9.gz +OLD_FILES+=usr/share/man/man9/CRYPTODEV_KPROCESS.9.gz # 20210410: remove unused libexec/rc.d/archdep OLD_FILES+=etc/rc.d/archdep From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:34:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90EFE5E9E19; Tue, 20 Apr 2021 21:34: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 4FPxlb3j82z3m4k; Tue, 20 Apr 2021 21:34: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 6E0231A1DE; Tue, 20 Apr 2021 21:34: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 13KLYJRM097437; Tue, 20 Apr 2021 21:34:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLYJZf097436; Tue, 20 Apr 2021 21:34:19 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:34:19 GMT Message-Id: <202104202134.13KLYJZf097436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 14fffd43061a - stable/13 - Remove reference to the pfctlinput2() from domain(9) after 237c1f932b. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14fffd43061a65239303db1e0d14dd2cf858e02d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:34:19 -0000 The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=14fffd43061a65239303db1e0d14dd2cf858e02d commit 14fffd43061a65239303db1e0d14dd2cf858e02d Author: Dmitry Chagin AuthorDate: 2021-04-13 21:40:20 +0000 Commit: Dmitry Chagin CommitDate: 2021-04-20 21:33:43 +0000 Remove reference to the pfctlinput2() from domain(9) after 237c1f932b. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D29751 (cherry picked from commit 86887853c39b0803009579e2b927bd67d524af63) --- ObsoleteFiles.inc | 3 +++ share/man/man9/Makefile | 1 - share/man/man9/domain.9 | 27 +-------------------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 4fd7275fb8fa..761d5f61dadd 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210413: Remove pfctlinput2 +OLD_FILES+=usr/share/man/man9/pfctlinput2.9.gz + # 20210329: Remove kernel-only crypto headers from /usr/include OLD_FILES+=usr/include/crypto/_cryptodev.h OLD_FILES+=usr/include/crypto/cbc_mac.h diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index edb87de6a35f..d2c3e77fc60f 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1010,7 +1010,6 @@ MLINKS+=dnv.9 dnvlist.9 \ MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 domain_add.9 \ domain.9 pfctlinput.9 \ - domain.9 pfctlinput2.9 \ domain.9 pffinddomain.9 \ domain.9 pffindproto.9 \ domain.9 pffindtype.9 diff --git a/share/man/man9/domain.9 b/share/man/man9/domain.9 index d8dca08c8dab..e8f97253a1d4 100644 --- a/share/man/man9/domain.9 +++ b/share/man/man9/domain.9 @@ -26,13 +26,12 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2020 +.Dd April 13, 2021 .Dt DOMAIN 9 .Os .Sh NAME .Nm domain_add , .Nm pfctlinput , -.Nm pfctlinput2 , .Nm pffinddomain , .Nm pffindproto , .Nm pffindtype , @@ -47,8 +46,6 @@ .Fn domain_add "void *data" .Ft void .Fn pfctlinput "int cmd" "struct sockaddr *sa" -.Ft void -.Fn pfctlinput2 "int cmd" "struct sockaddr *sa" "void *ctlparam" .Ft struct domain * .Fn pffinddomain "int family" .Ft struct protosw * @@ -130,27 +127,6 @@ calls the protocol specific .Fn pr_ctlinput function for each protocol in that has defined one, in every domain. .Pp -.Fn pfctlinput2 -provides that same functionality of -.Fn pfctlinput , -but with a few additional checks and a new -.Vt "void *" -argument that is passed directly to the protocol's -.Fn pr_ctlinput -function. -Unlike -.Fn pfctlinput , -.Fn pfctlinput2 -verifies that -.Fa sa -is not -.Dv NULL , -and that only the protocol families that are the same as -.Fa sa -have their -.Fn pr_ctlinput -function called. -.Pp .Fn domain_add adds a new protocol domain to the system. The argument @@ -240,7 +216,6 @@ types if the domain has a default raw protocol. The functions .Fn domain_add , .Fn pfctlinput , -.Fn pfctlinput2 , .Fn pffinddomain , .Fn pffindproto , .Fn pffindtype From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:35:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BA135E9E3F; Tue, 20 Apr 2021 21:35: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 4FPxmd41Vpz3lwW; Tue, 20 Apr 2021 21:35:13 +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 7CDC519EFC; Tue, 20 Apr 2021 21:35: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 13KLZD8q097609; Tue, 20 Apr 2021 21:35:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLZDPM097608; Tue, 20 Apr 2021 21:35:13 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:35:13 GMT Message-Id: <202104202135.13KLZDPM097608@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: b31fbebeb3d5 - main - Relax rtsock message restrictions. 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: b31fbebeb3d59af359a3417cddfbcf666b2c56c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:35:13 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=b31fbebeb3d59af359a3417cddfbcf666b2c56c9 commit b31fbebeb3d59af359a3417cddfbcf666b2c56c9 Author: Alexander V. Chernikov AuthorDate: 2021-04-19 20:49:18 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-20 21:34:19 +0000 Relax rtsock message restrictions. Address multiple issues with strict rtsock message validation. D28668 "normalisation" approach was based on the assumption that we always have at least "standard" sockaddr len. It turned out to be false - certain older applications like quagga or routed abuse sin[6]_len field and set it to the offset to the first fully-zero bit in the mask. It is impossible to normalise such sockaddrs without reallocation. With that in mind, change the approach to use a distinct memory buffer for the altered sockaddrs. This allows supporting the older software while maintaining the guarantee on the "standard" sockaddrs. PR: 255273,255089 Differential Revision: https://reviews.freebsd.org/D29826 MFC after: 3 days --- sys/net/rtsock.c | 271 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 177 insertions(+), 94 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 5194a2a15c1e..b7a7e5170c74 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -126,6 +126,13 @@ struct ifa_msghdrl32 { #endif /* COMPAT_FREEBSD32 */ +struct linear_buffer { + char *base; /* Base allocated memory pointer */ + uint32_t offset; /* Currently used offset */ + uint32_t size; /* Total buffer size */ +}; +#define SCRATCH_BUFFER_SIZE 1024 + #define RTS_PID_PRINTF(_fmt, ...) \ printf("rtsock:%s(): PID %d: " _fmt "\n", __func__, curproc->p_pid, ## __VA_ARGS__) @@ -177,7 +184,7 @@ static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *plen); static int rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo); -static int cleanup_xaddrs(struct rt_addrinfo *info); +static int cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb); static int sysctl_dumpentry(struct rtentry *rt, void *vw); static int sysctl_dumpnhop(struct rtentry *rt, struct nhop_object *nh, uint32_t weight, struct walkarg *w); @@ -621,7 +628,8 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) * Returns 0 on success. */ static int -fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo *info) +fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fibnum, + struct rt_addrinfo *info) { int error; sa_family_t saf; @@ -641,7 +649,7 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo * return (EINVAL); info->rti_flags = rtm->rtm_flags; - error = cleanup_xaddrs(info); + error = cleanup_xaddrs(info, lb); if (error != 0) return (error); saf = info->rti_info[RTAX_DST]->sa_family; @@ -878,6 +886,45 @@ export_rtaddrs(const struct rtentry *rt, struct sockaddr *dst, #endif } +static int +update_rtm_from_info(struct rt_addrinfo *info, struct rt_msghdr **prtm, + int alloc_len) +{ + struct rt_msghdr *rtm, *orig_rtm = NULL; + struct walkarg w; + int len; + + rtm = *prtm; + /* Check if we need to realloc storage */ + rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); + if (len > alloc_len) { + struct rt_msghdr *tmp_rtm; + + tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); + if (tmp_rtm == NULL) + return (ENOBUFS); + bcopy(rtm, tmp_rtm, rtm->rtm_msglen); + orig_rtm = rtm; + rtm = tmp_rtm; + alloc_len = len; + + /* + * Delay freeing original rtm as info contains + * data referencing it. + */ + } + + w.w_tmem = (caddr_t)rtm; + w.w_tmemsize = alloc_len; + rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); + rtm->rtm_addrs = info->rti_addrs; + + if (orig_rtm != NULL) + free(orig_rtm, M_TEMP); + *prtm = rtm; + return (0); +} + /* * Update sockaddrs, flags, etc in @prtm based on @rc data. @@ -891,11 +938,10 @@ static int update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, int alloc_len, struct rib_cmd_info *rc, struct nhop_object *nh) { - struct walkarg w; union sockaddr_union saun; - struct rt_msghdr *rtm, *orig_rtm = NULL; + struct rt_msghdr *rtm; struct ifnet *ifp; - int error, len; + int error; rtm = *prtm; union sockaddr_union sa_dst, sa_mask; @@ -927,28 +973,8 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, } else if (ifp != NULL) rtm->rtm_index = ifp->if_index; - /* Check if we need to realloc storage */ - rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); - if (len > alloc_len) { - struct rt_msghdr *tmp_rtm; - - tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); - if (tmp_rtm == NULL) - return (ENOBUFS); - bcopy(rtm, tmp_rtm, rtm->rtm_msglen); - orig_rtm = rtm; - rtm = tmp_rtm; - alloc_len = len; - - /* - * Delay freeing original rtm as info contains - * data referencing it. - */ - } - - w.w_tmem = (caddr_t)rtm; - w.w_tmemsize = alloc_len; - rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); + if ((error = update_rtm_from_info(info, prtm, alloc_len)) != 0) + return (error); rtm->rtm_flags = rc->rc_rt->rte_flags | nhop_get_rtflags(nh); if (rtm->rtm_flags & RTF_GWFLAG_COMPAT) @@ -956,11 +982,6 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, (rtm->rtm_flags & ~RTF_GWFLAG_COMPAT); rt_getmetrics(rc->rc_rt, nh, &rtm->rtm_rmx); rtm->rtm_rmx.rmx_weight = rc->rc_nh_weight; - rtm->rtm_addrs = info->rti_addrs; - - if (orig_rtm != NULL) - free(orig_rtm, M_TEMP); - *prtm = rtm; return (0); } @@ -985,6 +1006,17 @@ save_add_notification(struct rib_cmd_info *rc, void *_cbdata) } #endif +static struct sockaddr * +alloc_sockaddr_aligned(struct linear_buffer *lb, int len) +{ + len |= (sizeof(uint64_t) - 1); + if (lb->offset + len > lb->size) + return (NULL); + struct sockaddr *sa = (struct sockaddr *)(lb->base + lb->offset); + lb->offset += len; + return (sa); +} + /*ARGSUSED*/ static int route_output(struct mbuf *m, struct socket *so, ...) @@ -1022,12 +1054,17 @@ route_output(struct mbuf *m, struct socket *so, ...) * buffer aligned on 1k boundaty. */ alloc_len = roundup2(len, 1024); - if ((rtm = malloc(alloc_len, M_TEMP, M_NOWAIT)) == NULL) + int total_len = alloc_len + SCRATCH_BUFFER_SIZE; + if ((rtm = malloc(total_len, M_TEMP, M_NOWAIT)) == NULL) senderr(ENOBUFS); m_copydata(m, 0, len, (caddr_t)rtm); bzero(&info, sizeof(info)); nh = NULL; + struct linear_buffer lb = { + .base = (char *)rtm + alloc_len, + .size = SCRATCH_BUFFER_SIZE, + }; if (rtm->rtm_version != RTM_VERSION) { /* Do not touch message since format is unknown */ @@ -1042,19 +1079,19 @@ route_output(struct mbuf *m, struct socket *so, ...) * caller PID and error value. */ - if ((error = fill_addrinfo(rtm, len, fibnum, &info)) != 0) { + if ((error = fill_addrinfo(rtm, len, &lb, fibnum, &info)) != 0) { senderr(error); } + /* fill_addringo() embeds scope into IPv6 addresses */ +#ifdef INET6 + rti_need_deembed = 1; +#endif saf = info.rti_info[RTAX_DST]->sa_family; /* support for new ARP code */ if (rtm->rtm_flags & RTF_LLDATA) { error = lla_rt_output(rtm, &info); -#ifdef INET6 - if (error == 0) - rti_need_deembed = 1; -#endif goto flush; } @@ -1067,7 +1104,6 @@ route_output(struct mbuf *m, struct socket *so, ...) error = EINVAL; if (error != 0) senderr(error); - /* TODO: rebuild rtm from scratch */ } switch (rtm->rtm_type) { @@ -1079,9 +1115,6 @@ route_output(struct mbuf *m, struct socket *so, ...) } error = rib_action(fibnum, rtm->rtm_type, &info, &rc); if (error == 0) { -#ifdef INET6 - rti_need_deembed = 1; -#endif #ifdef ROUTE_MPATH if (NH_IS_NHGRP(rc.rc_nh_new) || (rc.rc_nh_old && NH_IS_NHGRP(rc.rc_nh_old))) { @@ -1110,12 +1143,7 @@ route_output(struct mbuf *m, struct socket *so, ...) } #endif nh = rc.rc_nh_old; - goto report; } -#ifdef INET6 - /* rt_msg2() will not be used when RTM_DELETE fails. */ - rti_need_deembed = 1; -#endif break; case RTM_GET: @@ -1124,13 +1152,18 @@ route_output(struct mbuf *m, struct socket *so, ...) senderr(error); nh = rc.rc_nh_new; -report: if (!can_export_rte(curthread->td_ucred, info.rti_info[RTAX_NETMASK] == NULL, info.rti_info[RTAX_DST])) { senderr(ESRCH); } + break; + default: + senderr(EOPNOTSUPP); + } + + if (error == 0) { error = update_rtm_from_rc(&info, &rtm, alloc_len, &rc, nh); /* * Note that some sockaddr pointers may have changed to @@ -1147,12 +1180,6 @@ report: #ifdef INET6 rti_need_deembed = 0; #endif - if (error != 0) - senderr(error); - break; - - default: - senderr(EOPNOTSUPP); } flush: @@ -1174,6 +1201,10 @@ flush: bcopy(sin6, info.rti_info[i], sizeof(*sin6)); } + if (update_rtm_from_info(&info, &rtm, alloc_len) != 0) { + if (error != 0) + error = ENOBUFS; + } } } #endif @@ -1350,9 +1381,10 @@ cleanup_xaddrs_lladdr(struct rt_addrinfo *info) } static int -cleanup_xaddrs_gateway(struct rt_addrinfo *info) +cleanup_xaddrs_gateway(struct rt_addrinfo *info, struct linear_buffer *lb) { struct sockaddr *gw = info->rti_info[RTAX_GATEWAY]; + struct sockaddr *sa; if (info->rti_flags & RTF_LLDATA) return (cleanup_xaddrs_lladdr(info)); @@ -1362,11 +1394,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) case AF_INET: { struct sockaddr_in *gw_sin = (struct sockaddr_in *)gw; - if (gw_sin->sin_len < sizeof(struct sockaddr_in)) { + + /* Ensure reads do not go beyoud SA boundary */ + if (SA_SIZE(gw) < offsetof(struct sockaddr_in, sin_zero)) { RTS_PID_PRINTF("gateway sin_len too small: %d", gw->sa_len); return (EINVAL); } - fill_sockaddr_inet(gw_sin, gw_sin->sin_addr); + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_in)); + if (sa == NULL) + return (ENOBUFS); + fill_sockaddr_inet((struct sockaddr_in *)sa, gw_sin->sin_addr); + info->rti_info[RTAX_GATEWAY] = sa; } break; #endif @@ -1392,13 +1430,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) RTS_PID_PRINTF("gateway sdl_len too small: %d", gw_sdl->sdl_len); return (EINVAL); } + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_dl_short)); + if (sa == NULL) + return (ENOBUFS); const struct sockaddr_dl_short sdl = { .sdl_family = AF_LINK, - .sdl_len = sdl_min_len, + .sdl_len = sizeof(struct sockaddr_dl_short), .sdl_index = gw_sdl->sdl_index, }; - memcpy(gw_sdl, &sdl, sdl_min_len); + *((struct sockaddr_dl_short *)sa) = sdl; + info->rti_info[RTAX_GATEWAY] = sa; break; } } @@ -1416,39 +1458,57 @@ remove_netmask(struct rt_addrinfo *info) #ifdef INET static int -cleanup_xaddrs_inet(struct rt_addrinfo *info) +cleanup_xaddrs_inet(struct rt_addrinfo *info, struct linear_buffer *lb) { struct sockaddr_in *dst_sa, *mask_sa; + const int sa_len = sizeof(struct sockaddr_in); + struct in_addr dst, mask; /* Check & fixup dst/netmask combination first */ dst_sa = (struct sockaddr_in *)info->rti_info[RTAX_DST]; mask_sa = (struct sockaddr_in *)info->rti_info[RTAX_NETMASK]; - struct in_addr mask = { - .s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST, - }; - struct in_addr dst = { - .s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)) - }; - - if (dst_sa->sin_len < sizeof(struct sockaddr_in)) { - printf("dst sin_len too small\n"); + /* Ensure reads do not go beyound the buffer size */ + if (SA_SIZE(dst_sa) < offsetof(struct sockaddr_in, sin_zero)) return (EINVAL); - } - if (mask_sa && mask_sa->sin_len < sizeof(struct sockaddr_in)) { - RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); - return (EINVAL); - } + + if ((mask_sa != NULL) && mask_sa->sin_len < sizeof(struct sockaddr_in)) { + /* + * Some older routing software encode mask length into the + * sin_len, thus resulting in "truncated" sockaddr. + */ + int len = mask_sa->sin_len - offsetof(struct sockaddr_in, sin_addr); + if (len >= 0) { + mask.s_addr = 0; + if (len > sizeof(struct in_addr)) + len = sizeof(struct in_addr); + memcpy(&mask, &mask_sa->sin_addr, len); + } else { + RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); + return (EINVAL); + } + } else + mask.s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST; + + dst.s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)); + + /* Construct new "clean" dst/mask sockaddresses */ + if ((dst_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); fill_sockaddr_inet(dst_sa, dst); + info->rti_info[RTAX_DST] = (struct sockaddr *)dst_sa; - if (mask.s_addr != INADDR_BROADCAST) + if (mask.s_addr != INADDR_BROADCAST) { + if ((mask_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); fill_sockaddr_inet(mask_sa, mask); - else + info->rti_info[RTAX_NETMASK] = (struct sockaddr *)mask_sa; + } else remove_netmask(info); /* Check gateway */ if (info->rti_info[RTAX_GATEWAY] != NULL) - return (cleanup_xaddrs_gateway(info)); + return (cleanup_xaddrs_gateway(info, lb)); return (0); } @@ -1456,43 +1516,66 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info) #ifdef INET6 static int -cleanup_xaddrs_inet6(struct rt_addrinfo *info) +cleanup_xaddrs_inet6(struct rt_addrinfo *info, struct linear_buffer *lb) { + struct sockaddr *sa; struct sockaddr_in6 *dst_sa, *mask_sa; - struct in6_addr mask; + struct in6_addr mask, *dst; + const int sa_len = sizeof(struct sockaddr_in6); /* Check & fixup dst/netmask combination first */ dst_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_DST]; mask_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_NETMASK]; - mask = mask_sa ? mask_sa->sin6_addr : in6mask128; - IN6_MASK_ADDR(&dst_sa->sin6_addr, &mask); - if (dst_sa->sin6_len < sizeof(struct sockaddr_in6)) { RTS_PID_PRINTF("prefix dst sin6_len too small: %d", dst_sa->sin6_len); return (EINVAL); } + if (mask_sa && mask_sa->sin6_len < sizeof(struct sockaddr_in6)) { - RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); - return (EINVAL); - } - fill_sockaddr_inet6(dst_sa, &dst_sa->sin6_addr, 0); + /* + * Some older routing software encode mask length into the + * sin6_len, thus resulting in "truncated" sockaddr. + */ + int len = mask_sa->sin6_len - offsetof(struct sockaddr_in6, sin6_addr); + if (len >= 0) { + bzero(&mask, sizeof(mask)); + if (len > sizeof(struct in6_addr)) + len = sizeof(struct in6_addr); + memcpy(&mask, &mask_sa->sin6_addr, len); + } else { + RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); + return (EINVAL); + } + } else + mask = mask_sa ? mask_sa->sin6_addr : in6mask128; - if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) - fill_sockaddr_inet6(mask_sa, &mask, 0); - else + dst = &dst_sa->sin6_addr; + IN6_MASK_ADDR(dst, &mask); + + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, dst, 0); + info->rti_info[RTAX_DST] = sa; + + if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) { + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) + return (ENOBUFS); + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, &mask, 0); + info->rti_info[RTAX_NETMASK] = sa; + } else remove_netmask(info); /* Check gateway */ if (info->rti_info[RTAX_GATEWAY] != NULL) - return (cleanup_xaddrs_gateway(info)); + return (cleanup_xaddrs_gateway(info, lb)); return (0); } #endif static int -cleanup_xaddrs(struct rt_addrinfo *info) +cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb) { int error = EAFNOSUPPORT; @@ -1511,12 +1594,12 @@ cleanup_xaddrs(struct rt_addrinfo *info) switch (info->rti_info[RTAX_DST]->sa_family) { #ifdef INET case AF_INET: - error = cleanup_xaddrs_inet(info); + error = cleanup_xaddrs_inet(info, lb); break; #endif #ifdef INET6 case AF_INET6: - error = cleanup_xaddrs_inet6(info); + error = cleanup_xaddrs_inet6(info, lb); break; #endif } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:51:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0169C5EA94E; Tue, 20 Apr 2021 21:51: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 4FPy7V6gYTz3n7y; Tue, 20 Apr 2021 21:51: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 D7F451A66C; Tue, 20 Apr 2021 21:51: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 13KLpYGH019796; Tue, 20 Apr 2021 21:51:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLpY5g019795; Tue, 20 Apr 2021 21:51:34 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:51:34 GMT Message-Id: <202104202151.13KLpY5g019795@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: ccefbe98d86e - main - bsdinstall: remove compat hacks for FreeBSD 9 and earlier 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: ccefbe98d86e437097a64e00cfde0578b84f1d3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:51:35 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ccefbe98d86e437097a64e00cfde0578b84f1d3e commit ccefbe98d86e437097a64e00cfde0578b84f1d3e Author: Warner Losh AuthorDate: 2021-04-20 21:41:39 +0000 Commit: Warner Losh CommitDate: 2021-04-20 21:51:31 +0000 bsdinstall: remove compat hacks for FreeBSD 9 and earlier Sponsored by: Netflix --- usr.sbin/bsdinstall/distextract/distextract.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/usr.sbin/bsdinstall/distextract/distextract.c b/usr.sbin/bsdinstall/distextract/distextract.c index 81d83f982e30..8ad6c7b2c64b 100644 --- a/usr.sbin/bsdinstall/distextract/distextract.c +++ b/usr.sbin/bsdinstall/distextract/distextract.c @@ -53,11 +53,6 @@ static void sig_int(int sig); static int count_files(const char *file); static int extract_files(struct dpv_file_node *file, int out); -#if __FreeBSD_version <= 1000008 /* r232154: bump for libarchive update */ -#define archive_read_support_filter_all(x) \ - archive_read_support_compression_all(x) -#endif - #define _errx(...) (end_dialog(), errx(__VA_ARGS__)) int From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:51:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87CFB5EAB92; Tue, 20 Apr 2021 21:51: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 4FPy7Y1kcmz3mw3; Tue, 20 Apr 2021 21:51: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 21B2A1A840; Tue, 20 Apr 2021 21:51: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 13KLpbfK019838; Tue, 20 Apr 2021 21:51:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLpbNN019837; Tue, 20 Apr 2021 21:51:37 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:51:37 GMT Message-Id: <202104202151.13KLpbNN019837@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: 8ef97d2ba339 - main - dconschat: Remove support for FreeBSD 4.x and earlier. 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: 8ef97d2ba339f84d96b0c68235da92903fbf54ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:51:37 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ef97d2ba339f84d96b0c68235da92903fbf54ce commit 8ef97d2ba339f84d96b0c68235da92903fbf54ce Author: Warner Losh AuthorDate: 2021-04-20 21:46:56 +0000 Commit: Warner Losh CommitDate: 2021-04-20 21:51:31 +0000 dconschat: Remove support for FreeBSD 4.x and earlier. Sponsored by: Netflix --- usr.sbin/dconschat/dconschat.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index 6d4750585df6..c7e21460226c 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -383,11 +383,7 @@ dconschat_fetch_header(struct dcons_state *dc) } if (ntohl(dbuf.version) != DCONS_VERSION) { snprintf(ebuf, sizeof(ebuf), -#if __FreeBSD_version < 500000 - "wrong version %ld,%d", -#else "wrong version %d,%d", -#endif ntohl(dbuf.version), DCONS_VERSION); /* XXX exit? */ dconschat_ready(dc, 0, ebuf); @@ -419,13 +415,8 @@ dconschat_fetch_header(struct dcons_state *dc) if (verbose) { printf("port %d size offset gen pos\n", j); -#if __FreeBSD_version < 500000 - printf("output: %5d %6ld %5d %5d\n" - "input : %5d %6ld %5d %5d\n", -#else printf("output: %5d %6d %5d %5d\n" "input : %5d %6d %5d %5d\n", -#endif o->size, ntohl(dbuf.ooffset[j]), o->gen, o->pos, i->size, ntohl(dbuf.ioffset[j]), i->gen, i->pos); } From owner-dev-commits-src-all@freebsd.org Tue Apr 20 21:51:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BF955EAB91; Tue, 20 Apr 2021 21:51: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 4FPy7X0d5Nz3mvr; Tue, 20 Apr 2021 21:51: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 06B021A4E8; Tue, 20 Apr 2021 21:51: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 13KLpZxk019817; Tue, 20 Apr 2021 21:51:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KLpZMB019816; Tue, 20 Apr 2021 21:51:35 GMT (envelope-from git) Date: Tue, 20 Apr 2021 21:51:35 GMT Message-Id: <202104202151.13KLpZMB019816@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: 4cc5ae5a3922 - main - fwcontrol: Remove support for FreeBSD 4.x 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: 4cc5ae5a39226cb76248a87cca799e1ac594b9ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 21:51:36 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4cc5ae5a39226cb76248a87cca799e1ac594b9ac commit 4cc5ae5a39226cb76248a87cca799e1ac594b9ac Author: Warner Losh AuthorDate: 2021-04-20 21:44:35 +0000 Commit: Warner Losh CommitDate: 2021-04-20 21:51:31 +0000 fwcontrol: Remove support for FreeBSD 4.x Sponsored by: Netflix --- usr.sbin/fwcontrol/fwdv.c | 4 ---- usr.sbin/fwcontrol/fwmpegts.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/usr.sbin/fwcontrol/fwdv.c b/usr.sbin/fwcontrol/fwdv.c index 2baf1c43c803..510d22fcbf7b 100644 --- a/usr.sbin/fwcontrol/fwdv.c +++ b/usr.sbin/fwcontrol/fwdv.c @@ -40,11 +40,7 @@ #include #include #include - -#if __FreeBSD_version >= 500000 #include -#endif - #include #include #include diff --git a/usr.sbin/fwcontrol/fwmpegts.c b/usr.sbin/fwcontrol/fwmpegts.c index 509d941021c8..c744b53a7d46 100644 --- a/usr.sbin/fwcontrol/fwmpegts.c +++ b/usr.sbin/fwcontrol/fwmpegts.c @@ -40,11 +40,7 @@ #include #include #include - -#if __FreeBSD_version >= 500000 #include -#endif - #include #include #include From owner-dev-commits-src-all@freebsd.org Tue Apr 20 22:41:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EB3A5EC09D; Tue, 20 Apr 2021 22:41: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 4FPzFY2YbSz3qLN; Tue, 20 Apr 2021 22:41: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 4A9E81B31B; Tue, 20 Apr 2021 22:41: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 13KMfrBs086588; Tue, 20 Apr 2021 22:41:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13KMfrKB086583; Tue, 20 Apr 2021 22:41:53 GMT (envelope-from git) Date: Tue, 20 Apr 2021 22:41:53 GMT Message-Id: <202104202241.13KMfrKB086583@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: 33cb3cb2e321 - main - Fix rib generation count for fib algo. 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: 33cb3cb2e3212705b10e7885b37f70a3c2987c9e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 22:41:53 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=33cb3cb2e3212705b10e7885b37f70a3c2987c9e commit 33cb3cb2e3212705b10e7885b37f70a3c2987c9e Author: Alexander V. Chernikov AuthorDate: 2021-04-17 18:58:12 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-20 22:02:41 +0000 Fix rib generation count for fib algo. Currently, PCB caching mechanism relies on the rib generation counter (rnh_gen) to invalidate cached nhops/LLE entries. With certain fib algorithms, it is now possible that the datapath lookup state applies RIB changes with some delay. In that scenario, PCB cache will invalidate on the RIB change, but the new lookup may result in the same nexthop being returned. When fib algo finally gets in sync with the RIB changes, PCB cache will not receive any notification and will end up caching the stale data. To fix this, introduce additional counter, rnh_gen_rib, which is used only when FIB_ALGO is enabled. This counter is incremented by the control plane. Each time when fib algo synchronises with the RIB, it updates rnh_gen to the current rnh_gen_rib value. Differential Revision: https://reviews.freebsd.org/D29812 Reviewed by: donner MFC after: 2 weeks --- sys/net/route/fib_algo.c | 13 ++++++++++++- sys/net/route/route_ctl.c | 6 +++--- sys/net/route/route_var.h | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 30e715e1e1ef..91565d727a9c 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -525,6 +525,13 @@ schedule_fd_rebuild(struct fib_data *fd, const char *reason) } } +static void +sync_rib_gen(struct fib_data *fd) +{ + FD_PRINTF(LOG_DEBUG, fd, "Sync gen %u -> %u", fd->fd_rh->rnh_gen, fd->fd_rh->rnh_gen_rib); + fd->fd_rh->rnh_gen = fd->fd_rh->rnh_gen_rib; +} + static int64_t get_tv_diff_ms(const struct timeval *old_tv, const struct timeval *new_tv) { @@ -680,6 +687,7 @@ apply_rtable_changes(struct fib_data *fd) result = fd->fd_flm->flm_change_rib_items_cb(fd->fd_rh, q, fd->fd_algo_data); if (result == FLM_SUCCESS) { + sync_rib_gen(fd); for (int i = 0; i < q->count; i++) if (q->entries[i].nh_old) fib_unref_nhop(fd, q->entries[i].nh_old); @@ -811,6 +819,7 @@ handle_rtable_change_cb(struct rib_head *rnh, struct rib_cmd_info *rc, switch (result) { case FLM_SUCCESS: + sync_rib_gen(fd); /* Unref old nexthop on success */ if (rc->rc_nh_old != NULL) fib_unref_nhop(fd, rc->rc_nh_old); @@ -1236,7 +1245,9 @@ setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); if ((result == FLM_SUCCESS) && attach) { - if (!fib_set_datapath_ptr(new_fd, &new_fd->fd_dp)) + if (fib_set_datapath_ptr(new_fd, &new_fd->fd_dp)) + sync_rib_gen(new_fd); + else result = FLM_REBUILD; } diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index fb3dfff87019..a0c4a2283a00 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -808,7 +808,7 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info rt->rte_flags &= ~RTF_UP; /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); rnh->rnh_prefixes--; rc->rc_cmd = RTM_DELETE; @@ -1060,7 +1060,7 @@ add_route_nhop(struct rib_head *rnh, struct rtentry *rt, tmproutes_update(rnh, rt); /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); rnh->rnh_prefixes++; rc->rc_cmd = RTM_ADD; @@ -1116,7 +1116,7 @@ change_route_nhop(struct rib_head *rnh, struct rtentry *rt, } /* Finalize notification */ - rnh->rnh_gen++; + rib_bump_gen(rnh); if (rnd->rnd_nhop == NULL) rnh->rnh_prefixes--; diff --git a/sys/net/route/route_var.h b/sys/net/route/route_var.h index 427c286a5090..f12931476fd3 100644 --- a/sys/net/route/route_var.h +++ b/sys/net/route/route_var.h @@ -60,7 +60,7 @@ struct rib_head { rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ rnh_preadd_entry_f_t *rnh_preadd; /* hook to alter record prior to insertion */ - rt_gen_t rnh_gen; /* generation counter */ + rt_gen_t rnh_gen; /* datapath generation counter */ int rnh_multipath; /* multipath capable ? */ struct radix_node rnh_nodes[3]; /* empty tree for common case */ struct rmlock rib_lock; /* config/data path lock */ @@ -71,6 +71,9 @@ struct rib_head { struct callout expire_callout; /* Callout for expiring dynamic routes */ time_t next_expire; /* Next expire run ts */ uint32_t rnh_prefixes; /* Number of prefixes */ +#ifdef FIB_ALGO + rt_gen_t rnh_gen_rib; /* rib generation counter */ +#endif uint32_t rib_dying:1; /* rib is detaching */ uint32_t rib_algo_fixed:1;/* fixed algorithm */ struct nh_control *nh_control; /* nexthop subsystem data */ @@ -116,6 +119,16 @@ CHK_STRUCT_ROUTE_FIELDS(_ro_new); \ _Static_assert(__offsetof(struct route, ro_dst) == __offsetof(_ro_new, _dst_new),\ "ro_dst and " #_dst_new " are at different offset") +static inline void +rib_bump_gen(struct rib_head *rnh) +{ +#ifdef FIB_ALGO + rnh->rnh_gen_rib++; +#else + rnh->rnh_gen++; +#endif +} + struct rib_head *rt_tables_get_rnh(uint32_t table, sa_family_t family); int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum); struct rib_cmd_info; From owner-dev-commits-src-all@freebsd.org Wed Apr 21 07:50:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D30A55FABA2; Wed, 21 Apr 2021 07:50: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 4FQCQx5dv9z4l9w; Wed, 21 Apr 2021 07:50: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 B4CF522355; Wed, 21 Apr 2021 07:50: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 13L7onAV015230; Wed, 21 Apr 2021 07:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L7on7x015229; Wed, 21 Apr 2021 07:50:49 GMT (envelope-from git) Date: Wed, 21 Apr 2021 07:50:49 GMT Message-Id: <202104210750.13L7on7x015229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6c9b3cb4936e - stable/13 - spigen.4: Fix typos 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c9b3cb4936e789ca43338a5f92a36fa51b2f7c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 07:50:49 -0000 The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6c9b3cb4936e789ca43338a5f92a36fa51b2f7c2 commit 6c9b3cb4936e789ca43338a5f92a36fa51b2f7c2 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 07:45:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-21 07:50:58 +0000 spigen.4: Fix typos MFC after: 3 days (cherry picked from commit 40277af7f23405c276edf02c3ddc8e770a06e3f6) --- share/man/man4/spigen.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/spigen.4 b/share/man/man4/spigen.4 index e586b0baa82a..8a8cc556be81 100644 --- a/share/man/man4/spigen.4 +++ b/share/man/man4/spigen.4 @@ -57,7 +57,7 @@ device is associated with a single chip-select line on the bus, and all I/O performed through that instance is done with that chip-select line asserted. .Pp -SPI data transfers are inherently bi-directional; there are not separate +SPI data transfers are inherently bi-directional; there are no separate read and write operations. When commands and data are sent to a device, data also comes back from the device, although in some cases the data may not be useful (or even @@ -117,7 +117,7 @@ Set the maximum clock speed (bus frequency in Hertz) to be used when communicating with this slave device. The setting remains in effect for subsequent transfers; it is not necessary to reset this before each transfer. -The actual bus frequency may be lower due to hardware limitiations +The actual bus frequency may be lower due to hardware limitations of the SPI bus controller device. .It Dv SPIGENIOC_GET_SPI_MODE Pq Vt uint32_t Get the SPI mode (clock polarity and phase) to be used From owner-dev-commits-src-all@freebsd.org Wed Apr 21 07:59:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B250F5FB68B; Wed, 21 Apr 2021 07:59: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 4FQCd94kfgz4mCj; Wed, 21 Apr 2021 07:59: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 953CE2298B; Wed, 21 Apr 2021 07:59: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 13L7xfha019407; Wed, 21 Apr 2021 07:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L7xf4h019406; Wed, 21 Apr 2021 07:59:41 GMT (envelope-from git) Date: Wed, 21 Apr 2021 07:59:41 GMT Message-Id: <202104210759.13L7xf4h019406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: bd2cb05d2490 - stable/12 - spigen.4: Fix typos 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/stable/12 X-Git-Reftype: branch X-Git-Commit: bd2cb05d24907e37029f252086aaef70d91c92ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 07:59:41 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bd2cb05d24907e37029f252086aaef70d91c92ff commit bd2cb05d24907e37029f252086aaef70d91c92ff Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-04-18 07:45:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-04-21 07:58:37 +0000 spigen.4: Fix typos MFC after: 3 days (cherry picked from commit 40277af7f23405c276edf02c3ddc8e770a06e3f6) --- share/man/man4/spigen.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/spigen.4 b/share/man/man4/spigen.4 index f79bb85dcfaf..061c192ab572 100644 --- a/share/man/man4/spigen.4 +++ b/share/man/man4/spigen.4 @@ -57,8 +57,8 @@ device is associated with a single chip-select line on the bus, and all I/O performed through that instance is done with that chip-select line asserted. .Pp -SPI data transfers are inherently bi-directional; there are not separate -read and write operations. +SPI data transfers are inherently bi-directional; there are no separate +read and write operations. When commands and data are sent to a device, data also comes back from the device, although in some cases the data may not be useful (or even documented or predictable for some devices). @@ -117,7 +117,7 @@ Set the maximum clock speed (bus frequency in Hertz) to be used when communicating with this slave device. The setting remains in effect for subsequent transfers; it is not necessary to reset this before each transfer. -The actual bus frequency may be lower due to hardware limitiations +The actual bus frequency may be lower due to hardware limitations of the SPI bus controller device. .It Dv SPIGENIOC_GET_SPI_MODE Pq Vt uint32_t Get the SPI mode (clock polarity and phase) to be used From owner-dev-commits-src-all@freebsd.org Wed Apr 21 08:06:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F1035FBB48; Wed, 21 Apr 2021 08:06: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 4FQCmX1pBCz4mh5; Wed, 21 Apr 2021 08:06: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 3011B225E2; Wed, 21 Apr 2021 08:06: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 13L864v2033012; Wed, 21 Apr 2021 08:06:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L864mf033011; Wed, 21 Apr 2021 08:06:04 GMT (envelope-from git) Date: Wed, 21 Apr 2021 08:06:04 GMT Message-Id: <202104210806.13L864mf033011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 438b5532070f - main - arcmsr(4): Fix SCSI command timeout on ARC-1886. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 438b5532070f7c52e88f514380ee8662de1f600b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 08:06:04 -0000 The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=438b5532070f7c52e88f514380ee8662de1f600b commit 438b5532070f7c52e88f514380ee8662de1f600b Author: Xin LI AuthorDate: 2021-04-21 08:03:54 +0000 Commit: Xin LI CommitDate: 2021-04-21 08:03:54 +0000 arcmsr(4): Fix SCSI command timeout on ARC-1886. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 2 weeks --- sys/dev/arcmsr/arcmsr.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index f2217deb1ce0..f7f913de89af 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -83,6 +83,8 @@ ** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ** 1.50.00.00 09/30/2020 Ching Huang Added support ARC-1886, NVMe/SAS/SATA controller ** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter +** 1.50.00.02 04/16/2021 Ching Huang Fixed scsi command timeout on ARC-1886 when +** scatter-gather count large than some number ****************************************************************************************** */ @@ -140,7 +142,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.01 2021-02-26" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.02 2021-04-16" #include /* ************************************************************************** @@ -1183,8 +1185,12 @@ static void arcmsr_post_srb(struct AdapterControlBlock *acb, struct CommandContr if (srb->arc_cdb_size <= 0x300) arc_cdb_size = (srb->arc_cdb_size - 1) >> 6 | 1; - else - arc_cdb_size = (((srb->arc_cdb_size + 0xff) >> 8) + 2) << 1 | 1; + else { + arc_cdb_size = ((srb->arc_cdb_size + 0xff) >> 8) + 2; + if (arc_cdb_size > 0xF) + arc_cdb_size = 0xF; + arc_cdb_size = (arc_cdb_size << 1) | 1; + } ccb_post_stamp = (srb->smid | arc_cdb_size); CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_high, 0); CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_queueport_low, ccb_post_stamp); From owner-dev-commits-src-all@freebsd.org Wed Apr 21 08:22:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ADB75FC50F; Wed, 21 Apr 2021 08:22: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 4FQD7C1gpjz4nQb; Wed, 21 Apr 2021 08:22:15 +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 2AAE722C59; Wed, 21 Apr 2021 08:22: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 13L8MFOq059866; Wed, 21 Apr 2021 08:22:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L8MFel059865; Wed, 21 Apr 2021 08:22:15 GMT (envelope-from git) Date: Wed, 21 Apr 2021 08:22:15 GMT Message-Id: <202104210822.13L8MFel059865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 4ce1ba652383 - main - sndstat: nvlist schema and API definition changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ce1ba6523839b5c88331de22937b1e0483fc40b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 08:22:15 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=4ce1ba6523839b5c88331de22937b1e0483fc40b commit 4ce1ba6523839b5c88331de22937b1e0483fc40b Author: Ka Ho Ng AuthorDate: 2021-04-21 08:19:15 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-21 08:19:15 +0000 sndstat: nvlist schema and API definition changes - SNDSTAT_LABEL_* are renamed to SNDST_DSPS_*, and SNDSTAT_LABEL_DSPS becomes SNDST_DSPS. - Centralize channel number/rate/formats into a single nvlist The above nvlist is named "info_play" and "info_rec" - Expose only encoding format in pfmts/rfmts. Userland has no direct access to AFMT_ENCODING/CHANNEL/EXTCHANNEL macros, thus it serves no meaning to expose too much information through this pair of labels. However pminrate/rminrate, pmaxrate/rmaxrate, pfmts/rfmts are deprecated and will be removed in future. This commit keeps ioctls ABI compatibility with __FreeBSD_version 1400006 for now. In future the compat ABI with 1400006 will be removed once audio/virtual_oss is rebuilt. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29770 --- share/man/man4/sndstat.4 | 101 ++++++++------ sys/dev/sound/pcm/sndstat.c | 329 ++++++++++++++++++++++++++++++-------------- sys/sys/sndstat.h | 73 +++++----- 3 files changed, 322 insertions(+), 181 deletions(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index ad5f4a76ea7e..26ecf9084dc1 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -31,7 +31,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd December 7, 2020 +.Dd April 15, 2021 .Dt SNDSTAT 4 .Os .Sh NAME @@ -52,7 +52,7 @@ device allows callers to enumeration PCM audio devices available for use. For all ioctls requiring data exchange between the subsystem and callers, the following structures are used to describe a serialized nvlist: .Bd -literal -offset indent -struct sndstat_nvlbuf_arg { +struct sndstioc_nv_arg { size_t nbytes; void *buf; }; @@ -67,9 +67,12 @@ dsps (NVLIST ARRAY): 1 desc (STRING): [Generic (0x8086) (Analog Line-out)] pchan (NUMBER): 1 (1) (0x1) rchan (NUMBER): 0 (0) (0x0) - pminrate (NUMBER): 48000 (48000) (0xbb80) - pmaxrate (NUMBER): 48000 (48000) (0xbb80) - pfmts (NUMBER): 2097168 (2097168) (0x200010) + info_play (NVLIST): + min_rate (NUMBER): 48000 (48000) (0xbb80) + max_rate (NUMBER): 48000 (48000) (0xbb80) + formats (NUMBER): 16 (16) (0x10) + min_chn (NUMBER): 2 (2) (0x2) + max_chn (NUMBER): 2 (2) (0x2) provider_info (NVLIST): unit (NUMBER): 0 (0) (0x0) bitperfect (BOOL): FALSE @@ -94,24 +97,38 @@ This can be 0 if this PCM audio device does not support playback at all. .It Dv rchan The number of recording channels supported by hardware. This can be 0 if this PCM audio device does not support recording at all. -.It Dv pminrate -The minimum supported playback direction sampling rate. -Only exists if pchan is greater than 0. -.It Dv pmaxrate -The maximum supported playback direction sampling rate. -Only exists if pchan is greater than 0. -.It Dv pfmts -The supported playback direction sample format. -Only exists if pchan is greater than 0. -.It Dv rminrate -The minimum supported recording direction sampling rate. -Only exists if rchan is greater than 0. -.It Dv rmaxrate -The maximum supported recording direction sampling rate. -Only exists if rchan is greater than 0. -.It Dv rfmts -The supported playback recording sample format. -Only exists if rchan is greater than 0. +.It Dv info_play +Supported configurations in playback direction. +This exists only if this PCM audio device supports playback. +There are a number of name/value pairs inside this field: +.Bl -tag -width ".Dv min_rate" +.It Dv min_rate +Minimum supported sampling rate. +.It Dv max_rate +Maximum supported sampling rate. +.It Dv formats +Supported sample formats. +.It Dv min_chn +Minimum supported number of channels in channel layout +.It Dv max_chn +Maximum supported number of channels in channel layout +.El +.It Dv info_rec +Supported configurations in recording direction. +This exists only if this PCM audio device supports recording. +There are a number of name/value pairs inside this field: +.Bl -tag -width ".Dv min_rate" +.It Dv min_rate +Minimum supported sampling rate. +.It Dv max_rate +Maximum supported sampling rate. +.It Dv formats +Supported sample formats. +.It Dv min_chn +Minimum supported number of channels in channel layout +.It Dv max_chn +Maximum supported number of channels in channel layout +.El .It Dv provider_info Provider-specific fields. This field may not exist if the PCM audio device is not provided by in-kernel @@ -121,15 +138,15 @@ This field will not exist if the provider field is an empty string. A string specifying the provider of the PCm audio device. .El .Pp -The following ioctls are providede for use: -.Bl -tag -width ".Dv SNDSTAT_FLUSH_USER_DEVS" -.It Dv SNDSTAT_REFRESH_DEVS +The following ioctls are provided for use: +.Bl -tag -width ".Dv SNDSTIOC_FLUSH_USER_DEVS" +.It Dv SNDSTIOC_REFRESH_DEVS Drop any previously fetched PCM audio devices list snapshots. This ioctl takes no arguments. -.It Dv SNDSTAT_GET_DEVS +.It Dv SNDSTIOC_GET_DEVS Generate and/or return PCM audio devices list snapshots to callers. This ioctl takes a pointer to -.Fa struct sndstat_nvlbuf_arg +.Fa struct sndstioc_nv_arg as the first and the only argument. Callers need to provide a sufficiently large buffer to hold a serialized nvlist. @@ -159,12 +176,12 @@ Once a PCM audio device list snapshot is returned to user-space successfully, the snapshot stored in the subsystem's internal structure of the given .Fa fd will be freed. -.It Dv SNDSTAT_ADD_USER_DEVS +.It Dv SNDSTIOC_ADD_USER_DEVS Add a list of PCM audio devices provided by callers to .Pa /dev/sndstat device. This ioctl takes a pointer to -.Fa struct sndstat_nvlbuf_arg +.Fa struct sndstioc_nv_arg as the first and the only argument. Callers have to provide a buffer holding a serialized nvlist. .Fa nbytes @@ -173,7 +190,7 @@ should be set to the length in bytes of the serialized nvlist. should be pointed to a buffer storing the serialized nvlist. Userspace-backed PCM audio device nodes should be listed inside the serialized nvlist. -.It Dv SNDSTAT_FLUSH_USER_DEVS +.It Dv SNDSTIOC_FLUSH_USER_DEVS Flush any PCM audio devices previously added by callers. This ioctl takes no arguments. .El @@ -198,7 +215,7 @@ int main() { int fd; - struct sndstat_nvlbuf_arg arg; + struct sndstioc_nv_arg arg; const nvlist_t * const *di; size_t i, nitems; nvlist_t *nvl; @@ -206,28 +223,28 @@ main() /* Open sndstat node in read-only first */ fd = open("/dev/sndstat", O_RDONLY); - if (ioctl(fd, SNDSTAT_REFRESH_DEVS, NULL)) - err(1, "ioctl(fd, SNDSTAT_REFRESH_DEVS, NULL)"); + if (ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL)) + err(1, "ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL)"); /* Get the size of snapshot, when nbytes = 0 */ arg.nbytes = 0; arg.buf = NULL; - if (ioctl(fd, SNDSTAT_GET_DEVS, &arg)) - err(1, "ioctl(fd, SNDSTAT_GET_DEVS, &arg)"); + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg)) + err(1, "ioctl(fd, SNDSTIOC_GET_DEVS, &arg)"); /* Get snapshot data */ arg.buf = malloc(arg.nbytes); if (arg.buf == NULL) err(EX_OSERR, "malloc"); - if (ioctl(fd, SNDSTAT_GET_DEVS, &arg)) - err(1, "ioctl(fd, SNDSTAT_GET_DEVS, &arg)"); + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg)) + err(1, "ioctl(fd, SNDSTIOC_GET_DEVS, &arg)"); /* Deserialize the nvlist stream */ nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); free(arg.buf); /* Get DSPs array */ - di = nvlist_get_nvlist_array(nvl, SNDSTAT_LABEL_DSPS, &nitems); + di = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); for (i = 0; i < nitems; i++) { const char *nameunit, *devnode, *desc; @@ -235,9 +252,9 @@ main() * Examine each device nvlist item */ - nameunit = nvlist_get_string(di[i], SNDSTAT_LABEL_NAMEUNIT); - devnode = nvlist_get_string(di[i], SNDSTAT_LABEL_DEVNODE); - desc = nvlist_get_string(di[i], SNDSTAT_LABEL_DESC); + nameunit = nvlist_get_string(di[i], SNDST_DSPS_NAMEUNIT); + devnode = nvlist_get_string(di[i], SNDST_DSPS_DEVNODE); + desc = nvlist_get_string(di[i], SNDST_DSPS_DESC); printf("Name unit: `%s`, Device node: `%s`, Description: `%s`\n", nameunit, devnode, desc); } diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index e89af772fe72..ea36f4ba79ba 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -89,12 +89,13 @@ struct sndstat_userdev { char *desc; unsigned int pchan; unsigned int rchan; - uint32_t pminrate; - uint32_t pmaxrate; - uint32_t rminrate; - uint32_t rmaxrate; - uint32_t pfmts; - uint32_t rfmts; + struct { + uint32_t min_rate; + uint32_t max_rate; + uint32_t formats; + uint32_t min_chn; + uint32_t max_chn; + } info_play, info_rec; nvlist_t *provider_nvl; }; @@ -326,46 +327,77 @@ sndstat_write(struct cdev *i_dev, struct uio *buf, int flag) static void sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, - uint32_t *max_rate, uint32_t *fmts) + uint32_t *max_rate, uint32_t *fmts, uint32_t *minchn, uint32_t *maxchn) { struct pcm_channel *c; + unsigned int encoding; int dir; dir = play ? PCMDIR_PLAY : PCMDIR_REC; - *min_rate = 0; - *max_rate = 0; - *fmts = 0; if (play && d->pvchancount > 0) { *min_rate = *max_rate = d->pvchanrate; - *fmts = d->pvchanformat; + *fmts = AFMT_ENCODING(d->pvchanformat); + *minchn = *maxchn = AFMT_CHANNEL(d->pvchanformat); return; } else if (!play && d->rvchancount > 0) { *min_rate = *max_rate = d->rvchanrate; - *fmts = d->rvchanformat; + *fmts = AFMT_ENCODING(d->rvchanformat); + *minchn = *maxchn = AFMT_CHANNEL(d->rvchanformat); return; } + *min_rate = UINT32_MAX; + *max_rate = 0; + *minchn = UINT32_MAX; + *maxchn = 0; + encoding = 0; CHN_FOREACH(c, d, channels.pcm) { struct pcmchan_caps *caps; + int i; if (c->direction != dir || (c->flags & CHN_F_VIRTUAL) != 0) continue; CHN_LOCK(c); caps = chn_getcaps(c); - *min_rate = caps->minspeed; - *max_rate = caps->maxspeed; - *fmts = chn_getformats(c); + *min_rate = min(caps->minspeed, *min_rate); + *max_rate = max(caps->maxspeed, *max_rate); + for (i = 0; caps->fmtlist[i]; i++) { + encoding |= AFMT_ENCODING(caps->fmtlist[i]); + *minchn = min(AFMT_CHANNEL(encoding), *minchn); + *maxchn = max(AFMT_CHANNEL(encoding), *maxchn); + } CHN_UNLOCK(c); } + if (*min_rate == UINT32_MAX) + *min_rate = 0; + if (*minchn == UINT32_MAX) + *minchn = 0; +} + +static nvlist_t * +sndstat_create_diinfo_nv(uint32_t min_rate, uint32_t max_rate, uint32_t formats, + uint32_t min_chn, uint32_t max_chn) +{ + nvlist_t *nv; + + nv = nvlist_create(0); + if (nv == NULL) + return (NULL); + nvlist_add_number(nv, SNDST_DSPS_INFO_MIN_RATE, min_rate); + nvlist_add_number(nv, SNDST_DSPS_INFO_MAX_RATE, max_rate); + nvlist_add_number(nv, SNDST_DSPS_INFO_FORMATS, formats); + nvlist_add_number(nv, SNDST_DSPS_INFO_MIN_CHN, min_chn); + nvlist_add_number(nv, SNDST_DSPS_INFO_MAX_CHN, max_chn); + return (nv); } static int sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) { - uint32_t maxrate, minrate, fmts; - nvlist_t *di = NULL, *sound4di = NULL; + uint32_t maxrate, minrate, fmts, minchn, maxchn; + nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL; int err; di = nvlist_create(0); @@ -379,40 +411,54 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) goto done; } - nvlist_add_bool(di, SNDSTAT_LABEL_FROM_USER, false); - nvlist_add_stringf(di, SNDSTAT_LABEL_NAMEUNIT, "%s", + nvlist_add_bool(di, SNDST_DSPS_FROM_USER, false); + nvlist_add_stringf(di, SNDST_DSPS_NAMEUNIT, "%s", device_get_nameunit(d->dev)); - nvlist_add_stringf(di, SNDSTAT_LABEL_DEVNODE, "dsp%d", + nvlist_add_stringf(di, SNDST_DSPS_DEVNODE, "dsp%d", device_get_unit(d->dev)); nvlist_add_string( - di, SNDSTAT_LABEL_DESC, device_get_desc(d->dev)); + di, SNDST_DSPS_DESC, device_get_desc(d->dev)); PCM_ACQUIRE_QUICK(d); - nvlist_add_number(di, SNDSTAT_LABEL_PCHAN, d->playcount); - nvlist_add_number(di, SNDSTAT_LABEL_RCHAN, d->reccount); + nvlist_add_number(di, SNDST_DSPS_PCHAN, d->playcount); + nvlist_add_number(di, SNDST_DSPS_RCHAN, d->reccount); if (d->playcount > 0) { - sndstat_get_caps(d, true, &minrate, &maxrate, &fmts); - nvlist_add_number(di, SNDSTAT_LABEL_PMINRATE, minrate); - nvlist_add_number(di, SNDSTAT_LABEL_PMAXRATE, maxrate); - nvlist_add_number(di, SNDSTAT_LABEL_PFMTS, fmts); + sndstat_get_caps(d, true, &minrate, &maxrate, &fmts, &minchn, + &maxchn); + nvlist_add_number(di, "pminrate", minrate); + nvlist_add_number(di, "pmaxrate", maxrate); + nvlist_add_number(di, "pfmts", fmts); + diinfo = sndstat_create_diinfo_nv(minrate, maxrate, fmts, + minchn, maxchn); + if (diinfo == NULL) + nvlist_set_error(di, ENOMEM); + else + nvlist_move_nvlist(di, SNDST_DSPS_INFO_PLAY, diinfo); } if (d->reccount > 0) { - sndstat_get_caps(d, false, &minrate, &maxrate, &fmts); - nvlist_add_number(di, SNDSTAT_LABEL_RMINRATE, minrate); - nvlist_add_number(di, SNDSTAT_LABEL_RMAXRATE, maxrate); - nvlist_add_number(di, SNDSTAT_LABEL_RFMTS, fmts); + sndstat_get_caps(d, false, &minrate, &maxrate, &fmts, &minchn, + &maxchn); + nvlist_add_number(di, "rminrate", minrate); + nvlist_add_number(di, "rmaxrate", maxrate); + nvlist_add_number(di, "rfmts", fmts); + diinfo = sndstat_create_diinfo_nv(minrate, maxrate, fmts, + minchn, maxchn); + if (diinfo == NULL) + nvlist_set_error(di, ENOMEM); + else + nvlist_move_nvlist(di, SNDST_DSPS_INFO_REC, diinfo); } - nvlist_add_number(sound4di, SNDSTAT_LABEL_SOUND4_UNIT, + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_UNIT, device_get_unit(d->dev)); // XXX: I want signed integer here nvlist_add_bool( - sound4di, SNDSTAT_LABEL_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); - nvlist_add_number(sound4di, SNDSTAT_LABEL_SOUND4_PVCHAN, d->pvchancount); - nvlist_add_number(sound4di, SNDSTAT_LABEL_SOUND4_RVCHAN, d->rvchancount); - nvlist_move_nvlist(di, SNDSTAT_LABEL_PROVIDER_INFO, sound4di); + sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHAN, d->rvchancount); + nvlist_move_nvlist(di, SNDST_DSPS_PROVIDER_INFO, sound4di); sound4di = NULL; PCM_RELEASE_QUICK(d); - nvlist_add_string(di, SNDSTAT_LABEL_PROVIDER, SNDSTAT_LABEL_SOUND4_PROVIDER); + nvlist_add_string(di, SNDST_DSPS_PROVIDER, SNDST_DSPS_SOUND4_PROVIDER); err = nvlist_error(di); if (err) @@ -431,7 +477,7 @@ done: static int sndstat_build_userland_nvlist(struct sndstat_userdev *ud, nvlist_t **dip) { - nvlist_t *di; + nvlist_t *di, *diinfo; int err; di = nvlist_create(0); @@ -440,34 +486,48 @@ sndstat_build_userland_nvlist(struct sndstat_userdev *ud, nvlist_t **dip) goto done; } - nvlist_add_bool(di, SNDSTAT_LABEL_FROM_USER, true); - nvlist_add_number(di, SNDSTAT_LABEL_PCHAN, ud->pchan); - nvlist_add_number(di, SNDSTAT_LABEL_RCHAN, ud->rchan); - nvlist_add_string(di, SNDSTAT_LABEL_NAMEUNIT, ud->nameunit); + nvlist_add_bool(di, SNDST_DSPS_FROM_USER, true); + nvlist_add_number(di, SNDST_DSPS_PCHAN, ud->pchan); + nvlist_add_number(di, SNDST_DSPS_RCHAN, ud->rchan); + nvlist_add_string(di, SNDST_DSPS_NAMEUNIT, ud->nameunit); nvlist_add_string( - di, SNDSTAT_LABEL_DEVNODE, ud->devnode); - nvlist_add_string(di, SNDSTAT_LABEL_DESC, ud->desc); + di, SNDST_DSPS_DEVNODE, ud->devnode); + nvlist_add_string(di, SNDST_DSPS_DESC, ud->desc); if (ud->pchan != 0) { - nvlist_add_number( - di, SNDSTAT_LABEL_PMINRATE, ud->pminrate); - nvlist_add_number( - di, SNDSTAT_LABEL_PMAXRATE, ud->pmaxrate); - nvlist_add_number( - di, SNDSTAT_LABEL_PFMTS, ud->pfmts); + nvlist_add_number(di, "pminrate", + ud->info_play.min_rate); + nvlist_add_number(di, "pmaxrate", + ud->info_play.max_rate); + nvlist_add_number(di, "pfmts", + ud->info_play.formats); + diinfo = sndstat_create_diinfo_nv(ud->info_play.min_rate, + ud->info_play.max_rate, ud->info_play.formats, + ud->info_play.min_chn, ud->info_play.max_chn); + if (diinfo == NULL) + nvlist_set_error(di, ENOMEM); + else + nvlist_move_nvlist(di, SNDST_DSPS_INFO_PLAY, diinfo); } if (ud->rchan != 0) { - nvlist_add_number( - di, SNDSTAT_LABEL_RMINRATE, ud->rminrate); - nvlist_add_number( - di, SNDSTAT_LABEL_RMAXRATE, ud->rmaxrate); - nvlist_add_number( - di, SNDSTAT_LABEL_RFMTS, ud->rfmts); + nvlist_add_number(di, "rminrate", + ud->info_rec.min_rate); + nvlist_add_number(di, "rmaxrate", + ud->info_rec.max_rate); + nvlist_add_number(di, "rfmts", + ud->info_rec.formats); + diinfo = sndstat_create_diinfo_nv(ud->info_rec.min_rate, + ud->info_rec.max_rate, ud->info_rec.formats, + ud->info_rec.min_chn, ud->info_rec.max_chn); + if (diinfo == NULL) + nvlist_set_error(di, ENOMEM); + else + nvlist_move_nvlist(di, SNDST_DSPS_INFO_REC, diinfo); } - nvlist_add_string(di, SNDSTAT_LABEL_PROVIDER, + nvlist_add_string(di, SNDST_DSPS_PROVIDER, (ud->provider != NULL) ? ud->provider : ""); if (ud->provider_nvl != NULL) nvlist_add_nvlist( - di, SNDSTAT_LABEL_PROVIDER_INFO, ud->provider_nvl); + di, SNDST_DSPS_PROVIDER_INFO, ud->provider_nvl); err = nvlist_error(di); if (err) @@ -511,7 +571,7 @@ sndstat_create_devs_nvlist(nvlist_t **nvlp) if (err) goto done; - nvlist_append_nvlist_array(nvl, SNDSTAT_LABEL_DSPS, di); + nvlist_append_nvlist_array(nvl, SNDST_DSPS, di); nvlist_destroy(di); err = nvlist_error(nvl); if (err) @@ -531,7 +591,7 @@ sndstat_create_devs_nvlist(nvlist_t **nvlp) sx_xunlock(&pf->lock); goto done; } - nvlist_append_nvlist_array(nvl, SNDSTAT_LABEL_DSPS, di); + nvlist_append_nvlist_array(nvl, SNDST_DSPS, di); nvlist_destroy(di); err = nvlist_error(nvl); @@ -568,7 +628,7 @@ static int sndstat_get_devs(struct sndstat_file *pf, caddr_t data) { int err; - struct sndstat_nvlbuf_arg *arg = (struct sndstat_nvlbuf_arg *)data; + struct sndstioc_nv_arg *arg = (struct sndstioc_nv_arg *)data; SNDSTAT_LOCK(); sx_xlock(&pf->lock); @@ -654,31 +714,65 @@ sndstat_unpack_user_nvlbuf(const void *unvlbuf, size_t nbytes, nvlist_t **nvl) return (0); } +static bool +sndstat_diinfo_is_sane(const nvlist_t *diinfo) +{ + if (!(nvlist_exists_number(diinfo, SNDST_DSPS_INFO_MIN_RATE) && + nvlist_exists_number(diinfo, SNDST_DSPS_INFO_MAX_RATE) && + nvlist_exists_number(diinfo, SNDST_DSPS_INFO_FORMATS) && + nvlist_exists_number(diinfo, SNDST_DSPS_INFO_MIN_CHN) && + nvlist_exists_number(diinfo, SNDST_DSPS_INFO_MAX_CHN))) + return (false); + return (true); +} + static bool sndstat_dsp_nvlist_is_sane(const nvlist_t *nvlist) { - if (!(nvlist_exists_string(nvlist, SNDSTAT_LABEL_DEVNODE) && - nvlist_exists_string(nvlist, SNDSTAT_LABEL_DESC) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_PCHAN) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_RCHAN))) + if (!(nvlist_exists_string(nvlist, SNDST_DSPS_DEVNODE) && + nvlist_exists_string(nvlist, SNDST_DSPS_DESC) && + nvlist_exists_number(nvlist, SNDST_DSPS_PCHAN) && + nvlist_exists_number(nvlist, SNDST_DSPS_RCHAN))) return (false); - if (nvlist_get_number(nvlist, SNDSTAT_LABEL_PCHAN) > 0) - if (!(nvlist_exists_number(nvlist, SNDSTAT_LABEL_PMINRATE) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_PMAXRATE) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_PFMTS))) + if (nvlist_get_number(nvlist, SNDST_DSPS_PCHAN) > 0) { + if (nvlist_exists_nvlist(nvlist, SNDST_DSPS_INFO_PLAY)) { + if (!sndstat_diinfo_is_sane(nvlist_get_nvlist(nvlist, + SNDST_DSPS_INFO_PLAY))) + return (false); + } else if (!(nvlist_exists_number(nvlist, "pminrate") && + nvlist_exists_number(nvlist, "pmaxrate") && + nvlist_exists_number(nvlist, "pfmts"))) return (false); + } - if (nvlist_get_number(nvlist, SNDSTAT_LABEL_RCHAN) > 0) - if (!(nvlist_exists_number(nvlist, SNDSTAT_LABEL_RMINRATE) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_RMAXRATE) && - nvlist_exists_number(nvlist, SNDSTAT_LABEL_RFMTS))) + if (nvlist_get_number(nvlist, SNDST_DSPS_RCHAN) > 0) { + if (nvlist_exists_nvlist(nvlist, SNDST_DSPS_INFO_REC)) { + if (!sndstat_diinfo_is_sane(nvlist_get_nvlist(nvlist, + SNDST_DSPS_INFO_REC))) + return (false); + } else if (!(nvlist_exists_number(nvlist, "rminrate") && + nvlist_exists_number(nvlist, "rmaxrate") && + nvlist_exists_number(nvlist, "rfmts"))) return (false); + } return (true); } +static void +sndstat_get_diinfo_nv(const nvlist_t *nv, uint32_t *min_rate, + uint32_t *max_rate, uint32_t *formats, uint32_t *min_chn, + uint32_t *max_chn) +{ + *min_rate = nvlist_get_number(nv, SNDST_DSPS_INFO_MIN_RATE); + *max_rate = nvlist_get_number(nv, SNDST_DSPS_INFO_MAX_RATE); + *formats = nvlist_get_number(nv, SNDST_DSPS_INFO_FORMATS); + *min_chn = nvlist_get_number(nv, SNDST_DSPS_INFO_MIN_CHN); + *max_chn = nvlist_get_number(nv, SNDST_DSPS_INFO_MAX_CHN); +} + static int sndstat_dsp_unpack_nvlist(const nvlist_t *nvlist, struct sndstat_userdev *ud) { @@ -687,36 +781,53 @@ sndstat_dsp_unpack_nvlist(const nvlist_t *nvlist, struct sndstat_userdev *ud) uint32_t pminrate = 0, pmaxrate = 0; uint32_t rminrate = 0, rmaxrate = 0; uint32_t pfmts = 0, rfmts = 0; + uint32_t pminchn = 0, pmaxchn = 0; + uint32_t rminchn = 0, rmaxchn = 0; nvlist_t *provider_nvl = NULL; + const nvlist_t *diinfo; const char *provider; - devnode = nvlist_get_string(nvlist, SNDSTAT_LABEL_DEVNODE); - if (nvlist_exists_string(nvlist, SNDSTAT_LABEL_NAMEUNIT)) - nameunit = nvlist_get_string(nvlist, SNDSTAT_LABEL_NAMEUNIT); + devnode = nvlist_get_string(nvlist, SNDST_DSPS_DEVNODE); + if (nvlist_exists_string(nvlist, SNDST_DSPS_NAMEUNIT)) + nameunit = nvlist_get_string(nvlist, SNDST_DSPS_NAMEUNIT); else nameunit = devnode; - desc = nvlist_get_string(nvlist, SNDSTAT_LABEL_DESC); - pchan = nvlist_get_number(nvlist, SNDSTAT_LABEL_PCHAN); - rchan = nvlist_get_number(nvlist, SNDSTAT_LABEL_RCHAN); + desc = nvlist_get_string(nvlist, SNDST_DSPS_DESC); + pchan = nvlist_get_number(nvlist, SNDST_DSPS_PCHAN); + rchan = nvlist_get_number(nvlist, SNDST_DSPS_RCHAN); if (pchan != 0) { - pminrate = nvlist_get_number(nvlist, SNDSTAT_LABEL_PMINRATE); - pmaxrate = nvlist_get_number(nvlist, SNDSTAT_LABEL_PMAXRATE); - pfmts = nvlist_get_number(nvlist, SNDSTAT_LABEL_PFMTS); + if (nvlist_exists_nvlist(nvlist, SNDST_DSPS_INFO_PLAY)) { + diinfo = nvlist_get_nvlist(nvlist, + SNDST_DSPS_INFO_PLAY); + sndstat_get_diinfo_nv(diinfo, &pminrate, &pmaxrate, + &pfmts, &pminchn, &pmaxchn); + } else { + pminrate = nvlist_get_number(nvlist, "pminrate"); + pmaxrate = nvlist_get_number(nvlist, "pmaxrate"); + pfmts = nvlist_get_number(nvlist, "pfmts"); + } } if (rchan != 0) { - rminrate = nvlist_get_number(nvlist, SNDSTAT_LABEL_RMINRATE); - rmaxrate = nvlist_get_number(nvlist, SNDSTAT_LABEL_RMAXRATE); - rfmts = nvlist_get_number(nvlist, SNDSTAT_LABEL_RFMTS); + if (nvlist_exists_nvlist(nvlist, SNDST_DSPS_INFO_REC)) { + diinfo = nvlist_get_nvlist(nvlist, + SNDST_DSPS_INFO_REC); + sndstat_get_diinfo_nv(diinfo, &rminrate, &rmaxrate, + &rfmts, &rminchn, &rmaxchn); + } else { + rminrate = nvlist_get_number(nvlist, "rminrate"); + rmaxrate = nvlist_get_number(nvlist, "rmaxrate"); + rfmts = nvlist_get_number(nvlist, "rfmts"); + } } - provider = dnvlist_get_string(nvlist, SNDSTAT_LABEL_PROVIDER, ""); + provider = dnvlist_get_string(nvlist, SNDST_DSPS_PROVIDER, ""); if (provider[0] == '\0') provider = NULL; if (provider != NULL && - nvlist_exists_nvlist(nvlist, SNDSTAT_LABEL_PROVIDER_INFO)) { + nvlist_exists_nvlist(nvlist, SNDST_DSPS_PROVIDER_INFO)) { provider_nvl = nvlist_clone( - nvlist_get_nvlist(nvlist, SNDSTAT_LABEL_PROVIDER_INFO)); + nvlist_get_nvlist(nvlist, SNDST_DSPS_PROVIDER_INFO)); if (provider_nvl == NULL) return (ENOMEM); } @@ -727,12 +838,16 @@ sndstat_dsp_unpack_nvlist(const nvlist_t *nvlist, struct sndstat_userdev *ud) ud->desc = strdup(desc, M_DEVBUF); ud->pchan = pchan; ud->rchan = rchan; - ud->pminrate = pminrate; - ud->pmaxrate = pmaxrate; - ud->rminrate = rminrate; - ud->rmaxrate = rmaxrate; - ud->pfmts = pfmts; - ud->rfmts = rfmts; + ud->info_play.min_rate = pminrate; + ud->info_play.max_rate = pmaxrate; + ud->info_play.formats = pfmts; + ud->info_play.min_chn = pminchn; + ud->info_play.max_chn = pmaxchn; + ud->info_rec.min_rate = rminrate; + ud->info_rec.max_rate = rmaxrate; + ud->info_rec.formats = rfmts; + ud->info_rec.min_chn = rminchn; + ud->info_rec.max_chn = rmaxchn; ud->provider_nvl = provider_nvl; return (0); } @@ -744,7 +859,7 @@ sndstat_add_user_devs(struct sndstat_file *pf, caddr_t data) nvlist_t *nvl = NULL; const nvlist_t * const *dsps; size_t i, ndsps; - struct sndstat_nvlbuf_arg *arg = (struct sndstat_nvlbuf_arg *)data; + struct sndstioc_nv_arg *arg = (struct sndstioc_nv_arg *)data; if ((pf->fflags & FWRITE) == 0) { err = EPERM; @@ -755,11 +870,11 @@ sndstat_add_user_devs(struct sndstat_file *pf, caddr_t data) if (err != 0) goto done; - if (!nvlist_exists_nvlist_array(nvl, SNDSTAT_LABEL_DSPS)) { + if (!nvlist_exists_nvlist_array(nvl, SNDST_DSPS)) { err = EINVAL; goto done; } - dsps = nvlist_get_nvlist_array(nvl, SNDSTAT_LABEL_DSPS, &ndsps); + dsps = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &ndsps); for (i = 0; i < ndsps; i++) { if (!sndstat_dsp_nvlist_is_sane(dsps[i])) { err = EINVAL; @@ -801,8 +916,8 @@ sndstat_flush_user_devs(struct sndstat_file *pf) static int compat_sndstat_get_devs32(struct sndstat_file *pf, caddr_t data) { - struct sndstat_nvlbuf_arg32 *arg32 = (struct sndstat_nvlbuf_arg32 *)data; - struct sndstat_nvlbuf_arg arg; + struct sndstioc_nv_arg32 *arg32 = (struct sndstioc_nv_arg32 *)data; + struct sndstioc_nv_arg arg; int err; arg.buf = (void *)(uintptr_t)arg32->buf; @@ -820,8 +935,8 @@ compat_sndstat_get_devs32(struct sndstat_file *pf, caddr_t data) static int compat_sndstat_add_user_devs32(struct sndstat_file *pf, caddr_t data) { - struct sndstat_nvlbuf_arg32 *arg32 = (struct sndstat_nvlbuf_arg32 *)data; - struct sndstat_nvlbuf_arg arg; + struct sndstioc_nv_arg32 *arg32 = (struct sndstioc_nv_arg32 *)data; + struct sndstioc_nv_arg arg; int err; arg.buf = (void *)(uintptr_t)arg32->buf; @@ -849,11 +964,11 @@ sndstat_ioctl( return (err); switch (cmd) { - case SNDSTAT_GET_DEVS: + case SNDSTIOC_GET_DEVS: err = sndstat_get_devs(pf, data); break; #ifdef COMPAT_FREEBSD32 - case SNDSTAT_GET_DEVS32: + case SNDSTIOC_GET_DEVS32: if (!SV_CURPROC_FLAG(SV_ILP32)) { err = ENODEV; break; @@ -861,11 +976,11 @@ sndstat_ioctl( err = compat_sndstat_get_devs32(pf, data); break; #endif - case SNDSTAT_ADD_USER_DEVS: + case SNDSTIOC_ADD_USER_DEVS: err = sndstat_add_user_devs(pf, data); break; #ifdef COMPAT_FREEBSD32 - case SNDSTAT_ADD_USER_DEVS32: + case SNDSTIOC_ADD_USER_DEVS32: if (!SV_CURPROC_FLAG(SV_ILP32)) { err = ENODEV; break; @@ -873,10 +988,10 @@ sndstat_ioctl( err = compat_sndstat_add_user_devs32(pf, data); break; #endif - case SNDSTAT_REFRESH_DEVS: + case SNDSTIOC_REFRESH_DEVS: err = sndstat_refresh_devs(pf); break; - case SNDSTAT_FLUSH_USER_DEVS: + case SNDSTIOC_FLUSH_USER_DEVS: err = sndstat_flush_user_devs(pf); break; default: diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 995d474f8290..bd9b76e1652d 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -38,56 +38,65 @@ #include #endif /* !_IOWR */ -struct sndstat_nvlbuf_arg { +struct sndstioc_nv_arg { size_t nbytes; /* [IN/OUT] buffer size/number of bytes filled */ void *buf; /* [OUT] buffer holding a packed nvlist */ }; /* - * Common labels + * Common name/value pair names */ -#define SNDSTAT_LABEL_DSPS "dsps" -#define SNDSTAT_LABEL_FROM_USER "from_user" -#define SNDSTAT_LABEL_PCHAN "pchan" -#define SNDSTAT_LABEL_RCHAN "rchan" -#define SNDSTAT_LABEL_PMINRATE "pminrate" -#define SNDSTAT_LABEL_PMAXRATE "pmaxrate" -#define SNDSTAT_LABEL_RMINRATE "rminrate" -#define SNDSTAT_LABEL_RMAXRATE "rmaxrate" -#define SNDSTAT_LABEL_PFMTS "pfmts" -#define SNDSTAT_LABEL_RFMTS "rfmts" -#define SNDSTAT_LABEL_NAMEUNIT "nameunit" -#define SNDSTAT_LABEL_DEVNODE "devnode" -#define SNDSTAT_LABEL_DESC "desc" -#define SNDSTAT_LABEL_PROVIDER "provider" -#define SNDSTAT_LABEL_PROVIDER_INFO "provider_info" +#define SNDST_DSPS "dsps" +#define SNDST_DSPS_FROM_USER "from_user" +#define SNDST_DSPS_PCHAN "pchan" +#define SNDST_DSPS_RCHAN "rchan" +#define SNDST_DSPS_NAMEUNIT "nameunit" +#define SNDST_DSPS_DEVNODE "devnode" +#define SNDST_DSPS_DESC "desc" +#define SNDST_DSPS_PROVIDER "provider" +#define SNDST_DSPS_PROVIDER_INFO "provider_info" /* - * sound(4)-specific labels + * Common name/value pair names for play/rec info */ -#define SNDSTAT_LABEL_SOUND4_PROVIDER "sound(4)" -#define SNDSTAT_LABEL_SOUND4_UNIT "unit" -#define SNDSTAT_LABEL_SOUND4_BITPERFECT "bitperfect" -#define SNDSTAT_LABEL_SOUND4_PVCHAN "pvchan" -#define SNDSTAT_LABEL_SOUND4_RVCHAN "rvchan" +#define SNDST_DSPS_INFO_PLAY "info_play" +#define SNDST_DSPS_INFO_REC "info_rec" +#define SNDST_DSPS_INFO_MIN_RATE "min_rate" +#define SNDST_DSPS_INFO_MAX_RATE "max_rate" +#define SNDST_DSPS_INFO_FORMATS "formats" +#define SNDST_DSPS_INFO_MIN_CHN "min_chn" +#define SNDST_DSPS_INFO_MAX_CHN "max_chn" -#define SNDSTAT_REFRESH_DEVS _IO('D', 100) -#define SNDSTAT_GET_DEVS _IOWR('D', 101, struct sndstat_nvlbuf_arg) -#define SNDSTAT_ADD_USER_DEVS _IOWR('D', 102, struct sndstat_nvlbuf_arg) -#define SNDSTAT_FLUSH_USER_DEVS _IO('D', 103) +/* + * sound(4)-specific name/value pair names + */ +#define SNDST_DSPS_SOUND4_PROVIDER "sound(4)" +#define SNDST_DSPS_SOUND4_UNIT "unit" +#define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" +#define SNDST_DSPS_SOUND4_PVCHAN "pvchan" +#define SNDST_DSPS_SOUND4_RVCHAN "rvchan" + +#define SNDSTIOC_REFRESH_DEVS \ + _IO('D', 100) +#define SNDSTIOC_GET_DEVS \ + _IOWR('D', 101, struct sndstioc_nv_arg) +#define SNDSTIOC_ADD_USER_DEVS \ + _IOWR('D', 102, struct sndstioc_nv_arg) +#define SNDSTIOC_FLUSH_USER_DEVS \ + _IO('D', 103) #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 -struct sndstat_nvlbuf_arg32 { +struct sndstioc_nv_arg32 { uint32_t nbytes; uint32_t buf; }; -#define SNDSTAT_GET_DEVS32 \ - _IOC_NEWTYPE(SNDSTAT_GET_DEVS, struct sndstat_nvlbuf_arg32) -#define SNDSTAT_ADD_USER_DEVS32 \ - _IOC_NEWTYPE(SNDSTAT_ADD_USER_DEVS, struct sndstat_nvlbuf_arg32) +#define SNDSTIOC_GET_DEVS32 \ + _IOC_NEWTYPE(SNDSTIOC_GET_DEVS, struct sndstioc_nv_arg32) +#define SNDSTIOC_ADD_USER_DEVS32 \ + _IOC_NEWTYPE(SNDSTIOC_ADD_USER_DEVS, struct sndstioc_nv_arg32) #endif #endif From owner-dev-commits-src-all@freebsd.org Wed Apr 21 08:22:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E3E35FC3A1; Wed, 21 Apr 2021 08:22: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 4FQD7D2wgNz4nbf; Wed, 21 Apr 2021 08:22: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 4E35422F9D; Wed, 21 Apr 2021 08:22: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 13L8MGOG059894; Wed, 21 Apr 2021 08:22:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L8MGVj059893; Wed, 21 Apr 2021 08:22:16 GMT (envelope-from git) Date: Wed, 21 Apr 2021 08:22:16 GMT Message-Id: <202104210822.13L8MGVj059893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: a3a02acde100 - main - param.h: bump __FreeBSD_version for commit 4ce1ba652383 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3a02acde1009f03dc78e979e051acee9f9247c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 08:22:16 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=a3a02acde1009f03dc78e979e051acee9f9247c2 commit a3a02acde1009f03dc78e979e051acee9f9247c2 Author: Ka Ho Ng AuthorDate: 2021-04-15 09:54:54 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-21 08:21:08 +0000 param.h: bump __FreeBSD_version for commit 4ce1ba652383 Commit 4ce1ba652383 changed the sndstat(4) ioctls nvlist schema and definitions. Approved by: philip (mentor) --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 24c335b06a8c..fbdb0eb6ea0d 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 1400009 /* Master, propagated to newvers */ +#define __FreeBSD_version 1400010 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Wed Apr 21 09:58:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C72425FECC2; Wed, 21 Apr 2021 09:58: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 4FQGFt4y23z4sW6; Wed, 21 Apr 2021 09:58: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 6F8A823FD0; Wed, 21 Apr 2021 09:58: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 13L9wAU3079675; Wed, 21 Apr 2021 09:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L9wACg079674; Wed, 21 Apr 2021 09:58:10 GMT (envelope-from git) Date: Wed, 21 Apr 2021 09:58:10 GMT Message-Id: <202104210958.13L9wACg079674@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: d37f81e35b6e - main - contrib/flex: Drop local __dead2 patch 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: d37f81e35b6e8f114b04315e06bab2cf0c03946c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 09:58:10 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d37f81e35b6e8f114b04315e06bab2cf0c03946c commit d37f81e35b6e8f114b04315e06bab2cf0c03946c Author: Alex Richardson AuthorDate: 2021-04-21 09:48:55 +0000 Commit: Alex Richardson CommitDate: 2021-04-21 09:54:59 +0000 contrib/flex: Drop local __dead2 patch Upstream flex has added a yynoreturn macro, so this diff is no longer needed. Partially reverts r181269. Reviewed By: jkim Differential Revision: https://reviews.freebsd.org/D29679 --- contrib/flex/src/flex.skl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/contrib/flex/src/flex.skl b/contrib/flex/src/flex.skl index c23b944ea473..304e664e4c62 100644 --- a/contrib/flex/src/flex.skl +++ b/contrib/flex/src/flex.skl @@ -216,12 +216,6 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]], /* First, we deal with platform-specific or compiler-specific issues. */ -#if defined(__FreeBSD__) -#include -#else -#define __dead2 -#endif - /* begin standard C headers. */ %if-c-only #include @@ -653,7 +647,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG); static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG ); -static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ) __dead2; +static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ); ]]) %endif From owner-dev-commits-src-all@freebsd.org Wed Apr 21 09:58:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 766A05FECBC; Wed, 21 Apr 2021 09:58: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 4FQGFs2tGWz4sNS; Wed, 21 Apr 2021 09:58: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 55C3C24048; Wed, 21 Apr 2021 09:58: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 13L9w964079645; Wed, 21 Apr 2021 09:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L9w9cF079644; Wed, 21 Apr 2021 09:58:09 GMT (envelope-from git) Date: Wed, 21 Apr 2021 09:58:09 GMT Message-Id: <202104210958.13L9w9cF079644@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: 3bca8d2b3270 - main - Revert "contrib/flex: Drop local __dead2 patch" 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: 3bca8d2b3270c38e67c1c851b1dae9d8cb921b69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 09:58:09 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=3bca8d2b3270c38e67c1c851b1dae9d8cb921b69 commit 3bca8d2b3270c38e67c1c851b1dae9d8cb921b69 Author: Alex Richardson AuthorDate: 2021-04-21 09:48:12 +0000 Commit: Alex Richardson CommitDate: 2021-04-21 09:48:47 +0000 Revert "contrib/flex: Drop local __dead2 patch" I missed the review comment to commit the changes separately, will reland in multiple smaller commits. Requested By: jkim This reverts commit bbd421cdf6d8c6102e6fd3979c5bec21ace3c2e3. --- contrib/flex/src/flex.skl | 8 +- tools/build/bootstrap-m4/inittokenizer.c | 414 +++++++++++++++---------------- usr.bin/lex/initscan.c | 16 +- usr.bin/lex/initskel.c | 8 +- 4 files changed, 220 insertions(+), 226 deletions(-) diff --git a/contrib/flex/src/flex.skl b/contrib/flex/src/flex.skl index 304e664e4c62..c23b944ea473 100644 --- a/contrib/flex/src/flex.skl +++ b/contrib/flex/src/flex.skl @@ -216,6 +216,12 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]], /* First, we deal with platform-specific or compiler-specific issues. */ +#if defined(__FreeBSD__) +#include +#else +#define __dead2 +#endif + /* begin standard C headers. */ %if-c-only #include @@ -647,7 +653,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG); static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG ); -static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ); +static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ) __dead2; ]]) %endif diff --git a/tools/build/bootstrap-m4/inittokenizer.c b/tools/build/bootstrap-m4/inittokenizer.c index a014012ad756..0c07f1ec2275 100644 --- a/tools/build/bootstrap-m4/inittokenizer.c +++ b/tools/build/bootstrap-m4/inittokenizer.c @@ -1,6 +1,4 @@ -#line 1 "tokenizer.c" -#line 3 "tokenizer.c" #define YY_INT_ALIGNED short int @@ -8,14 +6,24 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ +#if defined(__FreeBSD__) +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#include +#include +#else +#define __dead2 +#endif + /* begin standard C headers. */ #include #include @@ -85,61 +93,65 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -/* begin standard C++ headers. */ +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST -/* TODO: this is always defined, so inline it */ -#define yyconst const +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) +#ifdef YY_USE_CONST +#define yyconst const #else -#define yynoreturn +#define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * + /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START + /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart(yyin ) + #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -156,16 +168,15 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern int yyleng; +extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -180,6 +191,7 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) + #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -194,12 +206,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - int yy_buf_size; + yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -222,7 +234,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -250,7 +262,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -262,6 +274,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) #define yy_current_buffer YY_CURRENT_BUFFER + /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -269,11 +282,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -282,81 +295,85 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer + #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } + #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } + #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap() (/*CONSTCOND*/1) +#define yywrap() 1 #define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; -FILE *yyin = NULL, *yyout = NULL; +typedef unsigned char YY_CHAR; + +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; + int yylineno = 1; extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ) __dead2; /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ + yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; + #define YY_NUM_RULES 14 #define YY_END_OF_BUFFER 15 /* This struct is not used in this scanner, @@ -366,7 +383,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[35] = +static yyconst flex_int16_t yy_accept[35] = { 0, 0, 0, 15, 13, 1, 1, 13, 13, 13, 2, 2, 13, 13, 13, 13, 1, 9, 10, 12, 2, @@ -374,7 +391,7 @@ static const flex_int16_t yy_accept[35] = 2, 0, 3, 0 } ; -static const YY_CHAR yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -406,13 +423,13 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[19] = +static yyconst flex_int32_t yy_meta[19] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 3, 4, 4, 4, 1 } ; -static const flex_int16_t yy_base[39] = +static yyconst flex_int16_t yy_base[39] = { 0, 0, 0, 48, 49, 17, 19, 35, 41, 39, 16, 0, 14, 32, 15, 25, 27, 49, 49, 49, 27, @@ -420,7 +437,7 @@ static const flex_int16_t yy_base[39] = 0, 0, 0, 49, 39, 29, 34, 36 } ; -static const flex_int16_t yy_def[39] = +static yyconst flex_int16_t yy_def[39] = { 0, 34, 1, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, @@ -428,7 +445,7 @@ static const flex_int16_t yy_def[39] = 37, 38, 38, 0, 34, 34, 34, 34 } ; -static const flex_int16_t yy_nxt[68] = +static yyconst flex_int16_t yy_nxt[68] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 11, 4, 12, 13, 14, 4, 4, 4, 4, 15, 16, 16, @@ -439,7 +456,7 @@ static const flex_int16_t yy_nxt[68] = 34, 34, 34, 34, 34, 34, 34 } ; -static const flex_int16_t yy_chk[68] = +static yyconst flex_int16_t yy_chk[68] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, @@ -464,9 +481,7 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "tokenizer.l" #define YY_NO_INPUT 1 -#line 3 "tokenizer.l" /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie @@ -501,8 +516,6 @@ int32_t parse_radix(void); extern int yylex(void); #define YY_DECL int yylex(void) -#line 504 "tokenizer.c" -#line 505 "tokenizer.c" #define INITIAL 0 @@ -518,36 +531,36 @@ extern int yylex(void); #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals ( void ); +static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy ( void ); +int yylex_destroy (void ); -int yyget_debug ( void ); +int yyget_debug (void ); -void yyset_debug ( int debug_flag ); +void yyset_debug (int debug_flag ); -YY_EXTRA_TYPE yyget_extra ( void ); +YY_EXTRA_TYPE yyget_extra (void ); -void yyset_extra ( YY_EXTRA_TYPE user_defined ); +void yyset_extra (YY_EXTRA_TYPE user_defined ); -FILE *yyget_in ( void ); +FILE *yyget_in (void ); -void yyset_in ( FILE * _in_str ); +void yyset_in (FILE * in_str ); -FILE *yyget_out ( void ); +FILE *yyget_out (void ); -void yyset_out ( FILE * _out_str ); +void yyset_out (FILE * out_str ); - int yyget_leng ( void ); +yy_size_t yyget_leng (void ); -char *yyget_text ( void ); +char *yyget_text (void ); -int yyget_lineno ( void ); +int yyget_lineno (void ); -void yyset_lineno ( int _line_number ); +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -555,41 +568,33 @@ void yyset_lineno ( int _line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap ( void ); +extern "C" int yywrap (void ); #else -extern int yywrap ( void ); -#endif +extern int yywrap (void ); #endif - -#ifndef YY_NO_UNPUT - #endif #ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput ( void ); +static int yyinput (void ); #else -static int input ( void ); +static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -597,7 +602,7 @@ static int input ( void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -608,7 +613,7 @@ static int input ( void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -621,7 +626,7 @@ static int input ( void ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -676,7 +681,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; +#define YY_BREAK break; #endif #define YY_RULE_SETUP \ @@ -690,6 +695,8 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; + + if ( !(yy_init) ) { (yy_init) = 1; @@ -710,18 +717,13 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + yy_create_buffer(yyin,YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - { -#line 48 "tokenizer.l" - -#line 722 "tokenizer.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -747,9 +749,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 49 ); @@ -779,17 +781,14 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 49 "tokenizer.l" {/* just skip it */} YY_BREAK case 2: YY_RULE_SETUP -#line 50 "tokenizer.l" { yylval = number(); return(NUMBER); } YY_BREAK case 3: YY_RULE_SETUP -#line 51 "tokenizer.l" { if (mimic_gnu) { yylval = parse_radix(); return(NUMBER); } else { @@ -799,60 +798,48 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 57 "tokenizer.l" { return(LE); } YY_BREAK case 5: YY_RULE_SETUP -#line 58 "tokenizer.l" { return(GE); } YY_BREAK case 6: YY_RULE_SETUP -#line 59 "tokenizer.l" { return(LSHIFT); } YY_BREAK case 7: YY_RULE_SETUP -#line 60 "tokenizer.l" { return(RSHIFT); } YY_BREAK case 8: YY_RULE_SETUP -#line 61 "tokenizer.l" { return(EQ); } YY_BREAK case 9: YY_RULE_SETUP -#line 62 "tokenizer.l" { return(NE); } YY_BREAK case 10: YY_RULE_SETUP -#line 63 "tokenizer.l" { return(LAND); } YY_BREAK case 11: YY_RULE_SETUP -#line 64 "tokenizer.l" { return(LOR); } YY_BREAK case 12: YY_RULE_SETUP -#line 65 "tokenizer.l" { if (mimic_gnu) { return (EXPONENT); } } YY_BREAK case 13: YY_RULE_SETUP -#line 66 "tokenizer.l" { return yytext[0]; } YY_BREAK case 14: YY_RULE_SETUP -#line 67 "tokenizer.l" ECHO; YY_BREAK -#line 855 "tokenizer.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -930,7 +917,7 @@ case YY_STATE_EOF(INITIAL): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -983,7 +970,6 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1026,7 +1012,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1039,7 +1025,7 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1053,7 +1039,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1062,12 +1048,11 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; + b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1095,7 +1080,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else @@ -1109,15 +1094,12 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1150,9 +1132,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; @@ -1178,18 +1160,14 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[yy_c]; + yy_c = yy_meta[(unsigned int) yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 34); return yy_is_jam ? 0 : yy_current_state; } -#ifndef YY_NO_UNPUT - -#endif - #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1214,7 +1192,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1231,14 +1209,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart( yyin ); + yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return 0; + if ( yywrap( ) ) + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1275,11 +1253,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); + yy_create_buffer(yyin,YY_BUF_SIZE ); } - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -1307,7 +1285,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1335,7 +1313,7 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1344,13 +1322,13 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + yy_init_buffer(b,file ); return b; } @@ -1369,9 +1347,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); + yyfree((void *) b->yy_ch_buf ); - yyfree( (void *) b ); + yyfree((void *) b ); } /* Initializes or reinitializes a buffer. @@ -1383,7 +1361,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer( b ); + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1426,7 +1404,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1457,7 +1435,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1476,7 +1454,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1494,15 +1472,15 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1511,7 +1489,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; + int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -1531,7 +1509,7 @@ static void yyensure_buffer_stack (void) * @param base the character buffer *** 329 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Apr 21 09:58:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 149025FEE09; Wed, 21 Apr 2021 09:58: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 4FQGFw6SJ0z4sYt; Wed, 21 Apr 2021 09:58: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 BA76A23DF8; Wed, 21 Apr 2021 09:58: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 13L9wCB0079719; Wed, 21 Apr 2021 09:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L9wC8a079718; Wed, 21 Apr 2021 09:58:12 GMT (envelope-from git) Date: Wed, 21 Apr 2021 09:58:12 GMT Message-Id: <202104210958.13L9wC8a079718@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: f8e57f89f3f5 - main - tools/build/bootstrap-m4: regenerate after d37f81e35b 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: f8e57f89f3f550501c54ce839213a08981ff9250 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 09:58:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e57f89f3f550501c54ce839213a08981ff9250 commit f8e57f89f3f550501c54ce839213a08981ff9250 Author: Alex Richardson AuthorDate: 2021-04-21 09:53:04 +0000 Commit: Alex Richardson CommitDate: 2021-04-21 09:57:51 +0000 tools/build/bootstrap-m4: regenerate after d37f81e35b Reviewed by: jkim --- tools/build/bootstrap-m4/inittokenizer.c | 414 ++++++++++++++++--------------- 1 file changed, 219 insertions(+), 195 deletions(-) diff --git a/tools/build/bootstrap-m4/inittokenizer.c b/tools/build/bootstrap-m4/inittokenizer.c index 0c07f1ec2275..a014012ad756 100644 --- a/tools/build/bootstrap-m4/inittokenizer.c +++ b/tools/build/bootstrap-m4/inittokenizer.c @@ -1,4 +1,6 @@ +#line 1 "tokenizer.c" +#line 3 "tokenizer.c" #define YY_INT_ALIGNED short int @@ -6,24 +8,14 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ -#if defined(__FreeBSD__) -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif -#include -#include -#else -#define __dead2 -#endif - /* begin standard C headers. */ #include #include @@ -93,65 +85,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -168,15 +156,16 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t yyleng; +extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -191,7 +180,6 @@ extern FILE *yyin, *yyout; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -206,12 +194,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -234,7 +222,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -262,7 +250,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -274,7 +262,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) #define yy_current_buffer YY_CURRENT_BUFFER - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -282,11 +269,11 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -295,85 +282,81 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ -#define yywrap() 1 +#define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; - int yylineno = 1; extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ) __dead2; +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 14 #define YY_END_OF_BUFFER 15 /* This struct is not used in this scanner, @@ -383,7 +366,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[35] = +static const flex_int16_t yy_accept[35] = { 0, 0, 0, 15, 13, 1, 1, 13, 13, 13, 2, 2, 13, 13, 13, 13, 1, 9, 10, 12, 2, @@ -391,7 +374,7 @@ static yyconst flex_int16_t yy_accept[35] = 2, 0, 3, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -423,13 +406,13 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[19] = +static const YY_CHAR yy_meta[19] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 3, 4, 4, 4, 1 } ; -static yyconst flex_int16_t yy_base[39] = +static const flex_int16_t yy_base[39] = { 0, 0, 0, 48, 49, 17, 19, 35, 41, 39, 16, 0, 14, 32, 15, 25, 27, 49, 49, 49, 27, @@ -437,7 +420,7 @@ static yyconst flex_int16_t yy_base[39] = 0, 0, 0, 49, 39, 29, 34, 36 } ; -static yyconst flex_int16_t yy_def[39] = +static const flex_int16_t yy_def[39] = { 0, 34, 1, 34, 34, 34, 34, 34, 34, 34, 34, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, @@ -445,7 +428,7 @@ static yyconst flex_int16_t yy_def[39] = 37, 38, 38, 0, 34, 34, 34, 34 } ; -static yyconst flex_int16_t yy_nxt[68] = +static const flex_int16_t yy_nxt[68] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 11, 4, 12, 13, 14, 4, 4, 4, 4, 15, 16, 16, @@ -456,7 +439,7 @@ static yyconst flex_int16_t yy_nxt[68] = 34, 34, 34, 34, 34, 34, 34 } ; -static yyconst flex_int16_t yy_chk[68] = +static const flex_int16_t yy_chk[68] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, @@ -481,7 +464,9 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; +#line 1 "tokenizer.l" #define YY_NO_INPUT 1 +#line 3 "tokenizer.l" /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ /* * Copyright (c) 2004 Marc Espie @@ -516,6 +501,8 @@ int32_t parse_radix(void); extern int yylex(void); #define YY_DECL int yylex(void) +#line 504 "tokenizer.c" +#line 505 "tokenizer.c" #define INITIAL 0 @@ -531,36 +518,36 @@ extern int yylex(void); #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (void ); +int yylex_destroy ( void ); -int yyget_debug (void ); +int yyget_debug ( void ); -void yyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void yyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *yyget_in (void ); +FILE *yyget_in ( void ); -void yyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *yyget_out (void ); +FILE *yyget_out ( void ); -void yyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t yyget_leng (void ); + int yyget_leng ( void ); -char *yyget_text (void ); +char *yyget_text ( void ); -int yyget_lineno (void ); +int yyget_lineno ( void ); -void yyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -568,33 +555,41 @@ void yyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); +#endif #endif + +#ifndef YY_NO_UNPUT + #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -602,7 +597,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -613,7 +608,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -626,7 +621,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -681,7 +676,7 @@ extern int yylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -695,8 +690,6 @@ YY_DECL char *yy_cp, *yy_bp; int yy_act; - - if ( !(yy_init) ) { (yy_init) = 1; @@ -717,13 +710,18 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 48 "tokenizer.l" + +#line 722 "tokenizer.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -749,9 +747,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 49 ); @@ -781,14 +779,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP +#line 49 "tokenizer.l" {/* just skip it */} YY_BREAK case 2: YY_RULE_SETUP +#line 50 "tokenizer.l" { yylval = number(); return(NUMBER); } YY_BREAK case 3: YY_RULE_SETUP +#line 51 "tokenizer.l" { if (mimic_gnu) { yylval = parse_radix(); return(NUMBER); } else { @@ -798,48 +799,60 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP +#line 57 "tokenizer.l" { return(LE); } YY_BREAK case 5: YY_RULE_SETUP +#line 58 "tokenizer.l" { return(GE); } YY_BREAK case 6: YY_RULE_SETUP +#line 59 "tokenizer.l" { return(LSHIFT); } YY_BREAK case 7: YY_RULE_SETUP +#line 60 "tokenizer.l" { return(RSHIFT); } YY_BREAK case 8: YY_RULE_SETUP +#line 61 "tokenizer.l" { return(EQ); } YY_BREAK case 9: YY_RULE_SETUP +#line 62 "tokenizer.l" { return(NE); } YY_BREAK case 10: YY_RULE_SETUP +#line 63 "tokenizer.l" { return(LAND); } YY_BREAK case 11: YY_RULE_SETUP +#line 64 "tokenizer.l" { return(LOR); } YY_BREAK case 12: YY_RULE_SETUP +#line 65 "tokenizer.l" { if (mimic_gnu) { return (EXPONENT); } } YY_BREAK case 13: YY_RULE_SETUP +#line 66 "tokenizer.l" { return yytext[0]; } YY_BREAK case 14: YY_RULE_SETUP +#line 67 "tokenizer.l" ECHO; YY_BREAK +#line 855 "tokenizer.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -917,7 +930,7 @@ case YY_STATE_EOF(INITIAL): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -970,6 +983,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1012,7 +1026,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1025,7 +1039,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1039,7 +1053,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1048,11 +1062,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1080,7 +1095,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -1094,12 +1109,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1132,9 +1150,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1160,14 +1178,18 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 35 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 34); return yy_is_jam ? 0 : yy_current_state; } +#ifndef YY_NO_UNPUT + +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1192,7 +1214,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1209,14 +1231,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1253,11 +1275,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -1285,7 +1307,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -1313,7 +1335,7 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1322,13 +1344,13 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -1347,9 +1369,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -1361,7 +1383,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -1404,7 +1426,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1435,7 +1457,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1454,7 +1476,7 @@ void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1472,15 +1494,15 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1489,7 +1511,7 @@ static void yyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc @@ -1509,7 +1531,7 @@ static void yyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { @@ -1519,23 +1541,23 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); *** 214 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Apr 21 09:58:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E55615FECC3; Wed, 21 Apr 2021 09:58: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 4FQGFv5lG3z4sWB; Wed, 21 Apr 2021 09:58: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 A778923DF7; Wed, 21 Apr 2021 09:58: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 13L9wBNA079696; Wed, 21 Apr 2021 09:58:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13L9wB0h079695; Wed, 21 Apr 2021 09:58:11 GMT (envelope-from git) Date: Wed, 21 Apr 2021 09:58:11 GMT Message-Id: <202104210958.13L9wB0h079695@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: c6e66cbfbbd1 - main - usr.bin/lex: regenerate bootstrap files after d37f81e35b 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: c6e66cbfbbd1c5dec215cf91a79689037255171c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 09:58:12 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c6e66cbfbbd1c5dec215cf91a79689037255171c commit c6e66cbfbbd1c5dec215cf91a79689037255171c Author: Alex Richardson AuthorDate: 2021-04-21 09:50:33 +0000 Commit: Alex Richardson CommitDate: 2021-04-21 09:56:29 +0000 usr.bin/lex: regenerate bootstrap files after d37f81e35b Reviewed by: jkim --- usr.bin/lex/initscan.c | 16 +++++----------- usr.bin/lex/initskel.c | 8 +------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 9b6fb4ae5183..5c2701d060da 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -15,12 +15,6 @@ /* First, we deal with platform-specific or compiler-specific issues. */ -#if defined(__FreeBSD__) -#include -#else -#define __dead2 -#endif - /* begin standard C headers. */ #include #include @@ -348,7 +342,7 @@ extern char *yytext; static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ) __dead2; +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -1971,9 +1965,9 @@ extern int yylval; if (!indented_code) line_directive_out(NULL, 0);\ } while (0) -#line 1974 "" +#line 1968 "" -#line 1976 "" +#line 1970 "" #define INITIAL 0 #define SECT2 1 @@ -2239,7 +2233,7 @@ YY_DECL char nmdef[MAXLINE]; -#line 2242 "" +#line 2236 "" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -4140,7 +4134,7 @@ YY_RULE_SETUP #line 1014 "scan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 4143 "" +#line 4137 "" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(SECT2): case YY_STATE_EOF(CODEBLOCK): diff --git a/usr.bin/lex/initskel.c b/usr.bin/lex/initskel.c index 53a0ae452aa8..746ad6405c2a 100644 --- a/usr.bin/lex/initskel.c +++ b/usr.bin/lex/initskel.c @@ -446,12 +446,6 @@ const char *skel[] = { "", "/* First, we deal with platform-specific or compiler-specific issues. */", "", - "#if defined(__FreeBSD__)", - "#include ", - "#else", - "#define __dead2", - "#endif", - "", "/* begin standard C headers. */", "%if-c-only", "#include ", @@ -943,7 +937,7 @@ const char *skel[] = { "static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG );", "static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG);", "static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG );", - "static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG ) __dead2;", + "static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG );", "]])", "", "%endif", From owner-dev-commits-src-all@freebsd.org Wed Apr 21 10:01:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 008DB5FEFD7; Wed, 21 Apr 2021 10:01: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 4FQGKS6b6Cz4sxZ; Wed, 21 Apr 2021 10:01: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 D4EA92421F; Wed, 21 Apr 2021 10:01: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 13LA1Guc092328; Wed, 21 Apr 2021 10:01:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LA1G7a092327; Wed, 21 Apr 2021 10:01:16 GMT (envelope-from git) Date: Wed, 21 Apr 2021 10:01:16 GMT Message-Id: <202104211001.13LA1G7a092327@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: 67f2f67fc8ce - main - Update rtsock_l3 test after 2fe5a79425c79f7b828acd91da66d97230925fc8 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: 67f2f67fc8ce8484066e95dabac5af892888fca1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 10:01:17 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=67f2f67fc8ce8484066e95dabac5af892888fca1 commit 67f2f67fc8ce8484066e95dabac5af892888fca1 Author: Alex Richardson AuthorDate: 2021-04-21 09:58:34 +0000 Commit: Alex Richardson CommitDate: 2021-04-21 09:58:34 +0000 Update rtsock_l3 test after 2fe5a79425c79f7b828acd91da66d97230925fc8 Two of these tests now pass. Looking at Jenkins to find the first commit where this behaviour changed indicates that 2fe5a79425c79f7b828acd91da66d97230925fc8 is the most likely cause. Reviewed By: melifaro Differential Revision: https://reviews.freebsd.org/D28886 --- tests/sys/net/routing/rtsock_config.h | 9 +++++++- tests/sys/net/routing/test_rtsock_l3.c | 38 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/tests/sys/net/routing/rtsock_config.h b/tests/sys/net/routing/rtsock_config.h index 7d73f9e9a109..d9eccb6a19f6 100644 --- a/tests/sys/net/routing/rtsock_config.h +++ b/tests/sys/net/routing/rtsock_config.h @@ -126,8 +126,15 @@ config_setup(const atf_tc_t *tc, struct rtsock_config_options *co) inet_ntop(AF_INET6, &c->net6.sin6_addr, c->net6_str, INET6_ADDRSTRLEN); inet_ntop(AF_INET6, &c->addr6.sin6_addr, c->addr6_str, INET6_ADDRSTRLEN); + ATF_CHECK_ERRNO(0, true); + if (co->num_interfaces > 0) { - kldload("if_epair"); + if (kldload("if_epair") == -1) { + /* Any errno other than EEXIST is fatal. */ + ATF_REQUIRE_ERRNO(EEXIST, true); + /* Clear errno for the following tests. */ + errno = 0; + } ATF_REQUIRE_KERNEL_MODULE("if_epair"); c->ifnames = calloc(co->num_interfaces, sizeof(char *)); diff --git a/tests/sys/net/routing/test_rtsock_l3.c b/tests/sys/net/routing/test_rtsock_l3.c index 91816679400f..b377b6c51ef2 100644 --- a/tests/sys/net/routing/test_rtsock_l3.c +++ b/tests/sys/net/routing/test_rtsock_l3.c @@ -64,6 +64,7 @@ presetup_ipv6_iface(const atf_tc_t *tc) ret = iface_enable_ipv6(c->ifname); ATF_REQUIRE_MSG(ret == 0, "Unable to enable IPv6 on %s", c->ifname); + ATF_REQUIRE_ERRNO(0, true); return (c); } @@ -79,6 +80,7 @@ presetup_ipv6(const atf_tc_t *tc) ret = iface_setup_addr(c->ifname, c->addr6_str, c->plen6); c->rtsock_fd = rtsock_setup_socket(); + ATF_REQUIRE_ERRNO(0, true); return (c); } @@ -90,11 +92,13 @@ presetup_ipv4_iface(const atf_tc_t *tc) int ret; c = config_setup(tc, NULL); + ATF_REQUIRE(c != NULL); jump_vnet(c, tc); ret = iface_turn_up(c->ifname); ATF_REQUIRE_MSG(ret == 0, "Unable to turn up %s", c->ifname); + ATF_REQUIRE_ERRNO(0, true); return (c); } @@ -112,6 +116,7 @@ presetup_ipv4(const atf_tc_t *tc) ATF_REQUIRE_MSG(ret == 0, "ifconfig failed"); c->rtsock_fd = rtsock_setup_socket(); + ATF_REQUIRE_ERRNO(0, true); return (c); } @@ -365,7 +370,7 @@ ATF_TC_BODY(rtm_get_v4_empty_dst_failure, tc) (struct sockaddr *)&c->mask4, NULL); rtsock_update_rtm_len(rtm); - ATF_CHECK_ERRNO(EINVAL, write(c->rtsock_fd, rtm, rtm->rtm_msglen)); + ATF_CHECK_ERRNO(EINVAL, write(c->rtsock_fd, rtm, rtm->rtm_msglen) == -1); } ATF_TC_CLEANUP(rtm_get_v4_empty_dst_failure, tc) @@ -373,19 +378,16 @@ ATF_TC_CLEANUP(rtm_get_v4_empty_dst_failure, tc) CLEANUP_AFTER_TEST; } -ATF_TC_WITH_CLEANUP(rtm_get_v4_hostbits_failure); -ATF_TC_HEAD(rtm_get_v4_hostbits_failure, tc) +ATF_TC_WITH_CLEANUP(rtm_get_v4_hostbits_success); +ATF_TC_HEAD(rtm_get_v4_hostbits_success, tc) { DESCRIBE_ROOT_TEST("Tests RTM_GET with prefix with some hosts-bits set"); } -ATF_TC_BODY(rtm_get_v4_hostbits_failure, tc) +ATF_TC_BODY(rtm_get_v4_hostbits_success, tc) { DECLARE_TEST_VARS; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_expect_fail("Needs https://reviews.freebsd.org/D28886"); - c = presetup_ipv4(tc); /* Q the same prefix */ @@ -393,10 +395,11 @@ ATF_TC_BODY(rtm_get_v4_hostbits_failure, tc) (struct sockaddr *)&c->mask4, NULL); rtsock_update_rtm_len(rtm); - ATF_CHECK_ERRNO(ESRCH, write(c->rtsock_fd, rtm, rtm->rtm_msglen)); + ATF_REQUIRE_ERRNO(0, true); + ATF_CHECK_ERRNO(0, write(c->rtsock_fd, rtm, rtm->rtm_msglen) > 0); } -ATF_TC_CLEANUP(rtm_get_v4_hostbits_failure, tc) +ATF_TC_CLEANUP(rtm_get_v4_hostbits_success, tc) { CLEANUP_AFTER_TEST; } @@ -443,16 +446,13 @@ ATF_TC_CLEANUP(rtm_add_v4_gw_direct_success, tc) CLEANUP_AFTER_TEST; } -RTM_DECLARE_ROOT_TEST(rtm_add_v4_no_rtf_host_failure, - "Tests failure with netmask sa and RTF_HOST inconsistency"); +RTM_DECLARE_ROOT_TEST(rtm_add_v4_no_rtf_host_success, + "Tests success with netmask sa and RTF_HOST inconsistency"); -ATF_TC_BODY(rtm_add_v4_no_rtf_host_failure, tc) +ATF_TC_BODY(rtm_add_v4_no_rtf_host_success, tc) { DECLARE_TEST_VARS; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_expect_fail("Needs https://reviews.freebsd.org/D28886"); - c = presetup_ipv4(tc); /* Create IPv4 subnetwork with smaller prefix */ @@ -466,8 +466,8 @@ ATF_TC_BODY(rtm_add_v4_no_rtf_host_failure, tc) rtsock_update_rtm_len(rtm); /* RTF_HOST is NOT specified, while netmask is empty */ - - ATF_CHECK_ERRNO(EINVAL, write(c->rtsock_fd, rtm, rtm->rtm_msglen)); + ATF_REQUIRE_ERRNO(0, true); + ATF_CHECK_ERRNO(0, write(c->rtsock_fd, rtm, rtm->rtm_msglen) > 0); } ATF_TC_WITH_CLEANUP(rtm_del_v4_prefix_nogw_success); @@ -1393,9 +1393,9 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, rtm_get_v4_exact_success); ATF_TP_ADD_TC(tp, rtm_get_v4_lpm_success); - ATF_TP_ADD_TC(tp, rtm_get_v4_hostbits_failure); + ATF_TP_ADD_TC(tp, rtm_get_v4_hostbits_success); ATF_TP_ADD_TC(tp, rtm_get_v4_empty_dst_failure); - ATF_TP_ADD_TC(tp, rtm_add_v4_no_rtf_host_failure); + ATF_TP_ADD_TC(tp, rtm_add_v4_no_rtf_host_success); ATF_TP_ADD_TC(tp, rtm_add_v4_gw_direct_success); ATF_TP_ADD_TC(tp, rtm_del_v4_prefix_nogw_success); ATF_TP_ADD_TC(tp, rtm_add_v6_gu_gw_gu_direct_success); From owner-dev-commits-src-all@freebsd.org Wed Apr 21 10:03:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18BC05FF14C; Wed, 21 Apr 2021 10:03:43 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 4FQGNG2Qb1z4tQW; Wed, 21 Apr 2021 10:03:41 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ej1-f49.google.com with SMTP id w23so46852923ejb.9; Wed, 21 Apr 2021 03:03:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=zwJAisHHP4+fJkN8JS5UFken42ml9/M+Nj7wfenuXBY=; b=kFVxOg7AG3TD3+A25KJQPtKq7gviUuKsD2jIkRkohy5BQ7FqjQKEcKvHfzH7XCGfs4 Fo4+/burPqCWWEum5SnxaFlYdFOdTbQluf2rN2oEjhSWJFzbcfXpyj+CRV/E3MEHOcg5 z6CqU+WSXtWz55Ti854J3W/mWuZVb4Mvz2sXW2z/v7WZ7i8+A5+LMf5N1RoZzwsUhNiB sYwueBTpdVu3OJ170QycZZyUK4kcurM7ZE5b7O4SvXSKVvIetOIIYKdnWDGUC9q1piWt QeW4aZaltrm3IzT659LSr7NrV9igEVbr1JcV/s+emWMv3Ul3xzqFvoP18LYiDfOWGZuA Na3Q== X-Gm-Message-State: AOAM531jHe3KF3J35thp0B21zHm3TkiO5LSo2cQaetqDe5uB3zGAmQYU 4StHWSR65ML5xEU3d+hKoyoN1FfDlXds0b0k X-Google-Smtp-Source: ABdhPJz2qLx87KOD9m1X1GmzNJJ/fXYb9Wku47a+BNXT2CQozGY+uRtZcSKSGNRghdVr4QfxSStsLQ== X-Received: by 2002:a17:906:430f:: with SMTP id j15mr32106150ejm.543.1618999420122; Wed, 21 Apr 2021 03:03:40 -0700 (PDT) Received: from [192.168.0.106] (ip5f5bd493.dynamic.kabel-deutschland.de. [95.91.212.147]) by smtp.gmail.com with ESMTPSA id r17sm2539812edt.70.2021.04.21.03.03.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Apr 2021 03:03:39 -0700 (PDT) Subject: Re: git: c4207d867c20 - main - fork.2: Add a simple use pattern To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202104172113.13HLD6UI014137@gitrepo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <04cb1d58-a7ca-9ea1-0d69-57251c378794@FreeBSD.org> Date: Wed, 21 Apr 2021 12:03:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4FQGNG2Qb1z4tQW X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SENDERSCORE_FAIL(0.00)[209.85.218.49:server fail]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RWL_MAILSPIKE_GOOD(0.00)[209.85.218.49:from]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[95.91.212.147:received]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.218.49:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; SPAMHAUS_ZRD(0.00)[209.85.218.49:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.49:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 10:03:43 -0000 On 20/04/2021 11:58, Konstantin Belousov wrote: > On Sat, Apr 17, 2021 at 09:13:06PM +0000, Mateusz Piotrowski wrote: >> URL: https://cgit.FreeBSD.org/src/commit/?id=c4207d867c201a726aa3157e09262f72166c89c4 >> >> commit c4207d867c201a726aa3157e09262f72166c89c4 >> Author: Mateusz Piotrowski <0mp@FreeBSD.org> >> AuthorDate: 2021-04-17 21:10:48 +0000 >> Commit: Mateusz Piotrowski <0mp@FreeBSD.org> >> CommitDate: 2021-04-17 21:12:06 +0000 >> >> fork.2: Add a simple use pattern >> >> It seems to be a nice idea to show how fork() is usually used in >> practice. This may act as a guide to developers who want to quickly >> recall how to use the fork() function. >> >> Reviewed by: bcr, yuripv >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D27626 >> > Using printf around fork is not the best idea, and definitely should not > be provided as a guiding example in the man page. Using stdio safely around > fork() requires at least flushing buffers and ensuring that opened FILEs are > in some consistent state right at fork. > > It would work by chance in your example, mostly because you did not used > anything in stdio before fork, but any further changes would result in > very puzzling bugs (for beginners, who are the target of this example). OK, I've opened a revision on Phabricator to address those issues: https://reviews.freebsd.org/D29880 From owner-dev-commits-src-all@freebsd.org Wed Apr 21 10:42:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94FDB5E00A1; Wed, 21 Apr 2021 10:42:40 +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 4FQHFD3j8pz4vf4; Wed, 21 Apr 2021 10:42:40 +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 71F3924C9F; Wed, 21 Apr 2021 10:42:40 +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 13LAgekv045777; Wed, 21 Apr 2021 10:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LAgeeP045776; Wed, 21 Apr 2021 10:42:40 GMT (envelope-from git) Date: Wed, 21 Apr 2021 10:42:40 GMT Message-Id: <202104211042.13LAgeeP045776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Reifenberger Subject: git: b563ff5d4f81 - main - Append Keyboard Layout specified option for using VNC. Part one: supporting QEMU Extended Keyboard Event Message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b563ff5d4f812df198ade6991834782a5d35af08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 10:42:40 -0000 The branch main has been updated by mr: URL: https://cgit.FreeBSD.org/src/commit/?id=b563ff5d4f812df198ade6991834782a5d35af08 commit b563ff5d4f812df198ade6991834782a5d35af08 Author: Michael Reifenberger AuthorDate: 2021-04-21 10:38:26 +0000 Commit: Michael Reifenberger CommitDate: 2021-04-21 10:40:44 +0000 Append Keyboard Layout specified option for using VNC. Part one: supporting QEMU Extended Keyboard Event Message PR: 246121 Submitted by: koinec@yahoo.co.jp Differential Revision: https://reviews.freebsd.org/D29430 --- usr.sbin/bhyve/console.c | 4 +-- usr.sbin/bhyve/console.h | 4 +-- usr.sbin/bhyve/ps2kbd.c | 54 ++++++++++++++++++++++++++---------- usr.sbin/bhyve/rfb.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 115 insertions(+), 19 deletions(-) diff --git a/usr.sbin/bhyve/console.c b/usr.sbin/bhyve/console.c index 2567f699595c..d845df754048 100644 --- a/usr.sbin/bhyve/console.c +++ b/usr.sbin/bhyve/console.c @@ -106,10 +106,10 @@ console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri) } void -console_key_event(int down, uint32_t keysym) +console_key_event(int down, uint32_t keysym, uint32_t keycode) { if (console.kbd_event_cb) - (*console.kbd_event_cb)(down, keysym, console.kbd_arg); + (*console.kbd_event_cb)(down, keysym, keycode, console.kbd_arg); } void diff --git a/usr.sbin/bhyve/console.h b/usr.sbin/bhyve/console.h index 0d0a85486625..8029c28ab8a9 100644 --- a/usr.sbin/bhyve/console.h +++ b/usr.sbin/bhyve/console.h @@ -34,7 +34,7 @@ struct bhyvegc; typedef void (*fb_render_func_t)(struct bhyvegc *gc, void *arg); -typedef void (*kbd_event_func_t)(int down, uint32_t keysym, void *arg); +typedef void (*kbd_event_func_t)(int down, uint32_t keysym, uint32_t keycode, void *arg); typedef void (*ptr_event_func_t)(uint8_t mask, int x, int y, void *arg); void console_init(int w, int h, void *fbaddr); @@ -47,7 +47,7 @@ void console_fb_register(fb_render_func_t render_cb, void *arg); void console_refresh(void); void console_kbd_register(kbd_event_func_t event_cb, void *arg, int pri); -void console_key_event(int down, uint32_t keysym); +void console_key_event(int down, uint32_t keysym, uint32_t keycode); void console_ptr_register(ptr_event_func_t event_cb, void *arg, int pri); void console_ptr_event(uint8_t button, int x, int y); diff --git a/usr.sbin/bhyve/ps2kbd.c b/usr.sbin/bhyve/ps2kbd.c index ef20fa47e0a9..012c66160ebe 100644 --- a/usr.sbin/bhyve/ps2kbd.c +++ b/usr.sbin/bhyve/ps2kbd.c @@ -181,6 +181,26 @@ static const uint8_t ascii_translations[128] = { 0x22, 0x35, 0x1a, 0x54, 0x5d, 0x5b, 0x0e, 0x00, }; +/* ScanCode set1 to set2 lookup table */ +const uint8_t keyset1to2_translations[128] = { + 0, 0x76, 0x16, 0x1E, 0x26, 0x25, 0x2e, 0x36, + 0x3d, 0x3e, 0x46, 0x45, 0x4e, 0x55, 0x66, 0x0d, + 0x15, 0x1d, 0x24, 0x2d, 0x2c, 0x35, 0x3c, 0x43, + 0x44, 0x4d, 0x54, 0x5b, 0x5a, 0x14, 0x1c, 0x1b, + 0x23, 0x2b, 0x34, 0x33, 0x3b, 0x42, 0x4b, 0x4c, + 0x52, 0x0e, 0x12, 0x5d, 0x1a, 0x22, 0x21, 0x2a, + 0x32, 0x31, 0x3a, 0x41, 0x49, 0x4a, 0x59, 0x7c, + 0x11, 0x29, 0x58, 0x05, 0x06, 0x04, 0x0c, 0x03, + 0x0b, 0x83, 0x0a, 0x01, 0x09, 0x77, 0x7e, 0x6c, + 0x75, 0x7d, 0x7b, 0x6b, 0x73, 0x74, 0x79, 0x69, + 0x72, 0x7a, 0x70, 0x71, 0x84, 0x60, 0x61, 0x78, + 0x07, 0x0f, 0x17, 0x1f, 0x27, 0x2f, 0x37, 0x3f, + 0x47, 0x4f, 0x56, 0x5e, 0x08, 0x10, 0x18, 0x20, + 0x28, 0x30, 0x38, 0x40, 0x48, 0x50, 0x57, 0x6f, + 0x13, 0x19, 0x39, 0x51, 0x53, 0x5c, 0x5f, 0x62, + 0x63, 0x64, 0x65, 0x67, 0x68, 0x6a, 0x6d, 0x6e, +}; + static void fifo_init(struct ps2kbd_softc *sc) { @@ -315,26 +335,32 @@ ps2kbd_write(struct ps2kbd_softc *sc, uint8_t val) */ static void ps2kbd_keysym_queue(struct ps2kbd_softc *sc, - int down, uint32_t keysym) + int down, uint32_t keysym, uint32_t keycode) { assert(pthread_mutex_isowned_np(&sc->mtx)); int e0_prefix, found; uint8_t code; const struct extended_translation *trans; - found = 0; - if (keysym < 0x80) { - code = ascii_translations[keysym]; - e0_prefix = 0; + if (keycode) { + code = keyset1to2_translations[(uint8_t)(keycode & 0x7f)]; + e0_prefix = ((keycode & 0x80) ? SCANCODE_E0_PREFIX : 0); found = 1; } else { - for (trans = &(extended_translations[0]); trans->keysym != 0; - trans++) { - if (keysym == trans->keysym) { - code = trans->scancode; - e0_prefix = trans->flags & SCANCODE_E0_PREFIX; - found = 1; - break; + found = 0; + if (keysym < 0x80) { + code = ascii_translations[keysym]; + e0_prefix = 0; + found = 1; + } else { + for (trans = &(extended_translations[0]); trans->keysym != 0; + trans++) { + if (keysym == trans->keysym) { + code = trans->scancode; + e0_prefix = trans->flags & SCANCODE_E0_PREFIX; + found = 1; + break; + } } } } @@ -352,7 +378,7 @@ ps2kbd_keysym_queue(struct ps2kbd_softc *sc, } static void -ps2kbd_event(int down, uint32_t keysym, void *arg) +ps2kbd_event(int down, uint32_t keysym, uint32_t keycode, void *arg) { struct ps2kbd_softc *sc = arg; int fifo_full; @@ -363,7 +389,7 @@ ps2kbd_event(int down, uint32_t keysym, void *arg) return; } fifo_full = sc->fifo.num == PS2KBD_FIFOSZ; - ps2kbd_keysym_queue(sc, down, keysym); + ps2kbd_keysym_queue(sc, down, keysym, keycode); pthread_mutex_unlock(&sc->mtx); if (!fifo_full) diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c index 5230ae65cd57..b5556aad45a0 100644 --- a/usr.sbin/bhyve/rfb.c +++ b/usr.sbin/bhyve/rfb.c @@ -98,6 +98,7 @@ static int rfb_debug = 0; #define CS_KEY_EVENT 4 #define CS_POINTER_EVENT 5 #define CS_CUT_TEXT 6 +#define CS_MSG_CLIENT_QEMU 255 #define SECURITY_TYPE_NONE 1 #define SECURITY_TYPE_VNC_AUTH 2 @@ -118,6 +119,9 @@ struct rfb_softc { bool enc_raw_ok; bool enc_zlib_ok; bool enc_resize_ok; + bool enc_extkeyevent_ok; + + bool enc_extkeyevent_send; z_stream zstream; uint8_t *zbuf; @@ -170,6 +174,9 @@ struct rfb_pixfmt_msg { #define RFB_ENCODING_RAW 0 #define RFB_ENCODING_ZLIB 6 #define RFB_ENCODING_RESIZE -223 +#define RFB_ENCODING_EXT_KEYEVENT -258 + +#define RFB_CLIENTMSG_EXT_KEYEVENT 0 #define RFB_MAX_WIDTH 2000 #define RFB_MAX_HEIGHT 1200 @@ -197,6 +204,19 @@ struct rfb_key_msg { uint8_t type; uint8_t down; uint16_t pad; + uint32_t sym; +}; + +struct rfb_client_msg { + uint8_t type; + uint8_t subtype; +}; + +struct rfb_extended_key_msg { + uint8_t type; + uint8_t subtype; + uint16_t down; + uint32_t sym; uint32_t code; }; @@ -276,6 +296,27 @@ rfb_send_resize_update_msg(struct rfb_softc *rc, int cfd) stream_write(cfd, &srect_hdr, sizeof(struct rfb_srvr_rect_hdr)); } +static void +rfb_send_extended_keyevent_update_msg(struct rfb_softc *rc, int cfd) +{ + struct rfb_srvr_updt_msg supdt_msg; + struct rfb_srvr_rect_hdr srect_hdr; + + /* Number of rectangles: 1 */ + supdt_msg.type = 0; + supdt_msg.pad = 0; + supdt_msg.numrects = htons(1); + stream_write(cfd, &supdt_msg, sizeof(struct rfb_srvr_updt_msg)); + + /* Rectangle header */ + srect_hdr.x = htons(0); + srect_hdr.y = htons(0); + srect_hdr.width = htons(rc->width); + srect_hdr.height = htons(rc->height); + srect_hdr.encoding = htonl(RFB_ENCODING_EXT_KEYEVENT); + stream_write(cfd, &srect_hdr, sizeof(struct rfb_srvr_rect_hdr)); +} + static void rfb_recv_set_pixfmt_msg(struct rfb_softc *rc, int cfd) { @@ -309,6 +350,9 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int cfd) case RFB_ENCODING_RESIZE: rc->enc_resize_ok = true; break; + case RFB_ENCODING_EXT_KEYEVENT: + rc->enc_extkeyevent_ok = true; + break; } } } @@ -686,6 +730,11 @@ rfb_recv_update_msg(struct rfb_softc *rc, int cfd) (void)stream_read(cfd, ((void *)&updt_msg) + 1 , sizeof(updt_msg) - 1); + if (rc->enc_extkeyevent_ok && (!rc->enc_extkeyevent_send)) { + rfb_send_extended_keyevent_update_msg(rc, cfd); + rc->enc_extkeyevent_send = true; + } + rc->pending = true; if (!updt_msg.incremental) rc->update_all = true; @@ -698,10 +747,25 @@ rfb_recv_key_msg(struct rfb_softc *rc, int cfd) (void)stream_read(cfd, ((void *)&key_msg) + 1, sizeof(key_msg) - 1); - console_key_event(key_msg.down, htonl(key_msg.code)); + console_key_event(key_msg.down, htonl(key_msg.sym), htonl(0)); rc->input_detected = true; } +static void +rfb_recv_client_msg(struct rfb_softc *rc, int cfd) +{ + struct rfb_client_msg client_msg; + struct rfb_extended_key_msg extkey_msg; + + (void)stream_read(cfd, ((void *)&client_msg) + 1, sizeof(client_msg) - 1); + + if (client_msg.subtype == RFB_CLIENTMSG_EXT_KEYEVENT ) { + (void)stream_read(cfd, ((void *)&extkey_msg) + 2, sizeof(extkey_msg) - 2); + console_key_event((int)extkey_msg.down, htonl(extkey_msg.sym), htonl(extkey_msg.code)); + rc->input_detected = true; + } +} + static void rfb_recv_ptr_msg(struct rfb_softc *rc, int cfd) { @@ -997,6 +1061,9 @@ report_and_done: case CS_CUT_TEXT: rfb_recv_cuttext_msg(rc, cfd); break; + case CS_MSG_CLIENT_QEMU: + rfb_recv_client_msg(rc, cfd); + break; default: WPRINTF(("rfb unknown cli-code %d!", buf[0] & 0xff)); goto done; @@ -1031,6 +1098,9 @@ rfb_thr(void *arg) rc->enc_raw_ok = false; rc->enc_zlib_ok = false; rc->enc_resize_ok = false; + rc->enc_extkeyevent_ok = false; + + rc->enc_extkeyevent_send = false; cfd = accept(rc->sfd, NULL, NULL); if (rc->conn_wait) { From owner-dev-commits-src-all@freebsd.org Wed Apr 21 11:50:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55ABA5E2141; Wed, 21 Apr 2021 11:50: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 4FQJlc231yz3Fhp; Wed, 21 Apr 2021 11:50: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 3844F25B13; Wed, 21 Apr 2021 11:50: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 13LBoa5Q037183; Wed, 21 Apr 2021 11:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LBoaEi037182; Wed, 21 Apr 2021 11:50:36 GMT (envelope-from git) Date: Wed, 21 Apr 2021 11:50:36 GMT Message-Id: <202104211150.13LBoaEi037182@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: 4ba91fa0736b - main - loader: do not output empty menu title 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: 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 11:50:36 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=4ba91fa0736bb0672d475b6b56d9e7b06e78ff69 commit 4ba91fa0736bb0672d475b6b56d9e7b06e78ff69 Author: Toomas Soome AuthorDate: 2021-04-21 11:42:10 +0000 Commit: Toomas Soome CommitDate: 2021-04-21 11:50:23 +0000 loader: do not output empty menu title As we output spaces around the menu title, we should also check, if the title is actually empty string. PR: 255299 Submitted by: Jose Luis Duran Reported by: Jose Luis Duran MFC after: 1 week --- stand/forth/menu.4th | 6 +++++- stand/lua/drawer.lua | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/forth/menu.4th b/stand/forth/menu.4th index a336b9f9e7aa..75e75e3e3654 100644 --- a/stand/forth/menu.4th +++ b/stand/forth/menu.4th @@ -490,7 +490,11 @@ also menu-infrastructure definitions menuX @ 19 + over 2 / - menuY @ 1- then swap 1- swap - at-xy space type space + at-xy dup 0= if + 2drop ( empty loader_menu_title ) + else + space type space + then \ If $menu_init is set, evaluate it (allowing for whole menus to be \ constructed dynamically -- as this function could conceivably set diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index 523735a75d06..6324c2262c11 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -286,7 +286,10 @@ local function drawbox() menu_header_x = x + (w // 2) - (#menu_header // 2) end screen.setcursor(menu_header_x - 1, y) - printc(" " .. menu_header .. " ") + if menu_header ~= "" then + printc(" " .. menu_header .. " ") + end + end local function drawbrand() From owner-dev-commits-src-all@freebsd.org Wed Apr 21 11:58:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90DC85E2789; Wed, 21 Apr 2021 11:58: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 4FQJx93kcgz3G5k; Wed, 21 Apr 2021 11:58: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 736F325BBC; Wed, 21 Apr 2021 11:58: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 13LBwrGQ039562; Wed, 21 Apr 2021 11:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LBwrBB039561; Wed, 21 Apr 2021 11:58:53 GMT (envelope-from git) Date: Wed, 21 Apr 2021 11:58:53 GMT Message-Id: <202104211158.13LBwrBB039561@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: 45aec46246fe - main - rc: make the 'linux' script explicitly load filesystem modules 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: 45aec46246fe61a3f45cf7da1c80850dc226f609 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 11:58:53 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=45aec46246fe61a3f45cf7da1c80850dc226f609 commit 45aec46246fe61a3f45cf7da1c80850dc226f609 Author: Edward Tomasz Napierala AuthorDate: 2021-04-21 11:54:29 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-21 11:54:37 +0000 rc: make the 'linux' script explicitly load filesystem modules This removes a minor annoyance with Linux jails, where you often want linux_mounts_enable="NO", yet you want those filesystems available for mounting in jails; normally mount(8) would result in kernel automatically loading the KLD, but this doesn't work inside jails or chroots. PR: 242955 Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29725 --- libexec/rc/rc.d/linux | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index 882cf4012495..23cb5acc6f99 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -46,6 +46,12 @@ linux_start() # Linux uses the pre-pts(4) tty naming scheme. load_kld pty + # Explicitly load the filesystem modules; they are usually required, + # even with linux_mounts_enable="NO". + load_kld fdescfs + load_kld linprocfs + load_kld linsysfs + # Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX. if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then sysctl kern.elf64.fallback_brand=3 > /dev/null From owner-dev-commits-src-all@freebsd.org Wed Apr 21 13:51:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C48F45E5AF8; Wed, 21 Apr 2021 13:51:00 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FQMQX3BPXz3MZm; Wed, 21 Apr 2021 13:51:00 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 13LDotqJ075730; Wed, 21 Apr 2021 06:50:55 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 13LDotwF075729; Wed, 21 Apr 2021 06:50:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202104211350.13LDotwF075729@gndrsh.dnsmgr.net> Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files In-Reply-To: <1b95e1cc-0461-f7ef-9f29-e992c5d1e6d9@FreeBSD.org> To: Jung-uk Kim Date: Wed, 21 Apr 2021 06:50:55 -0700 (PDT) CC: rgrimes@FreeBSD.org, Warner Losh , src-committers , dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4FQMQX3BPXz3MZm 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 13:51:00 -0000 > On 21. 4. 20., Rodney W. Grimes wrote: > >> On Tue, Apr 20, 2021 at 10:24 AM Jung-uk Kim wrote: > >> > >>> On 21. 4. 20., Rodney W. Grimes wrote: > >>>>> On 21. 4. 20., Rodney W. Grimes wrote: > >>>>>>> The branch main has been updated by jkim: > >>>>>>> > >>>>>>> URL: > >>> https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > >>>>>>> > >>>>>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d > >>>>>>> Author: Jung-uk Kim > >>>>>>> AuthorDate: 2021-04-19 18:20:51 +0000 > >>>>>>> Commit: Jung-uk Kim > >>>>>>> CommitDate: 2021-04-19 18:20:51 +0000 > >>>>>>> > >>>>>>> flex: Regen bootstrap files > >>>>>>> > >>>>>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see > >>> any > >>>>>>> point of adding SPDX tag in generated file. > >>>>>> > >>>>>> The SPDX identifies the copyright that follows it, so please put this > >>> back. > >>>>> > >>>>> It is a generated file. If you really think it is necessary, you need > >>>>> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. > >>>> > >>>> Just because it is a generated file does not change the fact that > >>>> its contents are copyrighted. Leaving the copyright out at best > >>>> defaults to Bern convention, so the fact of the mater is the contents > >>>> is copyrighted, and it is best to explicitly state that it is. > >>> > >>> Of course, it is copyrighted. My point was parse.y should have been > >>> patched, not the generated file, if necessary. > >>> > >> > >> Yes. It was a mistake to put it into the generated file. > > > > He removed the SPDX from parse.y, now says that is the right place > > to put the SPDX. You agree. So can we have this undone? > > > >>>>> However, I don't see much sense in automatically adding BSD license in > >>>>> every generated file in the first place. In fact, I think it should not > >>>>> appear on generated file at all. It may say something along the line of > >>>>> "generated by flex" instead but IANAL. > >>>> > >>>> Well, someone before you did see since in it, and hence put that SPDX in > >>> it. > >>> > >>> Let me put it in another way. Do we really want to tag contrib code? > >>> > >> > >> I tend to agree. > >> > >> I tend to agree because the SPDX tags are generally only looked at in the > >> source tree by existing tools. The generated code won't be looked at > >> typically. > >> We should work to get this upstream, imho. > > > > Is parse.y not a source file? What am I missing? > > I guess you're confused somehow. > 686cf5468c4a85c2a6385cdbab2383900876a41d did not touch parse.y. > > https://cgit.freebsd.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d Hum, I guess I am very confused by this output in that commit message: @@ -19,8 +18,6 @@ #define YYPURE 0 #line 35 "parse.y" -/* SPDX-License-Identifier: BSD-2-Clause */ - /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */ Which actually appears to be a change to initparse.c, so never mind, the diff output along with your comment lead me astray. I would like to understand why this was being emmitted before, and is not being emmitted now though. That seems to conflict with what parse.y actually contains, did you somehow hand edit initparse.c to remove this? > > parse.y never had the tag from the day 1. Hummm... Then I am still further confused by the line 35 "parse.y" delta. > > https://cgit.freebsd.org/src/log/contrib/flex/src/parse.y > > Jung-uk Kim > > >> By itself, the SPDX tag is just information. There's no legal requirement in > >> copyright law to have it. Current project policy states they are just > >> informative, > >> though there's some desire to have a good framework to allow code with > >> just a copyright and a SDPX tag into the tree, so long as that framework > >> can be used to know what the license is for any file in a clear and > >> unambiguous > >> way. > >> > >> Warner > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:04:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4B305E634A; Wed, 21 Apr 2021 14:04:52 +0000 (UTC) (envelope-from jkim@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 4FQMkX4nL1z3N8K; Wed, 21 Apr 2021 14:04:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 8145F27D2A; Wed, 21 Apr 2021 14:04:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) To: rgrimes@FreeBSD.org Cc: Warner Losh , src-committers , dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104211350.13LDotwF075729@gndrsh.dnsmgr.net> From: Jung-uk Kim Organization: FreeBSD.org Subject: Re: git: 686cf5468c4a - main - flex: Regen bootstrap files Message-ID: Date: Wed, 21 Apr 2021 10:04:52 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <202104211350.13LDotwF075729@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:04:52 -0000 On 21. 4. 21., Rodney W. Grimes wrote: >> On 21. 4. 20., Rodney W. Grimes wrote: >>>> On Tue, Apr 20, 2021 at 10:24 AM Jung-uk Kim wrote: >>>> >>>>> On 21. 4. 20., Rodney W. Grimes wrote: >>>>>>> On 21. 4. 20., Rodney W. Grimes wrote: >>>>>>>>> The branch main has been updated by jkim: >>>>>>>>> >>>>>>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d >>>>>>>>> >>>>>>>>> commit 686cf5468c4a85c2a6385cdbab2383900876a41d >>>>>>>>> Author: Jung-uk Kim >>>>>>>>> AuthorDate: 2021-04-19 18:20:51 +0000 >>>>>>>>> Commit: Jung-uk Kim >>>>>>>>> CommitDate: 2021-04-19 18:20:51 +0000 >>>>>>>>> >>>>>>>>> flex: Regen bootstrap files >>>>>>>>> >>>>>>>>> This also partially reverts r326025 (8a16b7a18f5d). I do not see >>>>> any >>>>>>>>> point of adding SPDX tag in generated file. >>>>>>>> >>>>>>>> The SPDX identifies the copyright that follows it, so please put this >>>>> back. >>>>>>> >>>>>>> It is a generated file. If you really think it is necessary, you need >>>>>>> to patch its source, i.e., contrib/flex/src/parse.y, and regen the file. >>>>>> >>>>>> Just because it is a generated file does not change the fact that >>>>>> its contents are copyrighted. Leaving the copyright out at best >>>>>> defaults to Bern convention, so the fact of the mater is the contents >>>>>> is copyrighted, and it is best to explicitly state that it is. >>>>> >>>>> Of course, it is copyrighted. My point was parse.y should have been >>>>> patched, not the generated file, if necessary. >>>>> >>>> >>>> Yes. It was a mistake to put it into the generated file. >>> >>> He removed the SPDX from parse.y, now says that is the right place >>> to put the SPDX. You agree. So can we have this undone? >>> >>>>>>> However, I don't see much sense in automatically adding BSD license in >>>>>>> every generated file in the first place. In fact, I think it should not >>>>>>> appear on generated file at all. It may say something along the line of >>>>>>> "generated by flex" instead but IANAL. >>>>>> >>>>>> Well, someone before you did see since in it, and hence put that SPDX in >>>>> it. >>>>> >>>>> Let me put it in another way. Do we really want to tag contrib code? >>>>> >>>> >>>> I tend to agree. >>>> >>>> I tend to agree because the SPDX tags are generally only looked at in the >>>> source tree by existing tools. The generated code won't be looked at >>>> typically. >>>> We should work to get this upstream, imho. >>> >>> Is parse.y not a source file? What am I missing? >> >> I guess you're confused somehow. >> 686cf5468c4a85c2a6385cdbab2383900876a41d did not touch parse.y. >> >> https://cgit.freebsd.org/src/commit/?id=686cf5468c4a85c2a6385cdbab2383900876a41d > > Hum, I guess I am very confused by this output in that commit message: > @@ -19,8 +18,6 @@ > #define YYPURE 0 > > #line 35 "parse.y" > -/* SPDX-License-Identifier: BSD-2-Clause */ > - > /* Copyright (c) 1990 The Regents of the University of California. */ > /* All rights reserved. */ > > Which actually appears to be a change to initparse.c, so never mind, the > diff output along with your comment lead me astray. I would like to > understand why this was being emmitted before, and is not being emmitted > now though. That seems to conflict with what parse.y actually contains, > did you somehow hand edit initparse.c to remove this? It was manually added to initparse.c by the following commit: https://svnweb.freebsd.org/changeset/base/326025 https://svnweb.freebsd.org/base/head/usr.bin/lex/initparse.c?r1=326025&r2=326024&pathrev=326025&limit_changes=0&view=patch Jung-uk Kim >> parse.y never had the tag from the day 1. > > Hummm... Then I am still further confused by the line 35 "parse.y" delta. > >> >> https://cgit.freebsd.org/src/log/contrib/flex/src/parse.y >> >> Jung-uk Kim >> >>>> By itself, the SPDX tag is just information. There's no legal requirement in >>>> copyright law to have it. Current project policy states they are just >>>> informative, >>>> though there's some desire to have a good framework to allow code with >>>> just a copyright and a SDPX tag into the tree, so long as that framework >>>> can be used to know what the license is for any file in a clear and >>>> unambiguous >>>> way. >>>> >>>> Warner From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5DBD5E6DB5; Wed, 21 Apr 2021 14:31: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 4FQNJw64lvz3PQF; Wed, 21 Apr 2021 14:31: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 C385227C22; Wed, 21 Apr 2021 14:31: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 13LEVCvC047641; Wed, 21 Apr 2021 14:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVCsj047640; Wed, 21 Apr 2021 14:31:12 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:12 GMT Message-Id: <202104211431.13LEVCsj047640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 47301dfb9abd - stable/13 - x86: consolidate hw watchpoint logic into new file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47301dfb9abd30278eebd36d4f283e6bb256fffe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:13 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=47301dfb9abd30278eebd36d4f283e6bb256fffe commit 47301dfb9abd30278eebd36d4f283e6bb256fffe Author: Mitchell Horne AuthorDate: 2021-03-19 19:39:12 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:32 +0000 x86: consolidate hw watchpoint logic into new file This is a prerequisite to using these functions outside of ddb, but also provides some cleanup and minor refactoring. This code is almost entirely duplicated between the two implementations, the only significant difference being the lack of dbreg synchronization on i386. Cleanups are: - demote some internal functions to static - use the constant NDBREGS instead of a '4' literal - remove K&R definitions - some added comments Reviewed by: kib, jhb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit c02c04f113fe65001bc21363ae3ad08cf6c763eb) --- sys/amd64/amd64/db_trace.c | 216 +----------------------------------- sys/conf/files.x86 | 1 + sys/i386/i386/db_trace.c | 173 +---------------------------- sys/x86/include/x86_var.h | 3 + sys/x86/x86/dbreg.c | 267 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 281 insertions(+), 379 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 7d1544a5d0bc..5c1cd41cda15 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -128,11 +128,6 @@ static void db_nextframe(struct amd64_frame **, db_addr_t *, struct thread *); static void db_print_stack_entry(const char *, db_addr_t, void *); static void decode_syscall(int, struct thread *); -static const char * watchtype_str(int type); -int amd64_set_watch(int watchnum, unsigned long watchaddr, int size, - int access, struct dbreg *d); -int amd64_clr_watch(int watchnum, struct dbreg *d); - static void db_print_stack_entry(const char *name, db_addr_t callpc, void *frame) { @@ -391,223 +386,22 @@ db_trace_thread(struct thread *thr, int count) } int -amd64_set_watch(watchnum, watchaddr, size, access, d) - int watchnum; - unsigned long watchaddr; - int size; - int access; - struct dbreg *d; -{ - int i, len; - - if (watchnum == -1) { - for (i = 0; i < 4; i++) - if (!DBREG_DR7_ENABLED(d->dr[7], i)) - break; - if (i < 4) - watchnum = i; - else - return (-1); - } - - switch (access) { - case DBREG_DR7_EXEC: - size = 1; /* size must be 1 for an execution breakpoint */ - /* fall through */ - case DBREG_DR7_WRONLY: - case DBREG_DR7_RDWR: - break; - default: - return (-1); - } - - /* - * we can watch a 1, 2, 4, or 8 byte sized location - */ - switch (size) { - case 1: - len = DBREG_DR7_LEN_1; - break; - case 2: - len = DBREG_DR7_LEN_2; - break; - case 4: - len = DBREG_DR7_LEN_4; - break; - case 8: - len = DBREG_DR7_LEN_8; - break; - default: - return (-1); - } - - /* clear the bits we are about to affect */ - d->dr[7] &= ~DBREG_DR7_MASK(watchnum); - - /* set drN register to the address, N=watchnum */ - DBREG_DRX(d, watchnum) = watchaddr; - - /* enable the watchpoint */ - d->dr[7] |= DBREG_DR7_SET(watchnum, len, access, - DBREG_DR7_GLOBAL_ENABLE); - - return (watchnum); -} - -int -amd64_clr_watch(watchnum, d) - int watchnum; - struct dbreg *d; -{ - - if (watchnum < 0 || watchnum >= 4) - return (-1); - - d->dr[7] &= ~DBREG_DR7_MASK(watchnum); - DBREG_DRX(d, watchnum) = 0; - - return (0); -} - -int -db_md_set_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; +db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - struct dbreg *d; - struct pcpu *pc; - int avail, c, cpu, i, wsize; - - d = (struct dbreg *)PCPU_PTR(dbreg); - cpu = PCPU_GET(cpuid); - fill_dbregs(NULL, d); - - avail = 0; - for (i = 0; i < 4; i++) { - if (!DBREG_DR7_ENABLED(d->dr[7], i)) - avail++; - } - - if (avail * 8 < size) - return (-1); - - for (i = 0; i < 4 && size > 0; i++) { - if (!DBREG_DR7_ENABLED(d->dr[7], i)) { - if (size >= 8 || (avail == 1 && size > 4)) - wsize = 8; - else if (size > 2) - wsize = 4; - else - wsize = size; - amd64_set_watch(i, addr, wsize, DBREG_DR7_WRONLY, d); - addr += wsize; - size -= wsize; - avail--; - } - } - - set_dbregs(NULL, d); - CPU_FOREACH(c) { - if (c == cpu) - continue; - pc = pcpu_find(c); - memcpy(pc->pc_dbreg, d, sizeof(*d)); - pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; - } - return (0); + return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size)); } int -db_md_clr_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; +db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) { - struct dbreg *d; - struct pcpu *pc; - int i, c, cpu; - - d = (struct dbreg *)PCPU_PTR(dbreg); - cpu = PCPU_GET(cpuid); - fill_dbregs(NULL, d); - - for (i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d->dr[7], i)) { - if (DBREG_DRX((d), i) >= addr && - DBREG_DRX((d), i) < addr + size) - amd64_clr_watch(i, d); - } - } - - set_dbregs(NULL, d); - CPU_FOREACH(c) { - if (c == cpu) - continue; - pc = pcpu_find(c); - memcpy(pc->pc_dbreg, d, sizeof(*d)); - pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; - } - return (0); -} - -static const char * -watchtype_str(type) - int type; -{ - switch (type) { - case DBREG_DR7_EXEC : return "execute"; break; - case DBREG_DR7_RDWR : return "read/write"; break; - case DBREG_DR7_WRONLY : return "write"; break; - default : return "invalid"; break; - } + return (dbreg_clr_watchpoint((vm_offset_t)addr, (vm_size_t)size)); } void db_md_list_watchpoints(void) { - struct dbreg d; - int i, len, type; - - fill_dbregs(NULL, &d); - - db_printf("\nhardware watchpoints:\n"); - db_printf(" watch status type len address\n"); - db_printf(" ----- -------- ---------- --- ------------------\n"); - for (i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - type = DBREG_DR7_ACCESS(d.dr[7], i); - len = DBREG_DR7_LEN(d.dr[7], i); - if (len == DBREG_DR7_LEN_8) - len = 8; - else - len++; - db_printf(" %-5d %-8s %10s %3d ", - i, "enabled", watchtype_str(type), len); - db_printsym((db_addr_t)DBREG_DRX(&d, i), DB_STGY_ANY); - db_printf("\n"); - } else { - db_printf(" %-5d disabled\n", i); - } - } - db_printf("\ndebug register values:\n"); - for (i = 0; i < 8; i++) - if (i != 4 && i != 5) - db_printf(" dr%d 0x%016lx\n", i, DBREG_DRX(&d, i)); - db_printf("\n"); -} - -void -amd64_db_resume_dbreg(void) -{ - struct dbreg *d; - - switch (PCPU_GET(dbreg_cmd)) { - case PC_DBREG_CMD_LOAD: - d = (struct dbreg *)PCPU_PTR(dbreg); - set_dbregs(NULL, d); - PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); - break; - } + dbreg_list_watchpoints(); } diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index f51392d0614c..292389ac312f 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -331,6 +331,7 @@ x86/x86/bus_machdep.c standard x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/cpu_machdep.c standard +x86/x86/dbreg.c optional ddb x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt x86/x86/identcpu.c standard diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index 87229e74e70b..50fb1fa6355d 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -198,11 +198,6 @@ static void db_print_stack_entry(const char *, int, char **, int *, db_addr_t, void *); static void decode_syscall(int, struct thread *); -static const char * watchtype_str(int type); -int i386_set_watch(int watchnum, unsigned int watchaddr, int size, int access, - struct dbreg *d); -int i386_clr_watch(int watchnum, struct dbreg *d); - /* * Figure out how many arguments were passed into the frame at "fp". */ @@ -618,180 +613,22 @@ db_trace_thread(struct thread *thr, int count) } int -i386_set_watch(watchnum, watchaddr, size, access, d) - int watchnum; - unsigned int watchaddr; - int size; - int access; - struct dbreg *d; +db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - int i, len; - - if (watchnum == -1) { - for (i = 0; i < 4; i++) - if (!DBREG_DR7_ENABLED(d->dr[7], i)) - break; - if (i < 4) - watchnum = i; - else - return (-1); - } - - switch (access) { - case DBREG_DR7_EXEC: - size = 1; /* size must be 1 for an execution breakpoint */ - /* fall through */ - case DBREG_DR7_WRONLY: - case DBREG_DR7_RDWR: - break; - default: - return (-1); - } - /* - * we can watch a 1, 2, or 4 byte sized location - */ - switch (size) { - case 1: - len = DBREG_DR7_LEN_1; - break; - case 2: - len = DBREG_DR7_LEN_2; - break; - case 4: - len = DBREG_DR7_LEN_4; - break; - default: - return (-1); - } - - /* clear the bits we are about to affect */ - d->dr[7] &= ~DBREG_DR7_MASK(watchnum); - - /* set drN register to the address, N=watchnum */ - DBREG_DRX(d, watchnum) = watchaddr; - - /* enable the watchpoint */ - d->dr[7] |= DBREG_DR7_SET(watchnum, len, access, - DBREG_DR7_GLOBAL_ENABLE); - - return (watchnum); + return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size)); } int -i386_clr_watch(watchnum, d) - int watchnum; - struct dbreg *d; +db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) { - if (watchnum < 0 || watchnum >= 4) - return (-1); - - d->dr[7] &= ~DBREG_DR7_MASK(watchnum); - DBREG_DRX(d, watchnum) = 0; - - return (0); -} - -int -db_md_set_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; -{ - struct dbreg d; - int avail, i, wsize; - - fill_dbregs(NULL, &d); - - avail = 0; - for(i = 0; i < 4; i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) - avail++; - } - - if (avail * 4 < size) - return (-1); - - for (i = 0; i < 4 && (size > 0); i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) { - if (size > 2) - wsize = 4; - else - wsize = size; - i386_set_watch(i, addr, wsize, - DBREG_DR7_WRONLY, &d); - addr += wsize; - size -= wsize; - } - } - - set_dbregs(NULL, &d); - - return(0); -} - -int -db_md_clr_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; -{ - struct dbreg d; - int i; - - fill_dbregs(NULL, &d); - - for(i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - if ((DBREG_DRX((&d), i) >= addr) && - (DBREG_DRX((&d), i) < addr+size)) - i386_clr_watch(i, &d); - } - } - - set_dbregs(NULL, &d); - - return(0); -} - -static const char * -watchtype_str(type) - int type; -{ - switch (type) { - case DBREG_DR7_EXEC : return "execute"; break; - case DBREG_DR7_RDWR : return "read/write"; break; - case DBREG_DR7_WRONLY : return "write"; break; - default : return "invalid"; break; - } + return (dbreg_clr_watchpoint((vm_offset_t)addr, (vm_size_t)size)); } void db_md_list_watchpoints(void) { - struct dbreg d; - int i, len, type; - - fill_dbregs(NULL, &d); - - db_printf("\nhardware watchpoints:\n"); - db_printf(" watch status type len address\n"); - db_printf(" ----- -------- ---------- --- ----------\n"); - for (i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - type = DBREG_DR7_ACCESS(d.dr[7], i); - len = DBREG_DR7_LEN(d.dr[7], i); - db_printf(" %-5d %-8s %10s %3d ", - i, "enabled", watchtype_str(type), len + 1); - db_printsym((db_addr_t)DBREG_DRX(&d, i), DB_STGY_ANY); - db_printf("\n"); - } else { - db_printf(" %-5d disabled\n", i); - } - } - db_printf("\ndebug register values:\n"); - for (i = 0; i < 8; i++) - if (i != 4 && i != 5) - db_printf(" dr%d 0x%08x\n", i, DBREG_DRX(&d, i)); - db_printf("\n"); + dbreg_list_watchpoints(); } diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index c1425755b5d1..642f18964a3d 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -119,6 +119,9 @@ vm_paddr_t cpu_getmaxphyaddr(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); +int dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size); +int dbreg_clr_watchpoint(vm_offset_t addr, vm_size_t size); +void dbreg_list_watchpoints(void); bool disable_wp(void); void restore_wp(bool old_wp); void finishidentcpu(void); diff --git a/sys/x86/x86/dbreg.c b/sys/x86/x86/dbreg.c new file mode 100644 index 000000000000..0d28ef8dba38 --- /dev/null +++ b/sys/x86/x86/dbreg.c @@ -0,0 +1,267 @@ +/*- + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#include "opt_ddb.h" + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define NDBREGS 4 +#ifdef __amd64__ +#define MAXWATCHSIZE 8 +#else +#define MAXWATCHSIZE 4 +#endif + +/* + * Set a watchpoint in the debug register denoted by 'watchnum'. + */ +static void +dbreg_set_watchreg(int watchnum, vm_offset_t watchaddr, vm_size_t size, + int access, struct dbreg *d) +{ + int len; + + MPASS(watchnum >= 0 && watchnum < NDBREGS); + + /* size must be 1 for an execution breakpoint */ + if (access == DBREG_DR7_EXEC) + size = 1; + + /* + * we can watch a 1, 2, or 4 byte sized location + */ + switch (size) { + case 1: + len = DBREG_DR7_LEN_1; + break; + case 2: + len = DBREG_DR7_LEN_2; + break; + case 4: + len = DBREG_DR7_LEN_4; + break; +#if MAXWATCHSIZE >= 8 + case 8: + len = DBREG_DR7_LEN_8; + break; +#endif + default: + return; + } + + /* clear the bits we are about to affect */ + d->dr[7] &= ~DBREG_DR7_MASK(watchnum); + + /* set drN register to the address, N=watchnum */ + DBREG_DRX(d, watchnum) = watchaddr; + + /* enable the watchpoint */ + d->dr[7] |= DBREG_DR7_SET(watchnum, len, access, + DBREG_DR7_GLOBAL_ENABLE); +} + +/* + * Remove a watchpoint from the debug register denoted by 'watchnum'. + */ +static void +dbreg_clr_watchreg(int watchnum, struct dbreg *d) +{ + MPASS(watchnum >= 0 && watchnum < NDBREGS); + + d->dr[7] &= ~DBREG_DR7_MASK(watchnum); + DBREG_DRX(d, watchnum) = 0; +} + +/* + * Sync the debug registers. Other cores will read these values from the PCPU + * area when they resume. See amd64_db_resume_dbreg() below. + */ +static void +dbreg_sync(struct dbreg *dp) +{ +#ifdef __amd64__ + struct pcpu *pc; + int cpu, c; + + cpu = PCPU_GET(cpuid); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, dp, sizeof(*dp)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } +#endif +} + +int +dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size) +{ + struct dbreg *d; + int avail, i, wsize; + +#ifdef __amd64__ + d = (struct dbreg *)PCPU_PTR(dbreg); +#else + /* debug registers aren't stored in PCPU on i386. */ + struct dbreg d_temp; + d = &d_temp; +#endif + + fill_dbregs(NULL, d); + + /* + * Check if there are enough available registers to cover the desired + * area. + */ + avail = 0; + for (i = 0; i < NDBREGS; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) + avail++; + } + + if (avail * MAXWATCHSIZE < size) + return (-1); + + for (i = 0; i < NDBREGS && size > 0; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) { + if ((size >= 8 || (avail == 1 && size > 4)) && + MAXWATCHSIZE == 8) + wsize = 8; + else if (size > 2) + wsize = 4; + else + wsize = size; + dbreg_set_watchreg(i, addr, wsize, DBREG_DR7_WRONLY, d); + addr += wsize; + size -= wsize; + avail--; + } + } + + set_dbregs(NULL, d); + dbreg_sync(d); + + return (0); +} + +int +dbreg_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + struct dbreg *d; + int i; + +#ifdef __amd64__ + d = (struct dbreg *)PCPU_PTR(dbreg); +#else + /* debug registers aren't stored in PCPU on i386. */ + struct dbreg d_temp; + d = &d_temp; +#endif + fill_dbregs(NULL, d); + + for (i = 0; i < NDBREGS; i++) { + if (DBREG_DR7_ENABLED(d->dr[7], i)) { + if (DBREG_DRX((d), i) >= addr && + DBREG_DRX((d), i) < addr + size) + dbreg_clr_watchreg(i, d); + } + } + + set_dbregs(NULL, d); + dbreg_sync(d); + + return (0); +} + +#ifdef DDB +static const char * +watchtype_str(int type) +{ + + switch (type) { + case DBREG_DR7_EXEC: + return ("execute"); + case DBREG_DR7_RDWR: + return ("read/write"); + case DBREG_DR7_WRONLY: + return ("write"); + default: + return ("invalid"); + } +} + +void +dbreg_list_watchpoints(void) +{ + struct dbreg d; + int i, len, type; + + fill_dbregs(NULL, &d); + + db_printf("\nhardware watchpoints:\n"); + db_printf(" watch status type len address\n"); + db_printf(" ----- -------- ---------- --- ----------\n"); + for (i = 0; i < NDBREGS; i++) { + if (DBREG_DR7_ENABLED(d.dr[7], i)) { + type = DBREG_DR7_ACCESS(d.dr[7], i); + len = DBREG_DR7_LEN(d.dr[7], i); + db_printf(" %-5d %-8s %10s %3d ", + i, "enabled", watchtype_str(type), len + 1); + db_printsym((db_addr_t)DBREG_DRX(&d, i), DB_STGY_ANY); + db_printf("\n"); + } else { + db_printf(" %-5d disabled\n", i); + } + } +} +#endif + +#ifdef __amd64__ +/* Sync debug registers when resuming from debugger. */ +void +amd64_db_resume_dbreg(void) +{ + struct dbreg *d; + + switch (PCPU_GET(dbreg_cmd)) { + case PC_DBREG_CMD_LOAD: + d = (struct dbreg *)PCPU_PTR(dbreg); + set_dbregs(NULL, d); + PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); + break; + } +} +#endif From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 314485E7230; Wed, 21 Apr 2021 14:31: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 4FQNJy0BGNz3PSV; Wed, 21 Apr 2021 14:31: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 E805B274EF; Wed, 21 Apr 2021 14:31: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 13LEVDg6047664; Wed, 21 Apr 2021 14:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVDAx047663; Wed, 21 Apr 2021 14:31:13 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:13 GMT Message-Id: <202104211431.13LEVDAx047663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 45af63e5f893 - stable/13 - Introduce kdb-level watchpoint functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 45af63e5f89394219d56cc10e739be635fc6b116 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:14 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=45af63e5f89394219d56cc10e739be635fc6b116 commit 45af63e5f89394219d56cc10e739be635fc6b116 Author: Mitchell Horne AuthorDate: 2021-03-08 15:23:40 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 Introduce kdb-level watchpoint functions This basically mirrors what already exists in ddb, but provides a slightly improved interface. It allows the caller to specify the watchpoint access type, and returns more specific error codes to differentiate failure cases. This will be used to support hardware watchpoints in gdb(4). Stubs are provided for architectures lacking hardware watchpoint logic (mips, powerpc, riscv), while other architectures are added individually in follow-up commits. Reviewed by: jhb, kib, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 763107f26c3c3f4c8bb314a7cabc0a5548abff03) --- sys/mips/include/kdb.h | 15 +++++++++++++++ sys/powerpc/include/kdb.h | 14 ++++++++++++++ sys/riscv/include/kdb.h | 14 ++++++++++++++ sys/sys/kdb.h | 6 ++++++ 4 files changed, 49 insertions(+) diff --git a/sys/mips/include/kdb.h b/sys/mips/include/kdb.h index 33e54bc5fc05..64e39e154f21 100644 --- a/sys/mips/include/kdb.h +++ b/sys/mips/include/kdb.h @@ -55,4 +55,19 @@ static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) { } + +static __inline int +kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) +{ + + return (ENXIO); +} + +static __inline int +kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + + return (0); +} + #endif /* _MACHINE_KDB_H_ */ diff --git a/sys/powerpc/include/kdb.h b/sys/powerpc/include/kdb.h index 74f3e390b423..78e4966eaaf0 100644 --- a/sys/powerpc/include/kdb.h +++ b/sys/powerpc/include/kdb.h @@ -54,4 +54,18 @@ kdb_cpu_trap(int vector, int _) { } +static __inline int +kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) +{ + + return (ENXIO); +} + +static __inline int +kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + + return (0); +} + #endif /* _MACHINE_KDB_H_ */ diff --git a/sys/riscv/include/kdb.h b/sys/riscv/include/kdb.h index 312cac502824..0fdff26bb432 100644 --- a/sys/riscv/include/kdb.h +++ b/sys/riscv/include/kdb.h @@ -59,4 +59,18 @@ kdb_cpu_trap(int type, int code) { } +static __inline int +kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) +{ + + return (ENXIO); +} + +static __inline int +kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + + return (0); +} + #endif /* _MACHINE_KDB_H_ */ diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h index 5ace60740bb6..5833ebf8285f 100644 --- a/sys/sys/kdb.h +++ b/sys/sys/kdb.h @@ -128,4 +128,10 @@ extern const char * volatile kdb_why; #define KDB_REQ_PANIC 2 /* User requested a panic */ #define KDB_REQ_REBOOT 3 /* User requested a clean reboot */ +/* Debug breakpoint/watchpoint access types */ +#define KDB_DBG_ACCESS_EXEC 0 +#define KDB_DBG_ACCESS_R 1 +#define KDB_DBG_ACCESS_W 2 +#define KDB_DBG_ACCESS_RW 3 + #endif /* !_SYS_KDB_H_ */ From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B67785E7235; Wed, 21 Apr 2021 14:31: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 4FQNJz39m9z3PW4; Wed, 21 Apr 2021 14:31:15 +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 16ACC27C23; Wed, 21 Apr 2021 14:31: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 13LEVEKh047692; Wed, 21 Apr 2021 14:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVEZI047690; Wed, 21 Apr 2021 14:31:14 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:14 GMT Message-Id: <202104211431.13LEVEZI047690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 20e6d79f433b - stable/13 - x86: implement kdb watchpoint functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 20e6d79f433bd6607f7abb4ef67e016b8abee12c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:15 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=20e6d79f433bd6607f7abb4ef67e016b8abee12c commit 20e6d79f433bd6607f7abb4ef67e016b8abee12c Author: Mitchell Horne AuthorDate: 2021-02-19 22:36:08 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 x86: implement kdb watchpoint functions Add wrappers around the dbreg interface that can be consumed by MI kernel debugger code. The dbreg functions themselves are updated to return error codes, not just -1. dbreg_set_watchpoint() is extended to accept access bits as an argument. Reviewed by: jhb, kib, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 15dc1d44528a1e2693df41d5452d6ebb42ecafeb) --- sys/amd64/amd64/db_trace.c | 3 ++- sys/amd64/include/kdb.h | 3 +++ sys/i386/include/kdb.h | 3 +++ sys/x86/include/x86_var.h | 2 +- sys/x86/x86/dbreg.c | 41 ++++++++++++++++++++++++++++++++++++++--- 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index 5c1cd41cda15..beeb5cd6e9f3 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -389,7 +389,8 @@ int db_md_set_watchpoint(db_expr_t addr, db_expr_t size) { - return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size)); + return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size, + DBREG_DR7_WRONLY)); } int diff --git a/sys/amd64/include/kdb.h b/sys/amd64/include/kdb.h index 2fb158622eb4..03cb2205066f 100644 --- a/sys/amd64/include/kdb.h +++ b/sys/amd64/include/kdb.h @@ -36,6 +36,9 @@ #define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] +int kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); +int kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size); + static __inline void kdb_cpu_clear_singlestep(void) { diff --git a/sys/i386/include/kdb.h b/sys/i386/include/kdb.h index beb2bd0e4132..29a23fde0aad 100644 --- a/sys/i386/include/kdb.h +++ b/sys/i386/include/kdb.h @@ -36,6 +36,9 @@ #define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] +int kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); +int kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size); + static __inline void kdb_cpu_clear_singlestep(void) { diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 642f18964a3d..a802068d6fb4 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -119,7 +119,7 @@ vm_paddr_t cpu_getmaxphyaddr(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); -int dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size); +int dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); int dbreg_clr_watchpoint(vm_offset_t addr, vm_size_t size); void dbreg_list_watchpoints(void); bool disable_wp(void); diff --git a/sys/x86/x86/dbreg.c b/sys/x86/x86/dbreg.c index 0d28ef8dba38..ef30cc2d614e 100644 --- a/sys/x86/x86/dbreg.c +++ b/sys/x86/x86/dbreg.c @@ -27,11 +27,13 @@ #include "opt_ddb.h" #include +#include #include #include #include #include +#include #include #include @@ -127,7 +129,7 @@ dbreg_sync(struct dbreg *dp) } int -dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size) +dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) { struct dbreg *d; int avail, i, wsize; @@ -140,6 +142,11 @@ dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size) d = &d_temp; #endif + /* Validate the access type */ + if (access != DBREG_DR7_EXEC && access != DBREG_DR7_WRONLY && + access != DBREG_DR7_RDWR) + return (EINVAL); + fill_dbregs(NULL, d); /* @@ -153,7 +160,7 @@ dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size) } if (avail * MAXWATCHSIZE < size) - return (-1); + return (EBUSY); for (i = 0; i < NDBREGS && size > 0; i++) { if (!DBREG_DR7_ENABLED(d->dr[7], i)) { @@ -164,7 +171,7 @@ dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size) wsize = 4; else wsize = size; - dbreg_set_watchreg(i, addr, wsize, DBREG_DR7_WRONLY, d); + dbreg_set_watchreg(i, addr, wsize, access, d); addr += wsize; size -= wsize; avail--; @@ -265,3 +272,31 @@ amd64_db_resume_dbreg(void) } } #endif + +int +kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) +{ + + /* Convert the KDB access type */ + switch (access) { + case KDB_DBG_ACCESS_W: + access = DBREG_DR7_WRONLY; + break; + case KDB_DBG_ACCESS_RW: + access = DBREG_DR7_RDWR; + break; + case KDB_DBG_ACCESS_R: + /* FALLTHROUGH: read-only not supported */ + default: + return (EINVAL); + } + + return (dbreg_set_watchpoint(addr, size, access)); +} + +int +kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + + return (dbreg_clr_watchpoint(addr, size)); +} From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4A975E729A; Wed, 21 Apr 2021 14:31: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 4FQNK13GmQz3PhC; Wed, 21 Apr 2021 14:31: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 5DF3627C9F; Wed, 21 Apr 2021 14:31: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 13LEVHwX047734; Wed, 21 Apr 2021 14:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVHKB047733; Wed, 21 Apr 2021 14:31:17 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:17 GMT Message-Id: <202104211431.13LEVHKB047733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 2d0ad402a075 - stable/13 - arm: implement kdb watchpoint functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d0ad402a075d2c4ef8e47f11c1b3776f7eca666 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:17 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2d0ad402a075d2c4ef8e47f11c1b3776f7eca666 commit 2d0ad402a075d2c4ef8e47f11c1b3776f7eca666 Author: Mitchell Horne AuthorDate: 2021-03-04 00:14:42 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 arm: implement kdb watchpoint functions Implement wrappers around the existing debug_monitor interface, to be consumed by MI kernel debugger code. For now, the various db_printf() calls in this code remain. In the future, they could be converted to printf() or removed altogether, to properly decouple the DDB and GDB options. Reviewed by: jhb, kib, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 5a2933d0bf9fb0018349b67a39fa85cbb3740779) --- sys/arm/arm/debug_monitor.c | 37 ++++++++++++++++++++++++++++++++++--- sys/arm/include/kdb.h | 2 ++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/sys/arm/arm/debug_monitor.c b/sys/arm/arm/debug_monitor.c index ddf3e8e67b25..55b5f70b2397 100644 --- a/sys/arm/arm/debug_monitor.c +++ b/sys/arm/arm/debug_monitor.c @@ -326,6 +326,35 @@ kdb_cpu_clear_singlestep(void) } } +int +kdb_cpu_set_watchpoint(vm_offset_t addr, size_t size, int access) +{ + enum dbg_access_t dbg_access; + + switch (access) { + case KDB_DBG_ACCESS_R: + dbg_access = HW_WATCHPOINT_R; + break; + case KDB_DBG_ACCESS_W: + dbg_access = HW_WATCHPOINT_W; + break; + case KDB_DBG_ACCESS_RW: + dbg_access = HW_WATCHPOINT_RW; + break; + default: + return (EINVAL); + } + + return (dbg_setup_watchpoint(addr, size, (enum dbg_access_t)access)); +} + +int +kdb_cpu_clr_watchpoint(vm_offset_t addr, size_t size) +{ + + return (dbg_remove_watchpoint(addr, size)); +} + int dbg_setup_watchpoint(db_expr_t addr, db_expr_t size, enum dbg_access_t access) { @@ -624,7 +653,7 @@ dbg_setup_xpoint(struct dbg_wb_conf *conf) if (i == ~0U) { db_printf("Can not find slot for %s, max %d slots supported\n", typestr, dbg_watchpoint_num); - return (ENXIO); + return (EBUSY); } } @@ -645,7 +674,8 @@ dbg_setup_xpoint(struct dbg_wb_conf *conf) cr_size = DBG_WB_CTRL_LEN_8; break; default: - db_printf("Unsupported address size for %s\n", typestr); + db_printf("Unsupported address size for %s: %zu\n", typestr, + conf->size); return (EINVAL); } @@ -667,7 +697,8 @@ dbg_setup_xpoint(struct dbg_wb_conf *conf) cr_access = DBG_WB_CTRL_LOAD | DBG_WB_CTRL_STORE; break; default: - db_printf("Unsupported exception level for %s\n", typestr); + db_printf("Unsupported access type for %s: %d\n", + typestr, conf->access); return (EINVAL); } diff --git a/sys/arm/include/kdb.h b/sys/arm/include/kdb.h index 42677499ed78..728bf211dc62 100644 --- a/sys/arm/include/kdb.h +++ b/sys/arm/include/kdb.h @@ -41,6 +41,8 @@ extern void kdb_cpu_clear_singlestep(void); extern void kdb_cpu_set_singlestep(void); boolean_t kdb_cpu_pc_is_singlestep(db_addr_t); +int kdb_cpu_set_watchpoint(vm_offset_t addr, size_t size, int access); +int kdb_cpu_clr_watchpoint(vm_offset_t addr, size_t size); static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76BC55E6EDD; Wed, 21 Apr 2021 14:31: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 4FQNK02dX5z3Pdm; Wed, 21 Apr 2021 14:31: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 3C17327C9E; Wed, 21 Apr 2021 14:31: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 13LEVGpI047713; Wed, 21 Apr 2021 14:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVGwn047712; Wed, 21 Apr 2021 14:31:16 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:16 GMT Message-Id: <202104211431.13LEVGwn047712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 08ce99c3f1b8 - stable/13 - arm64: implement kdb watchpoint functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08ce99c3f1b88d38a15b1f30a8b0934a582e119a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:16 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=08ce99c3f1b88d38a15b1f30a8b0934a582e119a commit 08ce99c3f1b88d38a15b1f30a8b0934a582e119a Author: Mitchell Horne AuthorDate: 2021-03-04 21:53:21 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 arm64: implement kdb watchpoint functions Add wrappers around the debug_monitor interface, to be consumed by MI kernel debugger code. Update dbg_setup_watchpoint() and dbg_remove_watchpoint() to return specific error codes, not just -1. Reviewed by: jhb, kib, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 3ef68bc62c1e3ca9c452177f5cb9fd4de0df590d) --- sys/arm64/arm64/debug_monitor.c | 41 +++++++++++++++++++++++++++++++++++------ sys/arm64/include/kdb.h | 2 ++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c index a2b4b7e8b40b..3a5a40925c92 100644 --- a/sys/arm64/arm64/debug_monitor.c +++ b/sys/arm64/arm64/debug_monitor.c @@ -226,6 +226,35 @@ kdb_cpu_clear_singlestep(void) } } +int +kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access) +{ + enum dbg_access_t dbg_access; + + switch (access) { + case KDB_DBG_ACCESS_R: + dbg_access = HW_BREAKPOINT_R; + break; + case KDB_DBG_ACCESS_W: + dbg_access = HW_BREAKPOINT_W; + break; + case KDB_DBG_ACCESS_RW: + dbg_access = HW_BREAKPOINT_RW; + break; + default: + return (EINVAL); + } + + return (dbg_setup_watchpoint(NULL, addr, size, dbg_access)); +} + +int +kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) +{ + + return (dbg_remove_watchpoint(NULL, addr, size)); +} + static const char * dbg_watchtype_str(uint32_t type) { @@ -362,7 +391,7 @@ dbg_setup_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, if (i == -1) { printf("Can not find slot for watchpoint, max %d" " watchpoints supported\n", dbg_watchpoint_num); - return (i); + return (EBUSY); } switch(size) { @@ -379,8 +408,8 @@ dbg_setup_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, wcr_size = DBG_WATCH_CTRL_LEN_8; break; default: - printf("Unsupported address size for watchpoint\n"); - return (-1); + printf("Unsupported address size for watchpoint: %zu\n", size); + return (EINVAL); } if ((monitor->dbg_flags & DBGMON_KERNEL) == 0) @@ -402,8 +431,8 @@ dbg_setup_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, wcr_access = DBG_WATCH_CTRL_LOAD | DBG_WATCH_CTRL_STORE; break; default: - printf("Unsupported exception level for watchpoint\n"); - return (-1); + printf("Unsupported access type for watchpoint: %d\n", access); + return (EINVAL); } monitor->dbg_wvr[i] = addr; @@ -427,7 +456,7 @@ dbg_remove_watchpoint(struct debug_monitor_state *monitor, vm_offset_t addr, i = dbg_find_slot(monitor, DBG_TYPE_WATCHPOINT, addr); if (i == -1) { printf("Can not find watchpoint for address 0%lx\n", addr); - return (i); + return (EINVAL); } monitor->dbg_wvr[i] = 0; diff --git a/sys/arm64/include/kdb.h b/sys/arm64/include/kdb.h index 2f7306ef669b..d5450dd2d67a 100644 --- a/sys/arm64/include/kdb.h +++ b/sys/arm64/include/kdb.h @@ -39,6 +39,8 @@ void kdb_cpu_clear_singlestep(void); void kdb_cpu_set_singlestep(void); +int kdb_cpu_set_watchpoint(vm_offset_t addr, size_t size, int access); +int kdb_cpu_clr_watchpoint(vm_offset_t addr, size_t size); static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 534B25E7384; Wed, 21 Apr 2021 14:31: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 4FQNK24l7Dz3Pbn; Wed, 21 Apr 2021 14:31: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 7BF6927CA0; Wed, 21 Apr 2021 14:31: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 13LEVIVF047755; Wed, 21 Apr 2021 14:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVIrC047754; Wed, 21 Apr 2021 14:31:18 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:18 GMT Message-Id: <202104211431.13LEVIrC047754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ea2f252e9768 - stable/13 - ddb: replace watchpoint set/clear functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea2f252e97684e8edaf17ff9985f8522810ce19b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:19 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ea2f252e97684e8edaf17ff9985f8522810ce19b commit ea2f252e97684e8edaf17ff9985f8522810ce19b Author: Mitchell Horne AuthorDate: 2021-03-08 15:27:19 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 ddb: replace watchpoint set/clear functions Use the new kdb variants. Print more specific error messages. Reviewed by: jhb, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 9d81dd5404b3ad7108059d7065814d56a722a96c) --- sys/amd64/amd64/db_trace.c | 15 ---------- sys/arm/arm/db_trace.c | 14 ---------- sys/arm64/arm64/db_trace.c | 14 ---------- sys/ddb/db_watch.c | 59 +++++++++++++++++++++++++++++----------- sys/ddb/ddb.h | 2 -- sys/i386/i386/db_trace.c | 14 ---------- sys/mips/mips/db_trace.c | 14 ---------- sys/powerpc/powerpc/db_hwwatch.c | 14 ---------- sys/riscv/riscv/db_trace.c | 14 ---------- 9 files changed, 43 insertions(+), 117 deletions(-) diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c index beeb5cd6e9f3..4c569c456e92 100644 --- a/sys/amd64/amd64/db_trace.c +++ b/sys/amd64/amd64/db_trace.c @@ -385,21 +385,6 @@ db_trace_thread(struct thread *thr, int count) ctx->pcb_rip, ctx->pcb_rsp, count)); } -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size, - DBREG_DR7_WRONLY)); -} - -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbreg_clr_watchpoint((vm_offset_t)addr, (vm_size_t)size)); -} - void db_md_list_watchpoints(void) { diff --git a/sys/arm/arm/db_trace.c b/sys/arm/arm/db_trace.c index 195ed0f4e3d9..3f308c9f546c 100644 --- a/sys/arm/arm/db_trace.c +++ b/sys/arm/arm/db_trace.c @@ -134,20 +134,6 @@ db_md_list_watchpoints(void) dbg_show_watchpoint(); } -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbg_remove_watchpoint(addr, size)); -} - -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbg_setup_watchpoint(addr, size, HW_WATCHPOINT_RW)); -} - int db_trace_thread(struct thread *thr, int count) { diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c index 1743d7765861..9f9d00620652 100644 --- a/sys/arm64/arm64/db_trace.c +++ b/sys/arm64/arm64/db_trace.c @@ -50,20 +50,6 @@ db_md_list_watchpoints() dbg_show_watchpoint(); } -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbg_remove_watchpoint(NULL, addr, size)); -} - -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbg_setup_watchpoint(NULL, addr, size, HW_BREAKPOINT_RW)); -} - static void db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) { diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index f0fbb6768c12..3226b050a4c3 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -42,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -278,33 +281,57 @@ db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs) #endif /* Delete hardware watchpoint */ -/*ARGSUSED*/ void -db_deletehwatch_cmd(db_expr_t addr, bool have_addr, db_expr_t count, +db_deletehwatch_cmd(db_expr_t addr, bool have_addr, db_expr_t size, char *modif) { int rc; - if (count < 0) - count = 4; - - rc = db_md_clr_watchpoint(addr, count); - if (rc < 0) - db_printf("hardware watchpoint could not be deleted\n"); + if (size < 0) + size = 4; + + rc = kdb_cpu_clr_watchpoint((vm_offset_t)addr, (vm_size_t)size); + switch (rc) { + case ENXIO: + /* Not supported, ignored. */ + break; + case EINVAL: + db_printf("Invalid watchpoint address or size.\n"); + break; + default: + if (rc != 0) + db_printf("Hardware watchpoint could not be deleted, " + "status=%d\n", rc); + break; + } } /* Set hardware watchpoint */ -/*ARGSUSED*/ void -db_hwatchpoint_cmd(db_expr_t addr, bool have_addr, db_expr_t count, +db_hwatchpoint_cmd(db_expr_t addr, bool have_addr, db_expr_t size, char *modif) { int rc; - if (count < 0) - count = 4; - - rc = db_md_set_watchpoint(addr, count); - if (rc < 0) - db_printf("hardware watchpoint could not be set\n"); + if (size < 0) + size = 4; + + rc = kdb_cpu_set_watchpoint((vm_offset_t)addr, (vm_size_t)size, + KDB_DBG_ACCESS_W); + + switch (rc) { + case EINVAL: + db_printf("Invalid watchpoint size or address.\n"); + break; + case EBUSY: + db_printf("No hardware watchpoints available.\n"); + break; + case ENXIO: + db_printf("Hardware watchpoints are not supported on this platform.\n"); + break; + default: + if (rc != 0) + db_printf("Could not set hardware watchpoint, " + "status=%d\n", rc); + } } diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 81448474c514..21bc0712117f 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -204,8 +204,6 @@ struct thread *db_lookup_thread(db_expr_t addr, bool check_pid); struct vm_map *db_map_addr(vm_offset_t); bool db_map_current(struct vm_map *); bool db_map_equal(struct vm_map *, struct vm_map *); -int db_md_set_watchpoint(db_expr_t addr, db_expr_t size); -int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size); void db_md_list_watchpoints(void); void db_print_loc_and_inst(db_addr_t loc); void db_print_thread(void); diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c index 50fb1fa6355d..80ef0fe715d8 100644 --- a/sys/i386/i386/db_trace.c +++ b/sys/i386/i386/db_trace.c @@ -612,20 +612,6 @@ db_trace_thread(struct thread *thr, int count) ctx->pcb_eip, ctx->pcb_esp, count)); } -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbreg_set_watchpoint((vm_offset_t)addr, (vm_size_t)size)); -} - -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (dbreg_clr_watchpoint((vm_offset_t)addr, (vm_size_t)size)); -} - void db_md_list_watchpoints(void) { diff --git a/sys/mips/mips/db_trace.c b/sys/mips/mips/db_trace.c index 0762fdb8a1da..4903b6d3d432 100644 --- a/sys/mips/mips/db_trace.c +++ b/sys/mips/mips/db_trace.c @@ -395,20 +395,6 @@ done: } } -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return(0); -} - -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return(0); -} - void db_md_list_watchpoints() { diff --git a/sys/powerpc/powerpc/db_hwwatch.c b/sys/powerpc/powerpc/db_hwwatch.c index 37b4a9148495..aa9018a58417 100644 --- a/sys/powerpc/powerpc/db_hwwatch.c +++ b/sys/powerpc/powerpc/db_hwwatch.c @@ -36,20 +36,6 @@ #include #include -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (0); -} - -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (0); -} - void db_md_list_watchpoints(void) { diff --git a/sys/riscv/riscv/db_trace.c b/sys/riscv/riscv/db_trace.c index b8421fa3aa7a..dbc2ba92bce3 100644 --- a/sys/riscv/riscv/db_trace.c +++ b/sys/riscv/riscv/db_trace.c @@ -58,20 +58,6 @@ db_md_list_watchpoints() } -int -db_md_clr_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (0); -} - -int -db_md_set_watchpoint(db_expr_t addr, db_expr_t size) -{ - - return (0); -} - static void db_stack_trace_cmd(struct thread *td, struct unwind_state *frame) { From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5EE5E7241; Wed, 21 Apr 2021 14:31: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 4FQNK45v7lz3P0b; Wed, 21 Apr 2021 14:31: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 A5B8927CA2; Wed, 21 Apr 2021 14:31: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 13LEVKJa047803; Wed, 21 Apr 2021 14:31:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVKXZ047802; Wed, 21 Apr 2021 14:31:20 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:20 GMT Message-Id: <202104211431.13LEVKXZ047802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e21ed730a558 - stable/13 - gdb: report specific stop reason for watchpoints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e21ed730a558c63594877facbd4321cdb4fd729c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:21 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e21ed730a558c63594877facbd4321cdb4fd729c commit e21ed730a558c63594877facbd4321cdb4fd729c Author: Mitchell Horne AuthorDate: 2021-03-08 19:04:51 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 gdb: report specific stop reason for watchpoints The remote protocol allows for implementations to report more specific reasons for the break in execution back to the client [1]. This is entirely optional, so it is only implemented for amd64, arm64, and i386 at the moment. [1] https://sourceware.org/gdb/current/onlinedocs/gdb/Stop-Reply-Packets.html Reviewed by: jhb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. NetApp PR: 51 (cherry picked from commit 7446b0888d920124516284eaa32714d63353e2c9) --- sys/amd64/amd64/gdb_machdep.c | 35 ++++++++++++++++++++++++++++++++++ sys/amd64/include/gdb_machdep.h | 1 + sys/arm/include/gdb_machdep.h | 6 ++++++ sys/arm64/arm64/gdb_machdep.c | 12 ++++++++++++ sys/arm64/include/gdb_machdep.h | 1 + sys/gdb/gdb_main.c | 3 ++- sys/i386/i386/gdb_machdep.c | 40 +++++++++++++++++++++++++++++++++++++-- sys/i386/include/gdb_machdep.h | 1 + sys/mips/include/gdb_machdep.h | 6 ++++++ sys/powerpc/include/gdb_machdep.h | 6 ++++++ 10 files changed, 108 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/gdb_machdep.c b/sys/amd64/amd64/gdb_machdep.c index 610096e1355d..176c770a3731 100644 --- a/sys/amd64/amd64/gdb_machdep.c +++ b/sys/amd64/amd64/gdb_machdep.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include void * gdb_cpu_getreg(int regnum, size_t *regsz) @@ -152,6 +153,40 @@ gdb_cpu_signal(int type, int code) return (SIGEMT); } +void +gdb_cpu_stop_reason(int type, int code) +{ + uintmax_t val; + + val = 0; + if (type == T_TRCTRAP) { + /* NB: 'code' contains the value of dr6 at the trap. */ + if ((code & DBREG_DR6_B(0)) != 0) { + val = rdr0(); + } + if ((code & DBREG_DR6_B(1)) != 0) { + val = rdr1(); + } + if ((code & DBREG_DR6_B(2)) != 0) { + val = rdr2(); + } + if ((code & DBREG_DR6_B(3)) != 0) { + val = rdr3(); + } + + /* + * TODO: validate the bits in DR7 to differentiate between a + * watchpoint trap and a hardware breakpoint trap (currently + * unsupported). + */ + if (val != 0) { + gdb_tx_str("watch:"); + gdb_tx_varhex(val); + gdb_tx_char(';'); + } + } +} + void * gdb_begin_write(void) { diff --git a/sys/amd64/include/gdb_machdep.h b/sys/amd64/include/gdb_machdep.h index 459d4f17e9d1..4379b8a74709 100644 --- a/sys/amd64/include/gdb_machdep.h +++ b/sys/amd64/include/gdb_machdep.h @@ -72,5 +72,6 @@ void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); void gdb_end_write(void *); +void gdb_cpu_stop_reason(int, int); #endif /* !_MACHINE_GDB_MACHDEP_H_ */ diff --git a/sys/arm/include/gdb_machdep.h b/sys/arm/include/gdb_machdep.h index 017025253bd5..5190c2a4097e 100644 --- a/sys/arm/include/gdb_machdep.h +++ b/sys/arm/include/gdb_machdep.h @@ -66,6 +66,12 @@ gdb_end_write(void *arg __unused) } +static __inline void +gdb_cpu_stop_reason(int type __unused, int code __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); diff --git a/sys/arm64/arm64/gdb_machdep.c b/sys/arm64/arm64/gdb_machdep.c index dc0a7eeba692..b27e1edb3d7f 100644 --- a/sys/arm64/arm64/gdb_machdep.c +++ b/sys/arm64/arm64/gdb_machdep.c @@ -41,6 +41,7 @@ #include #include +#include void * gdb_cpu_getreg(int regnum, size_t *regsz) @@ -110,3 +111,14 @@ gdb_cpu_signal(int type, int code __unused) } return (SIGEMT); } + +void +gdb_cpu_stop_reason(int type, int code __unused) +{ + + if (type == EXCP_WATCHPT_EL1) { + gdb_tx_str("watch:"); + gdb_tx_varhex((uintmax_t)READ_SPECIALREG(far_el1)); + gdb_tx_char(';'); + } +} diff --git a/sys/arm64/include/gdb_machdep.h b/sys/arm64/include/gdb_machdep.h index 755c5d1657c0..17b46edd1a27 100644 --- a/sys/arm64/include/gdb_machdep.h +++ b/sys/arm64/include/gdb_machdep.h @@ -77,5 +77,6 @@ gdb_end_write(void *arg __unused) void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); +void gdb_cpu_stop_reason(int, int); #endif /* !_MACHINE_GDB_MACHDEP_H_ */ diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index d0dbdfa63cb7..de68e8c476b1 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -741,8 +741,9 @@ gdb_trap(int type, int code) gdb_tx_char(':'); gdb_tx_reg(GDB_REG_PC); gdb_tx_char(';'); + gdb_cpu_stop_reason(type, code); gdb_tx_str("thread:"); - gdb_tx_varhex((long)kdb_thread->td_tid); + gdb_tx_varhex((uintmax_t)kdb_thread->td_tid); gdb_tx_char(';'); gdb_tx_end(); /* XXX check error condition. */ diff --git a/sys/i386/i386/gdb_machdep.c b/sys/i386/i386/gdb_machdep.c index fd522309dbb2..549c6de7ba1b 100644 --- a/sys/i386/i386/gdb_machdep.c +++ b/sys/i386/i386/gdb_machdep.c @@ -36,13 +36,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include +#include #include -#include -#include #include +#include void * gdb_cpu_getreg(int regnum, size_t *regsz) @@ -114,3 +116,37 @@ gdb_cpu_signal(int type, int code) } return (SIGEMT); } + +void +gdb_cpu_stop_reason(int type, int code) +{ + uintmax_t val; + + val = 0; + if (type == T_TRCTRAP) { + /* NB: 'code' contains the value of dr6 at the trap. */ + if ((code & DBREG_DR6_B(0)) != 0) { + val = rdr0(); + } + if ((code & DBREG_DR6_B(1)) != 0) { + val = rdr1(); + } + if ((code & DBREG_DR6_B(2)) != 0) { + val = rdr2(); + } + if ((code & DBREG_DR6_B(3)) != 0) { + val = rdr3(); + } + + /* + * TODO: validate the bits in DR7 to differentiate between a + * watchpoint trap and a hardware breakpoint trap (currently + * unsupported). + */ + if (val != 0) { + gdb_tx_str("watch:"); + gdb_tx_varhex(val); + gdb_tx_char(';'); + } + } +} diff --git a/sys/i386/include/gdb_machdep.h b/sys/i386/include/gdb_machdep.h index ef9500160be1..77eb70e2fb28 100644 --- a/sys/i386/include/gdb_machdep.h +++ b/sys/i386/include/gdb_machdep.h @@ -63,5 +63,6 @@ gdb_end_write(void *arg __unused) void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); +void gdb_cpu_stop_reason(int, int); #endif /* !_MACHINE_GDB_MACHDEP_H_ */ diff --git a/sys/mips/include/gdb_machdep.h b/sys/mips/include/gdb_machdep.h index 03378b760024..e8ff620edc88 100644 --- a/sys/mips/include/gdb_machdep.h +++ b/sys/mips/include/gdb_machdep.h @@ -64,6 +64,12 @@ gdb_end_write(void *arg __unused) } +static __inline void +gdb_cpu_stop_reason(int type __unused, int code __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); diff --git a/sys/powerpc/include/gdb_machdep.h b/sys/powerpc/include/gdb_machdep.h index 41a9ab1f4fa7..5edf4d96cb7c 100644 --- a/sys/powerpc/include/gdb_machdep.h +++ b/sys/powerpc/include/gdb_machdep.h @@ -128,6 +128,12 @@ gdb_end_write(void *arg __unused) } +static __inline void +gdb_cpu_stop_reason(int type __unused, int code __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); From owner-dev-commits-src-all@freebsd.org Wed Apr 21 14:31:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FFBC5E6DD9; Wed, 21 Apr 2021 14:31: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 4FQNK40HlVz3PWQ; Wed, 21 Apr 2021 14:31: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 8F37627C25; Wed, 21 Apr 2021 14:31: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 13LEVJRr047776; Wed, 21 Apr 2021 14:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LEVJQ5047775; Wed, 21 Apr 2021 14:31:19 GMT (envelope-from git) Date: Wed, 21 Apr 2021 14:31:19 GMT Message-Id: <202104211431.13LEVJQ5047775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 123578f890ee - stable/13 - gdb: allow setting/removing hardware watchpoints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 123578f890ee067662670832099fc9616ae3c1fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 14:31:20 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=123578f890ee067662670832099fc9616ae3c1fc commit 123578f890ee067662670832099fc9616ae3c1fc Author: Mitchell Horne AuthorDate: 2021-03-08 19:03:45 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 13:20:33 +0000 gdb: allow setting/removing hardware watchpoints Handle the 'z' and 'Z' remote packets for manipulating hardware watchpoints. This could be expanded quite easily to support hardware or software breakpoints as well. https://sourceware.org/gdb/onlinedocs/gdb/Packets.html Reviewed by: cem, markj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. NetApp PR: 51 (cherry picked from commit 4beb385813c8b1014f8250a31b07fdc09a059713) --- sys/arm64/arm64/debug_monitor.c | 5 +- sys/conf/files.arm | 3 +- sys/conf/files.x86 | 2 +- sys/gdb/gdb_main.c | 102 ++++++++++++++++++++++++++++++++++++++++ sys/x86/x86/mp_x86.c | 3 +- 5 files changed, 110 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c index 3a5a40925c92..91594d5c3a78 100644 --- a/sys/arm64/arm64/debug_monitor.c +++ b/sys/arm64/arm64/debug_monitor.c @@ -28,6 +28,7 @@ */ #include "opt_ddb.h" +#include "opt_gdb.h" #include __FBSDID("$FreeBSD$"); @@ -181,7 +182,7 @@ dbg_wb_write_reg(int reg, int n, uint64_t val) isb(); } -#ifdef DDB +#if defined(DDB) || defined(GDB) void kdb_cpu_set_singlestep(void) { @@ -254,7 +255,9 @@ kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size) return (dbg_remove_watchpoint(NULL, addr, size)); } +#endif /* DDB || GDB */ +#ifdef DDB static const char * dbg_watchtype_str(uint32_t type) { diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 69986585bdf6..a3b0d166f020 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -19,8 +19,7 @@ arm/arm/cpu_asm-v6.S standard arm/arm/db_disasm.c optional ddb arm/arm/db_interface.c optional ddb arm/arm/db_trace.c optional ddb -arm/arm/debug_monitor.c optional ddb armv6 -arm/arm/debug_monitor.c optional ddb armv7 +arm/arm/debug_monitor.c optional ddb | gdb arm/arm/disassem.c optional ddb arm/arm/dump_machdep.c standard arm/arm/elf_machdep.c standard diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index 292389ac312f..7df289375cd3 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -331,7 +331,7 @@ x86/x86/bus_machdep.c standard x86/x86/busdma_bounce.c standard x86/x86/busdma_machdep.c standard x86/x86/cpu_machdep.c standard -x86/x86/dbreg.c optional ddb +x86/x86/dbreg.c optional ddb | gdb x86/x86/dump_machdep.c standard x86/x86/fdt_machdep.c optional fdt x86/x86/identcpu.c standard diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 6e0c9f21f947..d0dbdfa63cb7 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -618,6 +618,100 @@ gdb_handle_detach(void) #endif } +/* + * Handle a 'Z' packet: set a breakpoint or watchpoint. + * + * Currently, only watchpoints are supported. + */ +static void +gdb_z_insert(void) +{ + intmax_t addr, length; + char ztype; + int error; + + ztype = gdb_rx_char(); + if (gdb_rx_char() != ',' || gdb_rx_varhex(&addr) || + gdb_rx_char() != ',' || gdb_rx_varhex(&length)) { + error = EINVAL; + goto fail; + } + + switch (ztype) { + case '2': /* write watchpoint */ + error = kdb_cpu_set_watchpoint((vm_offset_t)addr, + (vm_size_t)length, KDB_DBG_ACCESS_W); + break; + case '3': /* read watchpoint */ + error = kdb_cpu_set_watchpoint((vm_offset_t)addr, + (vm_size_t)length, KDB_DBG_ACCESS_R); + break; + case '4': /* access (RW) watchpoint */ + error = kdb_cpu_set_watchpoint((vm_offset_t)addr, + (vm_size_t)length, KDB_DBG_ACCESS_RW); + break; + case '1': /* hardware breakpoint */ + case '0': /* software breakpoint */ + /* Not implemented. */ + gdb_tx_empty(); + return; + default: + error = EINVAL; + break; + } + if (error != 0) + goto fail; + gdb_tx_ok(); + return; +fail: + gdb_tx_err(error); + return; +} + +/* + * Handle a 'z' packet; clear a breakpoint or watchpoint. + * + * Currently, only watchpoints are supported. + */ +static void +gdb_z_remove(void) +{ + intmax_t addr, length; + char ztype; + int error; + + ztype = gdb_rx_char(); + if (gdb_rx_char() != ',' || gdb_rx_varhex(&addr) || + gdb_rx_char() != ',' || gdb_rx_varhex(&length)) { + error = EINVAL; + goto fail; + } + + switch (ztype) { + case '2': /* write watchpoint */ + case '3': /* read watchpoint */ + case '4': /* access (RW) watchpoint */ + error = kdb_cpu_clr_watchpoint((vm_offset_t)addr, + (vm_size_t)length); + break; + case '1': /* hardware breakpoint */ + case '0': /* software breakpoint */ + /* Not implemented. */ + gdb_tx_empty(); + return; + default: + error = EINVAL; + break; + } + if (error != 0) + goto fail; + gdb_tx_ok(); + return; +fail: + gdb_tx_err(error); + return; +} + static int gdb_trap(int type, int code) { @@ -868,6 +962,14 @@ gdb_trap(int type, int code) gdb_tx_err(ENOENT); break; } + case 'z': { /* Remove watchpoint. */ + gdb_z_remove(); + break; + } + case 'Z': { /* Set watchpoint. */ + gdb_z_insert(); + break; + } case EOF: /* Empty command. Treat as unknown command. */ /* FALLTHROUGH */ diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 0f528f6567ee..2dcdf923c467 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #endif #include "opt_cpu.h" #include "opt_ddb.h" +#include "opt_gdb.h" #include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_sched.h" @@ -1520,7 +1521,7 @@ cpustop_handler_post(u_int cpu) */ invltlb_glob(); -#if defined(__amd64__) && defined(DDB) +#if defined(__amd64__) && (defined(DDB) || defined(GDB)) amd64_db_resume_dbreg(); #endif From owner-dev-commits-src-all@freebsd.org Wed Apr 21 15:07:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B8B95E8A3E; Wed, 21 Apr 2021 15:07:40 +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 4FQP700lF4z3hHW; Wed, 21 Apr 2021 15:07:40 +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 0B609325; Wed, 21 Apr 2021 15:07:40 +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 13LF7dKB092373; Wed, 21 Apr 2021 15:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LF7dPt092372; Wed, 21 Apr 2021 15:07:39 GMT (envelope-from git) Date: Wed, 21 Apr 2021 15:07:39 GMT Message-Id: <202104211507.13LF7dPt092372@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: 54f98c4dbf9b - main - vn_open_vnode(): handle error when fp == NULL 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: 54f98c4dbf9b1203a4e3e1b13fd0738441226991 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 15:07:40 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=54f98c4dbf9b1203a4e3e1b13fd0738441226991 commit 54f98c4dbf9b1203a4e3e1b13fd0738441226991 Author: Konstantin Belousov AuthorDate: 2021-04-19 10:25:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-21 15:06:51 +0000 vn_open_vnode(): handle error when fp == NULL If VOP_ADD_WRITECOUNT() or adv locking failed, so VOP_CLOSE() needs to be called, we cannot use fp fo_close() when there is no fp. This occurs when e.g. kernel code directly calls vn_open() instead of the open(2) syscall. In this case, VOP_CLOSE() can be called directly, after possible lock upgrade. Reported by: nvass@gmx.com PR: 255119 Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29830 --- sys/kern/vfs_vnops.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9da35721def4..f715c9828d04 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -451,16 +451,34 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, /* * Error from advlock or VOP_ADD_WRITECOUNT() still requires * calling VOP_CLOSE() to pair with earlier VOP_OPEN(). - * Arrange for that by having fdrop() to use vn_closefile(). */ if (error != 0) { - fp->f_flag |= FOPENFAILED; - fp->f_vnode = vp; - if (fp->f_ops == &badfileops) { - fp->f_type = DTYPE_VNODE; - fp->f_ops = &vnops; + if (fp != NULL) { + /* + * Arrange the call by having fdrop() to use + * vn_closefile(). This is to satisfy + * filesystems like devfs or tmpfs, which + * override fo_close(). + */ + fp->f_flag |= FOPENFAILED; + fp->f_vnode = vp; + if (fp->f_ops == &badfileops) { + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + } + vref(vp); + } else { + /* + * If there is no fp, due to kernel-mode open, + * we can call VOP_CLOSE() now. + */ + if (vp->v_type != VFIFO && (fmode & FWRITE) != 0 && + !MNT_EXTENDED_SHARED(vp->v_mount) && + VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + vn_lock(vp, LK_UPGRADE | LK_RETRY); + (void)VOP_CLOSE(vp, fmode & (FREAD | FWRITE | FEXEC), + cred, td); } - vref(vp); } ASSERT_VOP_LOCKED(vp, "vn_open_vnode"); From owner-dev-commits-src-all@freebsd.org Wed Apr 21 15:26:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A87D25E9064; Wed, 21 Apr 2021 15:26: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 4FQPXS4RY7z3jGR; Wed, 21 Apr 2021 15:26: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 8B54B7A1; Wed, 21 Apr 2021 15:26: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 13LFQG5T018777; Wed, 21 Apr 2021 15:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LFQGh8018776; Wed, 21 Apr 2021 15:26:16 GMT (envelope-from git) Date: Wed, 21 Apr 2021 15:26:16 GMT Message-Id: <202104211526.13LFQGh8018776@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: 9c651561a2a3 - main - zfs: damage control racing .. lookups in face of mkdir/rmdir 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: 9c651561a2a31fcb08390d37947afc27ec03d87b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 15:26:16 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=9c651561a2a31fcb08390d37947afc27ec03d87b commit 9c651561a2a31fcb08390d37947afc27ec03d87b Author: Mateusz Guzik AuthorDate: 2021-04-15 07:54:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-04-21 15:25:32 +0000 zfs: damage control racing .. lookups in face of mkdir/rmdir Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29769 --- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 8172916c4329..a1e9c359b893 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -781,6 +781,7 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, znode_t *zdp = VTOZ(dvp); znode_t *zp; zfsvfs_t *zfsvfs = zdp->z_zfsvfs; + seqc_t dvp_seqc; int error = 0; /* @@ -806,6 +807,8 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zdp); + dvp_seqc = vn_seqc_read_any(dvp); + *vpp = NULL; if (flags & LOOKUP_XATTR) { @@ -975,6 +978,24 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, } } + if ((cnp->cn_flags & ISDOTDOT) != 0) { + /* + * FIXME: zfs_lookup_lock relocks vnodes and does nothing to + * handle races. In particular different callers may end up + * with different vnodes and will try to add conflicting + * entries to the namecache. + * + * While finding different result may be acceptable in face + * of concurrent modification, adding conflicting entries + * trips over an assert in the namecache. + * + * Ultimately let an entry through once everything settles. + */ + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + cnp->cn_flags &= ~MAKEENTRY; + } + } + /* Insert name into cache (as non-existent) if appropriate. */ if (zfsvfs->z_use_namecache && !zfsvfs->z_replay && error == ENOENT && (cnp->cn_flags & MAKEENTRY) != 0) From owner-dev-commits-src-all@freebsd.org Wed Apr 21 17:09:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EB635EBD2A; Wed, 21 Apr 2021 17:09:24 +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 4FQRqS0TlJz3njb; Wed, 21 Apr 2021 17:09:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (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 7D20728AFD; Wed, 21 Apr 2021 17:09:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 83223eb58bf7 - main - Fixup ObsoleteFiles after 76681661be28. To: Dmitry Chagin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104202110.13KLAQBd067241@gitrepo.freebsd.org> From: John Baldwin Message-ID: <2b5938be-17cd-ee04-e8f6-3689413429c3@FreeBSD.org> Date: Wed, 21 Apr 2021 10:09:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <202104202110.13KLAQBd067241@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 17:09:24 -0000 On 4/20/21 2:10 PM, Dmitry Chagin wrote: > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=83223eb58bf79270a84b34254679ff2c2adc304e > > commit 83223eb58bf79270a84b34254679ff2c2adc304e > Author: Dmitry Chagin > AuthorDate: 2021-04-20 21:06:16 +0000 > Commit: Dmitry Chagin > CommitDate: 2021-04-20 21:06:16 +0000 > > Fixup ObsoleteFiles after 76681661be28. My bad, thanks for fixing! -- John Baldwin From owner-dev-commits-src-all@freebsd.org Wed Apr 21 18:20:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7ED915EDD71; Wed, 21 Apr 2021 18:20: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 4FQTP33D9Cz3rwX; Wed, 21 Apr 2021 18:20: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 5D9B32A7E; Wed, 21 Apr 2021 18:20: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 13LIK7J3046434; Wed, 21 Apr 2021 18:20:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LIK7Wi046431; Wed, 21 Apr 2021 18:20:07 GMT (envelope-from git) Date: Wed, 21 Apr 2021 18:20:07 GMT Message-Id: <202104211820.13LIK7Wi046431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Reifenberger Subject: git: dcc2fb370791 - main - systat: Avoid incorrect reallocation in pigs.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcc2fb3707919c5184480d8cbde98d16f24a3945 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 18:20:07 -0000 The branch main has been updated by mr: URL: https://cgit.FreeBSD.org/src/commit/?id=dcc2fb3707919c5184480d8cbde98d16f24a3945 commit dcc2fb3707919c5184480d8cbde98d16f24a3945 Author: Michael Reifenberger AuthorDate: 2021-04-21 18:09:21 +0000 Commit: Michael Reifenberger CommitDate: 2021-04-21 18:09:21 +0000 systat: Avoid incorrect reallocation in pigs.c Stop free() even if kvm_getprocs as we can come back but set nprocs = 0. Check nprocs in showpigs() to ensure not try displaying with kvm_getprocs failed. Current code can have pt with non-null after kvm_getprocs() failure. Replace to realloc for simpler operations. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Reviewed by: mckusick@ Differential Revision: https://reviews.freebsd.org/D29303 --- usr.bin/systat/pigs.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index d9f3f8d4ad14..0bec6aceaaa1 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -62,7 +62,7 @@ static int nproc; static struct p_times { float pt_pctcpu; struct kinfo_proc *pt_kp; -} *pt; +} *pt = NULL; static int fscale; static double lccpu; @@ -90,7 +90,7 @@ showpigs(void) const char *uname, *pname; char pidname[30]; - if (pt == NULL) + if (nproc == 0) return; qsort(pt, nproc, sizeof (struct p_times), compar); @@ -146,23 +146,20 @@ fetchpigs(void) float ftime; float *pctp; struct kinfo_proc *kpp; - static int lastnproc = 0; + static int maxnproc = 0; if ((kpp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc)) == NULL) { error("%s", kvm_geterr(kd)); - if (pt) - free(pt); + nproc = 0; return; } - if (nproc > lastnproc) { - free(pt); - if ((pt = - malloc(nproc * sizeof(struct p_times))) == NULL) { + if (nproc > maxnproc) { + if ((pt = realloc(pt, nproc * sizeof(*pt))) == NULL) { error("Out of memory"); die(0); } + maxnproc = nproc; } - lastnproc = nproc; /* * calculate %cpu for each proc */ From owner-dev-commits-src-all@freebsd.org Wed Apr 21 18:34:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 465D55EE9C1; Wed, 21 Apr 2021 18:34: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 4FQTjv1WwKz3tFK; Wed, 21 Apr 2021 18:34: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 2309A319C; Wed, 21 Apr 2021 18:34: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 13LIYhIg069669; Wed, 21 Apr 2021 18:34:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LIYh0d069668; Wed, 21 Apr 2021 18:34:43 GMT (envelope-from git) Date: Wed, 21 Apr 2021 18:34:43 GMT Message-Id: <202104211834.13LIYh0d069668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Reifenberger Subject: git: 66483838039b - main - systat: Handle SIGWINCH to properly window resizing and adjust -swap disk stat based on new size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66483838039b21a20d748448f8916a73ec419691 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 18:34:43 -0000 The branch main has been updated by mr: URL: https://cgit.FreeBSD.org/src/commit/?id=66483838039b21a20d748448f8916a73ec419691 commit 66483838039b21a20d748448f8916a73ec419691 Author: Michael Reifenberger AuthorDate: 2021-04-21 18:31:58 +0000 Commit: Michael Reifenberger CommitDate: 2021-04-21 18:31:58 +0000 systat: Handle SIGWINCH to properly window resizing and adjust -swap disk stat based on new size. Display corrupts after resizing a window. Process SIGWINCH to redraw all window. Submitted by: Yoshihiro Ota ota@j.email.ne.jp Differential Revision: https://reviews.freebsd.org/D29337 --- usr.bin/systat/devs.c | 8 +------- usr.bin/systat/devs.h | 4 +++- usr.bin/systat/main.c | 16 ++++++++++++++++ usr.bin/systat/swap.c | 4 ++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/usr.bin/systat/devs.c b/usr.bin/systat/devs.c index b293796c2c77..87d04f989ea3 100644 --- a/usr.bin/systat/devs.c +++ b/usr.bin/systat/devs.c @@ -426,12 +426,6 @@ dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct s putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); } -static void -dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) -{ - dsshow2(diskcol, diskrow, dn, lc, now, then); -} - void dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) { @@ -439,5 +433,5 @@ dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct sta for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) if (dev_select[i].selected) - dsshow3(diskcol, diskrow, i, ++lc, now, then); + dsshow2(diskcol, diskrow, i, ++lc, now, then); } diff --git a/usr.bin/systat/devs.h b/usr.bin/systat/devs.h index cbedd844290e..79a44a6c3f5e 100644 --- a/usr.bin/systat/devs.h +++ b/usr.bin/systat/devs.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1998 David E. O'Brien - * 2015 Yoshihiro Ota + * 2015, 2021 Yoshihiro Ota * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,6 +34,8 @@ #include +#define DISKHIGHT 5 + int dsinit(int); void dsgetinfo(struct statinfo *); int dscmd(const char *, const char *, int, struct statinfo *); diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index b5a19d381ada..b84351379f41 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -135,6 +135,21 @@ parse_cmd_args (int argc, char **argv) } +static void +resize(int signo __unused) +{ + + endwin(); + refresh(); + clear(); + + CMDLINE = LINES - 1; + labels(); + display(); + status(); +} + + int main(int argc, char **argv) { @@ -191,6 +206,7 @@ main(int argc, char **argv) signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGTERM, die); + signal(SIGWINCH, resize); /* * Initialize display. Load average appears in a one line diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index 29b04df0157f..6052ca0d877b 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -136,7 +136,7 @@ labelswap(void) werase(wnd); - dslabel(12, 0, 18); + dslabel(12, 0, LINES - DISKHIGHT - 1); if (kvnsw <= 0) { mvwprintw(wnd, 0, 0, "(swap not configured)"); @@ -162,7 +162,7 @@ showswap(void) if (kvnsw != okvnsw) labelswap(); - dsshow(12, 0, 18, &cur_dev, &last_dev); + dsshow(12, 0, LINES - DISKHIGHT - 1, &cur_dev, &last_dev); if (kvnsw <= 0) return; From owner-dev-commits-src-all@freebsd.org Wed Apr 21 19:12:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BAB25EECF8; Wed, 21 Apr 2021 19:12:51 +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 4FQVYv0F19z3vBk; Wed, 21 Apr 2021 19:12:51 +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 EF2473874; Wed, 21 Apr 2021 19:12:50 +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 13LJCoiw022732; Wed, 21 Apr 2021 19:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LJCovp022731; Wed, 21 Apr 2021 19:12:50 GMT (envelope-from git) Date: Wed, 21 Apr 2021 19:12:50 GMT Message-Id: <202104211912.13LJCovp022731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d74d1284386a - stable/12 - safexcel: Fix the SHA-HMAC digest computation when AAD is present 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/stable/12 X-Git-Reftype: branch X-Git-Commit: d74d1284386aa37e6ec8ffa7739c51b3fa54fcb3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 19:12:51 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d74d1284386aa37e6ec8ffa7739c51b3fa54fcb3 commit d74d1284386aa37e6ec8ffa7739c51b3fa54fcb3 Author: Mark Johnston AuthorDate: 2021-04-21 18:50:48 +0000 Commit: Mark Johnston CommitDate: 2021-04-21 19:11:58 +0000 safexcel: Fix the SHA-HMAC digest computation when AAD is present The driver would fail to include the AAD in the input stream, resulting in incorrect digests for requests combining SHA-HMAC with AES-CBC or -CTR. Ensure that the AAD is included in the processor's input stream, and fix the corresponding instruction sequence to include the AAD as input to the digest computation. This is a direct commit to stable/12 since the bug was introduced while merging there and is not present in later branches. --- sys/dev/safexcel/safexcel.c | 47 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 0d209513ebdb..8c9094da9138 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -1590,16 +1590,27 @@ safexcel_instr_eta(struct safexcel_request *req, struct safexcel_instr *instr, start = instr; - /* Encrypt any data left in the request. */ + /* Insert the AAD into the input stream. */ instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; - instr->length = req->enc->crd_len; - instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; + instr->length = req->mac->crd_len - req->enc->crd_len; + instr->status = req->enc->crd_len == 0 ? + SAFEXCEL_INSTR_STATUS_LAST_HASH : 0; instr->instructions = SAFEXCEL_INSTR_INS_LAST | - SAFEXCEL_INSTR_DEST_CRYPTO | - SAFEXCEL_INSTR_DEST_HASH | - SAFEXCEL_INSTR_DEST_OUTPUT; + SAFEXCEL_INSTR_DEST_HASH; instr++; + /* Encrypt any data left in the request. */ + if (req->enc->crd_len > 0) { + instr->opcode = SAFEXCEL_INSTR_OPCODE_DIRECTION; + instr->length = req->enc->crd_len; + instr->status = SAFEXCEL_INSTR_STATUS_LAST_HASH; + instr->instructions = SAFEXCEL_INSTR_INS_LAST | + SAFEXCEL_INSTR_DEST_CRYPTO | + SAFEXCEL_INSTR_DEST_HASH | + SAFEXCEL_INSTR_DEST_OUTPUT; + instr++; + } + /* * Compute the digest, or extract it and place it in the output stream. */ @@ -2029,16 +2040,30 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, * consumers place the digest first in the input buffer, in which case * we have to create an extra descriptor. * + * Note that for encrypt-then-auth algorithms, mac->crd_len corresponds + * to the sum of the lengths of the AAD and payload, while for GCM and + * CCM it is the length of the AAD. + * * As an optimization, unmodified data is not passed to the output * stream. */ sglist_reset(ring->cmd_data); sglist_reset(ring->res_data); - if (req->mac != NULL && (req->enc == NULL || - req->enc->crd_alg == CRYPTO_AES_NIST_GCM_16 || - req->enc->crd_alg == CRYPTO_AES_CCM_16)) { - safexcel_append_segs(segs, nseg, ring->cmd_data, - req->mac->crd_skip, req->mac->crd_len); + if (req->mac != NULL) { + if (req->enc == NULL || + req->enc->crd_alg == CRYPTO_AES_NIST_GCM_16 || + req->enc->crd_alg == CRYPTO_AES_CCM_16) { + safexcel_append_segs(segs, nseg, ring->cmd_data, + req->mac->crd_skip, req->mac->crd_len); + } else { + if (req->mac->crd_len < req->enc->crd_len) { + req->error = EINVAL; + return; + } + safexcel_append_segs(segs, nseg, ring->cmd_data, + req->mac->crd_skip, + req->mac->crd_len - req->enc->crd_len); + } } if (req->enc != NULL) { safexcel_append_segs(segs, nseg, ring->cmd_data, From owner-dev-commits-src-all@freebsd.org Wed Apr 21 19:14:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FB935EF41D; Wed, 21 Apr 2021 19:14: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 4FQVby37llz3vWY; Wed, 21 Apr 2021 19:14:38 +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 5F0183A48; Wed, 21 Apr 2021 19:14:38 +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 13LJEcqe023030; Wed, 21 Apr 2021 19:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LJEcbO023029; Wed, 21 Apr 2021 19:14:38 GMT (envelope-from git) Date: Wed, 21 Apr 2021 19:14:38 GMT Message-Id: <202104211914.13LJEcbO023029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Reifenberger Subject: git: 70a2e9a3d447 - stable/13 - Improve size readability. Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70a2e9a3d447f4dcabb96a5782d09ef94ffda9fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 19:14:38 -0000 The branch stable/13 has been updated by mr: URL: https://cgit.FreeBSD.org/src/commit/?id=70a2e9a3d447f4dcabb96a5782d09ef94ffda9fb commit 70a2e9a3d447f4dcabb96a5782d09ef94ffda9fb Author: Michael Reifenberger AuthorDate: 2021-02-15 19:23:32 +0000 Commit: Michael Reifenberger CommitDate: 2021-04-21 19:11:36 +0000 Improve size readability. Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496 (cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f) --- lib/libc/gen/getbsize.3 | 5 +-- usr.bin/systat/extern.h | 1 + usr.bin/systat/swap.c | 116 +++++++++++++----------------------------------- usr.bin/systat/sysput.c | 21 ++++++--- 4 files changed, 51 insertions(+), 92 deletions(-) diff --git a/lib/libc/gen/getbsize.3 b/lib/libc/gen/getbsize.3 index c0b46bf9e235..acbe409a8456 100644 --- a/lib/libc/gen/getbsize.3 +++ b/lib/libc/gen/getbsize.3 @@ -45,10 +45,9 @@ The .Fn getbsize function returns a preferred block size for reporting by system utilities .Xr df 1 , -.Xr du 1 , -.Xr ls 1 +.Xr du 1 and -.Xr systat 1 , +.Xr ls 1 , based on the value of the .Ev BLOCKSIZE environment variable. diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 6e3117bece4e..322065f79312 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -168,6 +168,7 @@ char *sysctl_dynread(const char *, size_t *); void sysputpage(WINDOW* , int, int, int, uint64_t, int); void sysputspaces(WINDOW* , int, int, int); void sysputstrs(WINDOW* , int, int, int); +void sysputXs(WINDOW* , int, int, int); void sysputuint64(WINDOW* , int, int, int, uint64_t, int); void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index fc44db7d7d42..29b04df0157f 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -3,7 +3,7 @@ * * Copyright (c) 1980, 1992, 1993 * The Regents of the University of California. All rights reserved. - * Copyright (c) 2017 Yoshihiro Ota + * Copyright (c) 2017, 2020 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,22 +58,19 @@ static const char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95"; #include "extern.h" #include "devs.h" -static char *header; -static long blocksize; -static int dlen, odlen; -static int hlen; -static int ulen, oulen; -static int pagesize; +static int pathlen; WINDOW * openswap(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closeswap(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -92,29 +89,6 @@ closeswap(WINDOW *w) static struct kvm_swap kvmsw[NSWAP]; static int kvnsw, okvnsw; -static void calclens(void); - -#define CONVERT(v) ((int)((int64_t)(v) * pagesize / blocksize)) - -static void -calclens(void) -{ - int i, n; - int len; - - dlen = sizeof("Disk"); - for (i = 0; i < kvnsw; ++i) { - len = strlen(kvmsw[i].ksw_devname); - if (dlen < len) - dlen = len; - } - - ulen = sizeof("Used"); - for (n = CONVERT(kvmsw[kvnsw].ksw_used), len = 2; n /= 10; ++len); - if (ulen < len) - ulen = len; -} - int initswap(void) { @@ -123,22 +97,13 @@ initswap(void) if (once) return (1); - header = getbsize(&hlen, &blocksize); - pagesize = getpagesize(); - if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { error("systat: kvm_getswapinfo failed"); return (0); } - okvnsw = kvnsw; - - calclens(); - odlen = dlen; - oulen = ulen; - - once = 1; - + pathlen = 80 - 50 /* % */ - 5 /* Used */ - 5 /* Size */ - 3 /* space */; dsinit(12); + once = 1; return (1); } @@ -146,16 +111,13 @@ initswap(void) void fetchswap(void) { + okvnsw = kvnsw; if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { error("systat: kvm_getswapinfo failed"); return; } - odlen = dlen; - oulen = ulen; - calclens(); - struct devinfo *tmp_dinfo; tmp_dinfo = last_dev.dinfo; @@ -172,24 +134,23 @@ labelswap(void) const char *name; int i; - fetchswap(); - werase(wnd); - mvwprintw(wnd, 0, 0, "%*s%*s%*s %s", - -dlen, "Disk", hlen, header, ulen, "Used", - "/0% /10 /20 /30 /40 /50 /60 /70 /80 /90 /100"); + dslabel(12, 0, 18); + + if (kvnsw <= 0) { + mvwprintw(wnd, 0, 0, "(swap not configured)"); + return; + } + + mvwprintw(wnd, 0, 0, "%*s%5s %5s %s", + -pathlen, "Device/Path", "Size", "Used", + "|0% /10 /20 /30 /40 / 60\\ 70\\ 80\\ 90\\ 100|"); for (i = 0; i <= kvnsw; ++i) { - if (i == kvnsw) { - if (kvnsw == 1) - break; - name = "Total"; - } else - name = kvmsw[i].ksw_devname; - mvwprintw(wnd, i + 1, 0, "%*s", -dlen, name); + name = i == kvnsw ? "Total" : kvmsw[i].ksw_devname; + mvwprintw(wnd, 1 + i, 0, "%-*.*s", pathlen, pathlen - 1, name); } - dslabel(12, 0, 18); } void @@ -198,36 +159,23 @@ showswap(void) int count; int i; - if (kvnsw != okvnsw || dlen != odlen || ulen != oulen) + if (kvnsw != okvnsw) labelswap(); - for (i = 0; i <= kvnsw; ++i) { - if (i == kvnsw) { - if (kvnsw == 1) - break; - } - - if (kvmsw[i].ksw_total == 0) { - mvwprintw( - wnd, - i + 1, - dlen + hlen + ulen + 1, - "(swap not configured)" - ); - continue; - } - - wmove(wnd, i + 1, dlen); + dsshow(12, 0, 18, &cur_dev, &last_dev); - wprintw(wnd, "%*d", hlen, CONVERT(kvmsw[i].ksw_total)); - wprintw(wnd, "%*d", ulen, CONVERT(kvmsw[i].ksw_used)); + if (kvnsw <= 0) + return; - count = 50.0 * kvmsw[i].ksw_used / kvmsw[i].ksw_total + 1; + for (i = 0; i <= kvnsw; ++i) { + sysputpage(wnd, i + 1, pathlen, 5, kvmsw[i].ksw_total, 0); + sysputpage(wnd, i + 1, pathlen + 5 + 1, 5, kvmsw[i].ksw_used, + 0); - waddch(wnd, ' '); - while (count--) - waddch(wnd, 'X'); + if (kvmsw[i].ksw_used > 0) { + count = 50 * kvmsw[i].ksw_used / kvmsw[i].ksw_total; + sysputXs(wnd, i + 1, pathlen + 5 + 1 + 5 + 1, count); + } wclrtoeol(wnd); } - dsshow(12, 0, 18, &cur_dev, &last_dev); } diff --git a/usr.bin/systat/sysput.c b/usr.bin/systat/sysput.c index 31c9127a83b7..10401cee772a 100644 --- a/usr.bin/systat/sysput.c +++ b/usr.bin/systat/sysput.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2019 Yoshihiro Ota + * Copyright (c) 2019, 2020 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,17 +43,28 @@ __FBSDID("$FreeBSD$"); void sysputspaces(WINDOW *wd, int row, int col, int width) { - static char str40[] = " "; + static char str60[] = " " + " "; - mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); + mvwaddstr(wd, row, col, str60 + sizeof(str60) - width - 1); } void sysputstrs(WINDOW *wd, int row, int col, int width) { - static char str40[] = "****************************************"; + static char str60[] = "********************" + "****************************************"; - mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); + mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); +} + +void +sysputXs(WINDOW *wd, int row, int col, int width) +{ + static char str60[] = "XXXXXXXXXXXXXXXXXXXX" + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + + mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); } void From owner-dev-commits-src-all@freebsd.org Wed Apr 21 19:19:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 744F05EF6D4; Wed, 21 Apr 2021 19:19: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 4FQVjD2rCyz3vCw; Wed, 21 Apr 2021 19:19: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 53B313A4F; Wed, 21 Apr 2021 19:19: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 13LJJC7Q023601; Wed, 21 Apr 2021 19:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LJJCMJ023600; Wed, 21 Apr 2021 19:19:12 GMT (envelope-from git) Date: Wed, 21 Apr 2021 19:19:12 GMT Message-Id: <202104211919.13LJJCMJ023600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Reifenberger Subject: git: 9d75c569b42b - stable/12 - Improve size readability. Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mr X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9d75c569b42b6f7b8459e5d39258485d519fe78f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 19:19:12 -0000 The branch stable/12 has been updated by mr: URL: https://cgit.FreeBSD.org/src/commit/?id=9d75c569b42b6f7b8459e5d39258485d519fe78f commit 9d75c569b42b6f7b8459e5d39258485d519fe78f Author: Michael Reifenberger AuthorDate: 2021-02-15 19:23:32 +0000 Commit: Michael Reifenberger CommitDate: 2021-04-21 19:17:05 +0000 Improve size readability. Preserve more space for swap devise names. Prevent line overflow with long devise name. Don't draw a bar when swap is not used at all. Simplify and optimize code. Change the label to end at end of 100%. PR: 251655 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27496 (cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f) --- lib/libc/gen/getbsize.3 | 5 +-- usr.bin/systat/extern.h | 1 + usr.bin/systat/swap.c | 116 +++++++++++++----------------------------------- usr.bin/systat/sysput.c | 21 ++++++--- 4 files changed, 51 insertions(+), 92 deletions(-) diff --git a/lib/libc/gen/getbsize.3 b/lib/libc/gen/getbsize.3 index c0b46bf9e235..acbe409a8456 100644 --- a/lib/libc/gen/getbsize.3 +++ b/lib/libc/gen/getbsize.3 @@ -45,10 +45,9 @@ The .Fn getbsize function returns a preferred block size for reporting by system utilities .Xr df 1 , -.Xr du 1 , -.Xr ls 1 +.Xr du 1 and -.Xr systat 1 , +.Xr ls 1 , based on the value of the .Ev BLOCKSIZE environment variable. diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 6e3117bece4e..322065f79312 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -168,6 +168,7 @@ char *sysctl_dynread(const char *, size_t *); void sysputpage(WINDOW* , int, int, int, uint64_t, int); void sysputspaces(WINDOW* , int, int, int); void sysputstrs(WINDOW* , int, int, int); +void sysputXs(WINDOW* , int, int, int); void sysputuint64(WINDOW* , int, int, int, uint64_t, int); void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index fc44db7d7d42..29b04df0157f 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -3,7 +3,7 @@ * * Copyright (c) 1980, 1992, 1993 * The Regents of the University of California. All rights reserved. - * Copyright (c) 2017 Yoshihiro Ota + * Copyright (c) 2017, 2020 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,22 +58,19 @@ static const char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95"; #include "extern.h" #include "devs.h" -static char *header; -static long blocksize; -static int dlen, odlen; -static int hlen; -static int ulen, oulen; -static int pagesize; +static int pathlen; WINDOW * openswap(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closeswap(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -92,29 +89,6 @@ closeswap(WINDOW *w) static struct kvm_swap kvmsw[NSWAP]; static int kvnsw, okvnsw; -static void calclens(void); - -#define CONVERT(v) ((int)((int64_t)(v) * pagesize / blocksize)) - -static void -calclens(void) -{ - int i, n; - int len; - - dlen = sizeof("Disk"); - for (i = 0; i < kvnsw; ++i) { - len = strlen(kvmsw[i].ksw_devname); - if (dlen < len) - dlen = len; - } - - ulen = sizeof("Used"); - for (n = CONVERT(kvmsw[kvnsw].ksw_used), len = 2; n /= 10; ++len); - if (ulen < len) - ulen = len; -} - int initswap(void) { @@ -123,22 +97,13 @@ initswap(void) if (once) return (1); - header = getbsize(&hlen, &blocksize); - pagesize = getpagesize(); - if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { error("systat: kvm_getswapinfo failed"); return (0); } - okvnsw = kvnsw; - - calclens(); - odlen = dlen; - oulen = ulen; - - once = 1; - + pathlen = 80 - 50 /* % */ - 5 /* Used */ - 5 /* Size */ - 3 /* space */; dsinit(12); + once = 1; return (1); } @@ -146,16 +111,13 @@ initswap(void) void fetchswap(void) { + okvnsw = kvnsw; if ((kvnsw = kvm_getswapinfo(kd, kvmsw, NSWAP, 0)) < 0) { error("systat: kvm_getswapinfo failed"); return; } - odlen = dlen; - oulen = ulen; - calclens(); - struct devinfo *tmp_dinfo; tmp_dinfo = last_dev.dinfo; @@ -172,24 +134,23 @@ labelswap(void) const char *name; int i; - fetchswap(); - werase(wnd); - mvwprintw(wnd, 0, 0, "%*s%*s%*s %s", - -dlen, "Disk", hlen, header, ulen, "Used", - "/0% /10 /20 /30 /40 /50 /60 /70 /80 /90 /100"); + dslabel(12, 0, 18); + + if (kvnsw <= 0) { + mvwprintw(wnd, 0, 0, "(swap not configured)"); + return; + } + + mvwprintw(wnd, 0, 0, "%*s%5s %5s %s", + -pathlen, "Device/Path", "Size", "Used", + "|0% /10 /20 /30 /40 / 60\\ 70\\ 80\\ 90\\ 100|"); for (i = 0; i <= kvnsw; ++i) { - if (i == kvnsw) { - if (kvnsw == 1) - break; - name = "Total"; - } else - name = kvmsw[i].ksw_devname; - mvwprintw(wnd, i + 1, 0, "%*s", -dlen, name); + name = i == kvnsw ? "Total" : kvmsw[i].ksw_devname; + mvwprintw(wnd, 1 + i, 0, "%-*.*s", pathlen, pathlen - 1, name); } - dslabel(12, 0, 18); } void @@ -198,36 +159,23 @@ showswap(void) int count; int i; - if (kvnsw != okvnsw || dlen != odlen || ulen != oulen) + if (kvnsw != okvnsw) labelswap(); - for (i = 0; i <= kvnsw; ++i) { - if (i == kvnsw) { - if (kvnsw == 1) - break; - } - - if (kvmsw[i].ksw_total == 0) { - mvwprintw( - wnd, - i + 1, - dlen + hlen + ulen + 1, - "(swap not configured)" - ); - continue; - } - - wmove(wnd, i + 1, dlen); + dsshow(12, 0, 18, &cur_dev, &last_dev); - wprintw(wnd, "%*d", hlen, CONVERT(kvmsw[i].ksw_total)); - wprintw(wnd, "%*d", ulen, CONVERT(kvmsw[i].ksw_used)); + if (kvnsw <= 0) + return; - count = 50.0 * kvmsw[i].ksw_used / kvmsw[i].ksw_total + 1; + for (i = 0; i <= kvnsw; ++i) { + sysputpage(wnd, i + 1, pathlen, 5, kvmsw[i].ksw_total, 0); + sysputpage(wnd, i + 1, pathlen + 5 + 1, 5, kvmsw[i].ksw_used, + 0); - waddch(wnd, ' '); - while (count--) - waddch(wnd, 'X'); + if (kvmsw[i].ksw_used > 0) { + count = 50 * kvmsw[i].ksw_used / kvmsw[i].ksw_total; + sysputXs(wnd, i + 1, pathlen + 5 + 1 + 5 + 1, count); + } wclrtoeol(wnd); } - dsshow(12, 0, 18, &cur_dev, &last_dev); } diff --git a/usr.bin/systat/sysput.c b/usr.bin/systat/sysput.c index 31c9127a83b7..10401cee772a 100644 --- a/usr.bin/systat/sysput.c +++ b/usr.bin/systat/sysput.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2019 Yoshihiro Ota + * Copyright (c) 2019, 2020 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,17 +43,28 @@ __FBSDID("$FreeBSD$"); void sysputspaces(WINDOW *wd, int row, int col, int width) { - static char str40[] = " "; + static char str60[] = " " + " "; - mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); + mvwaddstr(wd, row, col, str60 + sizeof(str60) - width - 1); } void sysputstrs(WINDOW *wd, int row, int col, int width) { - static char str40[] = "****************************************"; + static char str60[] = "********************" + "****************************************"; - mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); + mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); +} + +void +sysputXs(WINDOW *wd, int row, int col, int width) +{ + static char str60[] = "XXXXXXXXXXXXXXXXXXXX" + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + + mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); } void From owner-dev-commits-src-all@freebsd.org Wed Apr 21 19:59:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D1155F04A1; Wed, 21 Apr 2021 19:59:50 +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 4FQWc63tYPz4R57; Wed, 21 Apr 2021 19:59:50 +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 73C9940C7; Wed, 21 Apr 2021 19:59:50 +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 13LJxoim076346; Wed, 21 Apr 2021 19:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LJxotQ076345; Wed, 21 Apr 2021 19:59:50 GMT (envelope-from git) Date: Wed, 21 Apr 2021 19:59:50 GMT Message-Id: <202104211959.13LJxotQ076345@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: 652908599b6f - main - Add required checks for unmapped mbufs in ipdivert and ipfw 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: 652908599b6fa7285ee60cb567b97e70b648ac29 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 19:59:50 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=652908599b6fa7285ee60cb567b97e70b648ac29 commit 652908599b6fa7285ee60cb567b97e70b648ac29 Author: Mark Johnston AuthorDate: 2021-04-21 19:38:01 +0000 Commit: Mark Johnston CommitDate: 2021-04-21 19:47:05 +0000 Add required checks for unmapped mbufs in ipdivert and ipfw Also add an M_ASSERTMAPPED() macro to verify that all mbufs in the chain are mapped. Use it in ipfw_nat, which operates on a chain returned by m_megapullup(). PR: 255164 Reviewed by: ae, gallatin MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29838 --- sys/netinet/ip_divert.c | 6 ++++++ sys/netpfil/ipfw/ip_fw_nat.c | 1 + sys/netpfil/ipfw/nat64/nat64_translate.c | 10 ++++++++++ sys/sys/mbuf.h | 11 +++++++++++ 4 files changed, 28 insertions(+) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 70d3fbd1f230..c3f9c43b8f70 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -212,11 +212,17 @@ divert_packet(struct mbuf *m, bool incoming) /* Delayed checksums are currently not compatible with divert. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + m = mb_unmapped_to_ext(m); + if (m == NULL) + return; in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #if defined(SCTP) || defined(SCTP_SUPPORT) if (m->m_pkthdr.csum_flags & CSUM_SCTP) { + m = mb_unmapped_to_ext(m); + if (m == NULL) + return; sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; } diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index bcda3cff011c..d7b31c29d4ec 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -307,6 +307,7 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m) args->m = NULL; return (IP_FW_DENY); } + M_ASSERTMAPPED(mcl); ip = mtod(mcl, struct ip *); /* diff --git a/sys/netpfil/ipfw/nat64/nat64_translate.c b/sys/netpfil/ipfw/nat64/nat64_translate.c index 4ed3bfa765f6..29666a7d3a9a 100644 --- a/sys/netpfil/ipfw/nat64/nat64_translate.c +++ b/sys/netpfil/ipfw/nat64/nat64_translate.c @@ -1296,6 +1296,11 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *saddr, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + NAT64STAT_INC(&cfg->stats, nomem); + return (NAT64RETURN); + } in_delayed_cksum(m); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } @@ -1673,6 +1678,11 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, uint16_t aport, /* Handle delayed checksums if needed. */ if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + NAT64STAT_INC(&cfg->stats, nomem); + return (NAT64RETURN); + } in6_delayed_cksum(m, plen, hlen); m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 52d000fea5fd..729653fa1e55 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1113,6 +1113,17 @@ m_extrefcnt(struct mbuf *m) KASSERT((((struct mbuf *)m)->m_flags & 0) == 0, \ ("%s: attempted use of a free mbuf!", __func__)) +/* Check whether any mbuf in the chain is unmapped. */ +#ifdef INVARIANTS +#define M_ASSERTMAPPED(m) do { \ + for (struct mbuf *__m = (m); __m != NULL; __m = __m->m_next) \ + KASSERT((__m->m_flags & M_EXTPG) == 0, \ + ("%s: chain %p contains an unmapped mbuf", __func__, (m)));\ +} while (0) +#else +#define M_ASSERTMAPPED(m) +#endif + /* * Return the address of the start of the buffer associated with an mbuf, * handling external storage, packet-header mbufs, and regular data mbufs. From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:01:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E9435F07AD; Wed, 21 Apr 2021 20:01: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 4FQWfN1qwVz4RKh; Wed, 21 Apr 2021 20:01: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 322974548; Wed, 21 Apr 2021 20:01: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 13LK1mDC089633; Wed, 21 Apr 2021 20:01:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LK1mpd089632; Wed, 21 Apr 2021 20:01:48 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:01:48 GMT Message-Id: <202104212001.13LK1mpd089632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 01d74fe1ffc3 - main - Path MTU discovery hooks for offloaded TCP connections. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01d74fe1ffc32dc7f42dc0fb0c4861276a6b2bd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:01:48 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=01d74fe1ffc32dc7f42dc0fb0c4861276a6b2bd2 commit 01d74fe1ffc32dc7f42dc0fb0c4861276a6b2bd2 Author: Navdeep Parhar AuthorDate: 2021-04-13 00:25:22 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-21 20:00:16 +0000 Path MTU discovery hooks for offloaded TCP connections. Notify the TOE driver when when an ICMP type 3 code 4 (Fragmentation needed and DF set) message is received for an offloaded connection. This gives the driver an opportunity to lower the path MTU for the connection and resume transmission, much like what the kernel does for the connections that it handles. Reviewed by: glebius@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29755 --- sys/netinet/tcp_offload.c | 11 +++++++ sys/netinet/tcp_offload.h | 3 ++ sys/netinet/tcp_subr.c | 80 ++++++++++++++++++++++++++++++++--------------- sys/netinet/toecore.c | 9 ++++++ sys/netinet/toecore.h | 4 +++ 5 files changed, 81 insertions(+), 26 deletions(-) diff --git a/sys/netinet/tcp_offload.c b/sys/netinet/tcp_offload.c index ba190f0303f1..84a4bc3c31a3 100644 --- a/sys/netinet/tcp_offload.c +++ b/sys/netinet/tcp_offload.c @@ -219,3 +219,14 @@ tcp_offload_detach(struct tcpcb *tp) tod->tod_pcb_detach(tod, tp); } + +void +tcp_offload_pmtu_update(struct tcpcb *tp, tcp_seq seq, int mtu) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_pmtu_update(tod, tp, seq, mtu); +} diff --git a/sys/netinet/tcp_offload.h b/sys/netinet/tcp_offload.h index 19c120ccdd7d..8f3786e9f7eb 100644 --- a/sys/netinet/tcp_offload.h +++ b/sys/netinet/tcp_offload.h @@ -36,6 +36,8 @@ #error "no user-serviceable parts inside" #endif +#include + extern int registered_toedevs; int tcp_offload_connect(struct socket *, struct sockaddr *); @@ -48,5 +50,6 @@ void tcp_offload_ctloutput(struct tcpcb *, int, int); void tcp_offload_tcp_info(struct tcpcb *, struct tcp_info *); int tcp_offload_alloc_tls_session(struct tcpcb *, struct ktls_session *, int); void tcp_offload_detach(struct tcpcb *); +void tcp_offload_pmtu_update(struct tcpcb *, tcp_seq, int); #endif diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 1ce7a5b1fcf3..b5ecdc6f2307 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2791,6 +2791,21 @@ SYSCTL_PROC(_net_inet6_tcp6, OID_AUTO, getcred, #endif /* INET6 */ #ifdef INET +/* Path MTU to try next when a fragmentation-needed message is received. */ +static inline int +tcp_next_pmtu(const struct icmp *icp, const struct ip *ip) +{ + int mtu = ntohs(icp->icmp_nextmtu); + + /* If no alternative MTU was proposed, try the next smaller one. */ + if (!mtu) + mtu = ip_next_mtu(ntohs(ip->ip_len), 1); + if (mtu < V_tcp_minmss + sizeof(struct tcpiphdr)) + mtu = V_tcp_minmss + sizeof(struct tcpiphdr); + + return (mtu); +} + static void tcp_ctlinput_with_port(int cmd, struct sockaddr *sa, void *vip, uint16_t port) { @@ -2846,6 +2861,17 @@ tcp_ctlinput_with_port(int cmd, struct sockaddr *sa, void *vip, uint16_t port) !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { tp = intotcpcb(inp); +#ifdef TCP_OFFLOAD + if (tp->t_flags & TF_TOE && cmd == PRC_MSGSIZE) { + /* + * MTU discovery for offloaded connections. Let + * the TOE driver verify seq# and process it. + */ + mtu = tcp_next_pmtu(icp, ip); + tcp_offload_pmtu_update(tp, icmp_tcp_seq, mtu); + goto out; + } +#endif if (tp->t_port != port) { goto out; } @@ -2853,24 +2879,11 @@ tcp_ctlinput_with_port(int cmd, struct sockaddr *sa, void *vip, uint16_t port) SEQ_LT(ntohl(icmp_tcp_seq), tp->snd_max)) { if (cmd == PRC_MSGSIZE) { /* - * MTU discovery: - * If we got a needfrag set the MTU - * in the route to the suggested new - * value (if given) and then notify. + * MTU discovery: we got a needfrag and + * will potentially try a lower MTU. */ - mtu = ntohs(icp->icmp_nextmtu); - /* - * If no alternative MTU was - * proposed, try the next smaller - * one. - */ - if (!mtu) - mtu = ip_next_mtu( - ntohs(ip->ip_len), 1); - if (mtu < V_tcp_minmss + - sizeof(struct tcpiphdr)) - mtu = V_tcp_minmss + - sizeof(struct tcpiphdr); + mtu = tcp_next_pmtu(icp, ip); + /* * Only process the offered MTU if it * is smaller than the current one. @@ -2948,6 +2961,20 @@ tcp_ctlinput_viaudp(int cmd, struct sockaddr *sa, void *vip, void *unused) #endif /* INET */ #ifdef INET6 +static inline int +tcp6_next_pmtu(const struct icmp6_hdr *icmp6) +{ + int mtu = ntohl(icmp6->icmp6_mtu); + + /* + * If no alternative MTU was proposed, or the proposed MTU was too + * small, set to the min. + */ + if (mtu < IPV6_MMTU) + mtu = IPV6_MMTU - 8; /* XXXNP: what is the adjustment for? */ + return (mtu); +} + static void tcp6_ctlinput_with_port(int cmd, struct sockaddr *sa, void *d, uint16_t port) { @@ -3039,6 +3066,14 @@ tcp6_ctlinput_with_port(int cmd, struct sockaddr *sa, void *d, uint16_t port) !(inp->inp_flags & INP_DROPPED) && !(inp->inp_socket == NULL)) { tp = intotcpcb(inp); +#ifdef TCP_OFFLOAD + if (tp->t_flags & TF_TOE && cmd == PRC_MSGSIZE) { + /* MTU discovery for offloaded connections. */ + mtu = tcp6_next_pmtu(icmp6); + tcp_offload_pmtu_update(tp, icmp_tcp_seq, mtu); + goto out; + } +#endif if (tp->t_port != port) { goto out; } @@ -3051,15 +3086,8 @@ tcp6_ctlinput_with_port(int cmd, struct sockaddr *sa, void *d, uint16_t port) * in the route to the suggested new * value (if given) and then notify. */ - mtu = ntohl(icmp6->icmp6_mtu); - /* - * If no alternative MTU was - * proposed, or the proposed - * MTU was too small, set to - * the min. - */ - if (mtu < IPV6_MMTU) - mtu = IPV6_MMTU - 8; + mtu = tcp6_next_pmtu(icmp6); + bzero(&inc, sizeof(inc)); inc.inc_fibnum = M_GETFIB(m); inc.inc_flags |= INC_ISIPV6; diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c index d8d499a6fde3..5792298d2883 100644 --- a/sys/netinet/toecore.c +++ b/sys/netinet/toecore.c @@ -199,6 +199,14 @@ toedev_alloc_tls_session(struct toedev *tod __unused, struct tcpcb *tp __unused, return (EINVAL); } +static void +toedev_pmtu_update(struct toedev *tod __unused, struct tcpcb *tp __unused, + tcp_seq seq __unused, int mtu __unused) +{ + + return; +} + /* * Inform one or more TOE devices about a listening socket. */ @@ -290,6 +298,7 @@ init_toedev(struct toedev *tod) tod->tod_ctloutput = toedev_ctloutput; tod->tod_tcp_info = toedev_tcp_info; tod->tod_alloc_tls_session = toedev_alloc_tls_session; + tod->tod_pmtu_update = toedev_pmtu_update; } /* diff --git a/sys/netinet/toecore.h b/sys/netinet/toecore.h index 36493abf7149..ce796ab54dc5 100644 --- a/sys/netinet/toecore.h +++ b/sys/netinet/toecore.h @@ -35,6 +35,7 @@ #error "no user-serviceable parts inside" #endif +#include #include struct tcpopt; @@ -114,6 +115,9 @@ struct toedev { /* Create a TLS session */ int (*tod_alloc_tls_session)(struct toedev *, struct tcpcb *, struct ktls_session *, int); + + /* ICMP fragmentation-needed received, adjust PMTU. */ + void (*tod_pmtu_update)(struct toedev *, struct tcpcb *, tcp_seq, int); }; typedef void (*tcp_offload_listen_start_fn)(void *, struct tcpcb *); From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:35:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B090F5F0FC6; Wed, 21 Apr 2021 20:35: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 4FQXNt4dM9z4Sgp; Wed, 21 Apr 2021 20:35: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 8E11A4E03; Wed, 21 Apr 2021 20:35: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 13LKZAoX029277; Wed, 21 Apr 2021 20:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LKZAqW029276; Wed, 21 Apr 2021 20:35:10 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:35:10 GMT Message-Id: <202104212035.13LKZAqW029276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 50f6c1399700 - main - pmc_allocate(3): document the count argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50f6c139970084adeefec98c658645c34b72209e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:35:10 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=50f6c139970084adeefec98c658645c34b72209e commit 50f6c139970084adeefec98c658645c34b72209e Author: Mitchell Horne AuthorDate: 2021-04-21 20:27:49 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 20:35:03 +0000 pmc_allocate(3): document the count argument This was added in b2ca2e50b9aa, and serves to provide an initial value to the PMC, eliminating the need for a second syscall via pmc_set(3). Reviewed by: gnn, 0mp (manpages) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29885 --- lib/libpmc/pmc_allocate.3 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/libpmc/pmc_allocate.3 b/lib/libpmc/pmc_allocate.3 index 291ca8ac0113..515b427cf7bc 100644 --- a/lib/libpmc/pmc_allocate.3 +++ b/lib/libpmc/pmc_allocate.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2008 +.Dd April 21, 2021 .Dt PMC_ALLOCATE 3 .Os .Sh NAME @@ -41,6 +41,7 @@ .Fa "uint32_t flags" .Fa "int cpu" .Fa "pmc_id_t *pmcid" +.Fa "uint64_t count" .Fc .Ft int .Fn pmc_release "pmc_id_t pmc" @@ -111,6 +112,20 @@ Process scope PMC allocations should specify the constant .Dv PMC_CPU_ANY for this argument. .Pp +The +.Fa count +argument behaves identically to the +.Xr pmc_set 3 +function's +.Fa value +argument. +For counting PMCs, +.Fa count +specifies the initial value of the allocated PMC. +For sampling PMCs, +.Fa count +specifies the reload count. +.Pp Function .Fn pmc_release releases the PMC denoted by argument From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:35:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BD525F0FCD; Wed, 21 Apr 2021 20:35: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 4FQXNv6lzGz4SMK; Wed, 21 Apr 2021 20: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 A366B4C37; Wed, 21 Apr 2021 20: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 13LKZBdq029328; Wed, 21 Apr 2021 20: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 13LKZBwf029319; Wed, 21 Apr 2021 20:35:11 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:35:11 GMT Message-Id: <202104212035.13LKZBwf029319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: edcf9e59c356 - main - pmcstat: set initial counter value to zero MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edcf9e59c356525632dd2546d72916aeca609a2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:35:12 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=edcf9e59c356525632dd2546d72916aeca609a2b commit edcf9e59c356525632dd2546d72916aeca609a2b Author: Mitchell Horne AuthorDate: 2021-04-21 20:28:12 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 20:35:03 +0000 pmcstat: set initial counter value to zero For an infrequent event, pmcstat may report (u_long)-1 for CPUs where the counter was never incremented. Just set this to zero, instead. ev->ev_count is passed as the 'count' argument to pmc_allocate(3), but this wasn't always the case. Reviewed by: gnn MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29887 --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 688a98843652..b7f6c5e0f63e 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -675,7 +675,7 @@ main(int argc, char **argv) if (option == 'S' || option == 'P') ev->ev_count = current_sampling_count ? current_sampling_count : pmc_pmu_sample_rate_get(ev->ev_spec); else - ev->ev_count = -1; + ev->ev_count = 0; if (option == 'S' || option == 's') ev->ev_cpu = CPU_FFS(&cpumask) - 1; From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:47:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D9F85F1AA2; Wed, 21 Apr 2021 20:47: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 4FQXgT1HXCz4TKl; Wed, 21 Apr 2021 20:47: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 1AAE14E3A; Wed, 21 Apr 2021 20:47: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 13LKlmmH042507; Wed, 21 Apr 2021 20:47:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LKlmdq042506; Wed, 21 Apr 2021 20:47:48 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:47:48 GMT Message-Id: <202104212047.13LKlmdq042506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: c4473add1d3d - main - pmcstat: fix the usage message for -t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4473add1d3d588d8747cab86796d2f2d4c8847c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:47:49 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c4473add1d3d588d8747cab86796d2f2d4c8847c commit c4473add1d3d588d8747cab86796d2f2d4c8847c Author: Mitchell Horne AuthorDate: 2021-04-21 20:44:52 +0000 Commit: Mitchell Horne CommitDate: 2021-04-21 20:44:52 +0000 pmcstat: fix the usage message for -t A slight mix-up of the flags means this case isn't triggered when it should be. Now, `pmcstat -s event -t 1234` will print the correct error message. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- usr.sbin/pmcstat/pmcstat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index b7f6c5e0f63e..997005cec269 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -898,7 +898,8 @@ main(int argc, char **argv) pmcstat_show_usage(); /* check for -t pid without a process PMC spec */ - if ((args.pa_required & FLAG_HAS_TARGET) && + if ((args.pa_flags & FLAG_HAS_TARGET) && + (args.pa_required & FLAG_HAS_PROCESS_PMCS) && (args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0) errx(EX_USAGE, "ERROR: option -t requires a process mode PMC to be specified." From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:57:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE5C45F1A58; Wed, 21 Apr 2021 20:57: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 4FQXtz4Qwsz4TrM; Wed, 21 Apr 2021 20:57: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 869104EC7; Wed, 21 Apr 2021 20:57: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 13LKvlmU056083; Wed, 21 Apr 2021 20:57:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LKvlYw056082; Wed, 21 Apr 2021 20:57:47 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:57:47 GMT Message-Id: <202104212057.13LKvlYw056082@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: 753bcca440a4 - main - riscv: Clear SUM in SSTATUS for supervisor mode exceptions. 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: 753bcca440a4d2c95f48536b586131b84c0bb87e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:57:47 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=753bcca440a4d2c95f48536b586131b84c0bb87e commit 753bcca440a4d2c95f48536b586131b84c0bb87e Author: John Baldwin AuthorDate: 2021-04-21 20:57:04 +0000 Commit: John Baldwin CommitDate: 2021-04-21 20:57:04 +0000 riscv: Clear SUM in SSTATUS for supervisor mode exceptions. Previously, a page fault taken during copyin/out and related functions would run the entire fault handler while permitting direct access to user addresses. This could also leak across context switches (e.g. if the page fault handler was preempted by an interrupt or slept for disk I/O). To fix, clear SUM in assembly after saving the original version of SSTATUS in the supervisor mode trapframe. Reviewed by: mhorne, jrtc27 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29763 --- sys/riscv/riscv/exception.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 50134980c7af..abd1307174f1 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -104,6 +104,11 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) +.if \mode == 1 + /* Disable user address access for supervisor mode exceptions. */ + li t0, SSTATUS_SUM + csrc sstatus, t0 +.endif csrr t0, stval sd t0, (TF_STVAL)(sp) csrr t0, scause From owner-dev-commits-src-all@freebsd.org Wed Apr 21 20:57:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCF5F5F1F8C; Wed, 21 Apr 2021 20:57: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 4FQXv04sw5z4TXy; Wed, 21 Apr 2021 20:57: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 98DFC5130; Wed, 21 Apr 2021 20:57: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 13LKvmrC056104; Wed, 21 Apr 2021 20:57:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LKvmQb056103; Wed, 21 Apr 2021 20:57:48 GMT (envelope-from git) Date: Wed, 21 Apr 2021 20:57:48 GMT Message-Id: <202104212057.13LKvmQb056103@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: 6a3a6fe34bf3 - main - riscv: Assert that SUM is not set in SSTATUS for exceptions. 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: 6a3a6fe34bf36b6e745b3e9ad1a991de057729c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 20:57:48 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3a6fe34bf36b6e745b3e9ad1a991de057729c7 commit 6a3a6fe34bf36b6e745b3e9ad1a991de057729c7 Author: John Baldwin AuthorDate: 2021-04-21 20:57:20 +0000 Commit: John Baldwin CommitDate: 2021-04-21 20:57:20 +0000 riscv: Assert that SUM is not set in SSTATUS for exceptions. Reviewed by: mhorne Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D29764 --- sys/riscv/riscv/trap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index 599fd64b56be..0aaaf46eb629 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -274,6 +274,9 @@ do_trap_supervisor(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, ("Came from S mode with interrupts enabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0, + ("Came from S mode with SUM enabled")); + exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ @@ -342,6 +345,9 @@ do_trap_user(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, ("Came from U mode with interrupts enabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SUM)) == 0, + ("Came from U mode with SUM enabled")); + exception = frame->tf_scause & SCAUSE_CODE; if ((frame->tf_scause & SCAUSE_INTR) != 0) { /* Interrupt */ From owner-dev-commits-src-all@freebsd.org Wed Apr 21 21:37:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3F125F2B08; Wed, 21 Apr 2021 21:37: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 4FQYms6V9tz4WHc; Wed, 21 Apr 2021 21:37: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 D1DCA5553; Wed, 21 Apr 2021 21:37: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 13LLbXde009546; Wed, 21 Apr 2021 21:37:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LLbXah009545; Wed, 21 Apr 2021 21:37:33 GMT (envelope-from git) Date: Wed, 21 Apr 2021 21:37:33 GMT Message-Id: <202104212137.13LLbXah009545@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: 1eebd6158ccc - main - newbus: Optimize/Simplify kobj_class_compile_common a little 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: 1eebd6158cccf12f3b057d6a1adf9d40ec59844c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 21:37:34 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1eebd6158cccf12f3b057d6a1adf9d40ec59844c commit 1eebd6158cccf12f3b057d6a1adf9d40ec59844c Author: Warner Losh AuthorDate: 2021-04-21 21:35:54 +0000 Commit: Warner Losh CommitDate: 2021-04-21 21:37:24 +0000 newbus: Optimize/Simplify kobj_class_compile_common a little "i" is not used in this loop at all. There's no need to initialize and increment it. Reviewed by: markj@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29898 --- sys/kern/subr_kobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c index d001450cba6f..17d23336e333 100644 --- a/sys/kern/subr_kobj.c +++ b/sys/kern/subr_kobj.c @@ -112,7 +112,7 @@ kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) { + for (m = cls->methods; m->desc; m++) { if (m->desc->id == 0) m->desc->id = kobj_next_id++; } From owner-dev-commits-src-all@freebsd.org Wed Apr 21 21:37:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DCE75F2A90; Wed, 21 Apr 2021 21:37: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 4FQYmv0KwCz4WNf; Wed, 21 Apr 2021 21:37: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 F0D4D59CB; Wed, 21 Apr 2021 21:37: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 13LLbYRW009574; Wed, 21 Apr 2021 21:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LLbYBj009573; Wed, 21 Apr 2021 21:37:34 GMT (envelope-from git) Date: Wed, 21 Apr 2021 21:37:34 GMT Message-Id: <202104212137.13LLbYBj009573@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: df456a1fcf73 - main - newbus: style nit (align comments) 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: df456a1fcf73fd2acdeefe4fe324836bda421ce2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 21:37:35 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=df456a1fcf73fd2acdeefe4fe324836bda421ce2 commit df456a1fcf73fd2acdeefe4fe324836bda421ce2 Author: Warner Losh AuthorDate: 2021-04-18 05:44:25 +0000 Commit: Warner Losh CommitDate: 2021-04-21 21:37:24 +0000 newbus: style nit (align comments) Sponsored by: Netflix --- sys/kern/subr_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 08f1cb5886d2..12399df40a5d 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -100,7 +100,7 @@ typedef TAILQ_HEAD(device_list, _device) device_list_t; struct devclass { TAILQ_ENTRY(devclass) link; devclass_t parent; /* parent in devclass hierarchy */ - driver_list_t drivers; /* bus devclasses store drivers for bus */ + driver_list_t drivers; /* bus devclasses store drivers for bus */ char *name; device_t *devices; /* array of devices indexed by unit */ int maxunit; /* size of devices array */ From owner-dev-commits-src-all@freebsd.org Thu Apr 22 07:59:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71ED75E3370; Thu, 22 Apr 2021 07:59: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 4FQqb22pngz3H9Q; Thu, 22 Apr 2021 07:59: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 533C31640C; Thu, 22 Apr 2021 07:59: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 13M7xwpa034093; Thu, 22 Apr 2021 07:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13M7xwCt034092; Thu, 22 Apr 2021 07:59:58 GMT (envelope-from git) Date: Thu, 22 Apr 2021 07:59:58 GMT Message-Id: <202104220759.13M7xwCt034092@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: 4044af03a4e9 - main - Fix vtnet TCP lro panic 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: 4044af03a4e95642d8d1982800c079029c2b087c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 07:59:58 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4044af03a4e95642d8d1982800c079029c2b087c commit 4044af03a4e95642d8d1982800c079029c2b087c Author: Alexander V. Chernikov AuthorDate: 2021-04-19 15:58:41 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-19 16:06:34 +0000 Fix vtnet TCP lro panic Differential Revision: https://reviews.freebsd.org/D29900 Reviewed by: hps, kp --- sys/dev/virtio/network/if_vtnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 3650d19fbe0e..e65914c5184f 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -2145,7 +2145,8 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) if (deq > 0) { #if defined(INET) || defined(INET6) - tcp_lro_flush_all(&rxq->vtnrx_lro); + if (vtnet_software_lro(sc)) + tcp_lro_flush_all(&rxq->vtnrx_lro); #endif virtqueue_notify(vq); } From owner-dev-commits-src-all@freebsd.org Thu Apr 22 09:37:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A140C5E7D22; Thu, 22 Apr 2021 09:37: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 4FQslH4C9Bz3P61; Thu, 22 Apr 2021 09:37:15 +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 83348176E9; Thu, 22 Apr 2021 09:37: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 13M9bFPX068040; Thu, 22 Apr 2021 09:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13M9bFo5068039; Thu, 22 Apr 2021 09:37:15 GMT (envelope-from git) Date: Thu, 22 Apr 2021 09:37:15 GMT Message-Id: <202104220937.13M9bFo5068039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 7c707c7c25ad - main - __FreeBSD_version: update the references to the doc tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c707c7c25ad361f911716c31d22f5722f4dffc9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 09:37:15 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=7c707c7c25ad361f911716c31d22f5722f4dffc9 commit 7c707c7c25ad361f911716c31d22f5722f4dffc9 Author: Ka Ho Ng AuthorDate: 2021-04-22 09:36:22 +0000 Commit: Ka Ho Ng CommitDate: 2021-04-22 09:36:22 +0000 __FreeBSD_version: update the references to the doc tree Update the reference of which file to update in the doc tree when bumping __FreeBSD_version. This change is to catch up with commit f8fed61b80 in the doc repository. MFC after: 3 days Approved by: lwhsu (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29920 --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index fbdb0eb6ea0d..e4fdb272b7fe 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -52,7 +52,7 @@ * there. * Currently this lives here in the doc/ repository: * - * documentation/content/en/books/porters-handbook/versions/chapter.adoc + * documentation/content/en/books/porters-handbook/versions/_index.adoc * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-dev-commits-src-all@freebsd.org Thu Apr 22 10:19:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CC395E9528; Thu, 22 Apr 2021 10:19:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FQtgv0806z3R4h; Thu, 22 Apr 2021 10:19:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13MAJ8qb005242 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 22 Apr 2021 13:19:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13MAJ8qb005242 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13MAJ7Gr005241; Thu, 22 Apr 2021 13:19:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Apr 2021 13:19:07 +0300 From: Konstantin Belousov To: myfreeweb Cc: John Baldwin , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 11d62b6f31ab - main - linuxkpi: add kernel_fpu_begin/kernel_fpu_end Message-ID: References: <202101121143.10CBh02x095972@gitrepo.freebsd.org> <20210113110826.46fbc900b3c375e7215a8195@bidouilliste.com> <171B7072-9BAE-46BB-82BA-4792AEBAD0EB@unrelenting.technology> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FQtgv0806z3R4h X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-1.70 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:470:d5e7:1::1:from]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.880]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[6]; SPAMHAUS_ZRD(0.00)[2001:470:d5e7:1::1:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.19)[0.185]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 10:19:24 -0000 On Thu, Jan 14, 2021 at 04:23:31AM +0200, Konstantin Belousov wrote: > On Thu, Jan 14, 2021 at 01:36:27AM +0000, myfreeweb wrote: > > > > > > On January 13, 2021 8:58:58 PM UTC, John Baldwin wrote: > > >It doesn't store at all because threads aren't allowed to sleep in a critical > > >section, so the thread will never give up the CPU while in the FPU section. If > > >threads can voluntarily sleep (cv_wait*, *sleep(), etc.) while using > > >kernel_fpu_begin(), then NOCTX won't work and we will need something else. > > > > Hmm but with no storage at all, how would it work from a syscall? > > The manpage does mention a "usermode save area" – I was talking about that. > There is a storage for the user state, always. When NOCTX is used, FPU state > is spilled into the _current_ save area, and then kernel lives to the promise > that the new state after fpu_enter(NOCTX) does not ever need to be saved. > > > > > Linux kernel_fpu_begin starts with preempt_disable, so definitely no condvars and the like. No idea about simple time sleeps. But amdgpu doesn't seem to do even that. > > You should get enough assertions fired if something tries to context switch > while entered NOCTX region. So this went dead in the mail, and kernel still contains that awful code that corrupts both userspace and kernel FPU contexts. I suggest to remove this file at all, since things are not being sorted. From owner-dev-commits-src-all@freebsd.org Thu Apr 22 10:27:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61FF85E9A93; Thu, 22 Apr 2021 10:27: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 4FQtrs2FqMz3R6G; Thu, 22 Apr 2021 10:27: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 3F83918240; Thu, 22 Apr 2021 10:27: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 13MAR9dG034659; Thu, 22 Apr 2021 10:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MAR9dV034658; Thu, 22 Apr 2021 10:27:09 GMT (envelope-from git) Date: Thu, 22 Apr 2021 10:27:09 GMT Message-Id: <202104221027.13MAR9dV034658@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: d2c87140648f - main - Remove USB device ID added by SVN r150701 in the CDC USB ethernet driver. Since then, the FreeBSD USB stack has got proper USB RNDIS support. 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: d2c87140648f61a6f139a2ecdf831e6a08cc4de2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 10:27:09 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c87140648f61a6f139a2ecdf831e6a08cc4de2 commit d2c87140648f61a6f139a2ecdf831e6a08cc4de2 Author: Hans Petter Selasky AuthorDate: 2021-04-22 10:22:39 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-22 10:23:36 +0000 Remove USB device ID added by SVN r150701 in the CDC USB ethernet driver. Since then, the FreeBSD USB stack has got proper USB RNDIS support. PR: 254345 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/net/if_cdce.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index 7bdb81f97b38..96df8b73f8ce 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -268,7 +268,6 @@ static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_GMATE, USB_PRODUCT_GMATE_YP3X00, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, - {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_ETHERNETGADGET, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2501, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5500, CDCE_FLAG_ZAURUS)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5600, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, From owner-dev-commits-src-all@freebsd.org Thu Apr 22 10:37:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01BB35EA4A2; Thu, 22 Apr 2021 10:37: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 4FQv4h6gPsz3hdZ; Thu, 22 Apr 2021 10:37: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 CD1DA18272; Thu, 22 Apr 2021 10:37: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 13MAbOjI047616; Thu, 22 Apr 2021 10:37:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MAbOHd047615; Thu, 22 Apr 2021 10:37:24 GMT (envelope-from git) Date: Thu, 22 Apr 2021 10:37:24 GMT Message-Id: <202104221037.13MAbOHd047615@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: 28af0c4814f5 - main - Add more USB quirks for Garmin devices. Sort the Garmin products while at it. 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: 28af0c4814f5fb8ce047d4ac0bbf26997ac5cc8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 10:37:25 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=28af0c4814f5fb8ce047d4ac0bbf26997ac5cc8f commit 28af0c4814f5fb8ce047d4ac0bbf26997ac5cc8f Author: Hans Petter Selasky AuthorDate: 2021-04-22 10:31:33 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-22 10:35:07 +0000 Add more USB quirks for Garmin devices. Sort the Garmin products while at it. PR: 254664 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/quirk/usb_quirk.c | 2 ++ sys/dev/usb/usbdevs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index e792523dd472..0acc341e385b 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -243,6 +243,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { USB_QUIRK(GARMIN, DAKOTA20, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(GARMIN, FORERUNNER230, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(GARMIN, GPSMAP62S, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), + USB_QUIRK(GARMIN, EDGETOURINGPLUS, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), + USB_QUIRK(GARMIN, INSTINCTSOLAR, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(GENESYS, GL641USB2IDE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 9bd95e03d41c..fcb7cd0953c1 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2255,10 +2255,12 @@ product FUJITSU AH_F401U 0x105b AH-F401U Air H device product FUJITSUSIEMENS SCR 0x0009 Fujitsu-Siemens SCR USB Reader /* Garmin products */ -product GARMIN DAKOTA20 0x23c0 Dakota 20 +product GARMIN IQUE_3600 0x0004 iQue 3600 product GARMIN FORERUNNER230 0x086d ForeRunner 230 +product GARMIN INSTINCTSOLAR 0x0d8a Instinct Solar +product GARMIN DAKOTA20 0x23c0 Dakota 20 product GARMIN GPSMAP62S 0x2459 GPSMAP 62s -product GARMIN IQUE_3600 0x0004 iQue 3600 +product GARMIN EDGETOURINGPLUS 0x26c8 Edge Touring+ /* Gemalto products */ product GEMALTO PROXPU 0x5501 Prox-PU/CU RFID Card Reader From owner-dev-commits-src-all@freebsd.org Thu Apr 22 10:42:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BEBD5EA55F; Thu, 22 Apr 2021 10:42: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 4FQvB62hCdz3hwD; Thu, 22 Apr 2021 10:42: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 4F4401836C; Thu, 22 Apr 2021 10:42: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 13MAg6eM059887; Thu, 22 Apr 2021 10:42:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MAg650059886; Thu, 22 Apr 2021 10:42:06 GMT (envelope-from git) Date: Thu, 22 Apr 2021 10:42:06 GMT Message-Id: <202104221042.13MAg650059886@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: 47bc8fc9ae6b - main - Add more USB quirks for Kingston devices. 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: 47bc8fc9ae6ba7aa708e0d4ee059a377ae707e5a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 10:42:06 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=47bc8fc9ae6ba7aa708e0d4ee059a377ae707e5a commit 47bc8fc9ae6ba7aa708e0d4ee059a377ae707e5a Author: Hans Petter Selasky AuthorDate: 2021-04-22 10:40:17 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-22 10:40:29 +0000 Add more USB quirks for Kingston devices. PR: 253855 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 0acc341e385b..cab6f1b7c074 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -293,6 +293,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(KINGSTON, HYPERX3_0, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), + USB_QUIRK(KINGSTON, DATATRAVELER3_0, 0x0000, 0xffff, UQ_MSC_NO_PREVENT_ALLOW, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(KYOCERA, FINECAM_L3, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_S3X, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index fcb7cd0953c1..d92d98614b07 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2727,6 +2727,7 @@ product KEYSPAN UIA11 0x0202 UIA-11 remote control product KINGSTON XX1 0x0008 Ethernet product KINGSTON KNU101TX 0x000a KNU101TX USB Ethernet product KINGSTON HYPERX3_0 0x162b DT HyperX 3.0 +product KINGSTON DATATRAVELER3_0 0x1666 DataTraveler 3.0 /* Kawasaki products */ product KLSI DUH3E10BT 0x0008 USB Ethernet From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E25995EBB44; Thu, 22 Apr 2021 11:08: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 4FQvmB64b5z3kCl; Thu, 22 Apr 2021 11:08: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 C3D9A18BAF; Thu, 22 Apr 2021 11:08: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 13MB8AnE088248; Thu, 22 Apr 2021 11:08:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8Af7088247; Thu, 22 Apr 2021 11:08:10 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:10 GMT Message-Id: <202104221108.13MB8Af7088247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 76713be0f593 - stable/13 - Avoid double output in fenv_test 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 76713be0f593d7b6cea0696024b804888a61547a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:10 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=76713be0f593d7b6cea0696024b804888a61547a commit 76713be0f593d7b6cea0696024b804888a61547a Author: Alex Richardson AuthorDate: 2021-01-29 09:29:26 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:40:42 +0000 Avoid double output in fenv_test This tests fork()s, so if there is still data in the stdout buffer on fork it will print it again in the child process. This was happening in the CheriBSD CI and caused the test to complain about malformed TAP output. Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28397 (cherry picked from commit 892a05ee3a6abd8d84f46a1b895b1d2bf805d08a) --- lib/msun/tests/fenv_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 9b615b100e8a..62abfefb4a8a 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -539,6 +539,8 @@ test_feholdupdate(void) int main(void) { + /* Avoid double output after fork() */ + setvbuf(stdout, NULL, _IONBF, 0); printf("1..8\n"); init_exceptsets(); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 100E05EBC14; Thu, 22 Apr 2021 11:08: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 4FQvmC73s8z3kRr; Thu, 22 Apr 2021 11:08: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 E563218BB0; Thu, 22 Apr 2021 11:08: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 13MB8Bif088273; Thu, 22 Apr 2021 11:08:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8B0Y088272; Thu, 22 Apr 2021 11:08:11 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:11 GMT Message-Id: <202104221108.13MB8B0Y088272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: b20f358a2de4 - stable/13 - tests/sys/kern/crc32: Check for SSE4.2 before using it 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b20f358a2de4fa442e8650f78187ad19764c7db8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:12 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b20f358a2de4fa442e8650f78187ad19764c7db8 commit b20f358a2de4fa442e8650f78187ad19764c7db8 Author: Alex Richardson AuthorDate: 2021-02-02 09:52:52 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:41:09 +0000 tests/sys/kern/crc32: Check for SSE4.2 before using it This avoids a SIGILL when running these tests on QEMU (which defaults to a basic amd64 CPU without SSE4.2). This commit also tests the table-based implementations in addition to testing the hw-accelerated crc32 versions. Reviewed By: cem, kib, markj Differential Revision: https://reviews.freebsd.org/D28395 (cherry picked from commit 83c20b8a2da04937cf4af127366b3dc92c855784) --- sys/libkern/gsb_crc32.c | 16 ++++++--- sys/sys/gsb_crc32.h | 7 +++- tests/sys/kern/Makefile | 14 ++++---- tests/sys/kern/libkern_crc32.c | 73 ++++++++++++++++++++++++------------------ 4 files changed, 65 insertions(+), 45 deletions(-) diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c index b2f7421c20eb..170ceb3aa710 100644 --- a/sys/libkern/gsb_crc32.c +++ b/sys/libkern/gsb_crc32.c @@ -46,11 +46,11 @@ __FBSDID("$FreeBSD$"); #include +#include #ifdef _KERNEL #include #include -#include #if defined(__amd64__) || defined(__i386__) #include @@ -216,7 +216,10 @@ static const uint32_t crc32Table[256] = { 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L }; -static uint32_t +#ifndef TESTING +static +#endif +uint32_t singletable_crc32c(uint32_t crc, const void *buf, size_t size) { const uint8_t *p = buf; @@ -730,10 +733,13 @@ crc32c_sb8_64_bit(uint32_t crc, return crc; } -static uint32_t +#ifndef TESTING +static +#endif +uint32_t multitable_crc32c(uint32_t crc32c, - const unsigned char *buffer, - unsigned int length) + const void *buffer, + size_t length) { uint32_t to_even_word; diff --git a/sys/sys/gsb_crc32.h b/sys/sys/gsb_crc32.h index c5a42d3d3152..dc126a5258fb 100644 --- a/sys/sys/gsb_crc32.h +++ b/sys/sys/gsb_crc32.h @@ -32,10 +32,10 @@ crc32(const void *buf, size_t size) crc = crc32_raw(buf, size, ~0U); return (crc ^ ~0U); } +#endif uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length); -#endif #if defined(__amd64__) || defined(__i386__) uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); @@ -44,4 +44,9 @@ uint32_t sse42_crc32c(uint32_t, const unsigned char *, unsigned); uint32_t armv8_crc32c(uint32_t, const unsigned char *, unsigned int); #endif +#ifdef TESTING +uint32_t singletable_crc32c(uint32_t, const void *, size_t); +uint32_t multitable_crc32c(uint32_t, const void *, size_t); +#endif + #endif /* !_SYS_GSB_CRC32_H_ */ diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 1806d7ce8597..f350b740b7ea 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -56,15 +56,15 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt -.if ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "aarch64" ATF_TESTS_C+= libkern_crc32 +SRCS.libkern_crc32+= libkern_crc32.c +.PATH: ${SRCTOP}/sys/libkern +SRCS.libkern_crc32+= gsb_crc32.c +CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c -.else -LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S -.endif +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.elif ${MACHINE_CPUARCH} == "aarch64" +SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be diff --git a/tests/sys/kern/libkern_crc32.c b/tests/sys/kern/libkern_crc32.c index 39cb8ca5aeeb..dd9508e1ebd6 100644 --- a/tests/sys/kern/libkern_crc32.c +++ b/tests/sys/kern/libkern_crc32.c @@ -33,10 +33,46 @@ #include -#if !defined(__amd64__) && !defined(__i386__) && !defined(__aarch64__) -#error These tests are not supported on this platform +#if defined(__amd64__) || defined(__i386__) +#include +#include + +static bool +have_sse42(void) +{ + u_int cpu_registers[4]; + + do_cpuid(1, cpu_registers); + + return ((cpu_registers[2] & CPUID2_SSE42) != 0); +} #endif +static void +check_crc32c(uint32_t expected, uint32_t crc32c, const void *buffer, + size_t length) +{ + uint32_t act; + +#if defined(__amd64__) || defined(__i386__) + if (have_sse42()) { + act = sse42_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "sse42_crc32c expected 0x%08x, got 0x%08x", expected, act); + } +#elif defined(__aarch64__) + act = armv8_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "armv8_crc32c expected 0x%08x, got 0x%08x", expected, act); +#endif + act = singletable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "singletable_crc32c expected 0x%08x, got 0x%08x", expected, act); + act = multitable_crc32c(crc32c, buffer, length); + ATF_CHECK_EQ_MSG(expected, act, + "multitable_crc32c expected 0x%08x, got 0x%08x", expected, act); +} + ATF_TC_WITHOUT_HEAD(crc32c_basic_correctness); ATF_TC_BODY(crc32c_basic_correctness, tc) { @@ -77,21 +113,11 @@ ATF_TC_BODY(crc32c_basic_correctness, tc) 0xfd562dc3, }; size_t i; - uint32_t act; ATF_REQUIRE(nitems(inputs) == nitems(results)); for (i = 0; i < nitems(inputs); i++) { -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#else - act = armv8_crc32c(~0, (const void *)&inputs[i], - sizeof(inputs[0])); -#endif - ATF_REQUIRE_MSG(act == results[i], - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)inputs[i], - results[i], act); + check_crc32c(results[i], ~0u, &inputs[i], sizeof(inputs[0])); } } @@ -102,20 +128,10 @@ ATF_TC_BODY(crc32c_alignment, tc) const uint32_t result = 0x2ce33ede; unsigned char buf[15]; size_t i; - uint32_t act; - for (i = 1; i < 8; i++) { memcpy(&buf[i], &input, sizeof(input)); - -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#else - act = armv8_crc32c(~0, (const void *)&buf[i], sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, - "crc32c(0x%jx) = 0x%08x, got 0x%08x", (uintmax_t)input, - result, act); + check_crc32c(result, ~0u, &buf[i], sizeof(input)); } } @@ -127,15 +143,8 @@ ATF_TC_BODY(crc32c_trailing_bytes, tc) 0xd4, 0x4, 0x5e, 0xa9, 0xb3 }; const uint32_t result = 0xec638d62; - uint32_t act; -#if defined(__amd64__) || defined(__i386__) - act = sse42_crc32c(~0, input, sizeof(input)); -#else - act = armv8_crc32c(~0, input, sizeof(input)); -#endif - ATF_REQUIRE_MSG(act == result, "expected 0x%08x, got 0x%08x", result, - act); + check_crc32c(result, ~0u, input, sizeof(input)); } ATF_TP_ADD_TCS(tp) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D3FB5EB964; Thu, 22 Apr 2021 11:08: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 4FQvmF6Rrnz3kRy; Thu, 22 Apr 2021 11:08:13 +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 0292018879; Thu, 22 Apr 2021 11:08: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 13MB8CO6088297; Thu, 22 Apr 2021 11:08:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8CFs088296; Thu, 22 Apr 2021 11:08:12 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:12 GMT Message-Id: <202104221108.13MB8CFs088296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 4ee7ac8dc525 - stable/13 - Fix build with read-only source dir after 83c20b8a2da0 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ee7ac8dc525d0253d90fef8b1882eb4cdef801c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:14 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=4ee7ac8dc525d0253d90fef8b1882eb4cdef801c commit 4ee7ac8dc525d0253d90fef8b1882eb4cdef801c Author: Alex Richardson AuthorDate: 2021-02-03 09:29:08 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:41:20 +0000 Fix build with read-only source dir after 83c20b8a2da0 I changed the Makefile to use SRCS instead of LDADD, but since there is still and absolute path to the source the .o file was created inside the source directory instead of the build directory. It would be nice if this was an error/warning by default, but for now just fix this issue by using .PATH and the base name of the file. Reported by: cy, peterj (cherry picked from commit 8b820df156e065f48857dca89a89462074659e14) --- tests/sys/kern/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index f350b740b7ea..6746812d9b4a 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -62,9 +62,11 @@ SRCS.libkern_crc32+= libkern_crc32.c SRCS.libkern_crc32+= gsb_crc32.c CFLAGS.libkern_crc32+= -DTESTING .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c +.PATH: ${SRCTOP}/sys/libkern/x86 +SRCS.libkern_crc32+= crc32_sse42.c .elif ${MACHINE_CPUARCH} == "aarch64" -SRCS.libkern_crc32+= ${SRCTOP}/sys/libkern/arm64/crc32c_armv8.S +.PATH: ${SRCTOP}/sys/libkern/arm64 +SRCS.libkern_crc32+= crc32c_armv8.S .endif # subr_unit.c contains functions whose prototypes lie in headers that cannot be From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A21785EB965; Thu, 22 Apr 2021 11:08: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 4FQvmG2BhTz3kYK; Thu, 22 Apr 2021 11:08: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 3373B1887A; Thu, 22 Apr 2021 11:08: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 13MB8E9s088318; Thu, 22 Apr 2021 11:08:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8ETx088317; Thu, 22 Apr 2021 11:08:14 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:14 GMT Message-Id: <202104221108.13MB8ETx088317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: c2ce92c39615 - stable/13 - sbin/bectl: Skip tests if sparse files are not supported 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c2ce92c39615ed259a7483d402aba8de30824923 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:14 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c2ce92c39615ed259a7483d402aba8de30824923 commit c2ce92c39615ed259a7483d402aba8de30824923 Author: Alex Richardson AuthorDate: 2021-02-03 09:31:32 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:41:29 +0000 sbin/bectl: Skip tests if sparse files are not supported The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463 (cherry picked from commit d6f4e1a8973daff2ffe4480b66c973562982ffc7) --- sbin/bectl/tests/bectl_test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 36c92235b6d8..221fe21e29ed 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -49,6 +49,13 @@ bectl_create_setup() atf_check test -n "$zpool" kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -R ${mnt} ${zpool} ${disk} From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB5495EBD81; Thu, 22 Apr 2021 11:08: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 4FQvmJ45Xlz3kgr; Thu, 22 Apr 2021 11:08: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 6790E1887B; Thu, 22 Apr 2021 11:08: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 13MB8Gnd088360; Thu, 22 Apr 2021 11:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8GZb088359; Thu, 22 Apr 2021 11:08:16 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:16 GMT Message-Id: <202104221108.13MB8GZb088359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: f6742fbfb5f6 - stable/13 - Update libm tests from NetBSD 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6742fbfb5f6d1651d88ce0952b0ec58c5a735a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:17 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f6742fbfb5f6d1651d88ce0952b0ec58c5a735a1 commit f6742fbfb5f6d1651d88ce0952b0ec58c5a735a1 Author: Alex Richardson AuthorDate: 2021-02-22 17:19:06 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:41:45 +0000 Update libm tests from NetBSD I did this without a full vendor update since that would cause too many conflicts. Since these files now almost match the NetBSD sources the next git subtree merge should work just fine. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28797 (cherry picked from commit 1ec3feb64826d2a43d41e74684690985bf20e71c) --- contrib/netbsd-tests/lib/libm/t_acos.c | 4 +- contrib/netbsd-tests/lib/libm/t_asin.c | 35 ++++-- contrib/netbsd-tests/lib/libm/t_bit.c | 102 +++++++++++++++ contrib/netbsd-tests/lib/libm/t_cabsl.cxx | 66 ++++++++++ contrib/netbsd-tests/lib/libm/t_cbrt.c | 95 +++++++++----- contrib/netbsd-tests/lib/libm/t_cos.c | 196 ++++++++++++++++++++++++----- contrib/netbsd-tests/lib/libm/t_cosh.c | 58 +++++---- contrib/netbsd-tests/lib/libm/t_exp.c | 52 ++++---- contrib/netbsd-tests/lib/libm/t_fe_round.c | 138 +++++++++++++++++++- contrib/netbsd-tests/lib/libm/t_fenv.c | 12 +- contrib/netbsd-tests/lib/libm/t_fmod.c | 8 +- contrib/netbsd-tests/lib/libm/t_ilogb.c | 8 +- contrib/netbsd-tests/lib/libm/t_ldexp.c | 37 +++--- contrib/netbsd-tests/lib/libm/t_libm.h | 6 +- contrib/netbsd-tests/lib/libm/t_log.c | 18 +-- contrib/netbsd-tests/lib/libm/t_round.c | 55 +++++++- contrib/netbsd-tests/lib/libm/t_scalbn.c | 58 ++++++--- contrib/netbsd-tests/lib/libm/t_sin.c | 91 +++++++++----- contrib/netbsd-tests/lib/libm/t_sinh.c | 56 ++++----- contrib/netbsd-tests/lib/libm/t_sqrt.c | 84 ++++++++----- contrib/netbsd-tests/lib/libm/t_tan.c | 86 +++++++++---- lib/msun/tests/Makefile | 2 + 22 files changed, 946 insertions(+), 321 deletions(-) diff --git a/contrib/netbsd-tests/lib/libm/t_acos.c b/contrib/netbsd-tests/lib/libm/t_acos.c index f051fb64df42..973f0245cdab 100644 --- a/contrib/netbsd-tests/lib/libm/t_acos.c +++ b/contrib/netbsd-tests/lib/libm/t_acos.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_acos.c,v 1.10 2014/03/05 20:14:46 dsl Exp $ */ +/* $NetBSD: t_acos.c,v 1.11 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ ATF_LIBM_TEST(acos_inrange, "Test acos/acosf(x) for some valid values") { 0, M_PI / 2, }, { 0.1, 1.470628905633337, }, { 0.5, 1.047197551196598, }, - { 0.99, 0.141539473324427, }, + { 0.99, 0.1415394733244273, }, }; unsigned int i; diff --git a/contrib/netbsd-tests/lib/libm/t_asin.c b/contrib/netbsd-tests/lib/libm/t_asin.c index 06de85216429..213b1f875439 100644 --- a/contrib/netbsd-tests/lib/libm/t_asin.c +++ b/contrib/netbsd-tests/lib/libm/t_asin.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_asin.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_asin.c,v 1.4 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,6 +30,7 @@ */ #include +#include #include static const struct { @@ -117,13 +118,14 @@ ATF_TC_HEAD(asin_inrange, tc) ATF_TC_BODY(asin_inrange, tc) { - const double eps = 1.0e-15; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - y = asin(values[i].x); - if (fabs(y - values[i].y) > eps) + double x = values[i].x; + double y = values[i].y; + + if (!(fabs((asin(x) - y)/y) <= eps)) atf_tc_fail_nonfatal("asin(%g) != %g", values[i].x, values[i].y); } @@ -230,16 +232,25 @@ ATF_TC_HEAD(asinf_inrange, tc) ATF_TC_BODY(asinf_inrange, tc) { - const float eps = 1.0e-6; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - if (fabs(asinf(x) - y) > eps) - atf_tc_fail_nonfatal("asinf(%g) != %g", x, y); + float x = values[i].x; + float y = values[i].y; + +#ifdef __NetBSD__ + if (fabs(x) == 0.5) + atf_tc_expect_fail("asinf is busted," + " gives ~2ulp error"); +#endif + if (!(fabsf((asinf(x) - y)/y) <= eps)) { + atf_tc_fail_nonfatal("asinf(%.8g) = %.8g != %.8g," + " error=~%.1fulp", + x, asinf(x), y, fabsf(((asinf(x) - y)/y)/eps)); + } + if (fabs(x) == 0.5) + atf_tc_expect_pass(); } } diff --git a/contrib/netbsd-tests/lib/libm/t_bit.c b/contrib/netbsd-tests/lib/libm/t_bit.c new file mode 100644 index 000000000000..b6e0218f601c --- /dev/null +++ b/contrib/netbsd-tests/lib/libm/t_bit.c @@ -0,0 +1,102 @@ +/* $NetBSD: t_bit.c,v 1.1 2019/04/26 08:52:16 maya Exp $ */ + +/* + * Written by Maya Rashish + * Public domain. + * + * Testing signbit{,f,l} function correctly + */ + +#include +#include +#include +#include +#include +#include + +static const struct { + double input; + bool is_negative; +} values[] = { + { -1, true}, + { -123, true}, + { -123E6, true}, +#ifdef INFINITY + { -INFINITY, true}, + { INFINITY, false}, +#endif + { 123E6, false}, + { 0, false}, + { -FLT_MIN, true}, + { FLT_MIN, false}, + /* + * Cannot be accurately represented as float, + * but sign should be preserved + */ + { DBL_MAX, false}, + { -DBL_MAX, true}, +}; + +#ifdef __HAVE_LONG_DOUBLE +static const struct { + long double input; + bool is_negative; +} ldbl_values[] = { + { -LDBL_MIN, true}, + { LDBL_MIN, false}, + { LDBL_MAX, false}, + { -LDBL_MAX, true}, +}; +#endif + +ATF_TC(signbit); +ATF_TC_HEAD(signbit, tc) +{ + atf_tc_set_md_var(tc, "descr","Check that signbit functions correctly"); +} + +ATF_TC_BODY(signbit, tc) +{ + double iterator_d; + float iterator_f; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + iterator_d = values[i].input; + iterator_f = (float) values[i].input; + if (signbit(iterator_f) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitf is wrong" + " about the sign of %f", __func__, + __LINE__, i, iterator_f); + if (signbit(iterator_d) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbit is wrong" + "about the sign of %f", __func__, + __LINE__,i, iterator_d); + +#ifdef __HAVE_LONG_DOUBLE + long double iterator_l = values[i].input; + if (signbit(iterator_l) != values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitl is wrong" + " about the sign of %Lf", __func__, + __LINE__, i, iterator_l); +#endif + } + +#ifdef __HAVE_LONG_DOUBLE + for (unsigned int i = 0; i < __arraycount(ldbl_values); i++) { + if (signbit(ldbl_values[i].input) != ldbl_values[i].is_negative) + atf_tc_fail("%s:%d iteration %d signbitl is" + "wrong about the sign of %Lf", + __func__, __LINE__, i, + ldbl_values[i].input); + } +#endif + +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, signbit); + + return atf_no_error(); +} diff --git a/contrib/netbsd-tests/lib/libm/t_cabsl.cxx b/contrib/netbsd-tests/lib/libm/t_cabsl.cxx new file mode 100644 index 000000000000..7dd119b1da3b --- /dev/null +++ b/contrib/netbsd-tests/lib/libm/t_cabsl.cxx @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Maya Rashish + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/* + * Test that C++ "cabsl" is usable. PR lib/50646 + */ + +#include +#include + +ATF_TEST_CASE(cabsl); +ATF_TEST_CASE_HEAD(cabsl) +{ + set_md_var("descr", "Check that cabsl is usable from C++"); +} +ATF_TEST_CASE_BODY(cabsl) +{ + int sum = 0; + +#ifdef __HAVE_LONG_DOUBLE + std::complex cld(3.0,4.0); + sum += std::abs(cld); +#endif + std::complex cd(3.0,4.0); + sum += std::abs(cd); + + std::complex cf(3.0,4.0); + sum += std::abs(cf); + +#ifdef __HAVE_LONG_DOUBLE + ATF_REQUIRE_EQ(sum, 3*5); +#else + ATF_REQUIRE_EQ(sum, 2*5); +#endif +} + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, cabsl); +} diff --git a/contrib/netbsd-tests/lib/libm/t_cbrt.c b/contrib/netbsd-tests/lib/libm/t_cbrt.c index 08e9faeb145c..639bc7e06517 100644 --- a/contrib/netbsd-tests/lib/libm/t_cbrt.c +++ b/contrib/netbsd-tests/lib/libm/t_cbrt.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cbrt.c,v 1.5 2018/11/15 05:14:20 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_cbrt.c,v 1.3 2014/03/03 10:39:08 martin Exp $"); +__RCSID("$NetBSD: t_cbrt.c,v 1.5 2018/11/15 05:14:20 riastradh Exp $"); #include +#include #include #include @@ -61,18 +62,26 @@ ATF_TC_HEAD(cbrt_pow, tc) ATF_TC_BODY(cbrt_pow, tc) { const double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const double eps = 1.0e-14; - double y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const double eps = 2*DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(x); i++) { - - y = cbrt(x[i]); - z = pow(x[i], 1.0 / 3.0); - - if (fabs(y - z) > eps) - atf_tc_fail_nonfatal("cbrt(%0.03f) != " - "pow(%0.03f, 1/3)\n", x[i], x[i]); + double x_cbrt = cbrt(x[i]); + double x_pow13 = pow(x[i], 1.0 / 3.0); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabs((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrt(%.17g) = %.17g != " + "pow(%.17g, 1/3) = %.17g\n", + x[i], x_cbrt, x[i], x_pow13); + } } } @@ -162,18 +171,27 @@ ATF_TC_HEAD(cbrtf_powf, tc) ATF_TC_BODY(cbrtf_powf, tc) { const float x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const float eps = 1.0e-5; - float y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const float eps = 2*FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(x); i++) { - - y = cbrtf(x[i]); - z = powf(x[i], 1.0 / 3.0); - - if (fabsf(y - z) > eps) - atf_tc_fail_nonfatal("cbrtf(%0.03f) != " - "powf(%0.03f, 1/3)\n", x[i], x[i]); + float x_cbrt = cbrtf(x[i]); + float x_pow13 = powf(x[i], 1.0 / 3.0); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabsf((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrtf(%.9g) = %.9g. != " + "powf(%.9g, 1/3) = %.9g\n", + (double)x[i], (double)x_cbrt, + (double)x[i], (double)x_pow13); + } } } @@ -264,27 +282,42 @@ ATF_TC_HEAD(cbrtl_powl, tc) ATF_TC_BODY(cbrtl_powl, tc) { const long double x[] = { 0.0, 0.005, 1.0, 99.0, 123.123, 9999.0 }; - const long double eps = 1.0e-15; - long double y, z; + /* Neither cbrt nor pow is required to be correctly rounded. */ + const long double eps = 2*LDBL_EPSILON; size_t i; #if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 && \ __clang_major__ < 10 && __FreeBSD_cc_version < 1300002 atf_tc_expect_fail("test fails with clang 7-9 - bug 234040"); #endif - for (i = 0; i < __arraycount(x); i++) { - - y = cbrtl(x[i]); + long double x_cbrt = cbrtl(x[i]); #ifdef __FreeBSD__ - z = powl(x[i], (long double)1.0 / 3.0); + /* + * NetBSD doesn't have a real powl/cbrtl implementation, they + * just call the double version. On FreeBSD we have a real + * powl implementation so we have to cast the second argument + * to long double before dividing to get a more precise + * approximation of 1/3. + * TODO: upstream this diff. + */ + long double x_pow13 = powl(x[i], (long double)1.0 / 3.0); #else - z = powl(x[i], 1.0 / 3.0); + long double x_pow13 = powl(x[i], 1.0 / 3.0); #endif - - if (fabsl(y - z) > eps * fabsl(1 + x[i])) - atf_tc_fail_nonfatal("cbrtl(%0.03Lf) != " - "powl(%0.03Lf, 1/3)\n", x[i], x[i]); + bool ok; + + if (x[i] == 0) { + ok = (x_cbrt == x_pow13); + } else { + ok = (fabsl((x_cbrt - x_pow13)/x_cbrt) <= eps); + } + + if (!ok) { + atf_tc_fail_nonfatal("cbrtl(%.35Lg) = %.35Lg != " + "powl(%.35Lg, 1/3) = %.35Lg\n", + x[i], x_cbrt, x[i], x_pow13); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_cos.c b/contrib/netbsd-tests/lib/libm/t_cos.c index d99d60810eeb..ca5f0aab7ffa 100644 --- a/contrib/netbsd-tests/lib/libm/t_cos.c +++ b/contrib/netbsd-tests/lib/libm/t_cos.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cos.c,v 1.4 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cos.c,v 1.9 2019/05/27 00:10:36 maya Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,31 +29,138 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include +#include #include static const struct { int angle; double x; double y; + float fy; } angles[] = { - { -180, -3.141592653589793, -1.0000000000000000 }, - { -135, -2.356194490192345, -0.7071067811865476 }, - { -90, -1.570796326794897, 0.0000000000000000 }, - { -45, -0.785398163397448, 0.7071067811865476 }, - { 0, 0.000000000000000, 1.0000000000000000 }, - { 30, 0.523598775598299, 0.8660254037844386 }, - { 45, 0.785398163397448, 0.7071067811865476 }, - { 60, 1.047197551196598, 0.5000000000000000 }, - { 90, 1.570796326794897, 0.0000000000000000 }, - { 120, 2.094395102393195, -0.5000000000000000 }, - { 135, 2.356194490192345, -0.7071067811865476 }, - { 150, 2.617993877991494, -0.8660254037844386 }, - { 180, 3.141592653589793, -1.0000000000000000 }, - { 270, 4.712388980384690, 0.0000000000000000 }, - { 360, 6.283185307179586, 1.0000000000000000 } + { -180, -3.141592653589793, -1.0000000000000000, 999 }, + { -135, -2.356194490192345, -0.7071067811865476, 999 }, + { -90, -1.5707963267948966, 6.123233995736766e-17, -4.3711388e-08 }, + { -90, -1.5707963267948968, -1.6081226496766366e-16, -4.3711388e-08 }, + { -45, -0.785398163397448, 0.7071067811865478, 999 }, + { 0, 0.000000000000000, 1.0000000000000000, 999 }, + { 30, 0.523598775598299, 0.8660254037844386, 999 }, + { 45, 0.785398163397448, 0.7071067811865478, 999 }, + { 60, 1.0471975511965976, 0.5000000000000001, 999 }, + { 60, 1.0471975511965979, 0.4999999999999999, 999 }, + { 90, 1.570796326794897, -3.8285686989269494e-16, -4.3711388e-08 }, + { 120, 2.0943951023931953, -0.4999999999999998, 999 }, + { 120, 2.0943951023931957, -0.5000000000000002, 999 }, + { 135, 2.356194490192345, -0.7071067811865476, 999 }, + { 150, 2.617993877991494, -0.8660254037844386, 999 }, + { 180, 3.141592653589793, -1.0000000000000000, 999 }, + { 270, 4.712388980384690, -1.8369701987210297e-16, 1.1924881e-08 }, + { 360, 6.283185307179586, 1.0000000000000000, 999 }, }; +#ifdef __HAVE_LONG_DOUBLE +/* + * cosl(3) + */ +ATF_TC(cosl_angles); +ATF_TC_HEAD(cosl_angles, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test some selected angles"); +} + +ATF_TC_BODY(cosl_angles, tc) +{ + /* + * XXX The given data is for double, so take that + * into account and expect less precise results.. + */ + const long double eps = DBL_EPSILON; + size_t i; + + for (i = 0; i < __arraycount(angles); i++) { + int deg = angles[i].angle; + long double theta = angles[i].x; + long double cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabsl((cosl(theta) - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cos(%d deg = %.17Lg) = %.17Lg" + " != %.17Lg", + deg, theta, cosl(theta), cos_theta); + } + } +} + +ATF_TC(cosl_nan); +ATF_TC_HEAD(cosl_nan, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(NaN) == NaN"); +} + +ATF_TC_BODY(cosl_nan, tc) +{ + const long double x = 0.0L / 0.0L; + + ATF_CHECK(isnan(x) != 0); + ATF_CHECK(isnan(cosl(x)) != 0); +} + +ATF_TC(cosl_inf_neg); +ATF_TC_HEAD(cosl_inf_neg, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(-Inf) == NaN"); +} + +ATF_TC_BODY(cosl_inf_neg, tc) +{ + const long double x = -1.0L / 0.0L; + + ATF_CHECK(isnan(cosl(x)) != 0); +} + +ATF_TC(cosl_inf_pos); +ATF_TC_HEAD(cosl_inf_pos, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(+Inf) == NaN"); +} + +ATF_TC_BODY(cosl_inf_pos, tc) +{ + const long double x = 1.0L / 0.0L; + + ATF_CHECK(isnan(cosl(x)) != 0); +} + + +ATF_TC(cosl_zero_neg); +ATF_TC_HEAD(cosl_zero_neg, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(-0.0) == 1.0"); +} + +ATF_TC_BODY(cosl_zero_neg, tc) +{ + const long double x = -0.0L; + + ATF_CHECK(cosl(x) == 1.0); +} + +ATF_TC(cosl_zero_pos); +ATF_TC_HEAD(cosl_zero_pos, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test cosl(+0.0) == 1.0"); +} + +ATF_TC_BODY(cosl_zero_pos, tc) +{ + const long double x = 0.0L; + + ATF_CHECK(cosl(x) == 1.0); +} +#endif + /* * cos(3) */ @@ -65,14 +172,20 @@ ATF_TC_HEAD(cos_angles, tc) ATF_TC_BODY(cos_angles, tc) { - const double eps = 1.0e-15; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(angles); i++) { - - if (fabs(cos(angles[i].x) - angles[i].y) > eps) - atf_tc_fail_nonfatal("cos(%d deg) != %0.01f", - angles[i].angle, angles[i].y); + int deg = angles[i].angle; + double theta = angles[i].x; + double cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabs((cos(theta) - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cos(%d deg = %.17g) = %.17g" + " != %.17g", + deg, theta, cos(theta), cos_theta); + } } } @@ -154,18 +267,33 @@ ATF_TC_HEAD(cosf_angles, tc) ATF_TC_BODY(cosf_angles, tc) { - const float eps = 1.0e-7; - float x, y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(angles); i++) { - - x = angles[i].x; - y = angles[i].y; - - if (fabsf(cosf(x) - y) > eps) - atf_tc_fail_nonfatal("cosf(%d deg) != %0.01f", - angles[i].angle, angles[i].y); + int deg = angles[i].angle; + float theta = angles[i].x; + float cos_theta = angles[i].fy; + + /* + * Force rounding to float even if FLT_EVAL_METHOD=2, + * as is the case on i386. + * + * The volatile should not be necessary, by C99 Sec. + * 5.2.4.2.2. para. 8 on p. 24 which specifies that + * assignment and cast remove all extra range and precision, + * but seems to be needed to work around a compiler bug. + */ + volatile float result = cosf(theta); + + if (cos_theta == 999) + cos_theta = angles[i].y; + + assert(cos_theta != 0); + if (!(fabsf((result - cos_theta)/cos_theta) <= eps)) { + atf_tc_fail_nonfatal("cosf(%d deg = %.8g) = %.8g" + " != %.8g", deg, theta, result, cos_theta); + } } } @@ -244,6 +372,14 @@ ATF_TC_BODY(cosf_zero_pos, tc) ATF_TP_ADD_TCS(tp) { +#ifdef __HAVE_LONG_DOUBLE + ATF_TP_ADD_TC(tp, cosl_angles); + ATF_TP_ADD_TC(tp, cosl_nan); + ATF_TP_ADD_TC(tp, cosl_inf_neg); + ATF_TP_ADD_TC(tp, cosl_inf_pos); + ATF_TP_ADD_TC(tp, cosl_zero_neg); + ATF_TP_ADD_TC(tp, cosl_zero_pos); +#endif ATF_TP_ADD_TC(tp, cos_angles); ATF_TP_ADD_TC(tp, cos_nan); diff --git a/contrib/netbsd-tests/lib/libm/t_cosh.c b/contrib/netbsd-tests/lib/libm/t_cosh.c index 3f998de761bb..aac3a39b0236 100644 --- a/contrib/netbsd-tests/lib/libm/t_cosh.c +++ b/contrib/netbsd-tests/lib/libm/t_cosh.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_cosh.c,v 1.7 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,28 +29,28 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_cosh.c,v 1.6 2014/03/03 10:39:08 martin Exp $"); +__RCSID("$NetBSD: t_cosh.c,v 1.7 2018/11/07 03:59:36 riastradh Exp $"); #include +#include #include #include static const struct { double x; double y; - double e; } values[] = { - { -10, 11013.23292010332, 1e4, }, - { -2, 3.762195691083631, 1, }, - { -1, 1.543080634815244, 1, }, - { -0.05, 1.001250260438369, 1, }, - { -0.001, 1.000000500000042, 1, }, - { 0, 1, 1, }, - { 0.001, 1.000000500000042, 1, }, - { 0.05, 1.001250260438369, 1, }, - { 1, 1.543080634815244, 1, }, - { 2, 3.762195691083631, 1, }, - { 10, 11013.23292010332, 1e4, }, + { -10, 11013.232920103323, }, + { -2, 3.762195691083631, }, + { -1, 1.543080634815244, }, + { -0.05, 1.001250260438369, }, + { -0.001, 1.0000005000000418, }, + { 0, 1, }, + { 0.001, 1.0000005000000418, }, + { 0.05, 1.001250260438369, }, + { 1, 1.543080634815244, }, + { 2, 3.762195691083631, }, + { 10, 11013.232920103323, }, }; /* @@ -64,18 +64,17 @@ ATF_TC_HEAD(cosh_inrange, tc) ATF_TC_BODY(cosh_inrange, tc) { - double eps; - double x; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - eps = 1e-15 * values[i].e; + double x = values[i].x; + double cosh_x = values[i].y; - if (fabs(cosh(x) - y) > eps) - atf_tc_fail_nonfatal("cosh(%g) != %g\n", x, y); + if (!(fabs((cosh(x) - cosh_x)/cosh_x) <= eps)) { + atf_tc_fail_nonfatal("cosh(%.17g) = %.17g != %.17g\n", + x, cosh(x), cosh_x); + } } } @@ -162,18 +161,17 @@ ATF_TC_HEAD(coshf_inrange, tc) ATF_TC_BODY(coshf_inrange, tc) { - float eps; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(values); i++) { - x = values[i].x; - y = values[i].y; - eps = 1e-6 * values[i].e; + float x = values[i].x; + float cosh_x = values[i].y; - if (fabsf(coshf(x) - y) > eps) - atf_tc_fail_nonfatal("coshf(%g) != %g\n", x, y); + if (!(fabsf((coshf(x) - cosh_x)/cosh_x) <= eps)) { + atf_tc_fail_nonfatal("coshf(%.17g) = %.17g != %.17g\n", + x, coshf(x), cosh_x); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_exp.c b/contrib/netbsd-tests/lib/libm/t_exp.c index 0eb6412b566e..acef4c0e91de 100644 --- a/contrib/netbsd-tests/lib/libm/t_exp.c +++ b/contrib/netbsd-tests/lib/libm/t_exp.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_exp.c,v 1.8 2014/10/07 16:53:44 gson Exp $ */ +/* $NetBSD: t_exp.c,v 1.9 2018/11/07 03:59:36 riastradh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -30,6 +30,7 @@ */ #include +#include #include #include "t_libm.h" @@ -37,17 +38,16 @@ static const struct { double x; double y; - double e; } exp_values[] = { - { -10, 0.4539992976248485e-4, 1e-4, }, - { -5, 0.6737946999085467e-2, 1e-2, }, - { -1, 0.3678794411714423, 1e-1, }, - { -0.1, 0.9048374180359595, 1e-1, }, - { 0, 1.0000000000000000, 1, }, - { 0.1, 1.1051709180756477, 1, }, - { 1, 2.7182818284590452, 1, }, - { 5, 148.41315910257660, 1e2, }, - { 10, 22026.465794806718, 1e4, }, + { -10, 0.4539992976248485e-4, }, + { -5, 0.6737946999085467e-2, }, + { -1, 0.3678794411714423, }, + { -0.1, 0.9048374180359595, }, + { 0, 1.0000000000000000, }, + { 0.1, 1.1051709180756477, }, + { 1, 2.7182818284590452, }, + { 5, 148.41315910257660, }, + { 10, 22026.465794806718, }, }; /* @@ -238,18 +238,17 @@ ATF_TC_HEAD(exp_product, tc) ATF_TC_BODY(exp_product, tc) { - double eps; - double x; - double y; + const double eps = DBL_EPSILON; size_t i; for (i = 0; i < __arraycount(exp_values); i++) { - x = exp_values[i].x; - y = exp_values[i].y; - eps = 1e-15 * exp_values[i].e; + double x = exp_values[i].x; + double e_x = exp_values[i].y; - if (fabs(exp(x) - y) > eps) - atf_tc_fail_nonfatal("exp(%0.01f) != %18.18e", x, y); + if (!(fabs((exp(x) - e_x)/e_x) <= eps)) { + atf_tc_fail_nonfatal("exp(%.17g) = %.17g != %.17g", + x, exp(x), e_x); + } } } @@ -336,18 +335,17 @@ ATF_TC_HEAD(expf_product, tc) ATF_TC_BODY(expf_product, tc) { - float eps; - float x; - float y; + const float eps = FLT_EPSILON; size_t i; for (i = 0; i < __arraycount(exp_values); i++) { - x = exp_values[i].x; - y = exp_values[i].y; - eps = 1e-6 * exp_values[i].e; + float x = exp_values[i].x; + float e_x = exp_values[i].y; - if (fabsf(expf(x) - y) > eps) - atf_tc_fail_nonfatal("expf(%0.01f) != %18.18e", x, y); + if (!(fabsf((expf(x) - e_x)/e_x) <= eps)) { + atf_tc_fail_nonfatal("expf(%.8g) = %.8g != %.8g", + x, exp(x), e_x); + } } } diff --git a/contrib/netbsd-tests/lib/libm/t_fe_round.c b/contrib/netbsd-tests/lib/libm/t_fe_round.c index fe805b4f86b8..33da289eb156 100644 --- a/contrib/netbsd-tests/lib/libm/t_fe_round.c +++ b/contrib/netbsd-tests/lib/libm/t_fe_round.c @@ -89,7 +89,97 @@ ATF_TC_BODY(fe_round, tc) (fegetround() == values[i].round_mode), "Didn't get the same rounding mode out!\n" "(index %d) fed in %d rounding mode, got %d out\n", - i, fegetround(), values[i].round_mode); + i, values[i].round_mode, fegetround()); + } +} + +ATF_TC(fe_nearbyint); +ATF_TC_HEAD(fe_nearbyint, tc) +{ + atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using nearbyint"); +} + +ATF_TC_BODY(fe_nearbyint, tc) +{ + double received; + + for (unsigned int i = 0; i < __arraycount(values); i++) { + fesetround(values[i].round_mode); + + received = nearbyint(values[i].input); + ATF_CHECK_MSG( + (fabs(received - values[i].expected) < EPSILON), + "nearbyint rounding wrong, difference too large\n" + "input: %f (index %d): got %f, expected %ld\n", + values[i].input, i, received, values[i].expected); + + /* Do we get the same rounding mode out? */ + ATF_CHECK_MSG( + (fegetround() == values[i].round_mode), + "Didn't get the same rounding mode out!\n" + "(index %d) fed in %d rounding mode, got %d out\n", + i, values[i].round_mode, fegetround()); + } +} + +static const struct { + double input; + double toward; + double expected; +} values2[] = { + { 10.0, 11.0, 10.0 }, + { -5.0, -6.0, -5.0 }, +}; + +ATF_TC(fe_nextafter); +ATF_TC_HEAD(fe_nextafter, tc) +{ + atf_tc_set_md_var(tc, "descr", "Checking IEEE 754 rounding using nextafter()"); +} + +ATF_TC_BODY(fe_nextafter, tc) +{ + double received; + int res; + + for (unsigned int i = 0; i < __arraycount(values2); i++) { + received = nextafter(values2[i].input, values2[i].toward); + if (values2[i].input < values2[i].toward) { + res = (received > values2[i].input); + } else { + res = (received < values2[i].input); + } + ATF_CHECK_MSG( + res && (fabs(received - values2[i].expected) < EPSILON), + "nextafter() rounding wrong, difference too large\n" + "input: %f (index %d): got %f, expected %f, res %d\n", + values2[i].input, i, received, values2[i].expected, res); + } *** 1055 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C2F85EBC2D; Thu, 22 Apr 2021 11:08: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 4FQvmH69Q4z3kbP; Thu, 22 Apr 2021 11:08:15 +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 5339118BB1; Thu, 22 Apr 2021 11:08: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 13MB8FXn088339; Thu, 22 Apr 2021 11:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8FLI088338; Thu, 22 Apr 2021 11:08:15 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:15 GMT Message-Id: <202104221108.13MB8FLI088338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 436fcd12f20d - stable/13 - du_test: Skip three tests if sparse files are not supported 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 436fcd12f20d80cbbbaeb55b8a639f02e6372929 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:16 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=436fcd12f20d80cbbbaeb55b8a639f02e6372929 commit 436fcd12f20d80cbbbaeb55b8a639f02e6372929 Author: Alex Richardson AuthorDate: 2021-02-03 16:07:05 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:41:39 +0000 du_test: Skip three tests if sparse files are not supported This fixes running the du tests with /tmp as tmpfs (which is what we do in the CheriBSD CI). Obtained from: CheriBSD Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28398 (cherry picked from commit 39a1f858ad735ef816a9b1fb7eeade2c6802eb98) --- usr.bin/du/tests/du_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 1c283b58fef4..5106307ad66a 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -24,6 +24,17 @@ # # $FreeBSD$ +require_sparse_file_support() +{ + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi +} + atf_test_case A_flag A_flag_head() { @@ -31,6 +42,7 @@ A_flag_head() } A_flag_body() { + require_sparse_file_support # XXX: compressed volumes? atf_check truncate -s 10g sparse.file atf_check -o inline:'1\tsparse.file\n' du -g sparse.file @@ -103,6 +115,7 @@ g_flag_head() } g_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C @@ -117,6 +130,7 @@ h_flag_head() } h_flag_body() { + require_sparse_file_support atf_check truncate -s 1k A atf_check truncate -s 1m B atf_check truncate -s 1g C From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFE685EBD91; Thu, 22 Apr 2021 11:08: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 4FQvmL6WsQz3kjJ; Thu, 22 Apr 2021 11:08: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 AB2DA18BB2; Thu, 22 Apr 2021 11:08: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 13MB8IAW088408; Thu, 22 Apr 2021 11:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8IFS088407; Thu, 22 Apr 2021 11:08:18 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:18 GMT Message-Id: <202104221108.13MB8IFS088407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: dd7dbb8021ef - stable/13 - Update scalbn* functions to the musl versions 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/stable/13 X-Git-Reftype: branch X-Git-Commit: dd7dbb8021ef958d8a9f7417812787e2f5931da2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:19 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=dd7dbb8021ef958d8a9f7417812787e2f5931da2 commit dd7dbb8021ef958d8a9f7417812787e2f5931da2 Author: Alex Richardson AuthorDate: 2021-02-24 16:56:53 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:12 +0000 Update scalbn* functions to the musl versions The only diff compared to musl is a minor change to scalbnl() to replace musl's union ldshape with union IEEEl2bits. This fixes the scalbn tests on non-x86 (since x86 has an assembly version that is used instead). Musl commit messages: commit 8c44a060243f04283ca68dad199aab90336141db Author: Szabolcs Nagy Date: Mon Apr 3 02:38:13 2017 +0200 fix scalbn when result is in the subnormal range in nearest rounding mode scalbn could introduce double rounding error when an intermediate value and the final result were both in the subnormal range e.g. scalbn(0x1.7ffffffffffffp-1, -1073) returned 0x1p-1073 instead of 0x1p-1074, because the intermediate computation got rounded to 0x1.8p-1023. with the fix an intermediate value can only be in the subnormal range if the final result is 0 which is correct even after double rounding. (there still can be two roundings so signals may be raised twice, but that's only observable with trapping exceptions which is not supported.) commit 2eaed464e2080d8321d3903b71086a1ecfc4ee4a Author: Szabolcs Nagy Date: Wed Sep 4 15:52:54 2013 +0000 math: use float_t and double_t in scalbnf and scalbn remove STRICT_ASSIGN (c99 semantics is assumed) and use the conventional union to prepare the scaling factor (so libm.h is no longer needed) commit 1b77b9072f374bd26eb0574b83a0d5f18d75ec60 Author: Szabolcs Nagy Date: Thu Aug 15 10:07:46 2013 +0000 math: minor scalbn*.c simplification commit c4359e01303da2755fe7e8033826b132eb3659b1 Author: Szabolcs Nagy Date: Tue Nov 13 10:55:35 2012 +0100 math: excess precision fix modf, modff, scalbn, scalbnf old code was correct only if the result was stored (without the excess precision) or musl was compiled with -ffloat-store. now we use STRICT_ASSIGN to work around the issue. (see note 160 in c11 section 6.8.6.4) commit 666271c105e4137bdfa195e217799d74143370d4 Author: Szabolcs Nagy Date: Tue Nov 13 10:30:40 2012 +0100 math: fix scalbn and scalbnf on overflow/underflow old code was correct only if the result was stored (without the excess precision) or musl was compiled with -ffloat-store. (see note 160 in n1570.pdf section 6.8.6.4) commit 8051e08e10d2b739fcfcbc6bc7466e8d77fa49f1 Author: nsz Date: Mon Mar 19 10:54:07 2012 +0100 simplify scalbn*.c implementations The old scalbn.c was wrong and slow, the new one is just slow. (scalbn(0x1p+1023,-2097) should give 0x1p-1074, but the old code gave 0) Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28872 (cherry picked from commit 760b2ffc552985017c5bc74fb9966d4dc1b5b691) --- lib/msun/src/s_scalbn.c | 86 +++++++++++++++----------------------------- lib/msun/src/s_scalbnf.c | 78 ++++++++++++++-------------------------- lib/msun/src/s_scalbnl.c | 92 ++++++++++++++++++------------------------------ 3 files changed, 90 insertions(+), 166 deletions(-) diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index b048b0596b67..219cd8f0c989 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -1,63 +1,35 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ +#include +#include -#include -__FBSDID("$FreeBSD$"); - -/* - * scalbn (double x, int n) - * scalbn(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an - * exponentiation or a multiplication. - */ - -#include - -#include "math.h" -#include "math_private.h" - -static const double -two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ -huge = 1.0e+300, -tiny = 1.0e-300; - -double -scalbn (double x, int n) +double scalbn(double x, int n) { - int32_t k,hx,lx; - EXTRACT_WORDS(hx,lx,x); - k = (hx&0x7ff00000)>>20; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two54; - GET_HIGH_WORD(hx,x); - k = ((hx&0x7ff00000)>>20) - 54; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7ff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} - if (k <= -54) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysign(huge,x); /*overflow*/ - else - return tiny*copysign(tiny,x); /*underflow*/ + union {double f; uint64_t i;} u; + double_t y = x; + + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) { + y *= 0x1p1023; + n -= 1023; + if (n > 1023) + n = 1023; + } + } else if (n < -1022) { + /* make sure final n < -53 to avoid double + rounding in the subnormal range */ + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) { + y *= 0x1p-1022 * 0x1p53; + n += 1022 - 53; + if (n < -1022) + n = -1022; + } } - k += 54; /* subnormal result */ - SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); - return x*twom54; + u.i = (uint64_t)(0x3ff+n)<<52; + x = y * u.f; + return x; } #if (LDBL_MANT_DIG == 53) diff --git a/lib/msun/src/s_scalbnf.c b/lib/msun/src/s_scalbnf.c index 21d001c1faf1..3a46470b5661 100644 --- a/lib/msun/src/s_scalbnf.c +++ b/lib/msun/src/s_scalbnf.c @@ -1,57 +1,33 @@ -/* s_scalbnf.c -- float version of s_scalbn.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ +#include +#include -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "math.h" -#include "math_private.h" - -static const float -two25 = 3.355443200e+07, /* 0x4c000000 */ -twom25 = 2.9802322388e-08, /* 0x33000000 */ -huge = 1.0e+30, -tiny = 1.0e-30; - -float -scalbnf (float x, int n) +float scalbnf(float x, int n) { - int32_t k,ix; - GET_FLOAT_WORD(ix,x); - k = (ix&0x7f800000)>>23; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((ix&0x7fffffff)==0) return x; /* +-0 */ - x *= two25; - GET_FLOAT_WORD(ix,x); - k = ((ix&0x7f800000)>>23) - 25; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0xff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} - if (k <= -25) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysignf(huge,x); /*overflow*/ - else - return tiny*copysignf(tiny,x); /*underflow*/ + union {float f; uint32_t i;} u; + float_t y = x; + + if (n > 127) { + y *= 0x1p127f; + n -= 127; + if (n > 127) { + y *= 0x1p127f; + n -= 127; + if (n > 127) + n = 127; + } + } else if (n < -126) { + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; + if (n < -126) { + y *= 0x1p-126f * 0x1p24f; + n += 126 - 24; + if (n < -126) + n = -126; + } } - k += 25; /* subnormal result */ - SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); - return x*twom25; + u.i = (uint32_t)(0x7f+n)<<23; + x = y * u.f; + return x; } __strong_reference(scalbnf, ldexpf); diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c index 28b0cf9b7294..65a9415b0d21 100644 --- a/lib/msun/src/s_scalbnl.c +++ b/lib/msun/src/s_scalbnl.c @@ -1,18 +1,7 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#include -__FBSDID("$FreeBSD$"); - +#include +#include +#include "math_private.h" +#include "fpmath.h" /* * scalbnl (long double x, int n) * scalbnl(x,n) returns x* 2**n computed by exponent @@ -20,52 +9,39 @@ __FBSDID("$FreeBSD$"); * exponentiation or a multiplication. */ -/* - * We assume that a long double has a 15-bit exponent. On systems - * where long double is the same as double, scalbnl() is an alias - * for scalbn(), so we don't use this routine. - */ - -#include -#include - -#include "fpmath.h" - -#if LDBL_MAX_EXP != 0x4000 -#error "Unsupported long double format" -#endif - -static const long double -huge = 0x1p16000L, -tiny = 0x1p-16000L; - -long double -scalbnl (long double x, int n) +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +long double scalbnl(long double x, int n) +{ + return scalbn(x, n); +} +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 +long double scalbnl(long double x, int n) { union IEEEl2bits u; - int k; - u.e = x; - k = u.bits.exp; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((u.bits.manh|u.bits.manl)==0) return x; /* +-0 */ - u.e *= 0x1p+128; - k = u.bits.exp - 128; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7fff) return x+x; /* NaN or Inf */ - k = k+n; - if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {u.bits.exp = k; return u.e;} - if (k <= -128) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*copysign(huge,x); /*overflow*/ - else - return tiny*copysign(tiny,x); /*underflow*/ + + if (n > 16383) { + x *= 0x1p16383L; + n -= 16383; + if (n > 16383) { + x *= 0x1p16383L; + n -= 16383; + if (n > 16383) + n = 16383; + } + } else if (n < -16382) { + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; + if (n < -16382) { + x *= 0x1p-16382L * 0x1p113L; + n += 16382 - 113; + if (n < -16382) + n = -16382; + } } - k += 128; /* subnormal result */ - u.bits.exp = k; - return u.e*0x1p-128; + u.e = 1.0; + u.xbits.expsign = 0x3fff + n; + return x * u.e; } +#endif __strong_reference(scalbnl, ldexpl); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63FCA5EBC9C; Thu, 22 Apr 2021 11:08: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 4FQvmK6w4wz3kD0; Thu, 22 Apr 2021 11:08: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 7FC7218D89; Thu, 22 Apr 2021 11:08: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 13MB8HWj088381; Thu, 22 Apr 2021 11:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8HkS088380; Thu, 22 Apr 2021 11:08:17 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:17 GMT Message-Id: <202104221108.13MB8HkS088380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 04b1a333b744 - stable/13 - lib/msun/ctrig_test: Print the mismatched values on failure 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 04b1a333b7443c7f37e140a176a0daa6617a3a79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:18 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=04b1a333b7443c7f37e140a176a0daa6617a3a79 commit 04b1a333b7443c7f37e140a176a0daa6617a3a79 Author: Alex Richardson AuthorDate: 2021-02-23 09:38:57 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:06 +0000 lib/msun/ctrig_test: Print the mismatched values on failure This test fails on aarch64 but debugging it is difficult without the results being printed. Now the failing AArch64 test prints: root@freebsd-aarch64:/nfsroot/usr/tests/lib/msun # kyua debug ctrig_test:test_nan_inputs *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 ctrig_test:test_nan_inputs -> failed: 16 checks failed; see output for more details Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28788 (cherry picked from commit f3f7b0dc065ce30f29b221788c58079d78931a77) --- lib/msun/tests/ctrig_test.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index b40373fed29b..2499e53ab4d5 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -58,14 +58,22 @@ __FBSDID("$FreeBSD$"); * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. */ -#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ - volatile long double complex _d = z; \ - debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(cfpequal_cs((func)(_d), (result), (checksign))); \ - ATF_CHECK(((void)(func), fetestexcept(exceptmask) == (excepts))); \ -} while (0) +#define test_p(func, z, result, exceptmask, excepts, checksign) \ + do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ + volatile long double complex _r = (func)(_d); \ + ATF_CHECK_MSG(cfpequal_cs(_r, (result), (checksign)), \ + "%s (%Lg + %Lg I) != expected (%Lg + %Lg I)", \ + __XSTRING((func)(_d)), creall(_r), cimagl(_r), \ + creall(result), cimagl(result)); \ + volatile int _e = fetestexcept(exceptmask); \ + ATF_CHECK_MSG(_e == (excepts), \ + "%s fetestexcept(%s) (%#x) != %#x", __XSTRING(func), \ + __XSTRING(exceptmask), _e, (excepts)); \ + } while (0) /* * Test within a given tolerance. The tolerance indicates relative error From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 106AC5EB6D7; Thu, 22 Apr 2021 11:08: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 4FQvmM6Wd8z3kTs; Thu, 22 Apr 2021 11:08: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 C951F18D16; Thu, 22 Apr 2021 11:08: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 13MB8Jin088429; Thu, 22 Apr 2021 11:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8JHg088428; Thu, 22 Apr 2021 11:08:19 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:19 GMT Message-Id: <202104221108.13MB8JHg088428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 85e5714ec795 - stable/13 - Also use the musl scalbn code for ldexp() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 85e5714ec7952851e4232a8fc8354b37c6d94971 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:20 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=85e5714ec7952851e4232a8fc8354b37c6d94971 commit 85e5714ec7952851e4232a8fc8354b37c6d94971 Author: Alex Richardson AuthorDate: 2021-02-25 14:29:44 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:19 +0000 Also use the musl scalbn code for ldexp() Instead of copying the code as 00646ca2047305fce32d99edc7a8e6dfd801f3b4 did, include the implementation with the function name re-defined. (cherry picked from commit aac21e66f94e0a8ad52c1f8cd8dce50fcdd35cca) --- lib/libc/gen/ldexp.c | 126 +++------------------------------------------------ 1 file changed, 6 insertions(+), 120 deletions(-) diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c index 887f673ee9a5..878271576313 100644 --- a/lib/libc/gen/ldexp.c +++ b/lib/libc/gen/ldexp.c @@ -1,123 +1,9 @@ -/* @(#)s_scalbn.c 5.1 93/09/24 */ -/* @(#)fdlibm.h 5.1 93/09/24 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - #include __FBSDID("$FreeBSD$"); -#include -#include -#include - -/* Bit fiddling routines copied from msun/src/math_private.h,v 1.15 */ - -#if BYTE_ORDER == BIG_ENDIAN - -typedef union -{ - double value; - struct - { - u_int32_t msw; - u_int32_t lsw; - } parts; -} ieee_double_shape_type; - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN - -typedef union -{ - double value; - struct - { - u_int32_t lsw; - u_int32_t msw; - } parts; -} ieee_double_shape_type; - -#endif - -/* Get two 32 bit ints from a double. */ - -#define EXTRACT_WORDS(ix0,ix1,d) \ -do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ -} while (0) - -/* Get the more significant 32 bit int from a double. */ - -#define GET_HIGH_WORD(i,d) \ -do { \ - ieee_double_shape_type gh_u; \ - gh_u.value = (d); \ - (i) = gh_u.parts.msw; \ -} while (0) - -/* Set the more significant 32 bits of a double from an int. */ - -#define SET_HIGH_WORD(d,v) \ -do { \ - ieee_double_shape_type sh_u; \ - sh_u.value = (d); \ - sh_u.parts.msw = (v); \ - (d) = sh_u.value; \ -} while (0) - - -static const double -two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ -twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ -huge = 1.0e+300, -tiny = 1.0e-300; - -static double -_copysign(double x, double y) -{ - u_int32_t hx,hy; - GET_HIGH_WORD(hx,x); - GET_HIGH_WORD(hy,y); - SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000)); - return x; -} - -double -ldexp(double x, int n) -{ - int32_t k,hx,lx; - EXTRACT_WORDS(hx,lx,x); - k = (hx&0x7ff00000)>>20; /* extract exponent */ - if (k==0) { /* 0 or subnormal x */ - if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two54; - GET_HIGH_WORD(hx,x); - k = ((hx&0x7ff00000)>>20) - 54; - if (n< -50000) return tiny*x; /*underflow*/ - } - if (k==0x7ff) return x+x; /* NaN or Inf */ - k = k+n; - if (k > 0x7fe) return huge*_copysign(huge,x); /* overflow */ - if (k > 0) /* normal result */ - {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} - if (k <= -54) { - if (n > 50000) /* in case integer overflow in n+k */ - return huge*_copysign(huge,x); /*overflow*/ - else return tiny*_copysign(tiny,x); /*underflow*/ - } - k += 54; /* subnormal result */ - SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); - return x*twom54; -} +/* + * ldexp() and scalbn() are defined to be identical, but ldexp() lives in libc + * for backwards compatibility. + */ +#define scalbn ldexp +#include "../../msun/src/s_scalbn.c" From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 628C15EBB5D; Thu, 22 Apr 2021 11:08: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 4FQvmP1xDtz3kjQ; Thu, 22 Apr 2021 11:08: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 F2AE51887C; Thu, 22 Apr 2021 11:08: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 13MB8KG5088450; Thu, 22 Apr 2021 11:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8Kxe088449; Thu, 22 Apr 2021 11:08:20 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:20 GMT Message-Id: <202104221108.13MB8Kxe088449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 770517d41a16 - stable/13 - s_scalbn.c: Add missing float.h include 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 770517d41a161c1e6b0d919ea8c4a51241c11898 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:21 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=770517d41a161c1e6b0d919ea8c4a51241c11898 commit 770517d41a161c1e6b0d919ea8c4a51241c11898 Author: Alex Richardson AuthorDate: 2021-03-01 14:10:24 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:28 +0000 s_scalbn.c: Add missing float.h include This caused LDBL_MANT_DIG to not be defined and therefore the scalbnl alias was not being emitted for double==long double platforms. Fixes: 760b2ffc ("Update scalbn* functions to the musl versions") Reported by: Jenkins (cherry picked from commit f5542795b99206a2b4e5a57429d18b9478264e24) --- lib/libc/gen/ldexp.c | 1 + lib/msun/src/s_scalbn.c | 3 ++- lib/msun/src/s_scalbnl.c | 10 ++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c index 878271576313..cbbcf0782387 100644 --- a/lib/libc/gen/ldexp.c +++ b/lib/libc/gen/ldexp.c @@ -7,3 +7,4 @@ __FBSDID("$FreeBSD$"); */ #define scalbn ldexp #include "../../msun/src/s_scalbn.c" +#undef scalbn diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index 219cd8f0c989..3de663f8b670 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -1,3 +1,4 @@ +#include #include #include @@ -32,7 +33,7 @@ double scalbn(double x, int n) return x; } -#if (LDBL_MANT_DIG == 53) +#if (LDBL_MANT_DIG == 53) && !defined(scalbn) __weak_reference(scalbn, ldexpl); __weak_reference(scalbn, scalbnl); #endif diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c index 65a9415b0d21..a79f79b33480 100644 --- a/lib/msun/src/s_scalbnl.c +++ b/lib/msun/src/s_scalbnl.c @@ -8,13 +8,7 @@ * manipulation rather than by actually performing an * exponentiation or a multiplication. */ - -#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 -long double scalbnl(long double x, int n) -{ - return scalbn(x, n); -} -#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 +#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double scalbnl(long double x, int n) { union IEEEl2bits u; @@ -42,6 +36,6 @@ long double scalbnl(long double x, int n) u.xbits.expsign = 0x3fff + n; return x * u.e; } +__strong_reference(scalbnl, ldexpl); #endif -__strong_reference(scalbnl, ldexpl); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB4E25EBBF4; Thu, 22 Apr 2021 11:08: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 4FQvmT2F2Rz3kpL; Thu, 22 Apr 2021 11:08:25 +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 7595B1887D; Thu, 22 Apr 2021 11:08: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 13MB8OTX088519; Thu, 22 Apr 2021 11:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8Orr088518; Thu, 22 Apr 2021 11:08:24 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:24 GMT Message-Id: <202104221108.13MB8Orr088518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 6dd6c03efb9e - stable/13 - lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6dd6c03efb9ecc214b0e00fcd32a1bb8887abc0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:26 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=6dd6c03efb9ecc214b0e00fcd32a1bb8887abc0f commit 6dd6c03efb9ecc214b0e00fcd32a1bb8887abc0f Author: Alex Richardson AuthorDate: 2021-03-12 18:44:42 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:54 +0000 lib/msun: Fix x86 GCC6 build after 221622ec0c8e184 Apparently GCC only supports arithmetic expressions that use static const variables in initializers starting with GCC8. To keep older versions happy use a macro instead. Fixes: 221622ec0c ("lib/msun: Avoid FE_INEXACT for x86 log2l/log10l") Reported by: Jenkins Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D29233 (cherry picked from commit 05eac56a0432d07acd7f159125855437a4dd6259) --- lib/msun/ld80/s_logl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c index d787b953fedb..c74519cafd69 100644 --- a/lib/msun/ld80/s_logl.c +++ b/lib/msun/ld80/s_logl.c @@ -674,14 +674,14 @@ logl(long double x) RETURNSPI(&r); } -static const double -invln10_hi = 4.3429448190317999e-1, /* 0x1bcb7b1526e000.0p-54 */ -invln10_lo = 7.1842412889749798e-14, /* 0x1438ca9aadd558.0p-96 */ -invln10_lo_plus_hi = invln10_lo + invln10_hi, -invln2_hi = 1.4426950408887933e0, /* 0x171547652b8000.0p-52 */ -invln2_lo = 1.7010652264631490e-13, /* 0x17f0bbbe87fed0.0p-95 */ -invln2_lo_plus_hi = invln2_lo + invln2_hi; - +/* Use macros since GCC < 8 rejects static const expressions in initializers. */ +#define invln10_hi 4.3429448190317999e-1 /* 0x1bcb7b1526e000.0p-54 */ +#define invln10_lo 7.1842412889749798e-14 /* 0x1438ca9aadd558.0p-96 */ +#define invln2_hi 1.4426950408887933e0 /* 0x171547652b8000.0p-52 */ +#define invln2_lo 1.7010652264631490e-13 /* 0x17f0bbbe87fed0.0p-95 */ +/* Let the compiler pre-calculate this sum to avoid FE_INEXACT at run time. */ +static const double invln10_lo_plus_hi = invln10_lo + invln10_hi; +static const double invln2_lo_plus_hi = invln2_lo + invln2_hi; long double log10l(long double x) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D13B35EBD64; Thu, 22 Apr 2021 11:08: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 4FQvmX69xnz3kpd; Thu, 22 Apr 2021 11:08: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 D183E18B1E; Thu, 22 Apr 2021 11:08: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 13MB8RKU088584; Thu, 22 Apr 2021 11:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8RSN088583; Thu, 22 Apr 2021 11:08:27 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:27 GMT Message-Id: <202104221108.13MB8RSN088583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: bc04f427f54f - stable/13 - Improve test messages for msun tests 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bc04f427f54f44d06f4e9644f9fbb2cdc04bfa8b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:30 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=bc04f427f54f44d06f4e9644f9fbb2cdc04bfa8b commit bc04f427f54f44d06f4e9644f9fbb2cdc04bfa8b Author: Alex Richardson AuthorDate: 2021-03-22 11:42:07 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:43:19 +0000 Improve test messages for msun tests Also print the mismatched values when numbers compare not equal. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D29091 (cherry picked from commit b424e0038a00dffbec800a6f0778db0ffdabe9d6) --- lib/msun/tests/cexp_test.c | 9 ++-- lib/msun/tests/conj_test.c | 12 +++--- lib/msun/tests/csqrt_test.c | 7 +--- lib/msun/tests/ctrig_test.c | 11 ++--- lib/msun/tests/exponential_test.c | 2 +- lib/msun/tests/fenv_test.c | 2 +- lib/msun/tests/fma_test.c | 2 +- lib/msun/tests/fmaxmin_test.c | 2 +- lib/msun/tests/invctrig_test.c | 7 ++-- lib/msun/tests/invtrig_test.c | 4 +- lib/msun/tests/logarithm_test.c | 6 +-- lib/msun/tests/lrint_test.c | 18 ++++---- lib/msun/tests/nearbyint_test.c | 36 ++++++++-------- lib/msun/tests/next_test.c | 2 +- lib/msun/tests/test-utils.h | 86 ++++++++++++++++++++++----------------- lib/msun/tests/trig_test.c | 2 +- 16 files changed, 102 insertions(+), 106 deletions(-) diff --git a/lib/msun/tests/cexp_test.c b/lib/msun/tests/cexp_test.c index 3a0f5dc39a5e..bb5b45b38492 100644 --- a/lib/msun/tests/cexp_test.c +++ b/lib/msun/tests/cexp_test.c @@ -63,7 +63,7 @@ do { \ volatile long double complex _d = z; \ volatile type complex _r = result; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(cfpequal_cs((func)(_d), (_r), (checksign))); \ + CHECK_CFPEQUAL_CS((func)(_d), (_r), (checksign)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #z); \ } while (0) @@ -75,10 +75,9 @@ do { \ test_t(float, func, z, result, exceptmask, excepts, checksign) /* Test within a given tolerance. */ -#define test_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), \ - FPE_ABS_ZERO | CS_BOTH)); \ +#define test_tol(func, z, result, tol) do { \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), \ + FPE_ABS_ZERO | CS_BOTH); \ } while (0) /* Test all the functions that compute cexp(x). */ diff --git a/lib/msun/tests/conj_test.c b/lib/msun/tests/conj_test.c index 5e9868939277..d0256c13b229 100644 --- a/lib/msun/tests/conj_test.c +++ b/lib/msun/tests/conj_test.c @@ -82,12 +82,12 @@ ATF_TC_BODY(main, tc) __imag__ in = tests[2 * i + 1]; __imag__ expected = -cimag(in); - ATF_REQUIRE(fpequal(libcrealf(in), __real__ in)); - ATF_REQUIRE(fpequal(libcreal(in), __real__ in)); - ATF_REQUIRE(fpequal(libcreall(in), __real__ in)); - ATF_REQUIRE(fpequal(libcimagf(in), __imag__ in)); - ATF_REQUIRE(fpequal(libcimag(in), __imag__ in)); - ATF_REQUIRE(fpequal(libcimagl(in), __imag__ in)); + ATF_REQUIRE(fpequal_cs(libcrealf(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcreal(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcreall(in), __real__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimagf(in), __imag__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimag(in), __imag__ in, true)); + ATF_REQUIRE(fpequal_cs(libcimagl(in), __imag__ in, true)); ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); ATF_REQUIRE_MSG( diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index a84605a379de..a46d0ddd45c5 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -67,12 +67,7 @@ _csqrt(long double complex d) * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. * Fail an assertion if they differ. */ -static void -assert_equal(long double complex d1, long double complex d2) -{ - - ATF_CHECK(cfpequal(d1, d2)); -} +#define assert_equal(d1, d2) CHECK_CFPEQUAL_CS(d1, d2, CS_BOTH) /* * Test csqrt for some finite arguments where the answer is exact. diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index f3951c575ceb..f5d52a0c06f1 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -62,11 +62,7 @@ __FBSDID("$FreeBSD$"); debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ creall(_d), cimagl(_d), creall(result), cimagl(result)); \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - volatile long double complex _r = (func)(_d); \ - ATF_CHECK_MSG(cfpequal_cs(_r, (result), (checksign)), \ - "%s (%Lg + %Lg I) != expected (%Lg + %Lg I)", \ - __XSTRING((func)(_d)), creall(_r), cimagl(_r), \ - creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_CS((func)(_d), (result), (checksign)); \ volatile int _e = fetestexcept(exceptmask); \ ATF_CHECK_MSG(_e == (excepts), \ "%s fetestexcept(%s) (%#x) != %#x", __XSTRING(func), \ @@ -79,10 +75,9 @@ __FBSDID("$FreeBSD$"); * of _EPSILON. */ #define test_p_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), FPE_ABS_ZERO)); \ + creall(z), cimagl(z), creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), FPE_ABS_ZERO); \ } while (0) /* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ diff --git a/lib/msun/tests/exponential_test.c b/lib/msun/tests/exponential_test.c index 14cedf8f9190..280f3e483d06 100644 --- a/lib/msun/tests/exponential_test.c +++ b/lib/msun/tests/exponential_test.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index b80b591cf52b..76998a7cb2d5 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -248,7 +248,7 @@ ATF_TC_BODY(fegsetexceptflag, tc) fexcept_t flag; int excepts, i; - ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; diff --git a/lib/msun/tests/fma_test.c b/lib/msun/tests/fma_test.c index e601c3e248b2..4e3df40be9c9 100644 --- a/lib/msun/tests/fma_test.c +++ b/lib/msun/tests/fma_test.c @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, y, z, result, exceptmask, excepts) do { \ volatile long double _vx = (x), _vy = (y), _vz = (z); \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(fpequal((func)(_vx, _vy, _vz), (result))); \ + CHECK_FPEQUAL((func)(_vx, _vy, _vz), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c index 06bd0a1ba7e0..12d845b76395 100644 --- a/lib/msun/tests/fmaxmin_test.c +++ b/lib/msun/tests/fmaxmin_test.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); long double __result = func((__x), (__y)); \ CHECK_FP_EXCEPTIONS_MSG(0, ALL_STD_EXCEPT, \ #func "(%.20Lg, %.20Lg) rmode%d", (x), (y), rmode); \ - ATF_CHECK_MSG(fpequal(__result, (expected)), \ + ATF_CHECK_MSG(fpequal_cs(__result, (expected), true), \ #func "(%.20Lg, %.20Lg) rmode%d = %.20Lg, expected %.20Lg\n", \ (x), (y), rmode, __result, (expected)); \ } while (0) diff --git a/lib/msun/tests/invctrig_test.c b/lib/msun/tests/invctrig_test.c index 537d73d1319c..179499f9f0b2 100644 --- a/lib/msun/tests/invctrig_test.c +++ b/lib/msun/tests/invctrig_test.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ creall(_d), cimagl(_d), creall(result), cimagl(result)); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(cfpequal_cs((func)(_d), (result), (checksign))); \ + CHECK_CFPEQUAL_CS((func)(_d), (result), (checksign)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #z); \ } while (0) @@ -71,10 +71,9 @@ __FBSDID("$FreeBSD$"); * in ulps. */ #define test_p_tol(func, z, result, tol) do { \ - volatile long double complex _d = z; \ debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ - creall(_d), cimagl(_d), creall(result), cimagl(result)); \ - ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), CS_BOTH)); \ + creall(z), cimagl(z), creall(result), cimagl(result)); \ + CHECK_CFPEQUAL_TOL((func)(z), (result), (tol), CS_BOTH); \ } while (0) /* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ diff --git a/lib/msun/tests/invtrig_test.c b/lib/msun/tests/invtrig_test.c index 9376ecea8658..7dd8b26f652f 100644 --- a/lib/msun/tests/invtrig_test.c +++ b/lib/msun/tests/invtrig_test.c @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #define test_tol(func, x, result, tol, excepts) do { \ volatile long double _in = (x), _out = (result); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal_tol(func(_in), _out, (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL(func(_in), _out, (tol), CS_BOTH); \ CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \ #func, #x); \ } while (0) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define test2_tol(func, y, x, result, tol, excepts) do { \ volatile long double _iny = (y), _inx = (x), _out = (result); \ ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal_tol(func(_iny, _inx), _out, (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL(func(_iny, _inx), _out, (tol), CS_BOTH); \ CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \ #func, #x); \ } while (0) diff --git a/lib/msun/tests/logarithm_test.c b/lib/msun/tests/logarithm_test.c index 0a6728681a30..48a368765b71 100644 --- a/lib/msun/tests/logarithm_test.c +++ b/lib/msun/tests/logarithm_test.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_CHECK_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define test_tol(func, z, result, tol) do { \ volatile long double _d = z; \ debug(" testing %6s(%15La) ~= % .36Le\n", #func, _d, result); \ - ATF_CHECK(fpequal_tol((func)(_d), (result), (tol), CS_BOTH)); \ + CHECK_FPEQUAL_TOL((func)(_d), (result), (tol), CS_BOTH); \ } while (0) /* Test all the functions that compute log(x). */ @@ -207,7 +207,7 @@ ATF_TC_BODY(accuracy_tests, tc) 1.29556709996247903756734359702926363e0L }, { 19.75 * 0x1p100, 1.043037807481771029244272863419411534e2L, - 7.229787154734166181706169344438271459e1L, + 72.29787154734166181706169344438271459357255439172762452L, 3.139856666636059855894123306947856631e1L }, }; unsigned i; diff --git a/lib/msun/tests/lrint_test.c b/lib/msun/tests/lrint_test.c index 2606f88a41a3..a2a93180e97e 100644 --- a/lib/msun/tests/lrint_test.c +++ b/lib/msun/tests/lrint_test.c @@ -42,16 +42,14 @@ __FBSDID("$FreeBSD$"); #include "test-utils.h" -/* - * XXX The volatile here is to avoid gcc's bogus constant folding and work - * around the lack of support for the FENV_ACCESS pragma. - */ -#define test(func, x, result, excepts) do { \ - volatile double _d = x; \ - ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ - CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT & ALL_STD_EXCEPT,\ - "for %s(%s)", #func, #x); \ +#define test(func, x, result, excepts) do { \ + ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ + long long _r = (func)(x); \ + ATF_CHECK_MSG(_r == (result) || fetestexcept(FE_INVALID), \ + #func "(%Lg) returned %lld, expected %lld", (long double)x, _r, \ + (long long)(result)); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT & ALL_STD_EXCEPT, \ + "for %s(%s)", #func, #x); \ } while (0) #define testall(x, result, excepts) do { \ diff --git a/lib/msun/tests/nearbyint_test.c b/lib/msun/tests/nearbyint_test.c index 6bcf6694fe90..25950eedd5d0 100644 --- a/lib/msun/tests/nearbyint_test.c +++ b/lib/msun/tests/nearbyint_test.c @@ -97,16 +97,16 @@ test_nearby(int testindex) in = tests[testindex].in; out = get_output(testindex, i, 0); - ATF_CHECK(fpequal(out, libnearbyintf(in))); - ATF_CHECK(fpequal(out, nearbyint(in))); - ATF_CHECK(fpequal(out, nearbyintl(in))); + CHECK_FPEQUAL(out, libnearbyintf(in)); + CHECK_FPEQUAL(out, nearbyint(in)); + CHECK_FPEQUAL(out, nearbyintl(in)); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); in = -tests[testindex].in; out = get_output(testindex, i, 1); - ATF_CHECK(fpequal(out, nearbyintf(in))); - ATF_CHECK(fpequal(out, nearbyint(in))); - ATF_CHECK(fpequal(out, nearbyintl(in))); + CHECK_FPEQUAL(out, nearbyintf(in)); + CHECK_FPEQUAL(out, nearbyint(in)); + CHECK_FPEQUAL(out, nearbyintl(in)); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } @@ -130,24 +130,24 @@ test_modf(int testindex) isinf(ipart_expected) ? 0.0 : in - ipart_expected, in); ipartl = ipart = ipartf = 42.0; - ATF_CHECK(fpequal(out, modff(in, &ipartf))); - ATF_CHECK(fpequal(ipart_expected, ipartf)); - ATF_CHECK(fpequal(out, modf(in, &ipart))); - ATF_CHECK(fpequal(ipart_expected, ipart)); - ATF_CHECK(fpequal(out, modfl(in, &ipartl))); - ATF_CHECK(fpequal(ipart_expected, ipartl)); + CHECK_FPEQUAL(out, modff(in, &ipartf)); + CHECK_FPEQUAL(ipart_expected, ipartf); + CHECK_FPEQUAL(out, modf(in, &ipart)); + CHECK_FPEQUAL(ipart_expected, ipart); + CHECK_FPEQUAL(out, modfl(in, &ipartl)); + CHECK_FPEQUAL(ipart_expected, ipartl); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); in = -in; ipart_expected = -ipart_expected; out = -out; ipartl = ipart = ipartf = 42.0; - ATF_CHECK(fpequal(out, modff(in, &ipartf))); - ATF_CHECK(fpequal(ipart_expected, ipartf)); - ATF_CHECK(fpequal(out, modf(in, &ipart))); - ATF_CHECK(fpequal(ipart_expected, ipart)); - ATF_CHECK(fpequal(out, modfl(in, &ipartl))); - ATF_CHECK(fpequal(ipart_expected, ipartl)); + CHECK_FPEQUAL(out, modff(in, &ipartf)); + CHECK_FPEQUAL(ipart_expected, ipartf); + CHECK_FPEQUAL(out, modf(in, &ipart)); + CHECK_FPEQUAL(ipart_expected, ipart); + CHECK_FPEQUAL(out, modfl(in, &ipartl)); + CHECK_FPEQUAL(ipart_expected, ipartl); CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } diff --git a/lib/msun/tests/next_test.c b/lib/msun/tests/next_test.c index 5801dc0e3589..763b1cc14e60 100644 --- a/lib/msun/tests/next_test.c +++ b/lib/msun/tests/next_test.c @@ -247,7 +247,7 @@ _testl(const char *exp, int line, long double actual, long double expected, int actual_except; actual_except = fetestexcept(ALL_STD_EXCEPT); - if (!fpequal(actual, expected)) { + if (!fpequal_cs(actual, expected, true)) { atf_tc_fail_check(__FILE__, line, "%s returned %La, expecting %La\n", exp, actual, expected); } diff --git a/lib/msun/tests/test-utils.h b/lib/msun/tests/test-utils.h index a20e30a2440a..615e8f8fafba 100644 --- a/lib/msun/tests/test-utils.h +++ b/lib/msun/tests/test-utils.h @@ -31,6 +31,7 @@ #include #include +#include #include @@ -90,34 +91,21 @@ CMPLXL(long double x, long double y) } #endif -static int fpequal(long double, long double) __used; -static int cfpequal(long double complex, long double complex) __used; -static int cfpequal_cs(long double complex, long double complex, - int) __used; -static int cfpequal_tol(long double complex, long double complex, - long double, unsigned int) __used; - /* - * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. - * Fail an assertion if they differ. + * The compiler-rt fp128 builtins do not update FP exceptions. + * See https://llvm.org/PR34126 */ -static int -fpequal(long double d1, long double d2) -{ - if (d1 != d2) - return (isnan(d1) && isnan(d2)); - return (copysignl(1.0, d1) == copysignl(1.0, d2)); -} +static int cfpequal(long double complex, long double complex) __used; /* * Determine whether x and y are equal, with two special rules: * +0.0 != -0.0 * NaN == NaN - * If checksign is 0, we compare the absolute values instead. + * If checksign is false, we compare the absolute values instead. */ -static int -fpequal_cs(long double x, long double y, int checksign) +static inline int +fpequal_cs(long double x, long double y, bool checksign) { if (isnan(x) && isnan(y)) return (1); @@ -127,7 +115,7 @@ fpequal_cs(long double x, long double y, int checksign) return (fabsl(x) == fabsl(y)); } -static int +static inline int fpequal_tol(long double x, long double y, long double tol, unsigned int flags) { @@ -158,32 +146,54 @@ fpequal_tol(long double x, long double y, long double tol, return (ret); } -static int +#define CHECK_FPEQUAL(x, y) CHECK_FPEQUAL_CS(x, y, true) + +#define CHECK_FPEQUAL_CS(x, y, checksign) do { \ + long double _x = x; \ + long double _y = y; \ + ATF_CHECK_MSG(fpequal_cs(_x, _y, checksign), \ + "%s (%.25Lg) ~= %s (%.25Lg)", #x, _x, #y, _y); \ +} while (0) + +#define CHECK_FPEQUAL_TOL(x, y, tol, flags) do { \ + long double _x = x; \ + long double _y = y; \ + bool eq = fpequal_tol(_x, _y, tol, flags); \ + long double _diff = eq ? 0.0L : fabsl(_x - _y); \ + ATF_CHECK_MSG(eq, "%s (%.25Lg) ~= %s (%.25Lg), diff=%Lg, maxdiff=%Lg,", \ + #x, _x, #y, _y, _diff, fabsl(_y * tol)); \ +} while (0) + +static inline int cfpequal(long double complex d1, long double complex d2) { - return (fpequal(creall(d1), creall(d2)) && - fpequal(cimagl(d1), cimagl(d2))); + return (fpequal_cs(creall(d1), creall(d2), true) && + fpequal_cs(cimagl(d1), cimagl(d2), true)); } -static int -cfpequal_cs(long double complex x, long double complex y, int checksign) -{ - return (fpequal_cs(creal(x), creal(y), checksign) - && fpequal_cs(cimag(x), cimag(y), checksign)); -} - -static int -cfpequal_tol(long double complex x, long double complex y, long double tol, - unsigned int flags) -{ - return (fpequal_tol(creal(x), creal(y), tol, flags) - && fpequal_tol(cimag(x), cimag(y), tol, flags)); -} +#define CHECK_CFPEQUAL_CS(x, y, checksign) do { \ + long double _x = x; \ + long double _y = y; \ + bool equal_cs = \ + fpequal_cs(creal(_x), creal(_y), (checksign & CS_REAL) != 0) && \ + fpequal_cs(cimag(_x), cimag(_y), (checksign & CS_IMAG) != 0); \ + ATF_CHECK_MSG(equal_cs, "%s (%Lg + %Lg I) ~= %s (%Lg + %Lg I)", \ + #x, creall(_x), cimagl(_x), #y, creall(_y), cimagl(_y)); \ +} while (0) + +#define CHECK_CFPEQUAL_TOL(x, y, tol, flags) do { \ + long double _x = x; \ + long double _y = y; \ + bool equal_tol = (fpequal_tol(creal(_x), creal(_y), tol, flags) && \ + fpequal_tol(cimag(_x), cimag(_y), tol, flags)); \ + ATF_CHECK_MSG(equal_tol, "%s (%Lg + %Lg I) ~= %s (%Lg + %Lg I)", \ + #x, creall(_x), cimagl(_x), #y, creall(_y), cimagl(_y)); \ +} while (0) #define CHECK_FP_EXCEPTIONS(excepts, exceptmask) \ ATF_CHECK_EQ_MSG((excepts), fetestexcept(exceptmask), \ - "unexpected exception flags: %#x not %#x", \ + "unexpected exception flags: got %#x not %#x", \ fetestexcept(exceptmask), (excepts)) #define CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, fmt, ...) \ ATF_CHECK_EQ_MSG((excepts), fetestexcept(exceptmask), \ diff --git a/lib/msun/tests/trig_test.c b/lib/msun/tests/trig_test.c index 55fd97ef4eef..2660c3f2c476 100644 --- a/lib/msun/tests/trig_test.c +++ b/lib/msun/tests/trig_test.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \ - ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FPEQUAL((func)(_d), (result)); \ CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ #func, #x); \ } while (0) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 662EA5EBD6B; Thu, 22 Apr 2021 11:08: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 4FQvmZ02htz3khV; Thu, 22 Apr 2021 11:08: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 121FD18D17; Thu, 22 Apr 2021 11:08: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 13MB8SmQ088606; Thu, 22 Apr 2021 11:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8SWA088605; Thu, 22 Apr 2021 11:08:28 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:28 GMT Message-Id: <202104221108.13MB8SWA088605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: b38293b480c3 - stable/13 - lib/msun: Allow building tests with WARNS=6 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b38293b480c324544535bb8efa4033e76f894d1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:30 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b38293b480c324544535bb8efa4033e76f894d1a commit b38293b480c324544535bb8efa4033e76f894d1a Author: Alex Richardson AuthorDate: 2021-02-25 14:28:17 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:43:24 +0000 lib/msun: Allow building tests with WARNS=6 The only change needed is to mark a few variables as static. (cherry picked from commit 87d65c747a4389901c2bbbcb1ec4878b2df7b32c) --- contrib/netbsd-tests/lib/libm/t_ldexp.c | 19 +++++++++---------- contrib/netbsd-tests/lib/libm/t_precision.c | 4 ++-- contrib/netbsd-tests/lib/libm/t_round.c | 2 +- contrib/netbsd-tests/lib/libm/t_scalbn.c | 2 +- lib/msun/tests/Makefile | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/contrib/netbsd-tests/lib/libm/t_ldexp.c b/contrib/netbsd-tests/lib/libm/t_ldexp.c index 977b2219873b..40c69206e741 100644 --- a/contrib/netbsd-tests/lib/libm/t_ldexp.c +++ b/contrib/netbsd-tests/lib/libm/t_ldexp.c @@ -53,7 +53,7 @@ struct ldexp_test { const char *result; }; -struct ldexp_test ldexp_basic[] = { +static struct ldexp_test ldexp_basic[] = { { 1.0, 5, SKIP, " 32" }, { 1.0, 1022, SKIP, "4.4942328371557897693233e+307" }, { 1.0, 1023, -1, "4.4942328371557897693233e+307" }, @@ -71,7 +71,7 @@ struct ldexp_test ldexp_basic[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_zero[] = { +static struct ldexp_test ldexp_zero[] = { { 0.0, -1, SKIP, " 0" }, { 0.0, 0, SKIP, " 0" }, { 0.0, 1, SKIP, " 0" }, @@ -82,7 +82,7 @@ struct ldexp_test ldexp_zero[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_infinity[] = { +static struct ldexp_test ldexp_infinity[] = { { 1.0, 1024, -1, " inf" }, { 1.0, 1024, 0, " inf" }, { 1.0, 1024, 1, " inf" }, @@ -92,7 +92,7 @@ struct ldexp_test ldexp_infinity[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_overflow[] = { +static struct ldexp_test ldexp_overflow[] = { { 1.0, 1024, SKIP, " inf" }, { 1.0, 1023, 1, " inf" }, { 1.0, -1022, 2046, " inf" }, @@ -106,7 +106,7 @@ struct ldexp_test ldexp_overflow[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_denormal[] = { +static struct ldexp_test ldexp_denormal[] = { { 1.0, -1023, SKIP, "1.1125369292536006915451e-308" }, { 1.0, -1022, -1, "1.1125369292536006915451e-308" }, { 1.0, 1023, -2046, "1.1125369292536006915451e-308" }, @@ -120,7 +120,7 @@ struct ldexp_test ldexp_denormal[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_underflow[] = { +static struct ldexp_test ldexp_underflow[] = { { 1.0, -1075, SKIP, " 0" }, { 1.0, -1074, -1, " 0" }, { 1.0, 1023, -2098, " 0" }, @@ -132,7 +132,7 @@ struct ldexp_test ldexp_underflow[] = { { 0, 0, 0, NULL } }; -struct ldexp_test ldexp_denormal_large[] = { +static struct ldexp_test ldexp_denormal_large[] = { { 1.0, -1028, 1024, " 0.0625" }, { 1.0, -1028, 1025, " 0.125" }, { 1.0, -1028, 1026, " 0.25" }, @@ -177,10 +177,9 @@ run_test(struct ldexp_test *table) v = ldexp(v, table->exp2); (void)snprintf(outbuf, sizeof(outbuf), FORMAT, v); - ATF_CHECK_STREQ_MSG(table->result, outbuf, - "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"", - i, table->result, outbuf); + "Entry %zu:\n\tExp: \"%s\"\n\tAct: \"%s\"/%a", + i, table->result, outbuf, v); } } diff --git a/contrib/netbsd-tests/lib/libm/t_precision.c b/contrib/netbsd-tests/lib/libm/t_precision.c index eb8e29546eb6..b953845c21f4 100644 --- a/contrib/netbsd-tests/lib/libm/t_precision.c +++ b/contrib/netbsd-tests/lib/libm/t_precision.c @@ -44,9 +44,9 @@ ATF_TC_HEAD(t_precision, tc) "Basic precision test for double and long double"); } -volatile double x = 1; +static volatile double x = 1; #if __HAVE_LONG_DOUBLE -volatile long double y = 1; +static volatile long double y = 1; #endif ATF_TC_BODY(t_precision, tc) diff --git a/contrib/netbsd-tests/lib/libm/t_round.c b/contrib/netbsd-tests/lib/libm/t_round.c index 7d32586f1aa5..bafc894943ce 100644 --- a/contrib/netbsd-tests/lib/libm/t_round.c +++ b/contrib/netbsd-tests/lib/libm/t_round.c @@ -117,7 +117,7 @@ ATF_TC_HEAD(rounding_alpha_simple, tc) } -double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */ +static double rounding_alpha_simple_even = 9223372036854775808.000000; /* 2^63 */ ATF_TC_BODY(rounding_alpha_simple, tc) { diff --git a/contrib/netbsd-tests/lib/libm/t_scalbn.c b/contrib/netbsd-tests/lib/libm/t_scalbn.c index f6adaaa993ec..dce07aac3c78 100644 --- a/contrib/netbsd-tests/lib/libm/t_scalbn.c +++ b/contrib/netbsd-tests/lib/libm/t_scalbn.c @@ -49,7 +49,7 @@ struct testcase { int error; int except; }; -struct testcase test_vals[] = { +static struct testcase test_vals[] = { { 0, 1.00085, 1.00085, 0, 0 }, { 0, 0.99755, 0.99755, 0, 0 }, { 0, -1.00085, -1.00085, 0, 0 }, diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 309f49c6dddd..4ef25c0a909a 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -88,7 +88,7 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD+= m -WARNS?= 1 +WARNS?= 6 # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A83A5EBD99; Thu, 22 Apr 2021 11:08: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 4FQvmQ5m1Zz3kSX; Thu, 22 Apr 2021 11:08:22 +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 1FFC918B1C; Thu, 22 Apr 2021 11:08: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 13MB8M8J088471; Thu, 22 Apr 2021 11:08:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8MhD088470; Thu, 22 Apr 2021 11:08:22 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:22 GMT Message-Id: <202104221108.13MB8MhD088470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: c8f8369856b5 - stable/13 - Allow ssp_test:read to pass more reliably 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c8f8369856b5fe8f6ca26a1e045903b119b80213 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:23 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c8f8369856b5fe8f6ca26a1e045903b119b80213 commit c8f8369856b5fe8f6ca26a1e045903b119b80213 Author: Alex Richardson AuthorDate: 2021-03-01 19:50:38 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:36 +0000 Allow ssp_test:read to pass more reliably It appears that the stackframe layout can be slightly different depending on compiler and target architecture. For example, when using CHERI LLVM for RISC-V we can actually overflow the buffer by up to 8 bytes without SSP detecting it. Fix this by increasing the overflow to 15 bytes. Reviewed By: ngie, emaste Differential Revision: https://reviews.freebsd.org/D28997 (cherry picked from commit c88c1f23a8989b881a5ca51223289ddb4ce74277) --- contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh index 7b963d18e3f7..b9d07b1804b1 100755 --- a/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh +++ b/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh @@ -390,7 +390,7 @@ read_body() if true; then MAX_PATH=$(getconf _XOPEN_PATH_MAX) || atf_fail "getconf failed" h_pass "$prog $MAX_PATH" "echo foo |" - h_fail "$prog $(( $MAX_PATH + 3 ))" "echo bar |" + h_fail "$prog $(( $MAX_PATH + 15 ))" "echo bar |" else # End FreeBSD h_pass "$prog 1024" "echo foo |" From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CE9C5EBDAA; Thu, 22 Apr 2021 11:08: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 4FQvmV6r8Rz3km3; Thu, 22 Apr 2021 11:08: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 A345618D8A; Thu, 22 Apr 2021 11:08: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 13MB8PwT088540; Thu, 22 Apr 2021 11:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8PYN088539; Thu, 22 Apr 2021 11:08:25 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:25 GMT Message-Id: <202104221108.13MB8PYN088539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: b69904b8916c - stable/13 - Convert the msun tests to ATF 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b69904b8916cb693b92a98271243ab2d407a0bc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:27 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b69904b8916cb693b92a98271243ab2d407a0bc2 commit b69904b8916cb693b92a98271243ab2d407a0bc2 Author: Alex Richardson AuthorDate: 2021-03-22 11:15:13 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:43:06 +0000 Convert the msun tests to ATF This provides better error messages that just an assertion failure and also makes it easier to mark individual tests as XFAIL. It was also helpful when coming up with D28786 and D28787. Differential Revision: https://reviews.freebsd.org/D28798 (cherry picked from commit 133bc645077d77ddb3c7d49130b4ec6fd93e7d34) --- lib/msun/tests/Makefile | 36 +++-- lib/msun/tests/cexp_test.c | 80 ++++------ lib/msun/tests/conj_test.c | 85 +++++------ lib/msun/tests/csqrt_test.c | 79 +++++----- lib/msun/tests/ctrig_test.c | 2 - lib/msun/tests/exponential_test.c | 84 ++++++----- lib/msun/tests/fenv_test.c | 298 ++++++++++++++++++-------------------- lib/msun/tests/fma_test.c | 96 ++++++------ lib/msun/tests/fmaxmin_test.c | 176 ++++++++++++++-------- lib/msun/tests/ilogb_test.c | 70 +++++---- lib/msun/tests/invctrig_test.c | 68 ++++----- lib/msun/tests/invtrig_test.c | 85 ++++------- lib/msun/tests/logarithm_test.c | 85 ++++------- lib/msun/tests/lrint_test.c | 49 +++---- lib/msun/tests/lround_test.c | 49 ++++--- lib/msun/tests/lround_test.t | 10 -- lib/msun/tests/nan_test.c | 53 +++---- lib/msun/tests/nearbyint_test.c | 72 +++++---- lib/msun/tests/next_test.c | 86 +++++++---- lib/msun/tests/rem_test.c | 109 +++++++------- lib/msun/tests/test-utils.h | 11 ++ lib/msun/tests/trig_test.c | 8 +- 22 files changed, 845 insertions(+), 846 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 85a558bb0733..309f49c6dddd 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -52,30 +52,28 @@ NETBSD_ATF_TESTS_C+= sqrt_test NETBSD_ATF_TESTS_C+= tan_test NETBSD_ATF_TESTS_C+= tanh_test -TAP_TESTS_C+= cexp_test -TAP_TESTS_C+= conj_test +ATF_TESTS_C+= cexp_test +ATF_TESTS_C+= conj_test .if ${MACHINE_CPUARCH} != "aarch64" # Hits an assert in llvm when building for arm64: # https://llvm.org/bugs/show_bug.cgi?id=26081 -TAP_TESTS_C+= csqrt_test +ATF_TESTS_C+= csqrt_test .endif ATF_TESTS_C+= ctrig_test -TAP_TESTS_C+= exponential_test -TAP_TESTS_C+= fenv_test -TAP_TESTS_C+= fma_test -TAP_TESTS_C+= fmaxmin_test -TAP_TESTS_C+= ilogb2_test -TAP_TESTS_C+= invtrig_test -TAP_TESTS_C+= invctrig_test -TAP_TESTS_C+= logarithm_test -TAP_TESTS_C+= lrint_test -# XXX: the testcase crashes on all platforms, but only on head -# (bug 205451) -#TAP_TESTS_C+= lround_test -TAP_TESTS_C+= nan_test -TAP_TESTS_C+= nearbyint_test -TAP_TESTS_C+= next_test -TAP_TESTS_C+= rem_test +ATF_TESTS_C+= exponential_test +ATF_TESTS_C+= fenv_test +ATF_TESTS_C+= fma_test +ATF_TESTS_C+= fmaxmin_test +ATF_TESTS_C+= ilogb2_test +ATF_TESTS_C+= invtrig_test +ATF_TESTS_C+= invctrig_test +ATF_TESTS_C+= logarithm_test +ATF_TESTS_C+= lrint_test +ATF_TESTS_C+= lround_test +ATF_TESTS_C+= nan_test +ATF_TESTS_C+= nearbyint_test +ATF_TESTS_C+= next_test +ATF_TESTS_C+= rem_test ATF_TESTS_C+= trig_test .if !empty(PROG) && !empty(TAP_TESTS_C:M${PROG}) diff --git a/lib/msun/tests/cexp_test.c b/lib/msun/tests/cexp_test.c index 8e342f8e0070..3a0f5dc39a5e 100644 --- a/lib/msun/tests/cexp_test.c +++ b/lib/msun/tests/cexp_test.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -63,9 +62,10 @@ __FBSDID("$FreeBSD$"); do { \ volatile long double complex _d = z; \ volatile type complex _r = result; \ - assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(cfpequal_cs((func)(_d), (_r), (checksign))); \ - assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ + ATF_CHECK(cfpequal_cs((func)(_d), (_r), (checksign))); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ + #func, #z); \ } while (0) #define test(func, z, result, exceptmask, excepts, checksign) \ @@ -77,7 +77,7 @@ do { \ /* Test within a given tolerance. */ #define test_tol(func, z, result, tol) do { \ volatile long double complex _d = z; \ - assert(cfpequal_tol((func)(_d), (result), (tol), \ + ATF_CHECK(cfpequal_tol((func)(_d), (result), (tol), \ FPE_ABS_ZERO | CS_BOTH)); \ } while (0) @@ -102,8 +102,8 @@ static const float finites[] = /* Tests for 0 */ -static void -test_zero(void) +ATF_TC_WITHOUT_HEAD(zero); +ATF_TC_BODY(zero, tc) { /* cexp(0) = 1, no exceptions raised */ @@ -117,15 +117,14 @@ test_zero(void) * Tests for NaN. The signs of the results are indeterminate unless the * imaginary part is 0. */ -static void -test_nan(void) +ATF_TC_WITHOUT_HEAD(nan); +ATF_TC_BODY(nan, tc) { unsigned i; /* cexp(x + NaNi) = NaN + NaNi and optionally raises invalid */ /* cexp(NaN + yi) = NaN + NaNi and optionally raises invalid (|y|>0) */ for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); testall(CMPLXL(finites[i], NAN), CMPLXL(NAN, NAN), ALL_STD_EXCEPT & ~FE_INVALID, 0, 0); if (finites[i] == 0.0) @@ -150,14 +149,13 @@ test_nan(void) ALL_STD_EXCEPT, 0, 0); } -static void -test_inf(void) +ATF_TC_WITHOUT_HEAD(inf); +ATF_TC_BODY(inf, tc) { unsigned i; /* cexp(x + inf i) = NaN + NaNi and raises invalid */ for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); testall(CMPLXL(finites[i], INFINITY), CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 1); } @@ -192,14 +190,13 @@ test_inf(void) ALL_STD_EXCEPT, 0, 1); } -static void -test_reals(void) +ATF_TC_WITHOUT_HEAD(reals); +ATF_TC_BODY(reals, tc) { unsigned i; for (i = 0; i < nitems(finites); i++) { /* XXX could check exceptions more meticulously */ - printf("# Run %d..\n", i); test(cexp, CMPLXL(finites[i], 0.0), CMPLXL(exp(finites[i]), 0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); @@ -215,13 +212,12 @@ test_reals(void) } } -static void -test_imaginaries(void) +ATF_TC_WITHOUT_HEAD(imaginaries); +ATF_TC_BODY(imaginaries, tc) { unsigned i; for (i = 0; i < nitems(finites); i++) { - printf("# Run %d..\n", i); test(cexp, CMPLXL(0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); @@ -237,8 +233,8 @@ test_imaginaries(void) } } -static void -test_small(void) +ATF_TC_WITHOUT_HEAD(small); +ATF_TC_BODY(small, tc) { static const double tests[] = { /* csqrt(a + bI) = x + yI */ @@ -253,7 +249,6 @@ test_small(void) unsigned i; for (i = 0; i < nitems(tests); i += 4) { - printf("# Run %d..\n", i); a = tests[i]; b = tests[i + 1]; x = tests[i + 2]; @@ -268,8 +263,8 @@ test_small(void) } /* Test inputs with a real part r that would overflow exp(r). */ -static void -test_large(void) +ATF_TC_WITHOUT_HEAD(large); +ATF_TC_BODY(large, tc) { test_tol(cexp, CMPLXL(709.79, 0x1p-1074), @@ -295,32 +290,15 @@ test_large(void) CMPLXL(INFINITY, 5.7878851079e+37f), 2 * FLT_ULP()); } -int -main(void) +ATF_TP_ADD_TCS(tp) { - - printf("1..7\n"); - - test_zero(); - printf("ok 1 - cexp zero\n"); - - test_nan(); - printf("ok 2 - cexp nan\n"); - - test_inf(); - printf("ok 3 - cexp inf\n"); - - test_reals(); - printf("ok 4 - cexp reals\n"); - - test_imaginaries(); - printf("ok 5 - cexp imaginaries\n"); - - test_small(); - printf("ok 6 - cexp small\n"); - - test_large(); - printf("ok 7 - cexp large\n"); - - return (0); + ATF_TP_ADD_TC(tp, zero); + ATF_TP_ADD_TC(tp, nan); + ATF_TP_ADD_TC(tp, inf); + ATF_TP_ADD_TC(tp, reals); + ATF_TP_ADD_TC(tp, imaginaries); + ATF_TP_ADD_TC(tp, small); + ATF_TP_ADD_TC(tp, large); + + return (atf_no_error()); } diff --git a/lib/msun/tests/conj_test.c b/lib/msun/tests/conj_test.c index 960fed5074b5..5e9868939277 100644 --- a/lib/msun/tests/conj_test.c +++ b/lib/msun/tests/conj_test.c @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -70,70 +69,54 @@ static const double tests[] = { -INFINITY, INFINITY, }; -int -main(void) +ATF_TC_WITHOUT_HEAD(main); +ATF_TC_BODY(main, tc) { static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2; complex float in; complex long double expected; int i; - printf("1..%d\n", ntests * 3); - for (i = 0; i < ntests; i++) { __real__ expected = __real__ in = tests[2 * i]; __imag__ in = tests[2 * i + 1]; __imag__ expected = -cimag(in); - assert(fpequal(libcrealf(in), __real__ in)); - assert(fpequal(libcreal(in), __real__ in)); - assert(fpequal(libcreall(in), __real__ in)); - assert(fpequal(libcimagf(in), __imag__ in)); - assert(fpequal(libcimag(in), __imag__ in)); - assert(fpequal(libcimagl(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcrealf(in), __real__ in)); + ATF_REQUIRE(fpequal(libcreal(in), __real__ in)); + ATF_REQUIRE(fpequal(libcreall(in), __real__ in)); + ATF_REQUIRE(fpequal(libcimagf(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcimag(in), __imag__ in)); + ATF_REQUIRE(fpequal(libcimagl(in), __imag__ in)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconjf(in), expected)) { - printf("not ok %d\t# conjf(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 1, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conjf(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 1, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conjf(%#.2g + %#.2gI)\n", - 3 * i + 1, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG( + cfpequal(libconjf(in), expected), + "conjf(%#.2g + %#.2gI): wrong value", creal(in), cimag(in) + ); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconj(in), expected)) { - printf("not ok %d\t# conj(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 2, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conj(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 2, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conj(%#.2g + %#.2gI)\n", - 3 * i + 2, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG(cfpequal(libconj(in), expected), + "conj(%#.2g + %#.2gI): wrong value", creal(in), cimag(in)); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conj(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); - feclearexcept(FE_ALL_EXCEPT); - if (!cfpequal(libconjl(in), expected)) { - printf("not ok %d\t# conjl(%#.2g + %#.2gI): " - "wrong value\n", - 3 * i + 3, creal(in), cimag(in)); - } else if (fetestexcept(FE_ALL_EXCEPT)) { - printf("not ok %d\t# conjl(%#.2g + %#.2gI): " - "threw an exception\n", - 3 * i + 3, creal(in), cimag(in)); - } else { - printf("ok %d\t\t# conjl(%#.2g + %#.2gI)\n", - 3 * i + 3, creal(in), cimag(in)); - } + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_REQUIRE_MSG(cfpequal(libconjl(in), expected), + "conjl(%#.2g + %#.2gI): wrong value", creal(in), cimag(in)); + ATF_REQUIRE_EQ_MSG(0, fetestexcept(FE_ALL_EXCEPT), + "conjl(%#.2g + %#.2gI): threw an exception: %#x", creal(in), + cimag(in), fetestexcept(FE_ALL_EXCEPT)); } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, main); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index 9f596ed67596..a84605a379de 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -72,7 +71,7 @@ static void assert_equal(long double complex d1, long double complex d2) { - assert(cfpequal(d1, d2)); + ATF_CHECK(cfpequal(d1, d2)); } /* @@ -133,7 +132,7 @@ test_finite(void) b = tests[i + 1] * mults[j] * mults[j]; x = tests[i + 2] * mults[j]; y = tests[i + 3] * mults[j]; - assert(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); + ATF_CHECK(t_csqrt(CMPLXL(a, b)) == CMPLXL(x, y)); } } @@ -190,11 +189,11 @@ static void test_nans(void) { - assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); - assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); + ATF_CHECK(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY); + ATF_CHECK(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN))))); - assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); - assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); + ATF_CHECK(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN))))); + ATF_CHECK(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN))))); assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)), CMPLXL(INFINITY, INFINITY)); @@ -224,7 +223,7 @@ test_overflow(int maxexp) long double complex result; int exp, i; - assert(maxexp > 0 && maxexp % 2 == 0); + ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); for (i = 0; i < 4; i++) { exp = maxexp - 2 * i; @@ -233,22 +232,22 @@ test_overflow(int maxexp) a = ldexpl(115 * 0x1p-8, exp); b = ldexpl(252 * 0x1p-8, exp); result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(14 * 0x1p-4, exp / 2)); - assert(cimagl(result) == ldexpl(9 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(creall(result), ldexpl(14 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(cimagl(result), ldexpl(9 * 0x1p-4, exp / 2)); /* csqrt(-11 + 60*I) = 5 + 6*I */ a = ldexpl(-11 * 0x1p-6, exp); b = ldexpl(60 * 0x1p-6, exp); result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(5 * 0x1p-3, exp / 2)); - assert(cimagl(result) == ldexpl(6 * 0x1p-3, exp / 2)); + ATF_CHECK_EQ(creall(result), ldexpl(5 * 0x1p-3, exp / 2)); + ATF_CHECK_EQ(cimagl(result), ldexpl(6 * 0x1p-3, exp / 2)); /* csqrt(225 + 0*I) == 15 + 0*I */ a = ldexpl(225 * 0x1p-8, exp); b = 0; result = t_csqrt(CMPLXL(a, b)); - assert(creall(result) == ldexpl(15 * 0x1p-4, exp / 2)); - assert(cimagl(result) == 0); + ATF_CHECK_EQ(creall(result), ldexpl(15 * 0x1p-4, exp / 2)); + ATF_CHECK_EQ(cimagl(result), 0); } } @@ -266,8 +265,8 @@ test_precision(int maxexp, int mantdig) uint64_t mantbits, sq_mantbits; int exp, i; - assert(maxexp > 0 && maxexp % 2 == 0); - assert(mantdig <= 64); + ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); + ATF_CHECK(mantdig <= 64); mantdig = rounddown(mantdig, 2); for (exp = 0; exp <= maxexp; exp += 2) { @@ -289,79 +288,67 @@ test_precision(int maxexp, int mantdig) b = ldexpl((long double)sq_mantbits, exp - 1 - mantdig); x = ldexpl(mantbits, (exp - 2 - mantdig) / 2); - assert(b == x * x * 2); + ATF_CHECK_EQ(b, x * x * 2); result = t_csqrt(CMPLXL(0, b)); - assert(creall(result) == x); - assert(cimagl(result) == x); + ATF_CHECK_EQ(x, creall(result)); + ATF_CHECK_EQ(x, cimagl(result)); } } } -int -main(void) +ATF_TC_WITHOUT_HEAD(csqrt); +ATF_TC_BODY(csqrt, tc) { - - printf("1..18\n"); - /* Test csqrt() */ t_csqrt = _csqrt; test_finite(); - printf("ok 1 - csqrt\n"); test_zeros(); - printf("ok 2 - csqrt\n"); test_infinities(); - printf("ok 3 - csqrt\n"); test_nans(); - printf("ok 4 - csqrt\n"); test_overflow(DBL_MAX_EXP); - printf("ok 5 - csqrt\n"); test_precision(DBL_MAX_EXP, DBL_MANT_DIG); - printf("ok 6 - csqrt\n"); +} +ATF_TC_WITHOUT_HEAD(csqrtf); +ATF_TC_BODY(csqrtf, tc) +{ /* Now test csqrtf() */ t_csqrt = _csqrtf; test_finite(); - printf("ok 7 - csqrt\n"); test_zeros(); - printf("ok 8 - csqrt\n"); test_infinities(); - printf("ok 9 - csqrt\n"); test_nans(); - printf("ok 10 - csqrt\n"); test_overflow(FLT_MAX_EXP); - printf("ok 11 - csqrt\n"); test_precision(FLT_MAX_EXP, FLT_MANT_DIG); - printf("ok 12 - csqrt\n"); +} +ATF_TC_WITHOUT_HEAD(csqrtl); +ATF_TC_BODY(csqrtl, tc) +{ /* Now test csqrtl() */ t_csqrt = csqrtl; test_finite(); - printf("ok 13 - csqrt\n"); test_zeros(); - printf("ok 14 - csqrt\n"); test_infinities(); - printf("ok 15 - csqrt\n"); test_nans(); - printf("ok 16 - csqrt\n"); test_overflow(LDBL_MAX_EXP); - printf("ok 17 - csqrt\n"); test_precision(LDBL_MAX_EXP, #ifndef __i386__ @@ -370,7 +357,13 @@ main(void) DBL_MANT_DIG #endif ); - printf("ok 18 - csqrt\n"); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, csqrt); + ATF_TP_ADD_TC(tp, csqrtf); + ATF_TP_ADD_TC(tp, csqrtl); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/ctrig_test.c b/lib/msun/tests/ctrig_test.c index 2499e53ab4d5..f3951c575ceb 100644 --- a/lib/msun/tests/ctrig_test.c +++ b/lib/msun/tests/ctrig_test.c @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "test-utils.h" #pragma STDC FENV_ACCESS ON diff --git a/lib/msun/tests/exponential_test.c b/lib/msun/tests/exponential_test.c index 5b39d29fa5bf..14cedf8f9190 100644 --- a/lib/msun/tests/exponential_test.c +++ b/lib/msun/tests/exponential_test.c @@ -31,7 +31,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -60,9 +59,10 @@ __FBSDID("$FreeBSD$"); */ #define test(func, x, result, exceptmask, excepts) do { \ volatile long double _d = x; \ - assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(fpequal((func)(_d), (result))); \ - assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \ + ATF_CHECK(fpequal((func)(_d), (result))); \ + CHECK_FP_EXCEPTIONS_MSG(excepts, exceptmask, "for %s(%s)", \ + #func, #x); \ } while (0) /* Test all the functions that compute b^x. */ @@ -122,48 +122,66 @@ run_generic_tests(void) testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); } -static void -run_exp2_tests(void) + +/* + * We should insist that exp2() return exactly the correct + * result and not raise an inexact exception for integer + * arguments. + */ +ATF_TC_WITHOUT_HEAD(exp2f); +ATF_TC_BODY(exp2f, tc) { - unsigned i; - - /* - * We should insist that exp2() return exactly the correct - * result and not raise an inexact exception for integer - * arguments. - */ - feclearexcept(FE_ALL_EXCEPT); - for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { - assert(exp2f(i) == ldexpf(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - } - for (i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { - assert(exp2(i) == ldexp(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - } - for (i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { - assert(exp2l(i) == ldexpl(1.0, i)); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2f(i), ldexpf(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); } } -int -main(void) +ATF_TC_WITHOUT_HEAD(exp2); +ATF_TC_BODY(exp2, tc) { + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2(i), ldexp(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); + } +} - printf("1..3\n"); +ATF_TC_WITHOUT_HEAD(exp2l); +ATF_TC_BODY(exp2l, tc) +{ + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + for (int i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { + ATF_CHECK_EQ(exp2l(i), ldexpl(1.0, i)); + CHECK_FP_EXCEPTIONS(0, ALL_STD_EXCEPT); + } +} +ATF_TC_WITHOUT_HEAD(generic); +ATF_TC_BODY(generic, tc) +{ run_generic_tests(); - printf("ok 1 - exponential\n"); +} #ifdef __i386__ +ATF_TC_WITHOUT_HEAD(generic_fp_pe); +ATF_TC_BODY(generic_fp_pe, tc) +{ fpsetprec(FP_PE); run_generic_tests(); +} #endif - printf("ok 2 - exponential\n"); - run_exp2_tests(); - printf("ok 3 - exponential\n"); +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, generic); +#ifdef __i386__ + ATF_TP_ADD_TC(tp, generic_fp_pe); +#endif + ATF_TP_ADD_TC(tp, exp2); + ATF_TP_ADD_TC(tp, exp2f); + ATF_TP_ADD_TC(tp, exp2l); - return (0); + return (atf_no_error()); } diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 62abfefb4a8a..b80b591cf52b 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -63,11 +63,14 @@ static int std_except_sets[1 << NEXCEPTS]; /* * Initialize std_except_sets[] to the power set of std_excepts[] */ -static void -init_exceptsets(void) +static __attribute__((constructor)) void +do_setup(void) { unsigned i, j, sr; + /* Avoid double output after fork() */ + setvbuf(stdout, NULL, _IONBF, 0); + for (i = 0; i < 1 << NEXCEPTS; i++) { for (sr = i, j = 0; sr != 0; sr >>= 1, j++) std_except_sets[i] |= std_excepts[j] & ((~sr & 1) - 1); @@ -154,7 +157,7 @@ static void trap_handler(int sig) { - assert(sig == SIGFPE); + ATF_CHECK_EQ(SIGFPE, sig); _exit(0); } @@ -163,8 +166,8 @@ trap_handler(int sig) * The memcmp() test below may be too much to ask for, since there * could be multiple machine-specific default environments. */ -static void -test_dfl_env(void) +ATF_TC_WITHOUT_HEAD(dfl_env); +ATF_TC_BODY(dfl_env, tc) { #ifndef NO_STRICT_DFL_ENV fenv_t env; @@ -186,52 +189,51 @@ test_dfl_env(void) * 1. http://support.amd.com/TechDocs/26569_APM_v5.pdf * 2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf */ - assert(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, + ATF_CHECK(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, sizeof(env.__mxcsr)) == 0); - assert(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, + ATF_CHECK(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, sizeof(env.__x87.__control)) == 0); - assert(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, + ATF_CHECK(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, sizeof(env.__x87.__status)) == 0); - assert(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, + ATF_CHECK(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, sizeof(env.__x87.__tag)) == 0); #else - assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) == 0); + ATF_CHECK_EQ(0, memcmp(&env, FE_DFL_ENV, sizeof(env))); #endif #endif - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); } /* * Test fetestexcept() and feclearexcept(). */ -static void -test_fetestclearexcept(void) +ATF_TC_WITHOUT_HEAD(fetestclearexcept); +ATF_TC_BODY(fetestclearexcept, tc) { int excepts, i; for (i = 0; i < 1 << NEXCEPTS; i++) - assert(fetestexcept(std_except_sets[i]) == 0); + ATF_CHECK_EQ(0, fetestexcept(std_except_sets[i])); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; /* FE_ALL_EXCEPT might be special-cased, as on i386. */ raiseexcept(excepts); - assert(fetestexcept(excepts) == excepts); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(excepts, fetestexcept(excepts)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); raiseexcept(excepts); - assert(fetestexcept(excepts) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(excepts)); if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { excepts |= FE_INEXACT; - assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == - excepts); + ATF_CHECK_EQ(excepts, (fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT)); } else { - assert(fetestexcept(ALL_STD_EXCEPT) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(ALL_STD_EXCEPT)); } - assert(feclearexcept(excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); + ATF_CHECK_EQ(0, feclearexcept(excepts)); + ATF_CHECK_EQ(0, fetestexcept(ALL_STD_EXCEPT)); } } @@ -240,31 +242,29 @@ test_fetestclearexcept(void) * * Prerequisites: fetestexcept(), feclearexcept() */ -static void -test_fegsetexceptflag(void) +ATF_TC_WITHOUT_HEAD(fegsetexceptflag); +ATF_TC_BODY(fegsetexceptflag, tc) { fexcept_t flag; int excepts, i; - assert(fetestexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; - assert(fegetexceptflag(&flag, excepts) == 0); + ATF_CHECK_EQ(0, fegetexceptflag(&flag, excepts)); raiseexcept(ALL_STD_EXCEPT); - assert(fesetexceptflag(&flag, excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == - (ALL_STD_EXCEPT ^ excepts)); - - assert(fegetexceptflag(&flag, FE_ALL_EXCEPT) == 0); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); - assert(fesetexceptflag(&flag, excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == 0); - assert(fesetexceptflag(&flag, ALL_STD_EXCEPT ^ excepts) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == - (ALL_STD_EXCEPT ^ excepts)); - - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, excepts)); + ATF_CHECK_EQ((ALL_STD_EXCEPT ^ excepts), fetestexcept(ALL_STD_EXCEPT)); + + ATF_CHECK_EQ(0, fegetexceptflag(&flag, FE_ALL_EXCEPT)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, excepts)); + ATF_CHECK_EQ(0, fetestexcept(ALL_STD_EXCEPT)); + ATF_CHECK_EQ(0, fesetexceptflag(&flag, ALL_STD_EXCEPT ^ excepts)); + ATF_CHECK_EQ((ALL_STD_EXCEPT ^ excepts), fetestexcept(ALL_STD_EXCEPT)); + + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } } @@ -273,63 +273,62 @@ test_fegsetexceptflag(void) * * Prerequisites: fetestexcept(), feclearexcept() */ -static void -test_feraiseexcept(void) +ATF_TC_WITHOUT_HEAD(feraiseexcept); +ATF_TC_BODY(feraiseexcept, tc) { int excepts, i; for (i = 0; i < 1 << NEXCEPTS; i++) { excepts = std_except_sets[i]; - assert(fetestexcept(FE_ALL_EXCEPT) == 0); - assert(feraiseexcept(excepts) == 0); + ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + ATF_CHECK_EQ(0, feraiseexcept(excepts)); if ((excepts & (FE_UNDERFLOW | FE_OVERFLOW)) != 0) { excepts |= FE_INEXACT; - assert((fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT) == - excepts); + ATF_CHECK_EQ(excepts, (fetestexcept(ALL_STD_EXCEPT) | FE_INEXACT)); } else { - assert(fetestexcept(ALL_STD_EXCEPT) == excepts); + ATF_CHECK_EQ(excepts, fetestexcept(ALL_STD_EXCEPT)); } - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } - assert(feraiseexcept(FE_INVALID | FE_DIVBYZERO) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == (FE_INVALID | FE_DIVBYZERO)); - assert(feraiseexcept(FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) == 0); - assert(fetestexcept(ALL_STD_EXCEPT) == ALL_STD_EXCEPT); - assert(feclearexcept(FE_ALL_EXCEPT) == 0); + ATF_CHECK_EQ(0, feraiseexcept(FE_INVALID | FE_DIVBYZERO)); + ATF_CHECK_EQ((FE_INVALID | FE_DIVBYZERO), fetestexcept(ALL_STD_EXCEPT)); + ATF_CHECK_EQ(0, feraiseexcept(FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)); + ATF_CHECK_EQ(ALL_STD_EXCEPT, fetestexcept(ALL_STD_EXCEPT)); + ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); } /* * Test fegetround() and fesetround(). */ -static void -test_fegsetround(void) +ATF_TC_WITHOUT_HEAD(fegsetround); +ATF_TC_BODY(fegsetround, tc) { - assert(fegetround() == FE_TONEAREST); - assert(getround() == FE_TONEAREST); - assert(FLT_ROUNDS == 1); + ATF_CHECK_EQ(FE_TONEAREST, fegetround()); + ATF_CHECK_EQ(FE_TONEAREST, getround()); + ATF_CHECK_EQ(1, FLT_ROUNDS); - assert(fesetround(FE_DOWNWARD) == 0); - assert(fegetround() == FE_DOWNWARD); - assert(getround() == FE_DOWNWARD); - assert(FLT_ROUNDS == 3); + ATF_CHECK_EQ(0, fesetround(FE_DOWNWARD)); + ATF_CHECK_EQ(FE_DOWNWARD, fegetround()); + ATF_CHECK_EQ(FE_DOWNWARD, getround()); + ATF_CHECK_EQ(3, FLT_ROUNDS); - assert(fesetround(FE_UPWARD) == 0); - assert(getround() == FE_UPWARD); - assert(fegetround() == FE_UPWARD); - assert(FLT_ROUNDS == 2); + ATF_CHECK_EQ(0, fesetround(FE_UPWARD)); + ATF_CHECK_EQ(FE_UPWARD, getround()); + ATF_CHECK_EQ(FE_UPWARD, fegetround()); + ATF_CHECK_EQ(2, FLT_ROUNDS); - assert(fesetround(FE_TOWARDZERO) == 0); - assert(getround() == FE_TOWARDZERO); - assert(fegetround() == FE_TOWARDZERO); - assert(FLT_ROUNDS == 0); + ATF_CHECK_EQ(0, fesetround(FE_TOWARDZERO)); + ATF_CHECK_EQ(FE_TOWARDZERO, getround()); + ATF_CHECK_EQ(FE_TOWARDZERO, fegetround()); + ATF_CHECK_EQ(0, FLT_ROUNDS); - assert(fesetround(FE_TONEAREST) == 0); - assert(getround() == FE_TONEAREST); - assert(FLT_ROUNDS == 1); + ATF_CHECK_EQ(0, fesetround(FE_TONEAREST)); + ATF_CHECK_EQ(FE_TONEAREST, getround()); *** 2137 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F7565EBE13; Thu, 22 Apr 2021 11:08: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 4FQvmW4R5Fz3kxq; Thu, 22 Apr 2021 11:08: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 C5DFD18BB3; Thu, 22 Apr 2021 11:08: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 13MB8QBf088563; Thu, 22 Apr 2021 11:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8QGE088562; Thu, 22 Apr 2021 11:08:26 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:26 GMT Message-Id: <202104221108.13MB8QGE088562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 5ba5ebf92b5d - stable/13 - Remove XFAILs from fmaxmin test 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ba5ebf92b5daec3f3eacf64fc56a863d9547bc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:28 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5ba5ebf92b5daec3f3eacf64fc56a863d9547bc3 commit 5ba5ebf92b5daec3f3eacf64fc56a863d9547bc3 Author: Alex Richardson AuthorDate: 2021-03-22 11:40:17 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:43:13 +0000 Remove XFAILs from fmaxmin test These appears to have been resolved by compiling the test with -fno-builtin and/or using a newer compiler. PR: 208703 Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28884 (cherry picked from commit b358534ab1a953fac5830012751232e2f0807cc0) --- lib/msun/tests/fmaxmin_test.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c index a89c10cc2554..06bd0a1ba7e0 100644 --- a/lib/msun/tests/fmaxmin_test.c +++ b/lib/msun/tests/fmaxmin_test.c @@ -94,13 +94,6 @@ testall(long double big, long double small) } } -/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ -#if defined(__clang__) && \ - ((__clang_major__ > 3)) || \ - ((__clang_major__ == 3 && __clang_minor__ >= 8)) -#define affected_by_bug_208703 -#endif - ATF_TC_WITHOUT_HEAD(test1); ATF_TC_BODY(test1, tc) { @@ -133,17 +126,11 @@ ATF_TC_BODY(test5, tc) ATF_TC_WITHOUT_HEAD(test6); ATF_TC_BODY(test6, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(1.0, NAN); } ATF_TC_WITHOUT_HEAD(test7); ATF_TC_BODY(test7, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(INFINITY, NAN); } @@ -162,18 +149,12 @@ ATF_TC_BODY(test9, tc) ATF_TC_WITHOUT_HEAD(test10); ATF_TC_BODY(test10, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(3.0, -INFINITY); } ATF_TC_WITHOUT_HEAD(test11); ATF_TC_BODY(test11, tc) { -#ifdef affected_by_bug_208703 - atf_tc_expect_fail("fails invariant with clang 3.8+ (bug 208703)"); -#endif testall(NAN, NAN); } From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D3D15EBE1E; Thu, 22 Apr 2021 11:08: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 4FQvmb6WlWz3ky3; Thu, 22 Apr 2021 11:08: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 45DFE188CD; Thu, 22 Apr 2021 11:08: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 13MB8VJ9088734; Thu, 22 Apr 2021 11:08:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8Viw088733; Thu, 22 Apr 2021 11:08:31 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:31 GMT Message-Id: <202104221108.13MB8Viw088733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 78fa908b1e88 - stable/13 - lib/msun/tests: Add more debug output to fenv_test.c 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 78fa908b1e88f78160664e93560b9ac78caecc53 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:32 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=78fa908b1e88f78160664e93560b9ac78caecc53 commit 78fa908b1e88f78160664e93560b9ac78caecc53 Author: Alex Richardson AuthorDate: 2021-03-04 18:41:06 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:51 +0000 lib/msun/tests: Add more debug output to fenv_test.c Output a hex dump of the current fenv and the expected value to allow comparing them without having to resort to interactive use of GDB. (cherry picked from commit 6ccdee8ab576577224fb9e4baed05bd0efe933fd) --- lib/msun/tests/Makefile | 1 + lib/msun/tests/fenv_test.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 4ef25c0a909a..7da1944c8ed8 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -86,6 +86,7 @@ IGNORE_PRAGMA= SRCS.ilogb2_test= ilogb_test.c +LIBADD.fenv_test+= util LIBADD+= m WARNS?= 6 diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index f275f0725504..aafdd32b7fbd 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,7 +174,10 @@ ATF_TC_BODY(dfl_env, tc) fenv_t env; fegetenv(&env); - + /* Print the default environment for debugging purposes. */ + hexdump(&env, sizeof(env), "current fenv ", HD_OMIT_CHARS); + hexdump(FE_DFL_ENV, sizeof(env), "default fenv ", HD_OMIT_CHARS); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); #ifdef __amd64__ /* * Compare the fields that the AMD [1] and Intel [2] specs say will be @@ -202,7 +206,7 @@ ATF_TC_BODY(dfl_env, tc) #endif #endif - ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT)); + CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT); } /* From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 980125EBD48; Thu, 22 Apr 2021 11:08: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 4FQvmR3DsBz3kV8; Thu, 22 Apr 2021 11:08: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 4C4DF18AC5; Thu, 22 Apr 2021 11:08: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 13MB8NCL088492; Thu, 22 Apr 2021 11:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8NWa088491; Thu, 22 Apr 2021 11:08:23 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:23 GMT Message-Id: <202104221108.13MB8NWa088491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: fe173c91b041 - stable/13 - lib/msun: Avoid FE_INEXACT for x86 log2l/log10l 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fe173c91b04148eaa12e15eb4aa444350ccaded4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:23 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=fe173c91b04148eaa12e15eb4aa444350ccaded4 commit fe173c91b04148eaa12e15eb4aa444350ccaded4 Author: Alex Richardson AuthorDate: 2021-03-08 09:39:29 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:42:48 +0000 lib/msun: Avoid FE_INEXACT for x86 log2l/log10l This fixes tests/lib/msun/logarithm_test after compiling the test with -fno-builtin (D28577). Adding invln10_lo + invln10_10 results in FE_INEXACT (for all inputs) and the same for the log2l invln2_lo + invln2_hi. This patch avoids FE_INEXACT (for exact results such as 0) by defining a constant and using that. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D28786 (cherry picked from commit 221622ec0c8e184dd1ea7e1f77fb45d2d32cb6e2) --- lib/msun/ld128/s_logl.c | 18 +++++++++--------- lib/msun/ld80/s_logl.c | 9 ++++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/msun/ld128/s_logl.c b/lib/msun/ld128/s_logl.c index 93a2a7c35ff5..4774a271e7ad 100644 --- a/lib/msun/ld128/s_logl.c +++ b/lib/msun/ld128/s_logl.c @@ -697,14 +697,15 @@ invln10_hi = 4.3429448176175356e-1, /* 0x1bcb7b15000000.0p-54 */ invln2_hi = 1.4426950402557850e0; /* 0x17154765000000.0p-52 */ static const long double invln10_lo = 1.41498268538580090791605082294397000e-10L, /* 0x137287195355baaafad33dc323ee3.0p-145L */ -invln2_lo = 6.33178418956604368501892137426645911e-10L; /* 0x15c17f0bbbe87fed0691d3e88eb57.0p-143L */ +invln2_lo = 6.33178418956604368501892137426645911e-10L, /* 0x15c17f0bbbe87fed0691d3e88eb57.0p-143L */ +invln10_lo_plus_hi = invln10_lo + invln10_hi, +invln2_lo_plus_hi = invln2_lo + invln2_hi; long double log10l(long double x) { struct ld r; - long double lo; - float hi; + long double hi, lo; ENTERI(); DOPRINT_START(&x); @@ -712,18 +713,17 @@ log10l(long double x) if (!r.lo_set) RETURNPI(r.hi); _2sumF(r.hi, r.lo); - hi = r.hi; + hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln10_hi * hi, - (invln10_lo + invln10_hi) * lo + invln10_lo * hi); + invln10_lo_plus_hi * lo + invln10_lo * hi); } long double log2l(long double x) { struct ld r; - long double lo; - float hi; + long double hi, lo; ENTERI(); DOPRINT_START(&x); @@ -731,10 +731,10 @@ log2l(long double x) if (!r.lo_set) RETURNPI(r.hi); _2sumF(r.hi, r.lo); - hi = r.hi; + hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln2_hi * hi, - (invln2_lo + invln2_hi) * lo + invln2_lo * hi); + invln2_lo_plus_hi * lo + invln2_lo * hi); } #endif /* STRUCT_RETURN */ diff --git a/lib/msun/ld80/s_logl.c b/lib/msun/ld80/s_logl.c index 0a220f2a2403..d787b953fedb 100644 --- a/lib/msun/ld80/s_logl.c +++ b/lib/msun/ld80/s_logl.c @@ -677,8 +677,11 @@ logl(long double x) static const double invln10_hi = 4.3429448190317999e-1, /* 0x1bcb7b1526e000.0p-54 */ invln10_lo = 7.1842412889749798e-14, /* 0x1438ca9aadd558.0p-96 */ +invln10_lo_plus_hi = invln10_lo + invln10_hi, invln2_hi = 1.4426950408887933e0, /* 0x171547652b8000.0p-52 */ -invln2_lo = 1.7010652264631490e-13; /* 0x17f0bbbe87fed0.0p-95 */ +invln2_lo = 1.7010652264631490e-13, /* 0x17f0bbbe87fed0.0p-95 */ +invln2_lo_plus_hi = invln2_lo + invln2_hi; + long double log10l(long double x) @@ -695,7 +698,7 @@ log10l(long double x) hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln10_hi * hi, - (invln10_lo + invln10_hi) * lo + invln10_lo * hi); + invln10_lo_plus_hi * lo + invln10_lo * hi); } long double @@ -713,7 +716,7 @@ log2l(long double x) hi = (float)r.hi; lo = r.lo + (r.hi - hi); RETURN2PI(invln2_hi * hi, - (invln2_lo + invln2_hi) * lo + invln2_lo * hi); + invln2_lo_plus_hi * lo + invln2_lo * hi); } #endif /* STRUCT_RETURN */ From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 167305EBF07; Thu, 22 Apr 2021 11:08: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 4FQvmd4n3qz3ks8; Thu, 22 Apr 2021 11:08: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 68CC918CD3; Thu, 22 Apr 2021 11:08: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 13MB8WM7088778; Thu, 22 Apr 2021 11:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8WFa088777; Thu, 22 Apr 2021 11:08:32 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:32 GMT Message-Id: <202104221108.13MB8WFa088777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: f32309564547 - stable/13 - Don't add -Winline for WARNS=6 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f3230956454747d4ef4f6d065fd7a5c269d6250d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:36 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f3230956454747d4ef4f6d065fd7a5c269d6250d commit f3230956454747d4ef4f6d065fd7a5c269d6250d Author: Alex Richardson AuthorDate: 2021-03-22 11:55:45 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:51 +0000 Don't add -Winline for WARNS=6 This warning is very rarely useful (inline is a hint and not mandatory). This flag results in many warnings being printed when compiling C++ code that uses the standard library with GCC. This flag was originally added in back in r94332 but the flag is a no-op in Clang ("This diagnostic flag exists for GCC compatibility, and has no effect in Clang"). Removing it should make the GCC build output slightly more readable. Reviewed By: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D29235 (cherry picked from commit c8c62548bffb83f3d25e062929c45d66fea755f1) --- lib/librt/Makefile | 2 +- lib/libthr/Makefile | 1 - share/mk/bsd.sys.mk | 3 +-- stand/i386/boot2/Makefile | 3 +-- stand/i386/isoboot/Makefile | 2 +- sys/conf/kern.mk | 1 - sys/conf/kern.pre.mk | 3 +-- tools/regression/capsicum/syscalls/Makefile | 2 +- 8 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/librt/Makefile b/lib/librt/Makefile index 389e0280a6bc..6a751b7a3aa3 100644 --- a/lib/librt/Makefile +++ b/lib/librt/Makefile @@ -8,7 +8,7 @@ CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR} .ifndef NO_THREAD_STACK_UNWIND CFLAGS+=-fexceptions .endif -CFLAGS+=-Winline -Wall +CFLAGS+=-Wall LIBADD= pthread WARNS?= 2 diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index c77b6b565a87..1a5dfa18dca7 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -25,7 +25,6 @@ CFLAGS+=-I${.CURDIR}/sys CFLAGS+=-I${SRCTOP}/libexec/rtld-elf CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${SRCTOP}/lib/libthread_db -CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index fad487cf5630..6341800d5c70 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -60,7 +60,7 @@ CWARNFLAGS+= -Wcast-align .endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE} .endif # WARNS >= 4 .if ${WARNS} >= 6 -CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ +CWARNFLAGS+= -Wchar-subscripts -Wnested-externs -Wredundant-decls\ -Wold-style-definition .if !defined(NO_WMISSING_VARIABLE_DECLARATIONS) CWARNFLAGS.clang+= -Wmissing-variable-declarations @@ -147,7 +147,6 @@ CWARNFLAGS+= -Wno-error=address \ -Wno-error=deprecated-declarations \ -Wno-error=enum-compare \ -Wno-error=extra \ - -Wno-error=inline \ -Wno-error=logical-not-parentheses \ -Wno-error=strict-aliasing \ -Wno-error=uninitialized \ diff --git a/stand/i386/boot2/Makefile b/stand/i386/boot2/Makefile index 8758261ad45f..d5ad0f6bd12c 100644 --- a/stand/i386/boot2/Makefile +++ b/stand/i386/boot2/Makefile @@ -31,8 +31,7 @@ CFLAGS+=-fomit-frame-pointer \ -I${LDRSRC} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings CFLAGS.gcc+= -Os \ -fno-asynchronous-unwind-tables \ diff --git a/stand/i386/isoboot/Makefile b/stand/i386/isoboot/Makefile index 67936e16176a..7732882b1e5c 100644 --- a/stand/i386/isoboot/Makefile +++ b/stand/i386/isoboot/Makefile @@ -29,7 +29,7 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-pointer-sign + -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b0a26cd1680c..3f14a42ab226 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -48,7 +48,6 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=attributes \ -Wno-error=cast-qual \ -Wno-error=enum-compare \ - -Wno-error=inline \ -Wno-error=maybe-uninitialized \ -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 75f59a90484d..bb52d1b9fbc4 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -192,7 +192,7 @@ NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ - -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ \ + -Wno-missing-prototypes ${PROF} -U__BMI__ \ -DZSTD_NO_INTRINSICS \ ${.IMPSRC} # https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] @@ -222,7 +222,6 @@ CDDL_CFLAGS= \ ${CFLAGS} \ -Wno-cast-qual \ -Wno-duplicate-decl-specifier \ - -Wno-inline \ -Wno-missing-braces \ -Wno-missing-prototypes \ -Wno-nested-externs \ diff --git a/tools/regression/capsicum/syscalls/Makefile b/tools/regression/capsicum/syscalls/Makefile index 5d3422656281..2380193d7d7a 100644 --- a/tools/regression/capsicum/syscalls/Makefile +++ b/tools/regression/capsicum/syscalls/Makefile @@ -6,7 +6,7 @@ CFLAGS= -O2 -pipe -std=gnu99 -fstack-protector CFLAGS+= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type CFLAGS+= -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -CFLAGS+= -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls +CFLAGS+= -Wcast-align -Wchar-subscripts -Wnested-externs -Wredundant-decls CFLAGS+= -Wold-style-definition -Wno-pointer-sign all: ${SYSCALLS} ${SYSCALLS:=.t} From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6A205EBCCD; Thu, 22 Apr 2021 11:08: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 4FQvmf6Yrzz3kVv; Thu, 22 Apr 2021 11:08: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 8A1B418AC7; Thu, 22 Apr 2021 11:08: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 13MB8XQu088799; Thu, 22 Apr 2021 11:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8XNr088798; Thu, 22 Apr 2021 11:08:33 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:33 GMT Message-Id: <202104221108.13MB8XNr088798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 549e8b821fcf - stable/13 - Fix unused functions in invtrig_test.c 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 549e8b821fcf102a99bffb995832e01fc9c5108d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:37 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=549e8b821fcf102a99bffb995832e01fc9c5108d commit 549e8b821fcf102a99bffb995832e01fc9c5108d Author: Alex Richardson AuthorDate: 2021-03-22 13:05:28 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:51 +0000 Fix unused functions in invtrig_test.c I only tested the WARNS=6 change on AArch64 and AMD64, but this file has unused functions for architectures with LDBL_PREC == 53. While touching this file change the LDBL_PREC == 53 checks to i386 checks. The long double tests should only be disabled for i386 (due to the rather odd rounding mode that it uses) not all architectures where long double is the same as double. PR: 205449 Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6") Reported by: Jenkins (cherry picked from commit 7f5693d05329ab976287b8d449e694e7a0f99e88) --- lib/msun/tests/invtrig_test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/msun/tests/invtrig_test.c b/lib/msun/tests/invtrig_test.c index 7dd8b26f652f..90ebcc5dfdad 100644 --- a/lib/msun/tests/invtrig_test.c +++ b/lib/msun/tests/invtrig_test.c @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ } while (0) -#if LDBL_PREC == 53 +#ifdef __i386__ #define testall_tol _testall_tol #else #define testall_tol(prefix, x, result, tol, excepts) do { \ @@ -98,7 +98,7 @@ __FBSDID("$FreeBSD$"); (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ } while (0) -#if LDBL_PREC == 53 +#ifdef __i386__ #define testall2_tol _testall2_tol #else #define testall2_tol(prefix, y, x, result, tol, excepts) do { \ @@ -380,12 +380,14 @@ sinasin(double x) return (sinl(asin(x))); } +#ifndef __i386__ static long double sinasinl(long double x) { return (sinl(asinl(x))); } +#endif static long double cosacosf(float x) @@ -401,12 +403,14 @@ cosacos(double x) return (cosl(acos(x))); } +#ifndef __i386__ static long double cosacosl(long double x) { return (cosl(acosl(x))); } +#endif static long double tanatanf(float x) @@ -422,12 +426,14 @@ tanatan(double x) return (tanl(atan(x))); } +#ifndef __i386__ static long double tanatanl(long double x) { return (tanl(atanl(x))); } +#endif ATF_TC_WITHOUT_HEAD(inverse); ATF_TC_BODY(inverse, tc) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D298A5EBE2F; Thu, 22 Apr 2021 11:08: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 4FQvmh5qX1z3kW4; Thu, 22 Apr 2021 11:08: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 B36C218CD4; Thu, 22 Apr 2021 11:08: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 13MB8Z2U088845; Thu, 22 Apr 2021 11:08:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8ZHD088844; Thu, 22 Apr 2021 11:08:35 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:35 GMT Message-Id: <202104221108.13MB8ZHD088844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: d72052dd5ed6 - stable/13 - lib/msun/tests: Re-enable csqrt_test on AArch64 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d72052dd5ed6ccd126fe8ea4bf580c2f726920c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:39 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d72052dd5ed6ccd126fe8ea4bf580c2f726920c4 commit d72052dd5ed6ccd126fe8ea4bf580c2f726920c4 Author: Alex Richardson AuthorDate: 2021-03-22 16:54:38 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:52 +0000 lib/msun/tests: Re-enable csqrt_test on AArch64 The LLVM bug was fixed a long time ago and with D29076 this test actually passes now. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D29092 (cherry picked from commit dbb2d6f5e1231a9f6b49efdc720ce97b520da2ba) --- lib/msun/tests/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 7da1944c8ed8..793d2e29639c 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -54,11 +54,7 @@ NETBSD_ATF_TESTS_C+= tanh_test ATF_TESTS_C+= cexp_test ATF_TESTS_C+= conj_test -.if ${MACHINE_CPUARCH} != "aarch64" -# Hits an assert in llvm when building for arm64: -# https://llvm.org/bugs/show_bug.cgi?id=26081 ATF_TESTS_C+= csqrt_test -.endif ATF_TESTS_C+= ctrig_test ATF_TESTS_C+= exponential_test ATF_TESTS_C+= fenv_test From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A4C35EBD79; Thu, 22 Apr 2021 11:08: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 4FQvmj18Gdz3kyK; Thu, 22 Apr 2021 11:08: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 E3C5218BB4; Thu, 22 Apr 2021 11:08: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 13MB8ak0088870; Thu, 22 Apr 2021 11:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8amI088869; Thu, 22 Apr 2021 11:08:36 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:36 GMT Message-Id: <202104221108.13MB8amI088869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: a18882ec97cc - stable/13 - lib/msun/tests: Drop WARNS=6 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a18882ec97ccb61b67fc70bd7aef3b0c9e710d96 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:37 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=a18882ec97ccb61b67fc70bd7aef3b0c9e710d96 commit a18882ec97ccb61b67fc70bd7aef3b0c9e710d96 Author: Alex Richardson AuthorDate: 2021-03-22 16:56:10 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:53 +0000 lib/msun/tests: Drop WARNS=6 This is the default already, so there is no need to override it. Reported by: kevans (cherry picked from commit f33b4fa2f0d4acf3978c7490b25c999b319c543b) --- lib/msun/tests/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 793d2e29639c..70f7d2fe5135 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -85,8 +85,6 @@ SRCS.ilogb2_test= ilogb_test.c LIBADD.fenv_test+= util LIBADD+= m -WARNS?= 6 - # Copied from lib/msun/Makefile .if ${MACHINE_CPUARCH} == "i386" ARCH_SUBDIR= i387 From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A41A5EBEB5; Thu, 22 Apr 2021 11:08: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 4FQvmg1vfSz3kyF; Thu, 22 Apr 2021 11:08: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 B010D18AC8; Thu, 22 Apr 2021 11:08: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 13MB8Y5C088821; Thu, 22 Apr 2021 11:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8YQk088820; Thu, 22 Apr 2021 11:08:34 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:34 GMT Message-Id: <202104221108.13MB8YQk088820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 47950e427c5f - stable/13 - Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 47950e427c5ffada65d639fb1107bf6a3ab85b7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:36 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=47950e427c5ffada65d639fb1107bf6a3ab85b7f commit 47950e427c5ffada65d639fb1107bf6a3ab85b7f Author: Alex Richardson AuthorDate: 2021-03-22 16:54:02 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:52 +0000 Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double If long double has more than 64 mantissa bits, using uint64_t to hold the mantissa bits will truncate the value and result in test failures. To fix this problem use __uint128_t since all platforms that have __LDBL_MANT_DIG__ > 64 also have compiler support for 128-bit integers. Reviewed By: rlibby Differential Revision: https://reviews.freebsd.org/D29076 (cherry picked from commit ce88eb476b86cac63cef7466bd71f14b611ab03a) --- lib/msun/tests/csqrt_test.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/msun/tests/csqrt_test.c b/lib/msun/tests/csqrt_test.c index a46d0ddd45c5..895aec481b60 100644 --- a/lib/msun/tests/csqrt_test.c +++ b/lib/msun/tests/csqrt_test.c @@ -257,17 +257,24 @@ test_precision(int maxexp, int mantdig) { long double b, x; long double complex result; - uint64_t mantbits, sq_mantbits; +#if LDBL_MANT_DIG <= 64 + typedef uint64_t ldbl_mant_type; +#elif LDBL_MANT_DIG <= 128 + typedef __uint128_t ldbl_mant_type; +#else +#error "Unsupported long double format" +#endif + ldbl_mant_type mantbits, sq_mantbits; int exp, i; - ATF_CHECK(maxexp > 0 && maxexp % 2 == 0); - ATF_CHECK(mantdig <= 64); + ATF_REQUIRE(maxexp > 0 && maxexp % 2 == 0); + ATF_REQUIRE(mantdig <= LDBL_MANT_DIG); mantdig = rounddown(mantdig, 2); for (exp = 0; exp <= maxexp; exp += 2) { - mantbits = ((uint64_t)1 << (mantdig / 2 )) - 1; - for (i = 0; - i < 100 && mantbits > ((uint64_t)1 << (mantdig / 2 - 1)); + mantbits = ((ldbl_mant_type)1 << (mantdig / 2)) - 1; + for (i = 0; i < 100 && + mantbits > ((ldbl_mant_type)1 << (mantdig / 2 - 1)); i++, mantbits--) { sq_mantbits = mantbits * mantbits; /* @@ -283,10 +290,10 @@ test_precision(int maxexp, int mantdig) b = ldexpl((long double)sq_mantbits, exp - 1 - mantdig); x = ldexpl(mantbits, (exp - 2 - mantdig) / 2); - ATF_CHECK_EQ(b, x * x * 2); + CHECK_FPEQUAL(b, x * x * 2); result = t_csqrt(CMPLXL(0, b)); - ATF_CHECK_EQ(x, creall(result)); - ATF_CHECK_EQ(x, cimagl(result)); + CHECK_FPEQUAL(x, creall(result)); + CHECK_FPEQUAL(x, cimagl(result)); } } } @@ -345,6 +352,7 @@ ATF_TC_BODY(csqrtl, tc) test_overflow(LDBL_MAX_EXP); + /* i386 is configured to use 53-bit rounding precision for long double. */ test_precision(LDBL_MAX_EXP, #ifndef __i386__ LDBL_MANT_DIG From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9267F5EBE1B; Thu, 22 Apr 2021 11:08: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 4FQvmb09vyz3kjr; Thu, 22 Apr 2021 11:08: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 2C4A618AC6; Thu, 22 Apr 2021 11:08: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 13MB8Uov088641; Thu, 22 Apr 2021 11:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8U5Q088640; Thu, 22 Apr 2021 11:08:30 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:30 GMT Message-Id: <202104221108.13MB8U5Q088640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 1f7e87f2d322 - stable/13 - lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f7e87f2d322512a055ca95fdff2e15fc21d243e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:31 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7e87f2d322512a055ca95fdff2e15fc21d243e commit 1f7e87f2d322512a055ca95fdff2e15fc21d243e Author: Alex Richardson AuthorDate: 2021-03-22 11:53:40 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:50 +0000 lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped Some CPUs (e.g. AArch64 QEMU) cannot trap on floating point exceptions and therefore ignore the writes to the floating point control register inside feenableexcept(). If no exceptions are enabled after feenableexcept(FE_ALL_EXCEPT), we can assume that the CPU does not support exceptions and we can then skip the test. Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D29095 (cherry picked from commit 2b9dbcd390dfbd573d3403360a36c5ade9815266) --- lib/msun/tests/fenv_test.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/msun/tests/fenv_test.c b/lib/msun/tests/fenv_test.c index 76998a7cb2d5..f275f0725504 100644 --- a/lib/msun/tests/fenv_test.c +++ b/lib/msun/tests/fenv_test.c @@ -392,7 +392,27 @@ ATF_TC_BODY(masking, tc) int except, pass, raise, status; unsigned i; - ATF_CHECK_EQ(0, (fegetexcept() & ALL_STD_EXCEPT)); + ATF_REQUIRE_EQ(0, (fegetexcept() & ALL_STD_EXCEPT)); + + /* + * Some CPUs, e.g. AArch64 QEMU does not support trapping on FP + * exceptions. In that case the trap enable bits are all RAZ/WI, so + * writing to those bits will be ignored and the the next read will + * return all zeroes for those bits. Skip the test if no floating + * point exceptions are supported and mark it XFAIL if some are missing. + */ + ATF_REQUIRE_EQ(0, (feenableexcept(FE_ALL_EXCEPT))); + except = fegetexcept(); + if (except == 0) { + atf_tc_skip("CPU does not support trapping on floating point " + "exceptions."); + } else if ((except & ALL_STD_EXCEPT) != ALL_STD_EXCEPT) { + atf_tc_expect_fail("Not all floating point exceptions can be " + "set to trap: %#x vs %#x", except, ALL_STD_EXCEPT); + } + fedisableexcept(FE_ALL_EXCEPT); + + ATF_CHECK_EQ(0, (feenableexcept(FE_INVALID|FE_OVERFLOW) & ALL_STD_EXCEPT)); ATF_CHECK_EQ((FE_INVALID | FE_OVERFLOW), (feenableexcept(FE_UNDERFLOW) & ALL_STD_EXCEPT)); ATF_CHECK_EQ((FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW), (fedisableexcept(FE_OVERFLOW) & ALL_STD_EXCEPT)); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F63A5EBF24; Thu, 22 Apr 2021 11:08: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 4FQvmm6TmKz3kyW; Thu, 22 Apr 2021 11:08:40 +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 564D718BB6; Thu, 22 Apr 2021 11:08:40 +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 13MB8ewO088934; Thu, 22 Apr 2021 11:08:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8ePS088933; Thu, 22 Apr 2021 11:08:40 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:40 GMT Message-Id: <202104221108.13MB8ePS088933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: d08c4d80abd8 - stable/13 - Remove XFAIL from tests/lib/msun/lround_test:main 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d08c4d80abd8fc49771f9e3895a5d519633a64ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:42 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d08c4d80abd8fc49771f9e3895a5d519633a64ef commit d08c4d80abd8fc49771f9e3895a5d519633a64ef Author: Alex Richardson AuthorDate: 2021-04-15 15:07:58 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:55 +0000 Remove XFAIL from tests/lib/msun/lround_test:main This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c. PR: 205451 MFC after: 1 week (cherry picked from commit 062293c2c471c6affb46f0ba44e7b7ee5b77b591) --- lib/msun/tests/lround_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/msun/tests/lround_test.c b/lib/msun/tests/lround_test.c index b2a046917c71..a6daa5459c7b 100644 --- a/lib/msun/tests/lround_test.c +++ b/lib/msun/tests/lround_test.c @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); ATF_TC_WITHOUT_HEAD(main); ATF_TC_BODY(main, tc) { - atf_tc_expect_fail("https://bugs.freebsd.org/205451"); testall(0.0, 0, 0); testall(0.25, 0, FE_INEXACT); testall(0.5, 1, FE_INEXACT); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34DB35EBE35; Thu, 22 Apr 2021 11:08: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 4FQvmm1hdwz3kqG; Thu, 22 Apr 2021 11:08: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 22A5518BB5; Thu, 22 Apr 2021 11:08: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 13MB8dJW088912; Thu, 22 Apr 2021 11:08:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8d8g088911; Thu, 22 Apr 2021 11:08:39 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:39 GMT Message-Id: <202104221108.13MB8d8g088911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 959cda8efcd2 - stable/13 - Remove amd64 XFAIL from tests/lib/msun/fma_test:infinities 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 959cda8efcd2b3f2dfa711b5e27602b0337e718e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:41 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=959cda8efcd2b3f2dfa711b5e27602b0337e718e commit 959cda8efcd2b3f2dfa711b5e27602b0337e718e Author: Alex Richardson AuthorDate: 2021-04-15 15:04:19 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:54 +0000 Remove amd64 XFAIL from tests/lib/msun/fma_test:infinities This test no longer fails after 3b00222f156dca5700c839d73e36daf479fa640c. PR: 205448 MFC after: 1 week (cherry picked from commit 3f01d8c2fe5d31866258c9872f35030d98828e48) --- lib/msun/tests/fma_test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/msun/tests/fma_test.c b/lib/msun/tests/fma_test.c index 4e3df40be9c9..2855877c68d0 100644 --- a/lib/msun/tests/fma_test.c +++ b/lib/msun/tests/fma_test.c @@ -484,10 +484,6 @@ ATF_TC_BODY(zeroes, tc) ATF_TC_WITHOUT_HEAD(infinities); ATF_TC_BODY(infinities, tc) { -#if defined(__amd64__) - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_expect_fail("https://bugs.freebsd.org/205448"); -#endif for (size_t i = 0; i < nitems(rmodes); i++) { printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59A0B5EBDE1; Thu, 22 Apr 2021 11:08: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 4FQvmn6SLmz3l1c; Thu, 22 Apr 2021 11:08: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 7560E18D18; Thu, 22 Apr 2021 11:08: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 13MB8fL3088955; Thu, 22 Apr 2021 11:08:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8fVJ088954; Thu, 22 Apr 2021 11:08:41 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:41 GMT Message-Id: <202104221108.13MB8fVJ088954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: b8beded34398 - stable/13 - Allow lib/msun/logarithm_test to pass on ld128 platforms 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b8beded343980477e6d670c263fda7b0007510cc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:42 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=b8beded343980477e6d670c263fda7b0007510cc commit b8beded343980477e6d670c263fda7b0007510cc Author: Alex Richardson AuthorDate: 2021-04-19 23:22:45 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:55 +0000 Allow lib/msun/logarithm_test to pass on ld128 platforms For some reason the ld128 log1pl() implementation is less accurate than logl(), but does at least guarantee precision >= the ld80 implementation. Mark log1p_accuracy_tests as XFAIL for ld128 and increase the log1p tolerance to the ld80 equivalent in accuracy_tests to avoid losing test coverage for the other functions. PR: 253984 Reviewed By: ngie, dim Differential Revision: https://reviews.freebsd.org/D29039 (cherry picked from commit 1ad83445fc0f1d2aecd32635f4ae713a057aa091) --- lib/msun/tests/logarithm_test.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/msun/tests/logarithm_test.c b/lib/msun/tests/logarithm_test.c index 48a368765b71..e372e889cb82 100644 --- a/lib/msun/tests/logarithm_test.c +++ b/lib/msun/tests/logarithm_test.c @@ -212,6 +212,17 @@ ATF_TC_BODY(accuracy_tests, tc) }; unsigned i; + long double log1p_ldbl_ulp = LDBL_ULP(); +#if LDBL_MANT_DIG > 64 + /* + * On ld128 platforms the log1p() implementation provides less accuracy, + * but does still match the ld80 precision. Use the ld80 LDBL_ULP() + * value for now to avoid losing test coverage for the other functions. + * Reported as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253984 + */ + log1p_ldbl_ulp = ldexpl(1.0, 1 - 64); +#endif + for (i = 0; i < nitems(tests); i++) { test_tol(log2, tests[i].x, tests[i].log2x, DBL_ULP()); test_tol(log2f, tests[i].x, tests[i].log2x, FLT_ULP()); @@ -228,7 +239,7 @@ ATF_TC_BODY(accuracy_tests, tc) test_tol(log1pf, tests[i].x - 1, tests[i].logex, FLT_ULP()); test_tol(log1pl, tests[i].x - 1, tests[i].logex, - LDBL_ULP()); + log1p_ldbl_ulp); } } } @@ -236,6 +247,11 @@ ATF_TC_BODY(accuracy_tests, tc) ATF_TC_WITHOUT_HEAD(log1p_accuracy_tests); ATF_TC_BODY(log1p_accuracy_tests, tc) { +#if LDBL_MANT_DIG > 64 + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_expect_fail("https://bugs.freebsd.org/253984"); +#endif + test_tol(log1pf, 0x0.333333p0F, 1.82321546859847114303367992804596800640e-1L, FLT_ULP()); test_tol(log1p, 0x0.3333333333333p0, From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:08:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E75DD5EBC7B; Thu, 22 Apr 2021 11:08: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 4FQvmk2qTRz3kw5; Thu, 22 Apr 2021 11:08:38 +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 0544718CD5; Thu, 22 Apr 2021 11:08:38 +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 13MB8bDr088891; Thu, 22 Apr 2021 11:08:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MB8bg0088890; Thu, 22 Apr 2021 11:08:37 GMT (envelope-from git) Date: Thu, 22 Apr 2021 11:08:37 GMT Message-Id: <202104221108.13MB8bg0088890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: a6898ea04e4d - stable/13 - lib/msun: Exclude ignored-pragmas from -Werror 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a6898ea04e4dd6c1f4f60622df59f1cd97d288f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:08:39 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=a6898ea04e4dd6c1f4f60622df59f1cd97d288f0 commit a6898ea04e4dd6c1f4f60622df59f1cd97d288f0 Author: Alex Richardson AuthorDate: 2021-04-15 15:27:52 +0000 Commit: Alex Richardson CommitDate: 2021-04-22 09:44:53 +0000 lib/msun: Exclude ignored-pragmas from -Werror This avoids build failures due to the clang 12 warning: '#pragma FENV_ACCESS' is not supported on this target - ignored Clang 12 currently emits this warning for all non-x86 architectures. While this can result in incorrect code generation (e.g. on AArch64 some exceptions are not raised as expected), this is a pre-existing issue and we should not fail the build due to this warning. Reviewed By: dim, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29743 (cherry picked from commit 168234fa67c38f898b784b3265dd77ace0b0a2f9) --- lib/msun/Makefile | 6 ++++++ lib/msun/tests/Makefile | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 0a486bb5a086..7107aad56aa7 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -255,4 +255,10 @@ MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.include +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 120000 +# Silence '#pragma FENV_ACCESS' is not supported on this target - ignored +CWARNFLAGS+= -Wno-error=ignored-pragmas +.endif + .include diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 70f7d2fe5135..d33a1b04888d 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -100,6 +100,12 @@ CFLAGS+= -DLDBL_PREC=${LDBL_PREC} CFLAGS.fe_round_test+= -D__HAVE_FENV +.include +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 120000 +# Silence '#pragma FENV_ACCESS' is not supported on this target - ignored +CWARNFLAGS+= -Wno-error=ignored-pragmas +.endif + .include .include From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:22:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4442D5ED7C9; Thu, 22 Apr 2021 11:22:45 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) (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 4FQw510b1fz3mvq; Thu, 22 Apr 2021 11:22:44 +0000 (UTC) (envelope-from greg@unrelenting.technology) Date: Thu, 22 Apr 2021 14:22:27 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unrelenting.technology; s=key1; t=1619090556; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dUJJ+mcjrBNRFddUc175K2rTmzP2X/JonJIYyHEZRX0=; b=CeiSz/Y0evMrwFDQpX9ms8RayWwI72OBrep4AqoOi7eBQjNRpi0oHN3IEoCl/2dDdtlbK7 YUf2Z5NRCOrdbYcWJc1quoYLXc5NGcsdu3v0QqC+2BwJr703LxxpxBsCv07Z/MdXgXODMZ ++SkWvg1f59FxVF8lTNgr193ZmFSz9OJuoxfBoa8NHGgRxwpIVZ6baj6835c3Q5Zth88If MsC5g51qkqwbj6W58tYl73eXubjECRbjTtCZqP8IMxW0zit0nQrMddNFTFP4ekjJK1JqC7 YXdg75CGNYXbdMn46Et7VUC0qJE0VXBLj7D5xltriHuVHLCzKj0mOtdvxsYl0w== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Greg V Subject: Re: git: 11d62b6f31ab - main - linuxkpi: =?UTF-8?Q?add=0D=0A?= kernel_fpu_begin/kernel_fpu_end To: Konstantin Belousov Cc: John Baldwin , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: In-Reply-To: References: <202101121143.10CBh02x095972@gitrepo.freebsd.org> <20210113110826.46fbc900b3c375e7215a8195@bidouilliste.com> <171B7072-9BAE-46BB-82BA-4792AEBAD0EB@unrelenting.technology> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: greg@unrelenting.technology X-Rspamd-Queue-Id: 4FQw510b1fz3mvq 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:22:45 -0000 On Thu, Apr 22, 2021 at 13:19, Konstantin Belousov=20 wrote: > On Thu, Jan 14, 2021 at 04:23:31AM +0200, Konstantin Belousov wrote: >> On Thu, Jan 14, 2021 at 01:36:27AM +0000, myfreeweb wrote: >> > >> > >> > On January 13, 2021 8:58:58 PM UTC, John Baldwin=20 >> wrote: >> > >It doesn't store at all because threads aren't allowed to sleep=20 >> in a critical >> > >section, so the thread will never give up the CPU while in the=20 >> FPU section. If >> > >threads can voluntarily sleep (cv_wait*, *sleep(), etc.) while=20 >> using >> > >kernel_fpu_begin(), then NOCTX won't work and we will need=20 >> something else. >> > >> > Hmm but with no storage at all, how would it work from a syscall? >> > The manpage does mention a "usermode save area" =96 I was talking=20 >> about that. >> There is a storage for the user state, always. When NOCTX is used,=20 >> FPU state >> is spilled into the _current_ save area, and then kernel lives to=20 >> the promise >> that the new state after fpu_enter(NOCTX) does not ever need to be=20 >> saved. >>=20 >> > >> > Linux kernel_fpu_begin starts with preempt_disable, so definitely=20 >> no condvars and the like. No idea about simple time sleeps. But=20 >> amdgpu doesn't seem to do even that. >>=20 >> You should get enough assertions fired if something tries to=20 >> context switch >> while entered NOCTX region. >=20 > So this went dead in the mail, and kernel still contains that awful=20 > code > that corrupts both userspace and kernel FPU contexts. >=20 > I suggest to remove this file at all, since things are not being=20 > sorted. Okay, let's try NOCTX: https://reviews.freebsd.org/D29921 I don't understand how using a full fpu_kern_ctx can *corrupt* anything=20 though? It should only be extra overhead? From owner-dev-commits-src-all@freebsd.org Thu Apr 22 11:38:48 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E26C5EE974; Thu, 22 Apr 2021 11:38:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FQwRW6sg2z3p02; Thu, 22 Apr 2021 11:38:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 13MBcd2A025112 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 22 Apr 2021 14:38:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 13MBcd2A025112 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 13MBcdQW025111; Thu, 22 Apr 2021 14:38:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 22 Apr 2021 14:38:39 +0300 From: Konstantin Belousov To: Greg V Cc: John Baldwin , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 11d62b6f31ab - main - linuxkpi: add?? kernel_fpu_begin/kernel_fpu_end Message-ID: References: <202101121143.10CBh02x095972@gitrepo.freebsd.org> <20210113110826.46fbc900b3c375e7215a8195@bidouilliste.com> <171B7072-9BAE-46BB-82BA-4792AEBAD0EB@unrelenting.technology> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4FQwRW6sg2z3p02 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 11:38:48 -0000 On Thu, Apr 22, 2021 at 02:22:27PM +0300, Greg V wrote: > > > On Thu, Apr 22, 2021 at 13:19, Konstantin Belousov > wrote: > > On Thu, Jan 14, 2021 at 04:23:31AM +0200, Konstantin Belousov wrote: > > > On Thu, Jan 14, 2021 at 01:36:27AM +0000, myfreeweb wrote: > > > > > > > > > > > > On January 13, 2021 8:58:58 PM UTC, John Baldwin > > > wrote: > > > > >It doesn't store at all because threads aren't allowed to sleep > > > in a critical > > > > >section, so the thread will never give up the CPU while in the > > > FPU section. If > > > > >threads can voluntarily sleep (cv_wait*, *sleep(), etc.) while > > > using > > > > >kernel_fpu_begin(), then NOCTX won't work and we will need > > > something else. > > > > > > > > Hmm but with no storage at all, how would it work from a syscall? > > > > The manpage does mention a "usermode save area" – I was talking > > > about that. > > > There is a storage for the user state, always. When NOCTX is used, > > > FPU state > > > is spilled into the _current_ save area, and then kernel lives to > > > the promise > > > that the new state after fpu_enter(NOCTX) does not ever need to be > > > saved. > > > > > > > > > > > Linux kernel_fpu_begin starts with preempt_disable, so definitely > > > no condvars and the like. No idea about simple time sleeps. But > > > amdgpu doesn't seem to do even that. > > > > > > You should get enough assertions fired if something tries to > > > context switch > > > while entered NOCTX region. > > > > So this went dead in the mail, and kernel still contains that awful code > > that corrupts both userspace and kernel FPU contexts. > > > > I suggest to remove this file at all, since things are not being sorted. > > Okay, let's try NOCTX: https://reviews.freebsd.org/D29921 > > I don't understand how using a full fpu_kern_ctx can *corrupt* anything > though? > It should only be extra overhead? Existing code uses global unsynchronized flag increment to conclude that there is no need to enter FPU. In other words, even ignoring races for updating the counter, if one thread entered FPU, another thread would not enter it and corrupt e.g. usermode context. From owner-dev-commits-src-all@freebsd.org Thu Apr 22 12:23:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 629295F0E50; Thu, 22 Apr 2021 12:23: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 4FQxR02LN0z3rk8; Thu, 22 Apr 2021 12:23: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 43A1219DC5; Thu, 22 Apr 2021 12:23: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 13MCNONU095271; Thu, 22 Apr 2021 12:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MCNOqa095270; Thu, 22 Apr 2021 12:23:24 GMT (envelope-from git) Date: Thu, 22 Apr 2021 12:23:24 GMT Message-Id: <202104221223.13MCNOqa095270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: fc620f9782d1 - main - ocs_fc: Fix memory leak in ocs_scsi_io_alloc() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc620f9782d1fda5a243fd51a93a0fb46bc80f64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 12:23:24 -0000 The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=fc620f9782d1fda5a243fd51a93a0fb46bc80f64 commit fc620f9782d1fda5a243fd51a93a0fb46bc80f64 Author: Ram Kishore Vegesna AuthorDate: 2021-04-19 15:40:59 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-04-22 12:18:37 +0000 ocs_fc: Fix memory leak in ocs_scsi_io_alloc() PR: 254690 Approved by: mav(mentor) MFC after: 2 weeks --- sys/dev/ocs_fc/ocs_scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ocs_fc/ocs_scsi.c b/sys/dev/ocs_fc/ocs_scsi.c index c2df898bda4b..b1d98c7c0e3d 100644 --- a/sys/dev/ocs_fc/ocs_scsi.c +++ b/sys/dev/ocs_fc/ocs_scsi.c @@ -201,6 +201,7 @@ ocs_scsi_io_alloc(ocs_node_t *node, ocs_scsi_io_role_e role) if (io->hio != NULL) { ocs_log_err(node->ocs, "assertion failed: io->hio is not NULL\n"); + ocs_io_free(ocs, io); ocs_unlock(&node->active_ios_lock); return NULL; } From owner-dev-commits-src-all@freebsd.org Thu Apr 22 13:20:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D42D65F2449; Thu, 22 Apr 2021 13:20: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 4FQyhQ5gWPz3v35; Thu, 22 Apr 2021 13:20: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 B58FD1A7AF; Thu, 22 Apr 2021 13:20: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 13MDK6hS064858; Thu, 22 Apr 2021 13:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MDK6VU064856; Thu, 22 Apr 2021 13:20:06 GMT (envelope-from git) Date: Thu, 22 Apr 2021 13:20:06 GMT Message-Id: <202104221320.13MDK6VU064856@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: 7ea3223c7822 - main - zfs: use vn_seqc_read_notmodify for racing .. lookups 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: 7ea3223c7822d20acfc907683fd0153d623185b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 13:20:06 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7ea3223c7822d20acfc907683fd0153d623185b3 commit 7ea3223c7822d20acfc907683fd0153d623185b3 Author: Mateusz Guzik AuthorDate: 2021-04-22 13:18:39 +0000 Commit: Mateusz Guzik CommitDate: 2021-04-22 13:18:39 +0000 zfs: use vn_seqc_read_notmodify for racing .. lookups Catching an in-flight unlocked vnode is fine here. Reported by; pho --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index a1e9c359b893..50454cad2468 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -807,7 +807,7 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zdp); - dvp_seqc = vn_seqc_read_any(dvp); + dvp_seqc = vn_seqc_read_notmodify(dvp); *vpp = NULL; From owner-dev-commits-src-all@freebsd.org Thu Apr 22 13:58:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9EBE5F387A; Thu, 22 Apr 2021 13:58: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 4FQzY36GFvz4R3b; Thu, 22 Apr 2021 13:58: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 BF6C91B1A6; Thu, 22 Apr 2021 13:58: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 13MDwlw3014503; Thu, 22 Apr 2021 13:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MDwlHf014502; Thu, 22 Apr 2021 13:58:47 GMT (envelope-from git) Date: Thu, 22 Apr 2021 13:58:47 GMT Message-Id: <202104221358.13MDwlHf014502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0e0aa1eed8fa - stable/13 - nfsd: fix replies from session cache for retried RPCs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e0aa1eed8fa18ab31fb6a3e6fe135b41d2a9923 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 13:58:48 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0e0aa1eed8fa18ab31fb6a3e6fe135b41d2a9923 commit 0e0aa1eed8fa18ab31fb6a3e6fe135b41d2a9923 Author: Rick Macklem AuthorDate: 2021-04-08 21:04:22 +0000 Commit: Rick Macklem CommitDate: 2021-04-22 13:54:31 +0000 nfsd: fix replies from session cache for retried RPCs Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. The FreeBSD server failec to reply using the cached reply in the session slot when an RPC was retried on the session slot, as indicated by same slot sequence#. This patch fixes this. It should also fix a similar failure for NFSv4.0 mounts, when the sequence# in the open/lock_owner requires a reply be done from an entry locked into the DRC. This fix affects the fairly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation. Note that retries only occur after the client has needed to create a new TCP connection. (cherry picked from commit 05a39c2c1c18cd0c4382a4f58e0952d3f77e7dfa) --- sys/fs/nfsserver/nfs_nfsdkrpc.c | 7 ++++++- sys/fs/nfsserver/nfs_nfsdsubs.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c index 7265e439d6a0..44f585ff0beb 100644 --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c @@ -410,8 +410,13 @@ nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt, m = NULL; if ((nd->nd_flag & ND_HASSEQUENCE) != 0) nfsrv_cache_session(nd, &m); - if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { nd->nd_repstat = 0; + if (m != NULL) { + m_freem(nd->nd_mreq); + nd->nd_mreq = m; + } + } cacherep = RC_REPLY; } else { if (nd->nd_repstat == NFSERR_DONTREPLY) diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index ac28119028c4..49c5cac999c7 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -1553,6 +1553,8 @@ nfsd_errmap(struct nfsrv_descript *nd) else if (nd->nd_repstat == NFSERR_MINORVERMISMATCH || nd->nd_repstat == NFSERR_OPILLEGAL) return (txdr_unsigned(nd->nd_repstat)); + else if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + return (txdr_unsigned(NFSERR_IO)); else if ((nd->nd_flag & ND_NFSV41) != 0) { if (nd->nd_repstat == EOPNOTSUPP) nd->nd_repstat = NFSERR_NOTSUPP; From owner-dev-commits-src-all@freebsd.org Thu Apr 22 14:03:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 069545F39DE; Thu, 22 Apr 2021 14:03: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 4FQzfX6rHVz4RRJ; Thu, 22 Apr 2021 14:03: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 D2DA71B449; Thu, 22 Apr 2021 14:03: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 13ME3W6N027844; Thu, 22 Apr 2021 14:03:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13ME3Wkn027843; Thu, 22 Apr 2021 14:03:32 GMT (envelope-from git) Date: Thu, 22 Apr 2021 14:03:32 GMT Message-Id: <202104221403.13ME3Wkn027843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a47c2ca8ae6a - stable/12 - nfsd: fix replies from session cache for retried RPCs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a47c2ca8ae6ab5065ca625fbad41bd642eba1105 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 14:03:33 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a47c2ca8ae6ab5065ca625fbad41bd642eba1105 commit a47c2ca8ae6ab5065ca625fbad41bd642eba1105 Author: Rick Macklem AuthorDate: 2021-04-08 21:04:22 +0000 Commit: Rick Macklem CommitDate: 2021-04-22 13:59:34 +0000 nfsd: fix replies from session cache for retried RPCs Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. The FreeBSD server failec to reply using the cached reply in the session slot when an RPC was retried on the session slot, as indicated by same slot sequence#. This patch fixes this. It should also fix a similar failure for NFSv4.0 mounts, when the sequence# in the open/lock_owner requires a reply be done from an entry locked into the DRC. This fix affects the fairly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation. Note that retries only occur after the client has needed to create a new TCP connection. (cherry picked from commit 05a39c2c1c18cd0c4382a4f58e0952d3f77e7dfa) --- sys/fs/nfsserver/nfs_nfsdkrpc.c | 7 ++++++- sys/fs/nfsserver/nfs_nfsdsubs.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c index 566c5260ed09..e727dc4127c0 100644 --- a/sys/fs/nfsserver/nfs_nfsdkrpc.c +++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c @@ -395,8 +395,13 @@ nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt, m = NULL; if ((nd->nd_flag & ND_HASSEQUENCE) != 0) nfsrv_cache_session(nd, &m); - if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { nd->nd_repstat = 0; + if (m != NULL) { + m_freem(nd->nd_mreq); + nd->nd_mreq = m; + } + } cacherep = RC_REPLY; } else { if (nd->nd_repstat == NFSERR_DONTREPLY) diff --git a/sys/fs/nfsserver/nfs_nfsdsubs.c b/sys/fs/nfsserver/nfs_nfsdsubs.c index b90d0b586ef4..9ab5ca174b29 100644 --- a/sys/fs/nfsserver/nfs_nfsdsubs.c +++ b/sys/fs/nfsserver/nfs_nfsdsubs.c @@ -1515,6 +1515,8 @@ nfsd_errmap(struct nfsrv_descript *nd) else if (nd->nd_repstat == NFSERR_MINORVERMISMATCH || nd->nd_repstat == NFSERR_OPILLEGAL) return (txdr_unsigned(nd->nd_repstat)); + else if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) + return (txdr_unsigned(NFSERR_IO)); else if ((nd->nd_flag & ND_NFSV41) != 0) { if (nd->nd_repstat == EOPNOTSUPP) nd->nd_repstat = NFSERR_NOTSUPP; From owner-dev-commits-src-all@freebsd.org Thu Apr 22 14:30:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E37D5F45E9; Thu, 22 Apr 2021 14:30: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 4FR0FX1mczz4S1S; Thu, 22 Apr 2021 14:30: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 2FC531B729; Thu, 22 Apr 2021 14:30: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 13MEUOJi062915; Thu, 22 Apr 2021 14:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MEUOcb062914; Thu, 22 Apr 2021 14:30:24 GMT (envelope-from git) Date: Thu, 22 Apr 2021 14:30:24 GMT Message-Id: <202104221430.13MEUOcb062914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Leandro Lupori Subject: git: f05174ed3547 - stable/13 - powerpc64: clear low-order bits of ARPN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f05174ed354797143200492b8fc9ea059e4fea10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 14:30:24 -0000 The branch stable/13 has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=f05174ed354797143200492b8fc9ea059e4fea10 commit f05174ed354797143200492b8fc9ea059e4fea10 Author: Leandro Lupori AuthorDate: 2021-03-25 16:30:56 +0000 Commit: Leandro Lupori CommitDate: 2021-04-22 14:29:15 +0000 powerpc64: clear low-order bits of ARPN PowerISA 2.07B says that the low-order p-12 bits of the real page number contained in ARPN and LP fields of a PTE must be 0s and are ignored by the hardware (Book III-S, 5.7.7.1), where 2^p is the actual page size in bytes, but we were clearing only the LP field. This worked on bare metal and QEMU with KVM, that ignore these bits, but caused a kernel panic on QEMU with TCG, that expects them to be cleared. This fixes running FreeBSD with HPT superpages enabled on QEMU with TCG. Sponsored by: Eldorado Research Institute (eldorado.org.br) (cherry picked from commit 3d0399c718b260da087d28825069f26d4f670065) --- sys/powerpc/aim/mmu_oea64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index f311b61188e7..0e9b15661758 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -3719,7 +3719,7 @@ moea64_sp_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, pvo = pvos[i]; pvo->pvo_pte.prot = prot; - pvo->pvo_pte.pa = (pa & ~LPTE_LP_MASK) | LPTE_LP_4K_16M | + pvo->pvo_pte.pa = (pa & ~HPT_SP_MASK) | LPTE_LP_4K_16M | moea64_calc_wimg(pa, pmap_page_get_memattr(m)); if ((flags & PMAP_ENTER_WIRED) != 0) @@ -3876,7 +3876,7 @@ moea64_sp_promote(pmap_t pmap, vm_offset_t va, vm_page_t m) for (pvo = first, va_end = PVO_VADDR(pvo) + HPT_SP_SIZE; pvo != NULL && PVO_VADDR(pvo) < va_end; pvo = RB_NEXT(pvo_tree, &pmap->pmap_pvo, pvo)) { - pvo->pvo_pte.pa &= ~LPTE_LP_MASK; + pvo->pvo_pte.pa &= ADDR_POFF | ~HPT_SP_MASK; pvo->pvo_pte.pa |= LPTE_LP_4K_16M; pvo->pvo_vaddr |= PVO_LARGE; } From owner-dev-commits-src-all@freebsd.org Thu Apr 22 14:32:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E857F5F4A8F; Thu, 22 Apr 2021 14:32: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 4FR0Hb6Hr8z4SZF; Thu, 22 Apr 2021 14:32: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 CAE521BA8E; Thu, 22 Apr 2021 14:32: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 13MEWBQB067151; Thu, 22 Apr 2021 14:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MEWBHu067150; Thu, 22 Apr 2021 14:32:11 GMT (envelope-from git) Date: Thu, 22 Apr 2021 14:32:11 GMT Message-Id: <202104221432.13MEWBHu067150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Leandro Lupori Subject: git: 019cdd20bbd3 - stable/13 - powerpc64: add missing TLB invalidations to radix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 019cdd20bbd3bd5d73444e0c0311bfbe2defe3c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 14:32:12 -0000 The branch stable/13 has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=019cdd20bbd3bd5d73444e0c0311bfbe2defe3c3 commit 019cdd20bbd3bd5d73444e0c0311bfbe2defe3c3 Author: Leandro Lupori AuthorDate: 2021-04-06 11:31:44 +0000 Commit: Leandro Lupori CommitDate: 2021-04-22 14:31:31 +0000 powerpc64: add missing TLB invalidations to radix Radix MMU code was missing TLB invalidations when some Level 3 PDEs were modified. This caused TLB multi-hit machine check interrupts when superpages were enabled. Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D29511 (cherry picked from commit 28d14569c8735060d0a1646a3422562c0741ac44) --- sys/powerpc/aim/mmu_radix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 2373425afd30..0f5aa2ec151e 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -3185,6 +3185,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags, * a reserved PT page could be freed. */ (void)pmap_remove_l3e(pmap, l3e, va, &free, lockp); + pmap_invalidate_l3e_page(pmap, va, oldl3e); } else { if (pmap_remove_ptes(pmap, va, va + L3_PAGE_SIZE, l3e, &free, lockp)) @@ -3243,6 +3244,7 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, u_int flags, * be any lingering 4KB page mappings in the TLB.) */ pte_store(l3e, newpde); + ptesync(); atomic_add_long(&pmap_l3e_mappings, 1); CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx" @@ -4944,7 +4946,7 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, * the read above and the store below. */ pde_store(l3e, mptepa); - ptesync(); + pmap_invalidate_l3e_page(pmap, trunc_2mpage(va), oldpde); /* * Demote the PV entry. */ @@ -5225,6 +5227,7 @@ mmu_radix_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) */ if (sva + L3_PAGE_SIZE == va_next && eva >= va_next) { pmap_remove_l3e(pmap, l3e, sva, &free, &lock); + anyvalid = true; continue; } else if (!pmap_demote_l3e_locked(pmap, l3e, sva, &lock)) { From owner-dev-commits-src-all@freebsd.org Thu Apr 22 15:03:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A93E5F567A; Thu, 22 Apr 2021 15:03: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 4FR1033Wptz4Tvk; Thu, 22 Apr 2021 15:03: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 6B99F1BE69; Thu, 22 Apr 2021 15:03: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 13MF3l5V007717; Thu, 22 Apr 2021 15:03:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MF3lWa007716; Thu, 22 Apr 2021 15:03:47 GMT (envelope-from git) Date: Thu, 22 Apr 2021 15:03:47 GMT Message-Id: <202104221503.13MF3lWa007716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 049d49e40a9d - stable/13 - zfs: merge openzfs/zfs@3522f57b6 (master) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 049d49e40a9d80facd7481785dca30d49e9110ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 15:03:47 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=049d49e40a9d80facd7481785dca30d49e9110ff commit 049d49e40a9d80facd7481785dca30d49e9110ff Author: Martin Matuska AuthorDate: 2021-04-14 10:49:10 +0000 Commit: Martin Matuska CommitDate: 2021-04-22 15:03:06 +0000 zfs: merge openzfs/zfs@3522f57b6 (master) Notable upstream pull request merges: #11742 When specifying raidz vdev name, parity count should match #11744 Use a helper function to clarify gang block size #11771 Support running FreeBSD buildworld on Arm-based macOS hosts This is the last update that will be MFCed into stable/13. From now on, the tracking of OpenZFS branches will be different: - main continues tracking openzfs/zfs/master - stable/13 is going to track openzfs/zfs/zfs-2.1-release Obtained from: OpenZFS (cherry picked from commit 6db169e920810bf1d7e9bd2fad5da92bfb696677) --- sys/contrib/openzfs/.editorconfig | 10 ++++ sys/contrib/openzfs/.gitignore | 70 ++++++++++++++++++++++ sys/contrib/openzfs/.gitmodules | 3 + sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c | 2 - sys/contrib/openzfs/cmd/zed/zed_exec.c | 1 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 2 - .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 3 - .../pyzfs/libzfs_core/test/test_libzfs_core.py | 2 +- sys/contrib/openzfs/include/sys/dmu_recv.h | 1 - sys/contrib/openzfs/include/sys/dmu_send.h | 1 - sys/contrib/openzfs/include/sys/spa.h | 6 ++ sys/contrib/openzfs/include/sys/vdev.h | 9 +++ .../openzfs/lib/libspl/include/sys/dklabel.h | 1 - sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 2 - sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 31 +++++++++- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 1 - .../lib/libzutil/os/linux/zutil_import_os.c | 1 - sys/contrib/openzfs/lib/libzutil/zutil_import.c | 1 - sys/contrib/openzfs/man/man8/zed.8.in | 4 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 1 - sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 1 - sys/contrib/openzfs/module/zfs/dmu_recv.c | 1 - sys/contrib/openzfs/module/zfs/fm.c | 1 - sys/contrib/openzfs/module/zfs/metaslab.c | 8 +-- sys/contrib/openzfs/module/zfs/zio.c | 18 +++--- sys/modules/zfs/zfs_config.h | 6 +- 28 files changed, 152 insertions(+), 39 deletions(-) diff --git a/sys/contrib/openzfs/.editorconfig b/sys/contrib/openzfs/.editorconfig new file mode 100644 index 000000000000..0f4b96a83070 --- /dev/null +++ b/sys/contrib/openzfs/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{c,h}] +tab_width = 8 +indent_style = tab diff --git a/sys/contrib/openzfs/.gitignore b/sys/contrib/openzfs/.gitignore new file mode 100644 index 000000000000..056bbb8f08c9 --- /dev/null +++ b/sys/contrib/openzfs/.gitignore @@ -0,0 +1,70 @@ +# +# N.B. +# This is the toplevel .gitignore file. +# This is not the place for entries that are specific to +# a subdirectory. Instead add those files to the +# .gitignore file in that subdirectory. +# +# N.B. +# Please use 'git ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. + +# +# Normal rules +# +*.[oa] +*.o.ur-safe +*.lo +*.la +*.mod.c +*~ +*.swp +*.gcno +*.gcda +*.pyc +*.pyo +.deps +.libs +.dirstamp +.DS_Store +modules.order +Makefile +Makefile.in + +# +# Top level generated files specific to this top level dir +# +/bin +/build +/configure +/config.log +/config.status +/libtool +/zfs_config.h +/zfs_config.h.in +/zfs.release +/stamp-h1 +/aclocal.m4 +/autom4te.cache + +# +# Top level generic files +# +!.gitignore +tags +TAGS +current +cscope.* +*.rpm +*.deb +*.tar.gz +*.patch +*.orig +*.log +*.tmp +venv + +*.so +*.so.debug +*.so.full diff --git a/sys/contrib/openzfs/.gitmodules b/sys/contrib/openzfs/.gitmodules new file mode 100644 index 000000000000..d400f10a7e63 --- /dev/null +++ b/sys/contrib/openzfs/.gitmodules @@ -0,0 +1,3 @@ +[submodule "scripts/zfs-images"] + path = scripts/zfs-images + url = https://github.com/zfsonlinux/zfs-images diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META index abced52178a7..480849288719 100644 --- a/sys/contrib/openzfs/META +++ b/sys/contrib/openzfs/META @@ -1,7 +1,7 @@ Meta: 1 Name: zfs Branch: 1.0 -Version: 2.0.0 +Version: 2.1.0 Release: rc1 Release-Tags: relext License: CDDL diff --git a/sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c b/sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c index a3446c52c416..f44d6fbde707 100644 --- a/sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c +++ b/sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c @@ -31,8 +31,6 @@ #include #include -#include - #include "raidz_test.h" #define GEN_BENCH_MEMORY (((uint64_t)1ULL)<<32) diff --git a/sys/contrib/openzfs/cmd/zed/zed_exec.c b/sys/contrib/openzfs/cmd/zed/zed_exec.c index aae607a9b7de..e8f510213868 100644 --- a/sys/contrib/openzfs/cmd/zed/zed_exec.c +++ b/sys/contrib/openzfs/cmd/zed/zed_exec.c @@ -173,6 +173,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog, zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d", prog, pid); (void) kill(pid, SIGKILL); + (void) waitpid(pid, &status, 0); } } diff --git a/sys/contrib/openzfs/cmd/zfs/zfs_main.c b/sys/contrib/openzfs/cmd/zfs/zfs_main.c index 9a59fddbf06d..1a5129f79493 100644 --- a/sys/contrib/openzfs/cmd/zfs/zfs_main.c +++ b/sys/contrib/openzfs/cmd/zfs/zfs_main.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -71,7 +70,6 @@ #include #include #include -#include #ifdef HAVE_IDMAP #include #include diff --git a/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c b/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c index d087c4c14dac..55a9367ec180 100644 --- a/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c +++ b/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c @@ -79,9 +79,6 @@ #include #include -#include -#include -#include #include #include #include diff --git a/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py b/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py index 08b58b5d1e0d..87138b305f73 100644 --- a/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py +++ b/sys/contrib/openzfs/contrib/pyzfs/libzfs_core/test/test_libzfs_core.py @@ -1062,7 +1062,7 @@ class ZFSTest(unittest.TestCase): lzc.lzc_bookmark({}) @skipUnlessBookmarksSupported - def test_bookmarks_foregin_source(self): + def test_bookmarks_foreign_source(self): snaps = [ZFSTest.pool.makeName(b'fs1@snap1')] bmarks = [ZFSTest.pool.makeName(b'fs2#bmark1')] bmark_dict = {x: y for x, y in zip(bmarks, snaps)} diff --git a/sys/contrib/openzfs/include/sys/dmu_recv.h b/sys/contrib/openzfs/include/sys/dmu_recv.h index dacc6b7829da..7188b2a02248 100644 --- a/sys/contrib/openzfs/include/sys/dmu_recv.h +++ b/sys/contrib/openzfs/include/sys/dmu_recv.h @@ -34,7 +34,6 @@ #include #include #include -#include extern const char *recv_clone_name; diff --git a/sys/contrib/openzfs/include/sys/dmu_send.h b/sys/contrib/openzfs/include/sys/dmu_send.h index d6d050e01f97..d150f816c945 100644 --- a/sys/contrib/openzfs/include/sys/dmu_send.h +++ b/sys/contrib/openzfs/include/sys/dmu_send.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #define BEGINNV_REDACT_SNAPS "redact_snaps" diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h index 8391be8328b6..c960478efe50 100644 --- a/sys/contrib/openzfs/include/sys/spa.h +++ b/sys/contrib/openzfs/include/sys/spa.h @@ -405,6 +405,12 @@ typedef struct blkptr { /* * Macros to get and set fields in a bp or DVA. */ + +/* + * Note, for gang blocks, DVA_GET_ASIZE() is the total space allocated for + * this gang DVA including its children BP's. The space allocated at this + * DVA's vdev/offset is vdev_gang_header_asize(vdev). + */ #define DVA_GET_ASIZE(dva) \ BF64_GET_SB((dva)->dva_word[0], 0, SPA_ASIZEBITS, SPA_MINBLOCKSHIFT, 0) #define DVA_SET_ASIZE(dva, x) \ diff --git a/sys/contrib/openzfs/include/sys/vdev.h b/sys/contrib/openzfs/include/sys/vdev.h index d1ef6b5b59b4..f235bfc8cc19 100644 --- a/sys/contrib/openzfs/include/sys/vdev.h +++ b/sys/contrib/openzfs/include/sys/vdev.h @@ -133,6 +133,15 @@ extern int64_t vdev_deflated_space(vdev_t *vd, int64_t space); extern uint64_t vdev_psize_to_asize(vdev_t *vd, uint64_t psize); +/* + * Return the amount of space allocated for a gang block header. + */ +static inline uint64_t +vdev_gang_header_asize(vdev_t *vd) +{ + return (vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE)); +} + extern int vdev_fault(spa_t *spa, uint64_t guid, vdev_aux_t aux); extern int vdev_degrade(spa_t *spa, uint64_t guid, vdev_aux_t aux); extern int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, diff --git a/sys/contrib/openzfs/lib/libspl/include/sys/dklabel.h b/sys/contrib/openzfs/lib/libspl/include/sys/dklabel.h index 95faf2bb4ab3..8c2ca06c0cbc 100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/dklabel.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/dklabel.h @@ -31,7 +31,6 @@ #include #include -#include #ifdef __cplusplus extern "C" { diff --git a/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c b/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c index 47418b3237bb..4598e87f2921 100644 --- a/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c +++ b/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #ifdef HAVE_IDMAP #include @@ -66,7 +65,6 @@ #include "zfs_namecheck.h" #include "zfs_prop.h" #include "libzfs_impl.h" -#include "libzfs.h" #include "zfs_deleg.h" static int userquota_propname_decode(const char *propname, boolean_t zoned, diff --git a/sys/contrib/openzfs/lib/libzfs/libzfs_pool.c b/sys/contrib/openzfs/lib/libzfs/libzfs_pool.c index 1934466536dc..9ef97cd677ff 100644 --- a/sys/contrib/openzfs/lib/libzfs/libzfs_pool.c +++ b/sys/contrib/openzfs/lib/libzfs/libzfs_pool.c @@ -49,7 +49,6 @@ #include #include #include -#include #include "zfs_namecheck.h" #include "zfs_prop.h" @@ -2670,6 +2669,36 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, boolean_t *avail_spare, errno = 0; vdev_id = strtoull(idx, &end, 10); + /* + * If we are looking for a raidz and a parity is + * specified, make sure it matches. + */ + int rzlen = strlen(VDEV_TYPE_RAIDZ); + assert(rzlen == strlen(VDEV_TYPE_DRAID)); + int typlen = strlen(type); + if ((strncmp(type, VDEV_TYPE_RAIDZ, rzlen) == 0 || + strncmp(type, VDEV_TYPE_DRAID, rzlen) == 0) && + typlen != rzlen) { + uint64_t vdev_parity; + int parity = *(type + rzlen) - '0'; + + if (parity <= 0 || parity > 3 || + (typlen - rzlen) != 1) { + /* + * Nonsense parity specified, can + * never match + */ + free(type); + return (NULL); + } + verify(nvlist_lookup_uint64(nv, + ZPOOL_CONFIG_NPARITY, &vdev_parity) == 0); + if ((int)vdev_parity != parity) { + free(type); + break; + } + } + free(type); if (errno != 0) return (NULL); diff --git a/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c b/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c index 1e3a0bf5618a..bc887e72a23c 100644 --- a/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c +++ b/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_import_os.c b/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_import_os.c index 519ab3a078e3..2e0baecb3bec 100644 --- a/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_import_os.c +++ b/sys/contrib/openzfs/lib/libzutil/os/linux/zutil_import_os.c @@ -61,7 +61,6 @@ #include #include #include -#include #include #include diff --git a/sys/contrib/openzfs/lib/libzutil/zutil_import.c b/sys/contrib/openzfs/lib/libzutil/zutil_import.c index e1f31b385503..93d05354f30f 100644 --- a/sys/contrib/openzfs/lib/libzutil/zutil_import.c +++ b/sys/contrib/openzfs/lib/libzutil/zutil_import.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include diff --git a/sys/contrib/openzfs/man/man8/zed.8.in b/sys/contrib/openzfs/man/man8/zed.8.in index 3d36c33ac9ca..e32a89de8a0f 100644 --- a/sys/contrib/openzfs/man/man8/zed.8.in +++ b/sys/contrib/openzfs/man/man8/zed.8.in @@ -234,8 +234,8 @@ Terminate the daemon. Events are processed synchronously by a single thread. This can delay the processing of simultaneous zevents. .PP -There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving -ZEDLET can delay the processing of subsequent zevents. +ZEDLETs are killed after a maximum of ten seconds. +This can lead to a violation of a ZEDLET's atomicity assumptions. .PP The ownership and permissions of the \fIenabled-zedlets\fR directory (along with all parent directories) are not checked. If any of these directories diff --git a/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c b/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c index 83d4a3d8496c..465775a6748e 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/arc_os.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c b/sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c index ea6993ffa4b0..d042783da1b2 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c @@ -867,7 +867,7 @@ __zpl_ioctl_setflags(struct inode *ip, uint32_t ioctl_flags, xvattr_t *xva) if ((fchange(ioctl_flags, zfs_flags, FS_IMMUTABLE_FL, ZFS_IMMUTABLE) || fchange(ioctl_flags, zfs_flags, FS_APPEND_FL, ZFS_APPENDONLY)) && !capable(CAP_LINUX_IMMUTABLE)) - return (-EACCES); + return (-EPERM); if (!zpl_inode_owner_or_capable(kcred->user_ns, ip)) return (-EACCES); diff --git a/sys/contrib/openzfs/module/zfs/arc.c b/sys/contrib/openzfs/module/zfs/arc.c index 9be0a4e8a4a9..55c71a3829cd 100644 --- a/sys/contrib/openzfs/module/zfs/arc.c +++ b/sys/contrib/openzfs/module/zfs/arc.c @@ -294,7 +294,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/contrib/openzfs/module/zfs/dmu_recv.c b/sys/contrib/openzfs/module/zfs/dmu_recv.c index a0fd157ebc5f..123ea05b0436 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_recv.c +++ b/sys/contrib/openzfs/module/zfs/dmu_recv.c @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/contrib/openzfs/module/zfs/fm.c b/sys/contrib/openzfs/module/zfs/fm.c index a5003f85d621..3070cab1e49d 100644 --- a/sys/contrib/openzfs/module/zfs/fm.c +++ b/sys/contrib/openzfs/module/zfs/fm.c @@ -67,7 +67,6 @@ #include #include #include -#include #include int zfs_zevent_len_max = 0; diff --git a/sys/contrib/openzfs/module/zfs/metaslab.c b/sys/contrib/openzfs/module/zfs/metaslab.c index 463806c6078a..3b2b79b2f42f 100644 --- a/sys/contrib/openzfs/module/zfs/metaslab.c +++ b/sys/contrib/openzfs/module/zfs/metaslab.c @@ -5544,7 +5544,7 @@ metaslab_unalloc_dva(spa_t *spa, const dva_t *dva, uint64_t txg) ASSERT3P(vd->vdev_indirect_mapping, ==, NULL); if (DVA_GET_GANG(dva)) - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + size = vdev_gang_header_asize(vd); msp = vd->vdev_ms[offset >> vd->vdev_ms_shift]; @@ -5579,7 +5579,7 @@ metaslab_free_dva(spa_t *spa, const dva_t *dva, boolean_t checkpoint) ASSERT3U(spa_config_held(spa, SCL_ALL, RW_READER), !=, 0); if (DVA_GET_GANG(dva)) { - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + size = vdev_gang_header_asize(vd); } metaslab_free_impl(vd, offset, size, checkpoint); @@ -5768,7 +5768,7 @@ metaslab_claim_dva(spa_t *spa, const dva_t *dva, uint64_t txg) ASSERT(DVA_IS_VALID(dva)); if (DVA_GET_GANG(dva)) - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + size = vdev_gang_header_asize(vd); return (metaslab_claim_impl(vd, offset, size, txg)); } @@ -6034,7 +6034,7 @@ metaslab_check_free(spa_t *spa, const blkptr_t *bp) uint64_t size = DVA_GET_ASIZE(&bp->blk_dva[i]); if (DVA_GET_GANG(&bp->blk_dva[i])) - size = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + size = vdev_gang_header_asize(vd); ASSERT3P(vd, !=, NULL); diff --git a/sys/contrib/openzfs/module/zfs/zio.c b/sys/contrib/openzfs/module/zfs/zio.c index a7820e75670b..b5ffe9c294df 100644 --- a/sys/contrib/openzfs/module/zfs/zio.c +++ b/sys/contrib/openzfs/module/zfs/zio.c @@ -1026,7 +1026,8 @@ zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp, boolean_t config_held, * that are in the log) to be arbitrarily large. */ for (int i = 0; i < BP_GET_NDVAS(bp); i++) { - uint64_t vdevid = DVA_GET_VDEV(&bp->blk_dva[i]); + const dva_t *dva = &bp->blk_dva[i]; + uint64_t vdevid = DVA_GET_VDEV(dva); if (vdevid >= spa->spa_root_vdev->vdev_children) { errors += zfs_blkptr_verify_log(spa, bp, blk_verify, @@ -1055,10 +1056,10 @@ zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp, boolean_t config_held, */ continue; } - uint64_t offset = DVA_GET_OFFSET(&bp->blk_dva[i]); - uint64_t asize = DVA_GET_ASIZE(&bp->blk_dva[i]); - if (BP_IS_GANG(bp)) - asize = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + uint64_t offset = DVA_GET_OFFSET(dva); + uint64_t asize = DVA_GET_ASIZE(dva); + if (DVA_GET_GANG(dva)) + asize = vdev_gang_header_asize(vd); if (offset + asize > vd->vdev_asize) { errors += zfs_blkptr_verify_log(spa, bp, blk_verify, "blkptr at %p DVA %u has invalid OFFSET %llu", @@ -1095,8 +1096,8 @@ zfs_dva_valid(spa_t *spa, const dva_t *dva, const blkptr_t *bp) uint64_t offset = DVA_GET_OFFSET(dva); uint64_t asize = DVA_GET_ASIZE(dva); - if (BP_IS_GANG(bp)) - asize = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + if (DVA_GET_GANG(dva)) + asize = vdev_gang_header_asize(vd); if (offset + asize > vd->vdev_asize) return (B_FALSE); @@ -4015,6 +4016,9 @@ zio_vdev_io_assess(zio_t *zio) */ if (zio->io_error == ENXIO && zio->io_type == ZIO_TYPE_WRITE && vd != NULL && !vd->vdev_ops->vdev_op_leaf) { + vdev_dbgmsg(vd, "zio_vdev_io_assess(zio=%px) setting " + "cant_write=TRUE due to write failure with ENXIO", + zio); vd->vdev_cant_write = B_TRUE; } diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index c3735b2c386c..ebc9bbe9059b 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -734,7 +734,7 @@ /* #undef ZFS_IS_GPL_COMPATIBLE */ /* Define the project alias string. */ -#define ZFS_META_ALIAS "zfs-2.0.0-FreeBSD_g891568c99" +#define ZFS_META_ALIAS "zfs-2.1.0-FreeBSD_g3522f57b6" /* Define the project author. */ #define ZFS_META_AUTHOR "OpenZFS" @@ -764,10 +764,10 @@ #define ZFS_META_NAME "zfs" /* Define the project release. */ -#define ZFS_META_RELEASE "FreeBSD_g891568c99" +#define ZFS_META_RELEASE "FreeBSD_g3522f57b6" /* Define the project version. */ -#define ZFS_META_VERSION "2.0.0" +#define ZFS_META_VERSION "2.1.0" /* count is located in percpu_ref.data */ /* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */ From owner-dev-commits-src-all@freebsd.org Thu Apr 22 16:07:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0BC55F7BD3; Thu, 22 Apr 2021 16:07: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 4FR2P765Fqz4Xml; Thu, 22 Apr 2021 16:07: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 C40DA1CF81; Thu, 22 Apr 2021 16:07: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 13MG77aM087010; Thu, 22 Apr 2021 16: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 13MG77Oe087009; Thu, 22 Apr 2021 16:07:07 GMT (envelope-from git) Date: Thu, 22 Apr 2021 16:07:07 GMT Message-Id: <202104221607.13MG77Oe087009@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: 89c3c32647a5 - main - bhyve: Gracefully handle virtio-scsi with no conf 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: 89c3c32647a5099b297af2958e5a939eff0c0ce0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 16:07:07 -0000 The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=89c3c32647a5099b297af2958e5a939eff0c0ce0 commit 89c3c32647a5099b297af2958e5a939eff0c0ce0 Author: Ryan Moeller AuthorDate: 2021-04-22 16:06:08 +0000 Commit: Ryan Moeller CommitDate: 2021-04-22 16:06:08 +0000 bhyve: Gracefully handle virtio-scsi with no conf Fixes segfault with the command `bhyve -s 0,virtio-scsi`, which is used by some third party software to probe bhyve for virtio-scsi support. Reviewed by: jhb MFC after: 1 day Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29926 --- usr.sbin/bhyve/pci_virtio_scsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c index aed2fe2dbb23..e8124b9b3441 100644 --- a/usr.sbin/bhyve/pci_virtio_scsi.c +++ b/usr.sbin/bhyve/pci_virtio_scsi.c @@ -662,6 +662,9 @@ pci_vtscsi_legacy_config(nvlist_t *nvl, const char *opts) { char *cp, *devname; + if (opts == NULL) + return (0); + cp = strchr(opts, ','); if (cp == NULL) { set_config_value_node(nvl, "dev", opts); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:24:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79E205F991D; Thu, 22 Apr 2021 17:24: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 4FR46T3148z4c4S; Thu, 22 Apr 2021 17:24: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 5A1B61DBCE; Thu, 22 Apr 2021 17:24: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 13MHOXtg093141; Thu, 22 Apr 2021 17:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHOXv3093140; Thu, 22 Apr 2021 17:24:33 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:24:33 GMT Message-Id: <202104221724.13MHOXv3093140@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: 9a5a5c1576b4 - main - pvscsi: Advertise maxio of 256k. 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: 9a5a5c1576b4ce308a97e0bce887261701ae3edc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:24:33 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a5a5c1576b4ce308a97e0bce887261701ae3edc commit 9a5a5c1576b4ce308a97e0bce887261701ae3edc Author: Warner Losh AuthorDate: 2021-04-21 18:10:42 +0000 Commit: Warner Losh CommitDate: 2021-04-22 17:23:29 +0000 pvscsi: Advertise maxio of 256k. While the PV SCSI SG list can handle 512k of SG entries, it can only do so for I/O that's aligned to 4k or better. newfs_msdos does unaligned I/O, so triggers too long for host errors in cam when a 512k I/O is attempted. Prefer power of 2 256k to the absolute maximum 508k, though that can be revisited should the latter show to give significant performance improvement. MFC After: 3 days Tested by: darius on discord (508k version of patch) Sponsored by: Netflix --- sys/dev/vmware/pvscsi/pvscsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index 3ca905313897..ad32d2ab4959 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1423,7 +1423,8 @@ finish_ccb: strlcpy(cpi->sim_vid, "VMware", SIM_IDLEN); strlcpy(cpi->hba_vid, "VMware", HBA_IDLEN); strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); - cpi->maxio = PVSCSI_MAX_SG_ENTRIES_PER_SEGMENT * PAGE_SIZE; + /* Limit I/O to 256k since we can't do 512k unaligned I/O */ + cpi->maxio = (PVSCSI_MAX_SG_ENTRIES_PER_SEGMENT / 2) * PAGE_SIZE; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC2; cpi->transport = XPORT_SAS; From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:36:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 934925F9AEB; Thu, 22 Apr 2021 17:36: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 4FR4NT3nMPz4clG; Thu, 22 Apr 2021 17:36: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 74B0B1E199; Thu, 22 Apr 2021 17:36: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 13MHaful006548; Thu, 22 Apr 2021 17:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHafaH006547; Thu, 22 Apr 2021 17:36:41 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:36:41 GMT Message-Id: <202104221736.13MHafaH006547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?B?RmVybmFuZG8gQXBlc3RlZ3XDrWE=?= Subject: git: 2e5929a75634 - main - stats.7: Add dwatch(1) to the list 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: 2e5929a75634504d388cc04d24e6a558840e18cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:36:41 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2e5929a75634504d388cc04d24e6a558840e18cb commit 2e5929a75634504d388cc04d24e6a558840e18cb Author: Fernando Apesteguía AuthorDate: 2021-04-22 13:54:45 +0000 Commit: Fernando Apesteguía CommitDate: 2021-04-22 17:33:12 +0000 stats.7: Add dwatch(1) to the list PR: 255303 Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D29924 --- share/man/man7/stats.7 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 index 949e3fd6112b..50d33a53849b 100644 --- a/share/man/man7/stats.7 +++ b/share/man/man7/stats.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2020 +.Dd April 22, 2021 .Dt STATS 7 .Os .Sh NAME @@ -46,6 +46,8 @@ are currently included in the base system, with more appearing periodically. Show Bluetooth socket information .It Nm ctlstat CAM Target Layer statistics utility +.It Nm dwatch +watch processes as they trigger a particular DTrace probe .It Nm fstat Identify active files .It Nm gstat @@ -89,6 +91,7 @@ Report ZFS I/O statistics .El .Sh SEE ALSO .Xr btsockstat 1 , +.Xr dwatch 1 , .Xr fstat 1 , .Xr intro 1 , .Xr lockstat 1 , From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:38:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46CB85F9F07; Thu, 22 Apr 2021 17:38: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 4FR4QK1YMzz4cjD; Thu, 22 Apr 2021 17:38: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 27E271DBEA; Thu, 22 Apr 2021 17:38: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 13MHcHSn006771; Thu, 22 Apr 2021 17:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHcHjw006770; Thu, 22 Apr 2021 17:38:17 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:38:17 GMT Message-Id: <202104221738.13MHcHjw006770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?RmVybmFuZG8gQXBlc3RlZ3XDrWE=?= Subject: git: bddac53994b6 - stable/13 - stats.7: Add dwatch(1) to the list 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bddac53994b6c3c837f7e3087c2111c09e4a301a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:38:17 -0000 The branch stable/13 has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bddac53994b6c3c837f7e3087c2111c09e4a301a commit bddac53994b6c3c837f7e3087c2111c09e4a301a Author: Fernando Apesteguía AuthorDate: 2021-04-22 13:54:45 +0000 Commit: Fernando Apesteguía CommitDate: 2021-04-22 17:34:28 +0000 stats.7: Add dwatch(1) to the list PR: 255303 Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D29924 (cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb) --- share/man/man7/stats.7 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 index 949e3fd6112b..50d33a53849b 100644 --- a/share/man/man7/stats.7 +++ b/share/man/man7/stats.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2020 +.Dd April 22, 2021 .Dt STATS 7 .Os .Sh NAME @@ -46,6 +46,8 @@ are currently included in the base system, with more appearing periodically. Show Bluetooth socket information .It Nm ctlstat CAM Target Layer statistics utility +.It Nm dwatch +watch processes as they trigger a particular DTrace probe .It Nm fstat Identify active files .It Nm gstat @@ -89,6 +91,7 @@ Report ZFS I/O statistics .El .Sh SEE ALSO .Xr btsockstat 1 , +.Xr dwatch 1 , .Xr fstat 1 , .Xr intro 1 , .Xr lockstat 1 , From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:42:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D9DF5FA301; Thu, 22 Apr 2021 17:42: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 4FR4Vx1LTrz4dDm; Thu, 22 Apr 2021 17:42: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 20FD31E392; Thu, 22 Apr 2021 17:42: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 13MHgHpv019191; Thu, 22 Apr 2021 17:42:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHgH0q019190; Thu, 22 Apr 2021 17:42:17 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:42:17 GMT Message-Id: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?RmVybmFuZG8gQXBlc3RlZ3XDrWE=?= Subject: git: 76b02b5cea1d - stable/12 - stats.7: Add dwatch(1) to the list 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:42:17 -0000 The branch stable/12 has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 Author: Fernando Apesteguía AuthorDate: 2021-04-22 13:54:45 +0000 Commit: Fernando Apesteguía CommitDate: 2021-04-22 17:38:32 +0000 stats.7: Add dwatch(1) to the list PR: 255303 Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D29924 (cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb) --- share/man/man7/stats.7 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 index e72407c96fee..5ccba52057dc 100644 --- a/share/man/man7/stats.7 +++ b/share/man/man7/stats.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2020 +.Dd April 22, 2021 .Dt STATS 7 .Os .Sh NAME @@ -46,6 +46,8 @@ are currently included in the base system, with more appearing periodically. Show Bluetooth socket information .It Nm ctlstat CAM Target Layer statistics utility +.It Nm dwatch +watch processes as they trigger a particular DTrace probe .It Nm fstat Identify active files .It Nm gstat @@ -87,6 +89,12 @@ Report virtual memory statistics .It Nm zpool iostat Report ZFS I/O statistics .Sh SEE ALSO +<<<<<<< HEAD +======= +.Xr btsockstat 1 , +.Xr dwatch 1 , +.Xr fstat 1 , +>>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) .Xr intro 1 , .Xr intro 7 , .Xr intro 8 , From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:45:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 522075FA140; Thu, 22 Apr 2021 17:45: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 4FR4Zb1vHgz4dB5; Thu, 22 Apr 2021 17:45: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 342BF1E412; Thu, 22 Apr 2021 17:45: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 13MHjRgn020362; Thu, 22 Apr 2021 17:45:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHjR7p020361; Thu, 22 Apr 2021 17:45:27 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:45:27 GMT Message-Id: <202104221745.13MHjR7p020361@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: 2183bfcce46b - main - newvers.sh: better regexp for the FreeBSD_version line 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: 2183bfcce46bf9fe8315de3d7997d28db0a58c18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:45:27 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2183bfcce46bf9fe8315de3d7997d28db0a58c18 commit 2183bfcce46bf9fe8315de3d7997d28db0a58c18 Author: Warner Losh AuthorDate: 2021-04-22 16:43:43 +0000 Commit: Warner Losh CommitDate: 2021-04-22 17:45:12 +0000 newvers.sh: better regexp for the FreeBSD_version line Tested with: cirrus-ci https://cirrus-ci.com/build/6012323274948608 Reviewed by: emaste@, rgrimes@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29869 --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 847c01186aeb..495d9c0e862e 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -65,7 +65,7 @@ if [ -z "${SYSDIR}" ]; then SYSDIR=$(dirname $0)/.. fi -RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) +RELDATE=$(awk '/^\#define[[:space:]]*__FreeBSD_version/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) if [ -r "${SYSDIR}/../COPYRIGHT" ]; then year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:48:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF0885FA484; Thu, 22 Apr 2021 17:48:42 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 4FR4fL4rt2z4d4S; Thu, 22 Apr 2021 17:48:42 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: by mail-wr1-x42e.google.com with SMTP id p6so38989271wrn.9; Thu, 22 Apr 2021 10:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ohcOMYw0PtGFWqfwG/6e7pqRGykbzLyzbmjU7sv1BcQ=; b=TZCNNMr7Hs8mekuBjsP/E1r7so7durC+l0IvLuwQPXKdP4GzQkVoe8UK1DkWrRAHNg 7UbdTEcx/x7U11kUzqZ+yqz95kQmijbmX0qCrctRaEz49nvKwG5o1VDwfnL73wdV4lGN btR+x+5+3W/x63cxZC6rsf7B5ZPJJjL86TTanIJtLvpEWfdygeAeWLyI0eld2Icz79As x8EGdOODiMTVy5u5jyAzZvFlV2tZE9/QXNvO9IGlnKp8QqV12nK2WbBfXG1C/JmZqGdO 4XOEb7ExFsKzNYLoCJnyyanuoG1ctU/sS4ASdqGXTXROy1/bOmMHxlBkRCDNk8NLoEKH KORA== 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=ohcOMYw0PtGFWqfwG/6e7pqRGykbzLyzbmjU7sv1BcQ=; b=jZe7TrnfmlUDlrTnszkpNmF7ZaUiGr3PfXDQpLcCJei+cBholp9fEB/6LcjOgd9cac p74EjcpHi9pKy03pQMnKSsHCrfDrxFl+G+aPynSEkN5/ME7ZbEWRnYAo3bJwz3YzQMvf EjSyFxplbVL10AoqqDZ7+EbBfccUrOuWumZogaGlGO2m/SDs85LSZt73oX/T3tQWCeGB SeT32KYW/yywV5TseUyPHmfyLM471m7Ka1b6bitGsdVcIVvdIvbtENtktUkZiiHIAEtm WIyZOyRoQT7Kvl5zYFKTB2P7uAU4Rda4pCshRhZbSn5UXnJR1yf2SnV/ZONZjIy0aTiQ PqxQ== X-Gm-Message-State: AOAM530OJ3lKO7PTvL2PFLqnkieuNDaEo/fR6auZqLjLT3iize8T9UuE wQDLKQsiLi4TCCjGGZfO2ea9w+lpE+MDww== X-Google-Smtp-Source: ABdhPJyCbgJkeM2/68jhejFfVptfjBMWklCriVoqn6wjXauxDGXeO7RCV/ciaOhl0SGaZfH0iHv0Hg== X-Received: by 2002:adf:dc8d:: with SMTP id r13mr5515864wrj.339.1619113721278; Thu, 22 Apr 2021 10:48:41 -0700 (PDT) Received: from p200300d5d70db01f990fce91787a1a05.dip0.t-ipconnect.de (p200300d5d70db01f990fce91787a1a05.dip0.t-ipconnect.de. [2003:d5:d70d:b01f:990f:ce91:787a:1a05]) by smtp.gmail.com with ESMTPSA id n9sm3965952wmo.27.2021.04.22.10.48.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Apr 2021 10:48:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 76b02b5cea1d - stable/12 - stats.7: Add dwatch(1) to the list From: Gordon Bergling In-Reply-To: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> Date: Thu, 22 Apr 2021 19:48:40 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <21943B45-EFA4-417A-8973-62D6F5BA31FA@gmail.com> References: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> To: =?utf-8?Q?Fernando_Apestegu=C3=ADa?= X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4FR4fL4rt2z4d4S 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:48:42 -0000 Hi Fernando, could you please revert this. The stats(7) framework is only available = in stable/13 and -CURRENT as far as I know. And you have committed a merge conflict (<<<<<<< HEAD). --Gordon > Am 22.04.2021 um 19:42 schrieb Fernando Apestegu=C3=ADa = : >=20 > The branch stable/12 has been updated by fernape (doc, ports = committer): >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D76b02b5cea1dc548d30b2ec5e95ce5a2= 7deb16e3 >=20 > commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 > Author: Fernando Apestegu=C3=ADa > AuthorDate: 2021-04-22 13:54:45 +0000 > Commit: Fernando Apestegu=C3=ADa > CommitDate: 2021-04-22 17:38:32 +0000 >=20 > stats.7: Add dwatch(1) to the list >=20 > PR: 255303 > Approved by: 0mp (mentor) > Differential Revision: https://reviews.freebsd.org/D29924 >=20 > (cherry picked from commit = 2e5929a75634504d388cc04d24e6a558840e18cb) > --- > share/man/man7/stats.7 | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 > index e72407c96fee..5ccba52057dc 100644 > --- a/share/man/man7/stats.7 > +++ b/share/man/man7/stats.7 > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 14, 2020 > +.Dd April 22, 2021 > .Dt STATS 7 > .Os > .Sh NAME > @@ -46,6 +46,8 @@ are currently included in the base system, with more = appearing periodically. > Show Bluetooth socket information > .It Nm ctlstat > CAM Target Layer statistics utility > +.It Nm dwatch > +watch processes as they trigger a particular DTrace probe > .It Nm fstat > Identify active files > .It Nm gstat > @@ -87,6 +89,12 @@ Report virtual memory statistics > .It Nm zpool iostat > Report ZFS I/O statistics > .Sh SEE ALSO > +<<<<<<< HEAD > +=3D=3D=3D=3D=3D=3D=3D > +.Xr btsockstat 1 , > +.Xr dwatch 1 , > +.Xr fstat 1 , > +>>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) > .Xr intro 1 , > .Xr intro 7 , > .Xr intro 8 , > _______________________________________________ > dev-commits-src-branches@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-branches > To unsubscribe, send any mail to = "dev-commits-src-branches-unsubscribe@freebsd.org" From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:53:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2E795FA51F; Thu, 22 Apr 2021 17:53:07 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (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 4FR4lR3lYFz4dS4; Thu, 22 Apr 2021 17:53:07 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-qt1-f172.google.com with SMTP id 18so21059110qtz.6; Thu, 22 Apr 2021 10:53:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KslEm9Y4+QuZSc9OIgmBVhOAJUnTKnNn0rgJvEcNwQ0=; b=MkwKblIYLTCkJNgueIsP1Pbkc/NDU7JrZ1a6/gL8fxZ/tHd+lG0JQ9J3u3kmz2/a58 oOTIcWk8u29NGG+FUQ5rTugu30VRYphdJ7oA+toxvIwNsHtC6fgXtjl3lHqH1zw+uVcZ eOTIIu7Gn/sxlvUCd+M2biOXGFjXpZVmLjWaF2hnn2BW8uEi6mD3TlxjAhl7Y+SrW2aZ MoFGLdkwdOY+VvH2zRYgC+/xecG5Lnd+ZvGtn8VmSZpLpxJe67ICEurRiw7ytZvz5a9A yhYp2Cc9o+5pZmNQlhx/ytOTRn6+tGiZIHwIso4KJ03dRkUnjl7lV+3gD0bITZKyZor0 bGJQ== X-Gm-Message-State: AOAM533NoIkk+tRLIc3ZqeoM0qMrAIKwrxSyMUQOX/zC6RqCNGtvzo7O 8seWMS1rS9IlIy/4Ij4LM2SxRJCeryssew== X-Google-Smtp-Source: ABdhPJwCiDzTskKSFWzWuh3InI0vkDnoAkZwROJSsC/DDYQ5UYiGRAJ7ENwXS1rO+FUYLwPa0/1ZRQ== X-Received: by 2002:a05:622a:18a:: with SMTP id s10mr4268909qtw.237.1619113985906; Thu, 22 Apr 2021 10:53:05 -0700 (PDT) Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com. [209.85.219.171]) by smtp.gmail.com with ESMTPSA id 198sm2674517qkf.20.2021.04.22.10.53.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 10:53:05 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id p3so31836420ybk.0; Thu, 22 Apr 2021 10:53:05 -0700 (PDT) X-Received: by 2002:a25:b746:: with SMTP id e6mr7022965ybm.187.1619113985416; Thu, 22 Apr 2021 10:53:05 -0700 (PDT) MIME-Version: 1.0 References: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> <21943B45-EFA4-417A-8973-62D6F5BA31FA@gmail.com> In-Reply-To: <21943B45-EFA4-417A-8973-62D6F5BA31FA@gmail.com> From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 22 Apr 2021 19:49:37 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 76b02b5cea1d - stable/12 - stats.7: Add dwatch(1) to the list To: Gordon Bergling Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4FR4lR3lYFz4dS4 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)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:53:07 -0000 On Thu, Apr 22, 2021 at 7:48 PM Gordon Bergling wrote= : > > Hi Fernando, > > could you please revert this. The stats(7) framework is only available in= stable/13 and -CURRENT as far as I know. > > And you have committed a merge conflict (<<<<<<< HEAD). Sorry about that. I was just updating the review to note the mess. Can you point me to the procedure in the documentation on how to revert the change _properly_? Thanks > > --Gordon > > > Am 22.04.2021 um 19:42 schrieb Fernando Apestegu=C3=ADa : > > > > The branch stable/12 has been updated by fernape (doc, ports committer)= : > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D76b02b5cea1dc548d30b2ec5= e95ce5a27deb16e3 > > > > commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 > > Author: Fernando Apestegu=C3=ADa > > AuthorDate: 2021-04-22 13:54:45 +0000 > > Commit: Fernando Apestegu=C3=ADa > > CommitDate: 2021-04-22 17:38:32 +0000 > > > > stats.7: Add dwatch(1) to the list > > > > PR: 255303 > > Approved by: 0mp (mentor) > > Differential Revision: https://reviews.freebsd.org/D29924 > > > > (cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb) > > --- > > share/man/man7/stats.7 | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 > > index e72407c96fee..5ccba52057dc 100644 > > --- a/share/man/man7/stats.7 > > +++ b/share/man/man7/stats.7 > > @@ -26,7 +26,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd May 14, 2020 > > +.Dd April 22, 2021 > > .Dt STATS 7 > > .Os > > .Sh NAME > > @@ -46,6 +46,8 @@ are currently included in the base system, with more = appearing periodically. > > Show Bluetooth socket information > > .It Nm ctlstat > > CAM Target Layer statistics utility > > +.It Nm dwatch > > +watch processes as they trigger a particular DTrace probe > > .It Nm fstat > > Identify active files > > .It Nm gstat > > @@ -87,6 +89,12 @@ Report virtual memory statistics > > .It Nm zpool iostat > > Report ZFS I/O statistics > > .Sh SEE ALSO > > +<<<<<<< HEAD > > +=3D=3D=3D=3D=3D=3D=3D > > +.Xr btsockstat 1 , > > +.Xr dwatch 1 , > > +.Xr fstat 1 , > > +>>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) > > .Xr intro 1 , > > .Xr intro 7 , > > .Xr intro 8 , > > _______________________________________________ > > dev-commits-src-branches@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-branches > > To unsubscribe, send any mail to "dev-commits-src-branches-unsubscribe@= freebsd.org" > From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:57:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4A275FA72E; Thu, 22 Apr 2021 17:57:03 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 4FR4qz4SqTz4ddp; Thu, 22 Apr 2021 17:57:03 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: by mail-wm1-x331.google.com with SMTP id u187so5089630wmb.0; Thu, 22 Apr 2021 10:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cgGDhjw5Kc6vnzslxl6tdEPNV5CkFRux7ImXp1WaApk=; b=GZwqoaRvVvVcajmsyewHDxRLp9j+8qcurew6l38I24adas0Q8i+snAcCmX/gNd5MsT PXiA6dqZrOmyZYUU1nElwGi4HJzH/yajnJIrrcj3n/h0ReFFejxf9e4OPU8D+nTbRSs2 cnUuZ+/BevAVuMhytJ/5FZDOetWTX8DSmG5BfxMZqXCVpST11O++UBaAPTXiDRU8Pc75 NfoH85OzPmMEW1cj16KrLkGzmfqv6to9NlBzQF+n/Mn2xRHm4d1R01Kakr7Vzbfns5OW rVhzhEx8fB0RKkSsRgw8B2demuxVMt2GNguahJ2VwRW6tXgrrNL8bLG9oyhXZD4xqogY /g/g== 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=cgGDhjw5Kc6vnzslxl6tdEPNV5CkFRux7ImXp1WaApk=; b=qbrckdD8g/zZGm8xQ4NsWFmFe7sxBLtPvePhnEsi3QWk7X3/hMkTVIwa0SE8JwdXXx WB7g29Q+/k0S2hXWsaxgCH0/C9TLG9q+NgWvqaiwvBOGbfRIfFVewqnWMUC1bmwnRCa5 pK7mNunL2e98TE3Fvtfx4doQFolV+T9mvRbDTAbOJjEsm70DH41X8MRakpL3YMAhZ0Q7 4JDJFpbirs+PtBvpjALe4033qi7kS9wcOQDAgH6Sfmv6yPENfimRLRaJmSB+u4NaPzMm 1zg+6Gygn/w/x1wsO/uZkccYAN8PceKrl+5i8DP0DNCpw6qPOrJU5ks7ANjgsziocLkq de8g== X-Gm-Message-State: AOAM532EfLYdTLQEbMEyh9S8JeWTUA700+xdw2J3HT9DxFfsguP/iooC nAXq2I9dRegr1YNRq9oo2Lj8YR1WhiWsUQ== X-Google-Smtp-Source: ABdhPJxddCJabO2TxzmsmbLlUcc2pfryk1MEVdDaxu0xgf07XNzejiP+Tg/2E5Rjhlj+XUpZyQF9MA== X-Received: by 2002:a7b:c20c:: with SMTP id x12mr5118880wmi.51.1619114221791; Thu, 22 Apr 2021 10:57:01 -0700 (PDT) Received: from p200300d5d70db01f990fce91787a1a05.dip0.t-ipconnect.de (p200300d5d70db01f990fce91787a1a05.dip0.t-ipconnect.de. [2003:d5:d70d:b01f:990f:ce91:787a:1a05]) by smtp.gmail.com with ESMTPSA id p3sm6496764wmq.31.2021.04.22.10.57.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Apr 2021 10:57:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: git: 76b02b5cea1d - stable/12 - stats.7: Add dwatch(1) to the list From: Gordon Bergling In-Reply-To: Date: Thu, 22 Apr 2021 19:57:01 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> <21943B45-EFA4-417A-8973-62D6F5BA31FA@gmail.com> To: =?utf-8?Q?Fernando_Apestegu=C3=ADa?= X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Rspamd-Queue-Id: 4FR4qz4SqTz4ddp 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:57:03 -0000 This is quite simple. $ git revert $HASH $ git push =E2=80=94Gordon > Am 22.04.2021 um 19:49 schrieb Fernando Apestegu=C3=ADa = : >=20 > On Thu, Apr 22, 2021 at 7:48 PM Gordon Bergling = wrote: >>=20 >> Hi Fernando, >>=20 >> could you please revert this. The stats(7) framework is only = available in stable/13 and -CURRENT as far as I know. >>=20 >> And you have committed a merge conflict (<<<<<<< HEAD). >=20 > Sorry about that. I was just updating the review to note the mess. >=20 > Can you point me to the procedure in the documentation on how to > revert the change _properly_? >=20 > Thanks >>=20 >> --Gordon >>=20 >>> Am 22.04.2021 um 19:42 schrieb Fernando Apestegu=C3=ADa = : >>>=20 >>> The branch stable/12 has been updated by fernape (doc, ports = committer): >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D76b02b5cea1dc548d30b2ec5e95ce5a2= 7deb16e3 >>>=20 >>> commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 >>> Author: Fernando Apestegu=C3=ADa >>> AuthorDate: 2021-04-22 13:54:45 +0000 >>> Commit: Fernando Apestegu=C3=ADa >>> CommitDate: 2021-04-22 17:38:32 +0000 >>>=20 >>> stats.7: Add dwatch(1) to the list >>>=20 >>> PR: 255303 >>> Approved by: 0mp (mentor) >>> Differential Revision: https://reviews.freebsd.org/D29924 >>>=20 >>> (cherry picked from commit = 2e5929a75634504d388cc04d24e6a558840e18cb) >>> --- >>> share/man/man7/stats.7 | 10 +++++++++- >>> 1 file changed, 9 insertions(+), 1 deletion(-) >>>=20 >>> diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 >>> index e72407c96fee..5ccba52057dc 100644 >>> --- a/share/man/man7/stats.7 >>> +++ b/share/man/man7/stats.7 >>> @@ -26,7 +26,7 @@ >>> .\" >>> .\" $FreeBSD$ >>> .\" >>> -.Dd May 14, 2020 >>> +.Dd April 22, 2021 >>> .Dt STATS 7 >>> .Os >>> .Sh NAME >>> @@ -46,6 +46,8 @@ are currently included in the base system, with = more appearing periodically. >>> Show Bluetooth socket information >>> .It Nm ctlstat >>> CAM Target Layer statistics utility >>> +.It Nm dwatch >>> +watch processes as they trigger a particular DTrace probe >>> .It Nm fstat >>> Identify active files >>> .It Nm gstat >>> @@ -87,6 +89,12 @@ Report virtual memory statistics >>> .It Nm zpool iostat >>> Report ZFS I/O statistics >>> .Sh SEE ALSO >>> +<<<<<<< HEAD >>> +=3D=3D=3D=3D=3D=3D=3D >>> +.Xr btsockstat 1 , >>> +.Xr dwatch 1 , >>> +.Xr fstat 1 , >>> +>>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) >>> .Xr intro 1 , >>> .Xr intro 7 , >>> .Xr intro 8 , >>> _______________________________________________ >>> dev-commits-src-branches@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-branches >>> To unsubscribe, send any mail to = "dev-commits-src-branches-unsubscribe@freebsd.org" >>=20 From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:59:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A7155FA1F6; Thu, 22 Apr 2021 17:59: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 4FR4tF338Yz4dsm; Thu, 22 Apr 2021 17:59: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 5B9381E7FA; Thu, 22 Apr 2021 17:59: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 13MHx1Vc033455; Thu, 22 Apr 2021 17:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MHx1X6033454; Thu, 22 Apr 2021 17:59:01 GMT (envelope-from git) Date: Thu, 22 Apr 2021 17:59:01 GMT Message-Id: <202104221759.13MHx1X6033454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?B?RmVybmFuZG8gQXBlc3RlZ3XDrWE=?= Subject: git: 33ed5220c2b8 - stable/12 - Revert "stats.7: Add dwatch(1) to the list" 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 33ed5220c2b8d6a67317df8a0b1adc31dae6557a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:59:01 -0000 The branch stable/12 has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=33ed5220c2b8d6a67317df8a0b1adc31dae6557a commit 33ed5220c2b8d6a67317df8a0b1adc31dae6557a Author: Fernando Apesteguía AuthorDate: 2021-04-22 17:55:01 +0000 Commit: Fernando Apesteguía CommitDate: 2021-04-22 17:55:01 +0000 Revert "stats.7: Add dwatch(1) to the list" As gbe@ notes, the stats(7) framework is not present in stable/12 This reverts commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3. --- share/man/man7/stats.7 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 index 5ccba52057dc..e72407c96fee 100644 --- a/share/man/man7/stats.7 +++ b/share/man/man7/stats.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2021 +.Dd May 14, 2020 .Dt STATS 7 .Os .Sh NAME @@ -46,8 +46,6 @@ are currently included in the base system, with more appearing periodically. Show Bluetooth socket information .It Nm ctlstat CAM Target Layer statistics utility -.It Nm dwatch -watch processes as they trigger a particular DTrace probe .It Nm fstat Identify active files .It Nm gstat @@ -89,12 +87,6 @@ Report virtual memory statistics .It Nm zpool iostat Report ZFS I/O statistics .Sh SEE ALSO -<<<<<<< HEAD -======= -.Xr btsockstat 1 , -.Xr dwatch 1 , -.Xr fstat 1 , ->>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) .Xr intro 1 , .Xr intro 7 , .Xr intro 8 , From owner-dev-commits-src-all@freebsd.org Thu Apr 22 17:59:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF8225FA906; Thu, 22 Apr 2021 17:59:46 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 4FR4v66Dgzz4dqn; Thu, 22 Apr 2021 17:59:46 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-qk1-f175.google.com with SMTP id y136so15112279qkb.1; Thu, 22 Apr 2021 10:59:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5OF6HPQAlTIku8oLgorHI4oEzv1swClkqeuFMBU4JRM=; b=AsO0nlDbMeqZhwHyQLiLq7q/0Zo1FlUfwo1BsPUlQUg+aC5womFFaV6oNo+JB2UgqG cPkv8XQjjBChvowJpDeHFhggJRIINoszgH4smwupLzOQgk1lDDANoc68WkOyJKDUWVpZ e/R7ZzCMR9XOnTXOM/hKmAzikR2fqr51fI47zjd47HbnEsfrWAb9PSiVlin26mfkql30 95arPxx0mjhfdcI7XJEYEsLlFTQ4pDbbEkSj8mq498rA90uqi0rydi0MCGTf+LbzsoKu XHvU43Lxy6A02Vmj4Jy91/nFzQ8gw8CvTHe2p1X03618zjmnkZk8XLZv/whGWLqcQ4HD lpNA== X-Gm-Message-State: AOAM5303IyZreLAHQVn/8aPSBJXdPvL99PfH63YQzoxXfAaGz46GUHu/ MznMKL3oYh2Coj0n2UVJr9lheoXMwZVPGg== X-Google-Smtp-Source: ABdhPJyosVR/22P78aSvaP1xUr8Y/PSfDLQiIfyKoj+mjAcFGzr6UqTVig47kHniB4/vgJwsqVAPyw== X-Received: by 2002:a05:620a:110a:: with SMTP id o10mr4881191qkk.148.1619114385611; Thu, 22 Apr 2021 10:59:45 -0700 (PDT) Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com. [209.85.219.171]) by smtp.gmail.com with ESMTPSA id t63sm2726801qkh.6.2021.04.22.10.59.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 10:59:45 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id g38so52493848ybi.12; Thu, 22 Apr 2021 10:59:45 -0700 (PDT) X-Received: by 2002:a25:2fc5:: with SMTP id v188mr6776493ybv.140.1619114385212; Thu, 22 Apr 2021 10:59:45 -0700 (PDT) MIME-Version: 1.0 References: <202104221742.13MHgH0q019190@gitrepo.freebsd.org> <21943B45-EFA4-417A-8973-62D6F5BA31FA@gmail.com> In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 22 Apr 2021 19:56:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 76b02b5cea1d - stable/12 - stats.7: Add dwatch(1) to the list To: Gordon Bergling Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4FR4v66Dgzz4dqn 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)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:59:47 -0000 On Thu, Apr 22, 2021 at 7:57 PM Gordon Bergling wrote= : > > This is quite simple. > > $ git revert $HASH > $ git push Should be fixed now. Thanks > > =E2=80=94Gordon > > > Am 22.04.2021 um 19:49 schrieb Fernando Apestegu=C3=ADa : > > > > On Thu, Apr 22, 2021 at 7:48 PM Gordon Bergling w= rote: > >> > >> Hi Fernando, > >> > >> could you please revert this. The stats(7) framework is only available= in stable/13 and -CURRENT as far as I know. > >> > >> And you have committed a merge conflict (<<<<<<< HEAD). > > > > Sorry about that. I was just updating the review to note the mess. > > > > Can you point me to the procedure in the documentation on how to > > revert the change _properly_? > > > > Thanks > >> > >> --Gordon > >> > >>> Am 22.04.2021 um 19:42 schrieb Fernando Apestegu=C3=ADa : > >>> > >>> The branch stable/12 has been updated by fernape (doc, ports committe= r): > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D76b02b5cea1dc548d30b2e= c5e95ce5a27deb16e3 > >>> > >>> commit 76b02b5cea1dc548d30b2ec5e95ce5a27deb16e3 > >>> Author: Fernando Apestegu=C3=ADa > >>> AuthorDate: 2021-04-22 13:54:45 +0000 > >>> Commit: Fernando Apestegu=C3=ADa > >>> CommitDate: 2021-04-22 17:38:32 +0000 > >>> > >>> stats.7: Add dwatch(1) to the list > >>> > >>> PR: 255303 > >>> Approved by: 0mp (mentor) > >>> Differential Revision: https://reviews.freebsd.org/D29924 > >>> > >>> (cherry picked from commit 2e5929a75634504d388cc04d24e6a558840e18cb= ) > >>> --- > >>> share/man/man7/stats.7 | 10 +++++++++- > >>> 1 file changed, 9 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/share/man/man7/stats.7 b/share/man/man7/stats.7 > >>> index e72407c96fee..5ccba52057dc 100644 > >>> --- a/share/man/man7/stats.7 > >>> +++ b/share/man/man7/stats.7 > >>> @@ -26,7 +26,7 @@ > >>> .\" > >>> .\" $FreeBSD$ > >>> .\" > >>> -.Dd May 14, 2020 > >>> +.Dd April 22, 2021 > >>> .Dt STATS 7 > >>> .Os > >>> .Sh NAME > >>> @@ -46,6 +46,8 @@ are currently included in the base system, with mor= e appearing periodically. > >>> Show Bluetooth socket information > >>> .It Nm ctlstat > >>> CAM Target Layer statistics utility > >>> +.It Nm dwatch > >>> +watch processes as they trigger a particular DTrace probe > >>> .It Nm fstat > >>> Identify active files > >>> .It Nm gstat > >>> @@ -87,6 +89,12 @@ Report virtual memory statistics > >>> .It Nm zpool iostat > >>> Report ZFS I/O statistics > >>> .Sh SEE ALSO > >>> +<<<<<<< HEAD > >>> +=3D=3D=3D=3D=3D=3D=3D > >>> +.Xr btsockstat 1 , > >>> +.Xr dwatch 1 , > >>> +.Xr fstat 1 , > >>> +>>>>>>> 2e5929a75634 (stats.7: Add dwatch(1) to the list) > >>> .Xr intro 1 , > >>> .Xr intro 7 , > >>> .Xr intro 8 , > >>> _______________________________________________ > >>> dev-commits-src-branches@freebsd.org mailing list > >>> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-branches > >>> To unsubscribe, send any mail to "dev-commits-src-branches-unsubscrib= e@freebsd.org" > >> > From owner-dev-commits-src-all@freebsd.org Thu Apr 22 18:31:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E43395FB374; Thu, 22 Apr 2021 18:31: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 4FR5bS4vrKz4gK8; Thu, 22 Apr 2021 18:31: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 9BE201E878; Thu, 22 Apr 2021 18:31: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 13MIVGK6084138; Thu, 22 Apr 2021 18:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MIVGZX084137; Thu, 22 Apr 2021 18:31:16 GMT (envelope-from git) Date: Thu, 22 Apr 2021 18:31:16 GMT Message-Id: <202104221831.13MIVGZX084137@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 21e596f343c0 - stable/13 - tcp: Refactor PRR code 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 21e596f343c0e57ce07729a22db6636a9f65edb1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 18:31:17 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=21e596f343c0e57ce07729a22db6636a9f65edb1 commit 21e596f343c0e57ce07729a22db6636a9f65edb1 Author: Richard Scheffenegger AuthorDate: 2021-03-25 22:58:46 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-22 18:28:54 +0000 tcp: Refactor PRR code No functional change intended. MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29411 (cherry picked from commit eb3a59a83112f5fcd60aab44ac0ac68331b6aedf) --- sys/netinet/tcp_input.c | 58 ++++++++----------------------------------------- sys/netinet/tcp_var.h | 2 +- 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ea9b03ae4a4d..3f2df998fd9e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2576,47 +2576,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - int snd_cnt = 0, limit = 0; - int del_data = 0, pipe = 0; - /* - * In a duplicate ACK del_data is only the - * diff_in_sack. If no SACK is used del_data - * will be 0. Pipe is the amount of data we - * estimate to be in the network. - */ - del_data = tp->sackhint.delivered_data; - if (V_tcp_do_rfc6675_pipe) - pipe = tcp_compute_pipe(tp); - else - pipe = (tp->snd_nxt - tp->snd_fack) + - tp->sackhint.sack_bytes_rexmit; - tp->sackhint.prr_delivered += del_data; - if (pipe >= tp->snd_ssthresh) { - if (tp->sackhint.recover_fs == 0) - tp->sackhint.recover_fs = - imax(1, tp->snd_nxt - tp->snd_una); - snd_cnt = howmany((long)tp->sackhint.prr_delivered * - tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.prr_out; - } else { - if (V_tcp_do_prr_conservative) - limit = tp->sackhint.prr_delivered - - tp->sackhint.prr_out; - else - limit = imax(tp->sackhint.prr_delivered - - tp->sackhint.prr_out, - del_data) + maxseg; - snd_cnt = imin(tp->snd_ssthresh - pipe, limit); - } - snd_cnt = imax(snd_cnt, 0) / maxseg; - /* - * Send snd_cnt new data into the network in - * response to this ACK. If there is a going - * to be a SACK retransmission, adjust snd_cwnd - * accordingly. - */ - tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + tcp_do_prr_ack(tp, th); } else if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACK) && IN_FASTRECOVERY(tp->t_flags)) { @@ -2814,9 +2774,13 @@ resume_partialack: if (IN_FASTRECOVERY(tp->t_flags)) { if (SEQ_LT(th->th_ack, tp->snd_recover)) { if (tp->t_flags & TF_SACK_PERMIT) - if (V_tcp_do_prr && to.to_flags & TOF_SACK) - tcp_prr_partialack(tp, th); - else + if (V_tcp_do_prr && to.to_flags & TOF_SACK) { + tcp_timer_activate(tp, TT_REXMT, 0); + tp->t_rtttime = 0; + tcp_do_prr_ack(tp, th); + tp->t_flags |= TF_ACKNOW; + (void) tcp_output(tp); + } else tcp_sack_partialack(tp, th); else tcp_newreno_partial_ack(tp, th); @@ -3944,15 +3908,13 @@ tcp_mssopt(struct in_conninfo *inc) } void -tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) +tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) { int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); - tcp_timer_activate(tp, TT_REXMT, 0); - tp->t_rtttime = 0; /* * Compute the amount of data that this ACK is indicating * (del_data) and an estimate of how many bytes are in the @@ -3992,8 +3954,6 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) */ tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); - tp->t_flags |= TF_ACKNOW; - (void) tcp_output(tp); } /* diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 3b007fcfcc93..1e1fb2eeb678 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1056,7 +1056,7 @@ void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); -void tcp_prr_partialack(struct tcpcb *, struct tcphdr *); +void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *); void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 18:31:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBF5D5FB6A3; Thu, 22 Apr 2021 18:31: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 4FR5bT5mVxz4gK9; Thu, 22 Apr 2021 18:31: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 B96371EEB0; Thu, 22 Apr 2021 18:31: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 13MIVHDW084161; Thu, 22 Apr 2021 18:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MIVH9O084160; Thu, 22 Apr 2021 18:31:17 GMT (envelope-from git) Date: Thu, 22 Apr 2021 18:31:17 GMT Message-Id: <202104221831.13MIVH9O084160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: f69b9760c202 - stable/13 - tcp: Use PRR for ECN congestion recovery 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f69b9760c202b9e3a320915f1c9e75ed96142872 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 18:31:18 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=f69b9760c202b9e3a320915f1c9e75ed96142872 commit f69b9760c202b9e3a320915f1c9e75ed96142872 Author: Richard Scheffenegger AuthorDate: 2021-03-26 01:05:22 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-22 18:28:54 +0000 tcp: Use PRR for ECN congestion recovery MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28972 (cherry picked from commit b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a) --- sys/netinet/tcp_input.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 3f2df998fd9e..67f16b77d041 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2786,6 +2786,16 @@ resume_partialack: tcp_newreno_partial_ack(tp, th); } else cc_post_recovery(tp, th); + } else if (IN_CONGRECOVERY(tp->t_flags)) { + if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (V_tcp_do_prr) { + tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); + tp->snd_fack = th->th_ack; + tcp_do_prr_ack(tp, th); + (void) tcp_output(tp); + } + } else + cc_post_recovery(tp, th); } /* * If we reach this point, ACK is not a duplicate, @@ -3952,8 +3962,12 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + if (IN_FASTRECOVERY(tp->t_flags)) { + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + } else if (IN_CONGRECOVERY(tp->t_flags)) + tp->snd_cwnd = imax(maxseg, pipe - del_data + + (snd_cnt * maxseg)); } /* From owner-dev-commits-src-all@freebsd.org Thu Apr 22 18:31:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 608C25FB54B; Thu, 22 Apr 2021 18:31: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 4FR5bW0jPZz4gFL; Thu, 22 Apr 2021 18:31: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 EB5DF1EEB2; Thu, 22 Apr 2021 18:31: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 13MIVIn1084186; Thu, 22 Apr 2021 18:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MIVIiG084185; Thu, 22 Apr 2021 18:31:18 GMT (envelope-from git) Date: Thu, 22 Apr 2021 18:31:18 GMT Message-Id: <202104221831.13MIVIiG084185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: af5916594bcb - stable/13 - tcp: Prepare PRR to work with NewReno LossRecovery 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/stable/13 X-Git-Reftype: branch X-Git-Commit: af5916594bcb13733acd6b40b69bce6796331fde Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 18:31:19 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=af5916594bcb13733acd6b40b69bce6796331fde commit af5916594bcb13733acd6b40b69bce6796331fde Author: Richard Scheffenegger AuthorDate: 2021-04-08 16:52:20 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-22 18:28:54 +0000 tcp: Prepare PRR to work with NewReno LossRecovery Add proper PRR vnet declarations for consistency. Also add pointer to tcpopt struct to tcp_do_prr_ack, in preparation for it to deal with non-SACK window reduction (after loss). No functional change. MFC after: 2 weeks Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29440 (cherry picked from commit 90cca08e91f54214747af0419c988aba868398ed) --- sys/netinet/tcp_input.c | 8 ++++---- sys/netinet/tcp_var.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 67f16b77d041..9905fc01ced8 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2576,7 +2576,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, if (V_tcp_do_prr && IN_FASTRECOVERY(tp->t_flags) && (tp->t_flags & TF_SACK_PERMIT)) { - tcp_do_prr_ack(tp, th); + tcp_do_prr_ack(tp, th, &to); } else if ((tp->t_flags & TF_SACK_PERMIT) && (to.to_flags & TOF_SACK) && IN_FASTRECOVERY(tp->t_flags)) { @@ -2777,7 +2777,7 @@ resume_partialack: if (V_tcp_do_prr && to.to_flags & TOF_SACK) { tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; - tcp_do_prr_ack(tp, th); + tcp_do_prr_ack(tp, th, &to); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); } else @@ -2791,7 +2791,7 @@ resume_partialack: if (V_tcp_do_prr) { tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); tp->snd_fack = th->th_ack; - tcp_do_prr_ack(tp, th); + tcp_do_prr_ack(tp, th, &to); (void) tcp_output(tp); } } else @@ -3918,7 +3918,7 @@ tcp_mssopt(struct in_conninfo *inc) } void -tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) +tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) { int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 1e1fb2eeb678..48762e231065 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -838,6 +838,8 @@ VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_autorcvbuf); VNET_DECLARE(int, tcp_do_autosndbuf); VNET_DECLARE(int, tcp_do_ecn); +VNET_DECLARE(int, tcp_do_prr); +VNET_DECLARE(int, tcp_do_prr_conservative); VNET_DECLARE(int, tcp_do_newcwv); VNET_DECLARE(int, tcp_do_rfc1323); VNET_DECLARE(int, tcp_tolerate_missing_ts); @@ -1056,7 +1058,7 @@ void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); -void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *); +void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *, struct tcpopt *); void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); From owner-dev-commits-src-all@freebsd.org Thu Apr 22 18:38:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 501765FBB19; Thu, 22 Apr 2021 18:38: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 4FR5lb0y6Wz4gj4; Thu, 22 Apr 2021 18:38: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 138F01EB6A; Thu, 22 Apr 2021 18:38: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 13MIcImA086357; Thu, 22 Apr 2021 18:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MIcIfE086356; Thu, 22 Apr 2021 18:38:18 GMT (envelope-from git) Date: Thu, 22 Apr 2021 18:38:18 GMT Message-Id: <202104221838.13MIcIfE086356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: eb65f2a3b1c8 - stable/13 - rack: Fix ECN on finalizing session. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: eb65f2a3b1c87a434f609756e6e91f63413e0981 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 18:38:19 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=eb65f2a3b1c87a434f609756e6e91f63413e0981 commit eb65f2a3b1c87a434f609756e6e91f63413e0981 Author: Richard Scheffenegger AuthorDate: 2021-04-17 18:16:06 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-22 18:37:17 +0000 rack: Fix ECN on finalizing session. Maintain code similarity between RACK and base stack for ECN. This may not strictly be necessary, depending when a state transition to FIN_WAIT_1 is done in RACK after a shutdown() or close() syscall. MFC after: 3 days Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29658 (cherry picked from commit 2e97826052d169f6e2e1d2f87b086f56d1cf2b0b) --- sys/netinet/tcp_stacks/rack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 104468bee53b..4a883ee32c79 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -13436,7 +13436,7 @@ send: flags |= TH_ECE; tp->t_flags2 &= ~TF2_ECN_SND_ECE; } - if (tp->t_state == TCPS_ESTABLISHED && + if (TCPS_HAVEESTABLISHED(tp->t_state) && (tp->t_flags2 & TF2_ECN_PERMIT)) { /* * If the peer has ECN, mark data packets with ECN capable From owner-dev-commits-src-all@freebsd.org Thu Apr 22 18:56:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9A55FC0A4; Thu, 22 Apr 2021 18:56:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FR68g3Z2tz4hZx; Thu, 22 Apr 2021 18:56:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (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 C64835816; Thu, 22 Apr 2021 18:56:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 89c3c32647a5 - main - bhyve: Gracefully handle virtio-scsi with no conf To: Ryan Moeller , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104221607.13MG77Oe087009@gitrepo.freebsd.org> From: John Baldwin Message-ID: <4f92a870-a79f-25f4-66a4-a7c1dee8d549@FreeBSD.org> Date: Thu, 22 Apr 2021 11:56:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <202104221607.13MG77Oe087009@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 18:56:35 -0000 On 4/22/21 9:07 AM, Ryan Moeller wrote: > The branch main has been updated by freqlabs: > > URL: https://cgit.FreeBSD.org/src/commit/?id=89c3c32647a5099b297af2958e5a939eff0c0ce0 > > commit 89c3c32647a5099b297af2958e5a939eff0c0ce0 > Author: Ryan Moeller > AuthorDate: 2021-04-22 16:06:08 +0000 > Commit: Ryan Moeller > CommitDate: 2021-04-22 16:06:08 +0000 > > bhyve: Gracefully handle virtio-scsi with no conf > > Fixes segfault with the command `bhyve -s 0,virtio-scsi`, which is used > by some third party software to probe bhyve for virtio-scsi support. > > Reviewed by: jhb > MFC after: 1 day No need to MFC this btw, as the conf stuff isn't merged yet. It would have been nice to include a 'Fixes' tag that I could use to try to locate all the various followup fixes for the config changes for when it is eventually merged to 13 however. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Thu Apr 22 19:51:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9187D5FD020; Thu, 22 Apr 2021 19:51:05 +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 4FR7MY3pkrz4kN8; Thu, 22 Apr 2021 19:51:05 +0000 (UTC) (envelope-from debdrup@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1619121065; 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=4nepadz+4eg+SyjkpwXPPt5GXg+s88fSQ0G96VaQilQ=; b=Udd8K4RUIG9KUXo88lCi08eaLtiFu9K9jqFosR+T/lnTmiMf1IKaTG2VMYqEVHLdBVndAz cCICe5P6v/N56w7jqDqERhJTQH3h5ZIjCclMihkeeAbtv5Vv/BXeVJ7Bw5cK7AyXWTPfEc kHZ5gR115ePwILDec1r0NstWyTeS35O9XJtr6g43hl/fdRWi2Y/tRdjfHtQzayB9Mlijbh F9XFPCml5ZqDf2KKc0nXgDUl43D7T1Gsd7lWgJOE892rQE06dE2uj73LmooimLh2ILa2nD nJ0f2jq+pOI9GYpx3TSwO8l/UPLKqH9njiZRQq+7lI7DI6rZI9MIXNEYpAoW6Q== Received: by freefall.freebsd.org (Postfix, from userid 1471) id 6E97727E88; Thu, 22 Apr 2021 19:51:05 +0000 (UTC) Date: Thu, 22 Apr 2021 21:51:03 +0200 From: Daniel Ebdrup Jensen To: dev-commits-src-main@freebsd.org, dev-commits-src-all@FreeBSD.org Subject: Re: git: 2e5929a75634 - main - stats.7: Add dwatch(1) to the list Message-ID: <20210422195103.h4uafdpwj7wwb765@nerd-thinkpad.local> Mail-Followup-To: Daniel Ebdrup Jensen , dev-commits-src-main@freebsd.org, dev-commits-src-all@FreeBSD.org References: <202104221736.13MHafaH006547@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jtzcqqublvw5xafj" Content-Disposition: inline In-Reply-To: <202104221736.13MHafaH006547@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1619121065; 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=4nepadz+4eg+SyjkpwXPPt5GXg+s88fSQ0G96VaQilQ=; b=XVtWLSXL5s8AY71HeeSKC20PpLI2ToVkf/aM/ipVHZmFI76mwaNM20sNTy+eSNn+RldteI +vEvucff1jpewNcJODgwfnNV5yzmw1Oxj7MdA2+ZVViHp1+Xy/U93lwVUZ3gwD+ssg/KsE IJ8e6nUpE3QkOfY6E+B7mXmrDNF/SyTS1Dww4E5hiWiIsnPui8eDlzEzasEAM1kvJouLru 8JQ53mrLJ33XpYZ6fwqDYbz47rsQuLXHO5bv5WsH+1iNDi78b97//uiavl9QfYHlOhD+ev LNbhAy4rZsJF2yRJTzEXFTBZdsDQLlHxYQhHdLMzhnI3gZRq5y+1D2fDZTnLzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1619121065; a=rsa-sha256; cv=none; b=gvu8QYbos5yYJk81aj+z8BLo+Vpl+GFIzpgYQUAXSusPoMnhSmV9YkKOQYaIl6WmLZTnzm UWBe0FTA2I9y0O4ZuXJ+ZkqWVkruiREKkhAklEa57nl1TMAqGJftmecK1CJqG8KKFhJ0n0 0HmxrLYjhXEGtR7GFmmzpT+pTqKZBwbySl9XYFqp/TYonVH3QcMeNvq0nAl8Ro6EKIc+B0 Qj2CUFgnIheNfMohtOAwglvPDAh+W5kZmHebmQ55ZcDEMYCr2+hCYgyBOHnrvqwO5tJula quBelhRArSVlGnvBlmpbteWvshquWdfvu9mMIPA2ydyCcM0xTRCFcwMC2V8cEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 19:51:05 -0000 --jtzcqqublvw5xafj Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 22, 2021 at 05:36:41PM +0000, Fernando Apestegu=EDa wrote: >The branch main has been updated by fernape (doc, ports committer): > >URL: https://cgit.FreeBSD.org/src/commit/?id=3D2e5929a75634504d388cc04d24e= 6a558840e18cb > >commit 2e5929a75634504d388cc04d24e6a558840e18cb >Author: Fernando Apestegu=EDa >AuthorDate: 2021-04-22 13:54:45 +0000 >Commit: Fernando Apestegu=EDa >CommitDate: 2021-04-22 17:33:12 +0000 > > stats.7: Add dwatch(1) to the list > > PR: 255303 > Approved by: 0mp (mentor) > Differential Revision: https://reviews.freebsd.org/D29924 >--- > share/man/man7/stats.7 | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > Hi Fernando, The original idea with stats(7) was to list all of the commands ending in -stat and which can be used for basic understanding of what the system is doing at any given time. In addition to this, dwatch(1) doesn't even work without loading the dtrace kernel module (as is expected, given the name of the command), but it's also intended for pretty deep inspection (the (in)famous example being that root can snoop on users passwords). I'm not saying it should be reverted, but maybe there's a better manual page for this that it could be added to instead? Yours hopefully, Daniel Ebdrup Jensen --jtzcqqublvw5xafj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmCB06dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN 87pQgQgAmZwSoGSY2bOcCq6iXfKTA4lGJIBkTqsYI1b7D8CZaMTK/YQIu00w0TWU ipWsY1ofS5Em4NngWQH9EukpU7idyml3MEOaL5WkkBdfTJ0ZwtCv5miPPaVnGDyn bA6QEvrQyTlbKb+GIXerBIUVavqRMLn7rSDGCo7FhDOJzwbxCyo9DBpHjxa/lX7h epeQ5Wr9Cv3k8jKaEVvQSnWuje5ZqNlLKhjhcDgOSAFxIv7I1+vOmYglOy8niJUB BymIC4FV1r64o8VotEYBGtiPdolGayoN6iF2Har7UmwBivYmHB56ZSzcdq85r8JD ZhbSR1vyHFN70lXfmWIcTTiW+HIMtg== =dNjl -----END PGP SIGNATURE----- --jtzcqqublvw5xafj-- From owner-dev-commits-src-all@freebsd.org Thu Apr 22 20:59:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58D9E5FE98F; Thu, 22 Apr 2021 20:59:33 +0000 (UTC) (envelope-from nwhitehorn@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 4FR8tY224Cz4n7Q; Thu, 22 Apr 2021 20:59:33 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (unknown [IPv6:2601:405:4a00:acd:3dd7:f96a:93a3:9836]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: nwhitehorn/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 04EA867BC; Thu, 22 Apr 2021 20:59:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Subject: Re: git: b31fbebeb3d5 - main - Relax rtsock message restrictions. To: "Alexander V. Chernikov" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104202135.13KLZDPM097608@gitrepo.freebsd.org> From: Nathan Whitehorn Message-ID: <8151c4a1-776e-ed67-6542-04dfbc945e52@freebsd.org> Date: Thu, 22 Apr 2021 16:59:31 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <202104202135.13KLZDPM097608@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 20:59:33 -0000 Thanks! Is this an erratum candidate for 13.0? I was pretty surprised when a production machine stopped routing after an upgrade, and I can't be the only one. -Nathan On 4/20/21 5:35 PM, Alexander V. Chernikov wrote: > The branch main has been updated by melifaro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b31fbebeb3d59af359a3417cddfbcf666b2c56c9 > > commit b31fbebeb3d59af359a3417cddfbcf666b2c56c9 > Author: Alexander V. Chernikov > AuthorDate: 2021-04-19 20:49:18 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2021-04-20 21:34:19 +0000 > > Relax rtsock message restrictions. > > Address multiple issues with strict rtsock message validation. > > D28668 "normalisation" approach was based on the assumption that > we always have at least "standard" sockaddr len. > It turned out to be false - certain older applications like quagga > or routed abuse sin[6]_len field and set it to the offset to the > first fully-zero bit in the mask. It is impossible to normalise > such sockaddrs without reallocation. > > With that in mind, change the approach to use a distinct memory > buffer for the altered sockaddrs. This allows supporting the older > software while maintaining the guarantee on the "standard" sockaddrs. > > PR: 255273,255089 > Differential Revision: https://reviews.freebsd.org/D29826 > MFC after: 3 days > --- > sys/net/rtsock.c | 271 ++++++++++++++++++++++++++++++++++++------------------- > 1 file changed, 177 insertions(+), 94 deletions(-) > > diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c > index 5194a2a15c1e..b7a7e5170c74 100644 > --- a/sys/net/rtsock.c > +++ b/sys/net/rtsock.c > @@ -126,6 +126,13 @@ struct ifa_msghdrl32 { > > #endif /* COMPAT_FREEBSD32 */ > > +struct linear_buffer { > + char *base; /* Base allocated memory pointer */ > + uint32_t offset; /* Currently used offset */ > + uint32_t size; /* Total buffer size */ > +}; > +#define SCRATCH_BUFFER_SIZE 1024 > + > #define RTS_PID_PRINTF(_fmt, ...) \ > printf("rtsock:%s(): PID %d: " _fmt "\n", __func__, curproc->p_pid, ## __VA_ARGS__) > > @@ -177,7 +184,7 @@ static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, > struct walkarg *w, int *plen); > static int rt_xaddrs(caddr_t cp, caddr_t cplim, > struct rt_addrinfo *rtinfo); > -static int cleanup_xaddrs(struct rt_addrinfo *info); > +static int cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb); > static int sysctl_dumpentry(struct rtentry *rt, void *vw); > static int sysctl_dumpnhop(struct rtentry *rt, struct nhop_object *nh, > uint32_t weight, struct walkarg *w); > @@ -621,7 +628,8 @@ fill_blackholeinfo(struct rt_addrinfo *info, union sockaddr_union *saun) > * Returns 0 on success. > */ > static int > -fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo *info) > +fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fibnum, > + struct rt_addrinfo *info) > { > int error; > sa_family_t saf; > @@ -641,7 +649,7 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo * > return (EINVAL); > > info->rti_flags = rtm->rtm_flags; > - error = cleanup_xaddrs(info); > + error = cleanup_xaddrs(info, lb); > if (error != 0) > return (error); > saf = info->rti_info[RTAX_DST]->sa_family; > @@ -878,6 +886,45 @@ export_rtaddrs(const struct rtentry *rt, struct sockaddr *dst, > #endif > } > > +static int > +update_rtm_from_info(struct rt_addrinfo *info, struct rt_msghdr **prtm, > + int alloc_len) > +{ > + struct rt_msghdr *rtm, *orig_rtm = NULL; > + struct walkarg w; > + int len; > + > + rtm = *prtm; > + /* Check if we need to realloc storage */ > + rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); > + if (len > alloc_len) { > + struct rt_msghdr *tmp_rtm; > + > + tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); > + if (tmp_rtm == NULL) > + return (ENOBUFS); > + bcopy(rtm, tmp_rtm, rtm->rtm_msglen); > + orig_rtm = rtm; > + rtm = tmp_rtm; > + alloc_len = len; > + > + /* > + * Delay freeing original rtm as info contains > + * data referencing it. > + */ > + } > + > + w.w_tmem = (caddr_t)rtm; > + w.w_tmemsize = alloc_len; > + rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); > + rtm->rtm_addrs = info->rti_addrs; > + > + if (orig_rtm != NULL) > + free(orig_rtm, M_TEMP); > + *prtm = rtm; > + return (0); > +} > + > > /* > * Update sockaddrs, flags, etc in @prtm based on @rc data. > @@ -891,11 +938,10 @@ static int > update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, > int alloc_len, struct rib_cmd_info *rc, struct nhop_object *nh) > { > - struct walkarg w; > union sockaddr_union saun; > - struct rt_msghdr *rtm, *orig_rtm = NULL; > + struct rt_msghdr *rtm; > struct ifnet *ifp; > - int error, len; > + int error; > > rtm = *prtm; > union sockaddr_union sa_dst, sa_mask; > @@ -927,28 +973,8 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, > } else if (ifp != NULL) > rtm->rtm_index = ifp->if_index; > > - /* Check if we need to realloc storage */ > - rtsock_msg_buffer(rtm->rtm_type, info, NULL, &len); > - if (len > alloc_len) { > - struct rt_msghdr *tmp_rtm; > - > - tmp_rtm = malloc(len, M_TEMP, M_NOWAIT); > - if (tmp_rtm == NULL) > - return (ENOBUFS); > - bcopy(rtm, tmp_rtm, rtm->rtm_msglen); > - orig_rtm = rtm; > - rtm = tmp_rtm; > - alloc_len = len; > - > - /* > - * Delay freeing original rtm as info contains > - * data referencing it. > - */ > - } > - > - w.w_tmem = (caddr_t)rtm; > - w.w_tmemsize = alloc_len; > - rtsock_msg_buffer(rtm->rtm_type, info, &w, &len); > + if ((error = update_rtm_from_info(info, prtm, alloc_len)) != 0) > + return (error); > > rtm->rtm_flags = rc->rc_rt->rte_flags | nhop_get_rtflags(nh); > if (rtm->rtm_flags & RTF_GWFLAG_COMPAT) > @@ -956,11 +982,6 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, > (rtm->rtm_flags & ~RTF_GWFLAG_COMPAT); > rt_getmetrics(rc->rc_rt, nh, &rtm->rtm_rmx); > rtm->rtm_rmx.rmx_weight = rc->rc_nh_weight; > - rtm->rtm_addrs = info->rti_addrs; > - > - if (orig_rtm != NULL) > - free(orig_rtm, M_TEMP); > - *prtm = rtm; > > return (0); > } > @@ -985,6 +1006,17 @@ save_add_notification(struct rib_cmd_info *rc, void *_cbdata) > } > #endif > > +static struct sockaddr * > +alloc_sockaddr_aligned(struct linear_buffer *lb, int len) > +{ > + len |= (sizeof(uint64_t) - 1); > + if (lb->offset + len > lb->size) > + return (NULL); > + struct sockaddr *sa = (struct sockaddr *)(lb->base + lb->offset); > + lb->offset += len; > + return (sa); > +} > + > /*ARGSUSED*/ > static int > route_output(struct mbuf *m, struct socket *so, ...) > @@ -1022,12 +1054,17 @@ route_output(struct mbuf *m, struct socket *so, ...) > * buffer aligned on 1k boundaty. > */ > alloc_len = roundup2(len, 1024); > - if ((rtm = malloc(alloc_len, M_TEMP, M_NOWAIT)) == NULL) > + int total_len = alloc_len + SCRATCH_BUFFER_SIZE; > + if ((rtm = malloc(total_len, M_TEMP, M_NOWAIT)) == NULL) > senderr(ENOBUFS); > > m_copydata(m, 0, len, (caddr_t)rtm); > bzero(&info, sizeof(info)); > nh = NULL; > + struct linear_buffer lb = { > + .base = (char *)rtm + alloc_len, > + .size = SCRATCH_BUFFER_SIZE, > + }; > > if (rtm->rtm_version != RTM_VERSION) { > /* Do not touch message since format is unknown */ > @@ -1042,19 +1079,19 @@ route_output(struct mbuf *m, struct socket *so, ...) > * caller PID and error value. > */ > > - if ((error = fill_addrinfo(rtm, len, fibnum, &info)) != 0) { > + if ((error = fill_addrinfo(rtm, len, &lb, fibnum, &info)) != 0) { > senderr(error); > } > + /* fill_addringo() embeds scope into IPv6 addresses */ > +#ifdef INET6 > + rti_need_deembed = 1; > +#endif > > saf = info.rti_info[RTAX_DST]->sa_family; > > /* support for new ARP code */ > if (rtm->rtm_flags & RTF_LLDATA) { > error = lla_rt_output(rtm, &info); > -#ifdef INET6 > - if (error == 0) > - rti_need_deembed = 1; > -#endif > goto flush; > } > > @@ -1067,7 +1104,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > error = EINVAL; > if (error != 0) > senderr(error); > - /* TODO: rebuild rtm from scratch */ > } > > switch (rtm->rtm_type) { > @@ -1079,9 +1115,6 @@ route_output(struct mbuf *m, struct socket *so, ...) > } > error = rib_action(fibnum, rtm->rtm_type, &info, &rc); > if (error == 0) { > -#ifdef INET6 > - rti_need_deembed = 1; > -#endif > #ifdef ROUTE_MPATH > if (NH_IS_NHGRP(rc.rc_nh_new) || > (rc.rc_nh_old && NH_IS_NHGRP(rc.rc_nh_old))) { > @@ -1110,12 +1143,7 @@ route_output(struct mbuf *m, struct socket *so, ...) > } > #endif > nh = rc.rc_nh_old; > - goto report; > } > -#ifdef INET6 > - /* rt_msg2() will not be used when RTM_DELETE fails. */ > - rti_need_deembed = 1; > -#endif > break; > > case RTM_GET: > @@ -1124,13 +1152,18 @@ route_output(struct mbuf *m, struct socket *so, ...) > senderr(error); > nh = rc.rc_nh_new; > > -report: > if (!can_export_rte(curthread->td_ucred, > info.rti_info[RTAX_NETMASK] == NULL, > info.rti_info[RTAX_DST])) { > senderr(ESRCH); > } > + break; > > + default: > + senderr(EOPNOTSUPP); > + } > + > + if (error == 0) { > error = update_rtm_from_rc(&info, &rtm, alloc_len, &rc, nh); > /* > * Note that some sockaddr pointers may have changed to > @@ -1147,12 +1180,6 @@ report: > #ifdef INET6 > rti_need_deembed = 0; > #endif > - if (error != 0) > - senderr(error); > - break; > - > - default: > - senderr(EOPNOTSUPP); > } > > flush: > @@ -1174,6 +1201,10 @@ flush: > bcopy(sin6, info.rti_info[i], > sizeof(*sin6)); > } > + if (update_rtm_from_info(&info, &rtm, alloc_len) != 0) { > + if (error != 0) > + error = ENOBUFS; > + } > } > } > #endif > @@ -1350,9 +1381,10 @@ cleanup_xaddrs_lladdr(struct rt_addrinfo *info) > } > > static int > -cleanup_xaddrs_gateway(struct rt_addrinfo *info) > +cleanup_xaddrs_gateway(struct rt_addrinfo *info, struct linear_buffer *lb) > { > struct sockaddr *gw = info->rti_info[RTAX_GATEWAY]; > + struct sockaddr *sa; > > if (info->rti_flags & RTF_LLDATA) > return (cleanup_xaddrs_lladdr(info)); > @@ -1362,11 +1394,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) > case AF_INET: > { > struct sockaddr_in *gw_sin = (struct sockaddr_in *)gw; > - if (gw_sin->sin_len < sizeof(struct sockaddr_in)) { > + > + /* Ensure reads do not go beyoud SA boundary */ > + if (SA_SIZE(gw) < offsetof(struct sockaddr_in, sin_zero)) { > RTS_PID_PRINTF("gateway sin_len too small: %d", gw->sa_len); > return (EINVAL); > } > - fill_sockaddr_inet(gw_sin, gw_sin->sin_addr); > + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_in)); > + if (sa == NULL) > + return (ENOBUFS); > + fill_sockaddr_inet((struct sockaddr_in *)sa, gw_sin->sin_addr); > + info->rti_info[RTAX_GATEWAY] = sa; > } > break; > #endif > @@ -1392,13 +1430,17 @@ cleanup_xaddrs_gateway(struct rt_addrinfo *info) > RTS_PID_PRINTF("gateway sdl_len too small: %d", gw_sdl->sdl_len); > return (EINVAL); > } > + sa = alloc_sockaddr_aligned(lb, sizeof(struct sockaddr_dl_short)); > + if (sa == NULL) > + return (ENOBUFS); > > const struct sockaddr_dl_short sdl = { > .sdl_family = AF_LINK, > - .sdl_len = sdl_min_len, > + .sdl_len = sizeof(struct sockaddr_dl_short), > .sdl_index = gw_sdl->sdl_index, > }; > - memcpy(gw_sdl, &sdl, sdl_min_len); > + *((struct sockaddr_dl_short *)sa) = sdl; > + info->rti_info[RTAX_GATEWAY] = sa; > break; > } > } > @@ -1416,39 +1458,57 @@ remove_netmask(struct rt_addrinfo *info) > > #ifdef INET > static int > -cleanup_xaddrs_inet(struct rt_addrinfo *info) > +cleanup_xaddrs_inet(struct rt_addrinfo *info, struct linear_buffer *lb) > { > struct sockaddr_in *dst_sa, *mask_sa; > + const int sa_len = sizeof(struct sockaddr_in); > + struct in_addr dst, mask; > > /* Check & fixup dst/netmask combination first */ > dst_sa = (struct sockaddr_in *)info->rti_info[RTAX_DST]; > mask_sa = (struct sockaddr_in *)info->rti_info[RTAX_NETMASK]; > > - struct in_addr mask = { > - .s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST, > - }; > - struct in_addr dst = { > - .s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)) > - }; > - > - if (dst_sa->sin_len < sizeof(struct sockaddr_in)) { > - printf("dst sin_len too small\n"); > + /* Ensure reads do not go beyound the buffer size */ > + if (SA_SIZE(dst_sa) < offsetof(struct sockaddr_in, sin_zero)) > return (EINVAL); > - } > - if (mask_sa && mask_sa->sin_len < sizeof(struct sockaddr_in)) { > - RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); > - return (EINVAL); > - } > + > + if ((mask_sa != NULL) && mask_sa->sin_len < sizeof(struct sockaddr_in)) { > + /* > + * Some older routing software encode mask length into the > + * sin_len, thus resulting in "truncated" sockaddr. > + */ > + int len = mask_sa->sin_len - offsetof(struct sockaddr_in, sin_addr); > + if (len >= 0) { > + mask.s_addr = 0; > + if (len > sizeof(struct in_addr)) > + len = sizeof(struct in_addr); > + memcpy(&mask, &mask_sa->sin_addr, len); > + } else { > + RTS_PID_PRINTF("prefix mask sin_len too small: %d", mask_sa->sin_len); > + return (EINVAL); > + } > + } else > + mask.s_addr = mask_sa ? mask_sa->sin_addr.s_addr : INADDR_BROADCAST; > + > + dst.s_addr = htonl(ntohl(dst_sa->sin_addr.s_addr) & ntohl(mask.s_addr)); > + > + /* Construct new "clean" dst/mask sockaddresses */ > + if ((dst_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) > + return (ENOBUFS); > fill_sockaddr_inet(dst_sa, dst); > + info->rti_info[RTAX_DST] = (struct sockaddr *)dst_sa; > > - if (mask.s_addr != INADDR_BROADCAST) > + if (mask.s_addr != INADDR_BROADCAST) { > + if ((mask_sa = (struct sockaddr_in *)alloc_sockaddr_aligned(lb, sa_len)) == NULL) > + return (ENOBUFS); > fill_sockaddr_inet(mask_sa, mask); > - else > + info->rti_info[RTAX_NETMASK] = (struct sockaddr *)mask_sa; > + } else > remove_netmask(info); > > /* Check gateway */ > if (info->rti_info[RTAX_GATEWAY] != NULL) > - return (cleanup_xaddrs_gateway(info)); > + return (cleanup_xaddrs_gateway(info, lb)); > > return (0); > } > @@ -1456,43 +1516,66 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info) > > #ifdef INET6 > static int > -cleanup_xaddrs_inet6(struct rt_addrinfo *info) > +cleanup_xaddrs_inet6(struct rt_addrinfo *info, struct linear_buffer *lb) > { > + struct sockaddr *sa; > struct sockaddr_in6 *dst_sa, *mask_sa; > - struct in6_addr mask; > + struct in6_addr mask, *dst; > + const int sa_len = sizeof(struct sockaddr_in6); > > /* Check & fixup dst/netmask combination first */ > dst_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_DST]; > mask_sa = (struct sockaddr_in6 *)info->rti_info[RTAX_NETMASK]; > > - mask = mask_sa ? mask_sa->sin6_addr : in6mask128; > - IN6_MASK_ADDR(&dst_sa->sin6_addr, &mask); > - > if (dst_sa->sin6_len < sizeof(struct sockaddr_in6)) { > RTS_PID_PRINTF("prefix dst sin6_len too small: %d", dst_sa->sin6_len); > return (EINVAL); > } > + > if (mask_sa && mask_sa->sin6_len < sizeof(struct sockaddr_in6)) { > - RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); > - return (EINVAL); > - } > - fill_sockaddr_inet6(dst_sa, &dst_sa->sin6_addr, 0); > + /* > + * Some older routing software encode mask length into the > + * sin6_len, thus resulting in "truncated" sockaddr. > + */ > + int len = mask_sa->sin6_len - offsetof(struct sockaddr_in6, sin6_addr); > + if (len >= 0) { > + bzero(&mask, sizeof(mask)); > + if (len > sizeof(struct in6_addr)) > + len = sizeof(struct in6_addr); > + memcpy(&mask, &mask_sa->sin6_addr, len); > + } else { > + RTS_PID_PRINTF("rtsock: prefix mask sin6_len too small: %d", mask_sa->sin6_len); > + return (EINVAL); > + } > + } else > + mask = mask_sa ? mask_sa->sin6_addr : in6mask128; > > - if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) > - fill_sockaddr_inet6(mask_sa, &mask, 0); > - else > + dst = &dst_sa->sin6_addr; > + IN6_MASK_ADDR(dst, &mask); > + > + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) > + return (ENOBUFS); > + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, dst, 0); > + info->rti_info[RTAX_DST] = sa; > + > + if (!IN6_ARE_ADDR_EQUAL(&mask, &in6mask128)) { > + if ((sa = alloc_sockaddr_aligned(lb, sa_len)) == NULL) > + return (ENOBUFS); > + fill_sockaddr_inet6((struct sockaddr_in6 *)sa, &mask, 0); > + info->rti_info[RTAX_NETMASK] = sa; > + } else > remove_netmask(info); > > /* Check gateway */ > if (info->rti_info[RTAX_GATEWAY] != NULL) > - return (cleanup_xaddrs_gateway(info)); > + return (cleanup_xaddrs_gateway(info, lb)); > > return (0); > } > #endif > > static int > -cleanup_xaddrs(struct rt_addrinfo *info) > +cleanup_xaddrs(struct rt_addrinfo *info, struct linear_buffer *lb) > { > int error = EAFNOSUPPORT; > > @@ -1511,12 +1594,12 @@ cleanup_xaddrs(struct rt_addrinfo *info) > switch (info->rti_info[RTAX_DST]->sa_family) { > #ifdef INET > case AF_INET: > - error = cleanup_xaddrs_inet(info); > + error = cleanup_xaddrs_inet(info, lb); > break; > #endif > #ifdef INET6 > case AF_INET6: > - error = cleanup_xaddrs_inet6(info); > + error = cleanup_xaddrs_inet6(info, lb); > break; > #endif > } > From owner-dev-commits-src-all@freebsd.org Thu Apr 22 22:07:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79CB3621219; Thu, 22 Apr 2021 22:07: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 4FRBPK31HFz4rbZ; Thu, 22 Apr 2021 22:07: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 5613121BD8; Thu, 22 Apr 2021 22:07: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 13MM7n1L064866; Thu, 22 Apr 2021 22:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MM7n48064865; Thu, 22 Apr 2021 22:07:49 GMT (envelope-from git) Date: Thu, 22 Apr 2021 22:07:49 GMT Message-Id: <202104222207.13MM7n48064865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 557c4521bbb2 - main - cxgbe/t4_tom: Implement tod_pmtu_update. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 557c4521bbb2517bd0552a15cb9429e524c3c0fd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 22:07:49 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=557c4521bbb2517bd0552a15cb9429e524c3c0fd commit 557c4521bbb2517bd0552a15cb9429e524c3c0fd Author: Navdeep Parhar AuthorDate: 2021-04-13 23:31:08 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-22 21:48:57 +0000 cxgbe/t4_tom: Implement tod_pmtu_update. tod_pmtu_update was added to the kernel in 01d74fe1ffc. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/offload.h | 1 + sys/dev/cxgbe/t4_main.c | 6 ++ sys/dev/cxgbe/tom/t4_tom.c | 161 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index e264882fb5b4..7efbd5f81f34 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -232,6 +232,7 @@ struct tom_tunables { int tx_zcopy; int cop_managed_offloading; int autorcvbuf_inc; + int update_hc_on_pmtu_change; }; /* iWARP driver tunables */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index ce439b94aa6c..3066d133e437 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -6844,6 +6844,12 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RW, &sc->tt.autorcvbuf_inc, 0, "autorcvbuf increment"); + sc->tt.update_hc_on_pmtu_change = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "update_hc_on_pmtu_change", CTLFLAG_RW, + &sc->tt.update_hc_on_pmtu_change, 0, + "Update hostcache entry if the PMTU changes"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 6a4b5e8f261e..173357404ebe 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include #include @@ -841,6 +842,165 @@ t4_alloc_tls_session(struct toedev *tod, struct tcpcb *tp, } #endif +/* SET_TCB_FIELD sent as a ULP command looks like this */ +#define LEN__SET_TCB_FIELD_ULP (sizeof(struct ulp_txpkt) + \ + sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) + +static void * +mk_set_tcb_field_ulp(struct ulp_txpkt *ulpmc, uint64_t word, uint64_t mask, + uint64_t val, uint32_t tid) +{ + struct ulptx_idata *ulpsc; + struct cpl_set_tcb_field_core *req; + + ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0)); + ulpmc->len = htobe32(howmany(LEN__SET_TCB_FIELD_ULP, 16)); + + ulpsc = (struct ulptx_idata *)(ulpmc + 1); + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); + ulpsc->len = htobe32(sizeof(*req)); + + req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); + OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); + req->reply_ctrl = htobe16(V_NO_REPLY(1)); + req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); + req->mask = htobe64(mask); + req->val = htobe64(val); + + ulpsc = (struct ulptx_idata *)(req + 1); + if (LEN__SET_TCB_FIELD_ULP % 16) { + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); + ulpsc->len = htobe32(0); + return (ulpsc + 1); + } + return (ulpsc); +} + +static void +send_mss_flowc_wr(struct adapter *sc, struct toepcb *toep) +{ + struct wrq_cookie cookie; + struct fw_flowc_wr *flowc; + struct ofld_tx_sdesc *txsd; + const int flowclen = sizeof(*flowc) + sizeof(struct fw_flowc_mnemval); + const int flowclen16 = howmany(flowclen, 16); + + if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0) { + CH_ERR(sc, "%s: tid %u out of tx credits (%d, %d).\n", __func__, + toep->tid, toep->tx_credits, toep->txsd_avail); + return; + } + + flowc = start_wrq_wr(&toep->ofld_txq->wrq, flowclen16, &cookie); + if (__predict_false(flowc == NULL)) { + CH_ERR(sc, "ENOMEM in %s for tid %u.\n", __func__, toep->tid); + return; + } + flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | + V_FW_FLOWC_WR_NPARAMS(1)); + flowc->flowid_len16 = htonl(V_FW_WR_LEN16(flowclen16) | + V_FW_WR_FLOWID(toep->tid)); + flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_MSS; + flowc->mnemval[0].val = htobe32(toep->params.emss); + + txsd = &toep->txsd[toep->txsd_pidx]; + txsd->tx_credits = flowclen16; + txsd->plen = 0; + toep->tx_credits -= txsd->tx_credits; + if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) + toep->txsd_pidx = 0; + toep->txsd_avail--; + commit_wrq_wr(&toep->ofld_txq->wrq, flowc, &cookie); +} + +static void +t4_pmtu_update(struct toedev *tod, struct tcpcb *tp, tcp_seq seq, int mtu) +{ + struct work_request_hdr *wrh; + struct ulp_txpkt *ulpmc; + int idx, len; + struct wrq_cookie cookie; + struct inpcb *inp = tp->t_inpcb; + struct toepcb *toep = tp->t_toe; + struct adapter *sc = td_adapter(toep->td); + unsigned short *mtus = &sc->params.mtus[0]; + + INP_WLOCK_ASSERT(inp); + MPASS(mtu > 0); /* kernel is supposed to provide something usable. */ + + /* tp->snd_una and snd_max are in host byte order too. */ + seq = be32toh(seq); + + CTR6(KTR_CXGBE, "%s: tid %d, seq 0x%08x, mtu %u, mtu_idx %u (%d)", + __func__, toep->tid, seq, mtu, toep->params.mtu_idx, + mtus[toep->params.mtu_idx]); + + if (ulp_mode(toep) == ULP_MODE_NONE && /* XXX: Read TCB otherwise? */ + (SEQ_LT(seq, tp->snd_una) || SEQ_GEQ(seq, tp->snd_max))) { + CTR5(KTR_CXGBE, + "%s: tid %d, seq 0x%08x not in range [0x%08x, 0x%08x).", + __func__, toep->tid, seq, tp->snd_una, tp->snd_max); + return; + } + + /* Find the best mtu_idx for the suggested MTU. */ + for (idx = 0; idx < NMTUS - 1 && mtus[idx + 1] <= mtu; idx++) + continue; + if (idx >= toep->params.mtu_idx) + return; /* Never increase the PMTU (just like the kernel). */ + + /* + * We'll send a compound work request with 2 SET_TCB_FIELDs -- the first + * one updates the mtu_idx and the second one triggers a retransmit. + */ + len = sizeof(*wrh) + 2 * roundup2(LEN__SET_TCB_FIELD_ULP, 16); + wrh = start_wrq_wr(toep->ctrlq, howmany(len, 16), &cookie); + if (wrh == NULL) { + CH_ERR(sc, "failed to change mtu_idx of tid %d (%u -> %u).\n", + toep->tid, toep->params.mtu_idx, idx); + return; + } + INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ + ulpmc = (struct ulp_txpkt *)(wrh + 1); + ulpmc = mk_set_tcb_field_ulp(ulpmc, W_TCB_T_MAXSEG, + V_TCB_T_MAXSEG(M_TCB_T_MAXSEG), V_TCB_T_MAXSEG(idx), toep->tid); + ulpmc = mk_set_tcb_field_ulp(ulpmc, W_TCB_TIMESTAMP, + V_TCB_TIMESTAMP(0x7FFFFULL << 11), 0, toep->tid); + commit_wrq_wr(toep->ctrlq, wrh, &cookie); + + /* Update the software toepcb and tcpcb. */ + toep->params.mtu_idx = idx; + tp->t_maxseg = mtus[toep->params.mtu_idx]; + if (inp->inp_inc.inc_flags & INC_ISIPV6) + tp->t_maxseg -= sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + else + tp->t_maxseg -= sizeof(struct ip) + sizeof(struct tcphdr); + toep->params.emss = tp->t_maxseg; + if (tp->t_flags & TF_RCVD_TSTMP) + toep->params.emss -= TCPOLEN_TSTAMP_APPA; + + /* Update the firmware flowc. */ + send_mss_flowc_wr(sc, toep); + + /* Update the MTU in the kernel's hostcache. */ + if (sc->tt.update_hc_on_pmtu_change != 0) { + struct in_conninfo inc = {0}; + + inc.inc_fibnum = inp->inp_inc.inc_fibnum; + if (inp->inp_inc.inc_flags & INC_ISIPV6) { + inc.inc_flags |= INC_ISIPV6; + inc.inc6_faddr = inp->inp_inc.inc6_faddr; + } else { + inc.inc_faddr = inp->inp_inc.inc_faddr; + } + tcp_hc_updatemtu(&inc, mtu); + } + + CTR6(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), t_maxseg %u, emss %u", + __func__, toep->tid, toep->params.mtu_idx, + mtus[toep->params.mtu_idx], tp->t_maxseg, toep->params.emss); +} + /* * The TOE driver will not receive any more CPLs for the tid associated with the * toepcb; release the hold on the inpcb. @@ -1754,6 +1914,7 @@ t4_tom_activate(struct adapter *sc) #ifdef KERN_TLS tod->tod_alloc_tls_session = t4_alloc_tls_session; #endif + tod->tod_pmtu_update = t4_pmtu_update; for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { From owner-dev-commits-src-all@freebsd.org Thu Apr 22 22:14:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DADB36210C2; Thu, 22 Apr 2021 22:14: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 4FRBXv5rwsz4rRh; Thu, 22 Apr 2021 22:14: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 BBBBA21F06; Thu, 22 Apr 2021 22:14: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 13MMENNf078123; Thu, 22 Apr 2021 22:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MMENsI078122; Thu, 22 Apr 2021 22:14:23 GMT (envelope-from git) Date: Thu, 22 Apr 2021 22:14:23 GMT Message-Id: <202104222214.13MMENsI078122@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: 55eb41bb1fb6 - main - hv_kbd: Fix build with EVDEV_SUPPORT kernel option disabled. 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: 55eb41bb1fb69429330ea415fb463735ae08da64 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 22:14:23 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=55eb41bb1fb69429330ea415fb463735ae08da64 commit 55eb41bb1fb69429330ea415fb463735ae08da64 Author: Vladimir Kondratyev AuthorDate: 2021-04-22 22:13:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-22 22:13:25 +0000 hv_kbd: Fix build with EVDEV_SUPPORT kernel option disabled. Reported by: olivier MFC with: e4643aa4c4ff --- sys/dev/hyperv/input/hv_kbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/hyperv/input/hv_kbd.c b/sys/dev/hyperv/input/hv_kbd.c index 52ce621b2a89..53aacda7fbcb 100644 --- a/sys/dev/hyperv/input/hv_kbd.c +++ b/sys/dev/hyperv/input/hv_kbd.c @@ -269,9 +269,8 @@ hvkbd_read_char_locked(keyboard_t *kbd, int wait) uint32_t action; keystroke ks; hv_kbd_sc *sc = kbd->kb_data; -#ifdef EVDEV_SUPPORT int keycode; -#endif + HVKBD_LOCK_ASSERT(); if (!KBD_IS_ACTIVE(kbd) || !hv_kbd_prod_is_ready(sc)) From owner-dev-commits-src-all@freebsd.org Thu Apr 22 22:31:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E66EE62190E; Thu, 22 Apr 2021 22:31: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 4FRBwj66zDz4sJL; Thu, 22 Apr 2021 22:31: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 C50E021CF9; Thu, 22 Apr 2021 22:31: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 13MMVXJS002483; Thu, 22 Apr 2021 22:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MMVXEd002482; Thu, 22 Apr 2021 22:31:33 GMT (envelope-from git) Date: Thu, 22 Apr 2021 22:31:33 GMT Message-Id: <202104222231.13MMVXEd002482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 8f1bc78ef79b - main - cxgbe(4): make the logging helpers a little more robust. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f1bc78ef79bc13d88d15cdc5b1bf2f7361ded6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 22:31:34 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=8f1bc78ef79bc13d88d15cdc5b1bf2f7361ded6d commit 8f1bc78ef79bc13d88d15cdc5b1bf2f7361ded6d Author: Navdeep Parhar AuthorDate: 2021-04-22 22:28:43 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-22 22:28:43 +0000 cxgbe(4): make the logging helpers a little more robust. MFC after: 3 days Sponsored by: Chelsio Communications --- sys/dev/cxgbe/osdep.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h index 95c93d83cff8..3f41ccaf3d2c 100644 --- a/sys/dev/cxgbe/osdep.h +++ b/sys/dev/cxgbe/osdep.h @@ -43,13 +43,13 @@ #include #define CH_ERR(adap, fmt, ...) log(LOG_ERR, "%s: " fmt, \ - device_get_nameunit(adap->dev), ##__VA_ARGS__) + device_get_nameunit((adap)->dev), ##__VA_ARGS__) #define CH_WARN(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ - device_get_nameunit(adap->dev), ##__VA_ARGS__) + device_get_nameunit((adap)->dev), ##__VA_ARGS__) #define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, "%s: " fmt, \ - device_get_nameunit(adap->dev), ##__VA_ARGS__) + device_get_nameunit((adap)->dev), ##__VA_ARGS__) #define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ - device_get_nameunit(adap->dev), ##__VA_ARGS__) + device_get_nameunit((adap)->dev), ##__VA_ARGS__) #ifndef LINUX_TYPES_DEFINED typedef int8_t s8; From owner-dev-commits-src-all@freebsd.org Thu Apr 22 22:40:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A0A162175D; Thu, 22 Apr 2021 22:40: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 4FRC7L1h2hz4sDx; Thu, 22 Apr 2021 22:40: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 2D16322438; Thu, 22 Apr 2021 22:40: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 13MMekO1013076; Thu, 22 Apr 2021 22:40:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MMekAe013075; Thu, 22 Apr 2021 22:40:46 GMT (envelope-from git) Date: Thu, 22 Apr 2021 22:40:46 GMT Message-Id: <202104222240.13MMekAe013075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: dc77e7929644 - main - cxgbe(4): Fix minor nit in the display of MPS TCAM entries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc77e7929644b87c0aa3f8f5e8d57fd10f49df54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 22:40:46 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=dc77e7929644b87c0aa3f8f5e8d57fd10f49df54 commit dc77e7929644b87c0aa3f8f5e8d57fd10f49df54 Author: Navdeep Parhar AuthorDate: 2021-04-22 22:36:51 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-22 22:36:51 +0000 cxgbe(4): Fix minor nit in the display of MPS TCAM entries. MFC after: 3 days --- sys/dev/cxgbe/t4_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 3066d133e437..07fd43a06edc 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -9147,7 +9147,7 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) if (lookup_type && lookup_type != M_DATALKPTYPE) { sbuf_printf(sb, "\n%3u %02x:%02x:%02x:%02x:%02x:%02x " "%012jx %06x %06x - - %3c" - " 'I' %4x %3c %#x%4u%4d", i, addr[0], + " I %4x %3c %#x%4u%4d", i, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], (uintmax_t)mask, vniy, vnix, dip_hit ? 'Y' : 'N', port_num, cls_lo & F_T6_SRAM_VLD ? 'Y' : 'N', From owner-dev-commits-src-all@freebsd.org Thu Apr 22 23:33:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F197C62267D; Thu, 22 Apr 2021 23:33: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 4FRDJH6CCxz4vYQ; Thu, 22 Apr 2021 23:33: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 C74EF22C32; Thu, 22 Apr 2021 23:33: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 13MNXZIA083644; Thu, 22 Apr 2021 23:33:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13MNXZbd083643; Thu, 22 Apr 2021 23:33:35 GMT (envelope-from git) Date: Thu, 22 Apr 2021 23:33:35 GMT Message-Id: <202104222333.13MNXZbd083643@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: 3cfd08c1c740 - main - libkiconv: address memory leak in not-found cases 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: 3cfd08c1c74058451a02bac35307bf7fa509c617 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 23:33:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3cfd08c1c74058451a02bac35307bf7fa509c617 commit 3cfd08c1c74058451a02bac35307bf7fa509c617 Author: Ed Maste AuthorDate: 2021-04-21 17:45:27 +0000 Commit: Ed Maste CommitDate: 2021-04-22 23:32:34 +0000 libkiconv: address memory leak in not-found cases Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 --- lib/libkiconv/kiconv_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c index da68b3011f36..841a162bfd27 100644 --- a/lib/libkiconv/kiconv_sysctl.c +++ b/lib/libkiconv/kiconv_sysctl.c @@ -59,6 +59,7 @@ kiconv_lookupconv(const char *drvname) free(drivers); return (0); } + free(drivers); } return (ENOENT); } @@ -86,6 +87,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode) return (0); } } + free(csi); } return (ENOENT); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 00:47:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97C7E6235FA; Fri, 23 Apr 2021 00:47: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 4FRFxM3lbpz3DSw; Fri, 23 Apr 2021 00:47: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 64CD923E80; Fri, 23 Apr 2021 00:47: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 13N0lJ7X075770; Fri, 23 Apr 2021 00:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N0lJcP075769; Fri, 23 Apr 2021 00:47:19 GMT (envelope-from git) Date: Fri, 23 Apr 2021 00:47:19 GMT Message-Id: <202104230047.13N0lJcP075769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: b47b28e5b28a - main - cxgbe(4): Add flag to reliably stop the driver from accessing hw stats. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b47b28e5b28aeaa42e87f905fe6a0fe65dbfc184 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 00:47:19 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=b47b28e5b28aeaa42e87f905fe6a0fe65dbfc184 commit b47b28e5b28aeaa42e87f905fe6a0fe65dbfc184 Author: Navdeep Parhar AuthorDate: 2021-04-23 00:45:52 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-23 00:45:52 +0000 cxgbe(4): Add flag to reliably stop the driver from accessing hw stats. There are two kinds of routines in the driver that read statistics from the hardware: the cxgbe_* variants read the per-port MPS/MAC registers and the vi_* variants read the per-VI registers. They can be called from the 1Hz callout or if_get_counter. All stats collection now takes place under the callout lock and there is a new flag to indicate that these routines should not access any hardware register. MFC after: 2 weeks Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 4 +--- sys/dev/cxgbe/t4_main.c | 59 +++++++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index c46f9626b95b..7bdad292c752 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -175,6 +175,7 @@ enum { VI_INIT_DONE = (1 << 1), VI_SYSCTL_CTX = (1 << 2), TX_USES_VM_WR = (1 << 3), + VI_SKIP_STATS = (1 << 4), /* adapter debug_flags */ DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ @@ -311,7 +312,6 @@ struct port_info { struct link_config link_cfg; struct ifmedia media; - struct timeval last_refreshed; struct port_stats stats; u_int tnl_cong_drops; u_int tx_parse_error; @@ -1213,11 +1213,9 @@ void end_synchronized_op(struct adapter *, int); int update_mac_settings(struct ifnet *, int); int adapter_full_init(struct adapter *); int adapter_full_uninit(struct adapter *); -uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); int vi_full_init(struct vi_info *); int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); -void vi_tick(void *); int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); int alloc_atid(struct adapter *, void *); void *lookup_atid(struct adapter *, int); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 07fd43a06edc..6774e1bbb833 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -735,9 +735,10 @@ static int t4_free_irq(struct adapter *, struct irq *); static void t4_init_atid_table(struct adapter *); static void t4_free_atid_table(struct adapter *); static void get_regs(struct adapter *, struct t4_regdump *, uint8_t *); -static void vi_refresh_stats(struct adapter *, struct vi_info *); -static void cxgbe_refresh_stats(struct adapter *, struct port_info *); +static void vi_refresh_stats(struct vi_info *); +static void cxgbe_refresh_stats(struct vi_info *); static void cxgbe_tick(void *); +static void vi_tick(void *); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); @@ -820,6 +821,8 @@ static int ktls_capability(struct adapter *, bool); #endif static int mod_event(module_t, int, void *); static int notify_siblings(device_t, int); +static uint64_t vi_get_counter(struct ifnet *, ift_counter); +static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); struct { uint16_t device; @@ -1818,7 +1821,10 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_ioctl = cxgbe_ioctl; ifp->if_transmit = cxgbe_transmit; ifp->if_qflush = cxgbe_qflush; - ifp->if_get_counter = cxgbe_get_counter; + if (vi->pi->nvi > 1 || sc->flags & IS_VF) + ifp->if_get_counter = vi_get_counter; + else + ifp->if_get_counter = cxgbe_get_counter; #if defined(KERN_TLS) || defined(RATELIMIT) ifp->if_snd_tag_alloc = cxgbe_snd_tag_alloc; ifp->if_snd_tag_modify = cxgbe_snd_tag_modify; @@ -2336,7 +2342,9 @@ vi_get_counter(struct ifnet *ifp, ift_counter c) struct vi_info *vi = ifp->if_softc; struct fw_vi_stats_vf *s = &vi->stats; - vi_refresh_stats(vi->adapter, vi); + mtx_lock(&vi->tick_mtx); + vi_refresh_stats(vi); + mtx_unlock(&vi->tick_mtx); switch (c) { case IFCOUNTER_IPACKETS: @@ -2380,18 +2388,16 @@ vi_get_counter(struct ifnet *ifp, ift_counter c) } } -uint64_t +static uint64_t cxgbe_get_counter(struct ifnet *ifp, ift_counter c) { struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; struct port_stats *s = &pi->stats; - if (pi->nvi > 1 || sc->flags & IS_VF) - return (vi_get_counter(ifp, c)); - - cxgbe_refresh_stats(sc, pi); + mtx_lock(&vi->tick_mtx); + cxgbe_refresh_stats(vi); + mtx_unlock(&vi->tick_mtx); switch (c) { case IFCOUNTER_IPACKETS: @@ -5586,7 +5592,7 @@ cxgbe_init_synchronized(struct vi_info *vi) PORT_UNLOCK(pi); mtx_lock(&vi->tick_mtx); - if (pi->nvi > 1 || sc->flags & IS_VF) + if (ifp->if_get_counter == vi_get_counter) callout_reset(&vi->tick, hz, vi_tick, vi); else callout_reset(&vi->tick, hz, cxgbe_tick, vi); @@ -6334,12 +6340,14 @@ t4_clr_vi_stats(struct adapter *sc, u_int vin) } static void -vi_refresh_stats(struct adapter *sc, struct vi_info *vi) +vi_refresh_stats(struct vi_info *vi) { struct timeval tv; const struct timeval interval = {0, 250000}; /* 250ms */ - if (!(vi->flags & VI_INIT_DONE)) + mtx_assert(&vi->tick_mtx, MA_OWNED); + + if (!(vi->flags & VI_INIT_DONE) || vi->flags & VI_SKIP_STATS) return; getmicrotime(&tv); @@ -6347,22 +6355,31 @@ vi_refresh_stats(struct adapter *sc, struct vi_info *vi) if (timevalcmp(&tv, &vi->last_refreshed, <)) return; - t4_get_vi_stats(sc, vi->vin, &vi->stats); + t4_get_vi_stats(vi->adapter, vi->vin, &vi->stats); getmicrotime(&vi->last_refreshed); } static void -cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi) +cxgbe_refresh_stats(struct vi_info *vi) { u_int i, v, tnl_cong_drops, chan_map; struct timeval tv; const struct timeval interval = {0, 250000}; /* 250ms */ + struct port_info *pi; + struct adapter *sc; + + mtx_assert(&vi->tick_mtx, MA_OWNED); + + if (vi->flags & VI_SKIP_STATS) + return; getmicrotime(&tv); timevalsub(&tv, &interval); - if (timevalcmp(&tv, &pi->last_refreshed, <)) + if (timevalcmp(&tv, &vi->last_refreshed, <)) return; + pi = vi->pi; + sc = vi->adapter; tnl_cong_drops = 0; t4_get_port_stats(sc, pi->tx_chan, &pi->stats); chan_map = pi->rx_e_chan_map; @@ -6376,31 +6393,29 @@ cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi) chan_map &= ~(1 << i); } pi->tnl_cong_drops = tnl_cong_drops; - getmicrotime(&pi->last_refreshed); + getmicrotime(&vi->last_refreshed); } static void cxgbe_tick(void *arg) { struct vi_info *vi = arg; - struct adapter *sc = vi->adapter; MPASS(IS_MAIN_VI(vi)); mtx_assert(&vi->tick_mtx, MA_OWNED); - cxgbe_refresh_stats(sc, vi->pi); + cxgbe_refresh_stats(vi); callout_schedule(&vi->tick, hz); } -void +static void vi_tick(void *arg) { struct vi_info *vi = arg; - struct adapter *sc = vi->adapter; mtx_assert(&vi->tick_mtx, MA_OWNED); - vi_refresh_stats(sc, vi); + vi_refresh_stats(vi); callout_schedule(&vi->tick, hz); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 01:05:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 662876241B9; Fri, 23 Apr 2021 01:05:51 +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 4FRGLl2Gn1z3FJ3; Fri, 23 Apr 2021 01:05:51 +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 3D1F723FAB; Fri, 23 Apr 2021 01:05:51 +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 13N15pcw002415; Fri, 23 Apr 2021 01:05:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N15pwE002414; Fri, 23 Apr 2021 01:05:51 GMT (envelope-from git) Date: Fri, 23 Apr 2021 01:05:51 GMT Message-Id: <202104230105.13N15pwE002414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 4bc708e1e87b - stable/13 - pms(4): Do not return CAM_REQ_CMP on errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4bc708e1e87b493551fc286e25477490b1a75b99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 01:05:51 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4bc708e1e87b493551fc286e25477490b1a75b99 commit 4bc708e1e87b493551fc286e25477490b1a75b99 Author: Alexander Motin AuthorDate: 2021-04-16 19:16:09 +0000 Commit: Alexander Motin CommitDate: 2021-04-23 01:05:24 +0000 pms(4): Do not return CAM_REQ_CMP on errors. It is a direct request for data corruptions, one report of which we have received. I am very surprised that only one. MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e) --- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index 69f488c4199b..4ce32d0ce6c0 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -2629,9 +2629,11 @@ static void agtiapi_PrepareSGListCB( void *arg, { AGTIAPI_PRINTK("agtiapi_PrepareSGListCB: error status 0x%x\n", error); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return; } @@ -2643,9 +2645,8 @@ static void agtiapi_PrepareSGListCB( void *arg, " AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done(ccb); return; } @@ -3689,9 +3690,11 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGListCB: error status 0x%x\n", error ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done( ccb ); return; } @@ -3703,9 +3706,8 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, "AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done( ccb ); return; } @@ -4410,7 +4412,7 @@ static int agtiapi_QueueSMP(struct agtiapi_softc *pmcsc, union ccb * ccb) if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) { AGTIAPI_PRINTK("agtiapi_QueueSMP: GetCCB ERROR\n"); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return tiBusy; } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 01:05:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95B1962400F; Fri, 23 Apr 2021 01:05: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 4FRGLm2xPGz3F9F; Fri, 23 Apr 2021 01:05: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 56D4C23C7B; Fri, 23 Apr 2021 01:05: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 13N15q9h002436; Fri, 23 Apr 2021 01:05:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N15qrc002435; Fri, 23 Apr 2021 01:05:52 GMT (envelope-from git) Date: Fri, 23 Apr 2021 01:05:52 GMT Message-Id: <202104230105.13N15qrc002435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 6514cb18d94e - stable/13 - pms(4): Limit maximum I/O size to 256KB instead of 1MB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6514cb18d94e9ab46406b7077d207c8b1a551e6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 01:05:52 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6514cb18d94e9ab46406b7077d207c8b1a551e6e commit 6514cb18d94e9ab46406b7077d207c8b1a551e6e Author: Alexander Motin AuthorDate: 2021-04-16 19:39:01 +0000 Commit: Alexander Motin CommitDate: 2021-04-23 01:05:42 +0000 pms(4): Limit maximum I/O size to 256KB instead of 1MB. There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per I/O since the initial driver import. I don't know why it was added, can only guess some hardware limitation, but in worst case it means maximum I/O size of 508KB. Respect it to be safe, rounding to 256KB. MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 3e347834200b5d91a33384e696793e4ac20a44d4) --- sys/dev/pms/freebsd/driver/ini/src/agdef.h | 2 +- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agdef.h b/sys/dev/pms/freebsd/driver/ini/src/agdef.h index 4c2ba2867f5f..b58741a434c7 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agdef.h +++ b/sys/dev/pms/freebsd/driver/ini/src/agdef.h @@ -62,7 +62,7 @@ EW 09-17-2004 1.0.0 Constant definitions #define AGTIAPI_MAX_DEVICE_7H 256 /*Max devices per channel in 7H */ #define AGTIAPI_MAX_DEVICE_8H 512 /*Max devices per channel in 8H*/ #define AGTIAPI_MAX_CAM_Q_DEPTH 1024 -#define AGTIAPI_NSEGS (btoc(maxphys) + 1) +#define AGTIAPI_NSEGS (MIN(btoc(maxphys), 64) + 1) /* ** Adapter specific defines */ diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index 4ce32d0ce6c0..a2b20c9e9264 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -1834,7 +1834,7 @@ static void agtiapi_cam_action( struct cam_sim *sim, union ccb * ccb ) cpi->max_target = maxTargets - 1; cpi->max_lun = AGTIAPI_MAX_LUN; /* Max supported I/O size, in bytes. */ - cpi->maxio = ulmin(1024 * 1024, maxphys); + cpi->maxio = ctob(AGTIAPI_NSEGS - 1); cpi->initiator_id = 255; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "PMC", HBA_IDLEN); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 01:09:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 800196240AA; Fri, 23 Apr 2021 01:09: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 4FRGQj3BG3z3FjS; Fri, 23 Apr 2021 01:09: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 60966240D5; Fri, 23 Apr 2021 01:09: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 13N19Hk7002794; Fri, 23 Apr 2021 01:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N19H3O002793; Fri, 23 Apr 2021 01:09:17 GMT (envelope-from git) Date: Fri, 23 Apr 2021 01:09:17 GMT Message-Id: <202104230109.13N19H3O002793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 320fd259c69e - stable/12 - pms(4): Do not return CAM_REQ_CMP on errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 320fd259c69ef16e9b8d64424f66eeed8ddc3c77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 01:09:17 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=320fd259c69ef16e9b8d64424f66eeed8ddc3c77 commit 320fd259c69ef16e9b8d64424f66eeed8ddc3c77 Author: Alexander Motin AuthorDate: 2021-04-16 19:16:09 +0000 Commit: Alexander Motin CommitDate: 2021-04-23 01:09:07 +0000 pms(4): Do not return CAM_REQ_CMP on errors. It is a direct request for data corruptions, one report of which we have received. I am very surprised that only one. MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 8434a65ce49bd6bc6779f0e57b0ce0f4bc46f48e) --- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index 8a6865bbccc9..711fb027f59e 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -2629,9 +2629,11 @@ static void agtiapi_PrepareSGListCB( void *arg, { AGTIAPI_PRINTK("agtiapi_PrepareSGListCB: error status 0x%x\n", error); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return; } @@ -2643,9 +2645,8 @@ static void agtiapi_PrepareSGListCB( void *arg, " AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload(pmcsc->buffer_dmat, pccb->CCB_dmamap); - bus_dmamap_destroy(pmcsc->buffer_dmat, pccb->CCB_dmamap); agtiapi_FreeCCB(pmcsc, pccb); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done(ccb); return; } @@ -3689,9 +3690,11 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, AGTIAPI_PRINTK( "agtiapi_PrepareSMPSGListCB: error status 0x%x\n", error ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + if (error == EFBIG) + ccb->ccb_h.status = CAM_REQ_TOO_BIG; + else + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done( ccb ); return; } @@ -3703,9 +3706,8 @@ static void agtiapi_PrepareSMPSGListCB( void *arg, "AGTIAPI_MAX_DMA_SEGS %d\n", nsegs, AGTIAPI_MAX_DMA_SEGS ); bus_dmamap_unload( pmcsc->buffer_dmat, pccb->CCB_dmamap ); - bus_dmamap_destroy( pmcsc->buffer_dmat, pccb->CCB_dmamap ); agtiapi_FreeCCB( pmcsc, pccb ); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_TOO_BIG; xpt_done( ccb ); return; } @@ -4410,7 +4412,7 @@ static int agtiapi_QueueSMP(struct agtiapi_softc *pmcsc, union ccb * ccb) if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) { AGTIAPI_PRINTK("agtiapi_QueueSMP: GetCCB ERROR\n"); - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); return tiBusy; } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 01:09:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AFF06240AB; Fri, 23 Apr 2021 01:09: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 4FRGQk3XYhz3FjV; Fri, 23 Apr 2021 01:09: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 6C4FA23DF1; Fri, 23 Apr 2021 01:09: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 13N19IeJ002821; Fri, 23 Apr 2021 01:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N19It7002820; Fri, 23 Apr 2021 01:09:18 GMT (envelope-from git) Date: Fri, 23 Apr 2021 01:09:18 GMT Message-Id: <202104230109.13N19It7002820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 39c37df826a7 - stable/12 - pms(4): Limit maximum I/O size to 256KB instead of 1MB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 39c37df826a73a8dd4d2d3e5909102969291170e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 01:09:18 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=39c37df826a73a8dd4d2d3e5909102969291170e commit 39c37df826a73a8dd4d2d3e5909102969291170e Author: Alexander Motin AuthorDate: 2021-04-16 19:39:01 +0000 Commit: Alexander Motin CommitDate: 2021-04-23 01:09:07 +0000 pms(4): Limit maximum I/O size to 256KB instead of 1MB. There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per I/O since the initial driver import. I don't know why it was added, can only guess some hardware limitation, but in worst case it means maximum I/O size of 508KB. Respect it to be safe, rounding to 256KB. MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 3e347834200b5d91a33384e696793e4ac20a44d4) --- sys/dev/pms/freebsd/driver/ini/src/agdef.h | 2 +- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pms/freebsd/driver/ini/src/agdef.h b/sys/dev/pms/freebsd/driver/ini/src/agdef.h index fea7563c8b04..20d5d93690d3 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agdef.h +++ b/sys/dev/pms/freebsd/driver/ini/src/agdef.h @@ -62,7 +62,7 @@ EW 09-17-2004 1.0.0 Constant definitions #define AGTIAPI_MAX_DEVICE_7H 256 /*Max devices per channel in 7H */ #define AGTIAPI_MAX_DEVICE_8H 512 /*Max devices per channel in 8H*/ #define AGTIAPI_MAX_CAM_Q_DEPTH 1024 -#define AGTIAPI_NSEGS (btoc(MAXPHYS) + 1) +#define AGTIAPI_NSEGS (MIN(btoc(MAXPHYS), 64) + 1) /* ** Adapter specific defines */ diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index 711fb027f59e..79de3f6961d3 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -1834,7 +1834,7 @@ static void agtiapi_cam_action( struct cam_sim *sim, union ccb * ccb ) cpi->max_target = maxTargets - 1; cpi->max_lun = AGTIAPI_MAX_LUN; /* Max supported I/O size, in bytes. */ - cpi->maxio = ulmin(1024 * 1024, MAXPHYS); + cpi->maxio = ctob(AGTIAPI_NSEGS - 1); cpi->initiator_id = 255; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "PMC", HBA_IDLEN); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 07:28:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16B945E2A51; Fri, 23 Apr 2021 07:28: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 4FRQqz0BSpz3lgL; Fri, 23 Apr 2021 07:28:15 +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 ED4B7DC5; Fri, 23 Apr 2021 07:28: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 13N7SEid004766; Fri, 23 Apr 2021 07:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N7SEs0004765; Fri, 23 Apr 2021 07:28:14 GMT (envelope-from git) Date: Fri, 23 Apr 2021 07:28:14 GMT Message-Id: <202104230728.13N7SEs0004765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 5f00292fe3b7 - main - cxgbe(4): Move the hw-specific parts of VXLAN setup to a separate function. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f00292fe3b76aba9115f3b2dfc887acb647eb91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 07:28:15 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=5f00292fe3b76aba9115f3b2dfc887acb647eb91 commit 5f00292fe3b76aba9115f3b2dfc887acb647eb91 Author: Navdeep Parhar AuthorDate: 2021-04-23 07:26:47 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-23 07:26:47 +0000 cxgbe(4): Move the hw-specific parts of VXLAN setup to a separate function. It can be called to (re)apply the settings in the driver softc to the hardware. MFC after: 2 weeks Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 58 ++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6774e1bbb833..6e5d263c7649 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -823,6 +823,7 @@ static int mod_event(module_t, int, void *); static int notify_siblings(device_t, int); static uint64_t vi_get_counter(struct ifnet *, ift_counter); static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); +static void enable_vxlan_rx(struct adapter *); struct { uint16_t device; @@ -11671,12 +11672,38 @@ struct vxlan_evargs { }; static void -t4_vxlan_start(struct adapter *sc, void *arg) +enable_vxlan_rx(struct adapter *sc) { - struct vxlan_evargs *v = arg; + int i, rc; struct port_info *pi; uint8_t match_all_mac[ETHER_ADDR_LEN] = {0}; - int i, rc; + + ASSERT_SYNCHRONIZED_OP(sc); + + t4_write_reg(sc, A_MPS_RX_VXLAN_TYPE, V_VXLAN(sc->vxlan_port) | + F_VXLAN_EN); + for_each_port(sc, i) { + pi = sc->port[i]; + if (pi->vxlan_tcam_entry == true) + continue; + rc = t4_alloc_raw_mac_filt(sc, pi->vi[0].viid, match_all_mac, + match_all_mac, sc->rawf_base + pi->port_id, 1, pi->port_id, + true); + if (rc < 0) { + rc = -rc; + CH_ERR(&pi->vi[0], + "failed to add VXLAN TCAM entry: %d.\n", rc); + } else { + MPASS(rc == sc->rawf_base + pi->port_id); + pi->vxlan_tcam_entry = true; + } + } +} + +static void +t4_vxlan_start(struct adapter *sc, void *arg) +{ + struct vxlan_evargs *v = arg; if (sc->nrawf == 0 || chip_id(sc) <= CHELSIO_T5) return; @@ -11686,32 +11713,13 @@ t4_vxlan_start(struct adapter *sc, void *arg) if (sc->vxlan_refcount == 0) { sc->vxlan_port = v->port; sc->vxlan_refcount = 1; - t4_write_reg(sc, A_MPS_RX_VXLAN_TYPE, - V_VXLAN(v->port) | F_VXLAN_EN); - for_each_port(sc, i) { - pi = sc->port[i]; - if (pi->vxlan_tcam_entry == true) - continue; - rc = t4_alloc_raw_mac_filt(sc, pi->vi[0].viid, - match_all_mac, match_all_mac, - sc->rawf_base + pi->port_id, 1, pi->port_id, true); - if (rc < 0) { - rc = -rc; - log(LOG_ERR, - "%s: failed to add VXLAN TCAM entry: %d.\n", - device_get_name(pi->vi[0].dev), rc); - } else { - MPASS(rc == sc->rawf_base + pi->port_id); - rc = 0; - pi->vxlan_tcam_entry = true; - } - } + enable_vxlan_rx(sc); } else if (sc->vxlan_port == v->port) { sc->vxlan_refcount++; } else { - log(LOG_ERR, "%s: VXLAN already configured on port %d; " + CH_ERR(sc, "VXLAN already configured on port %d; " "ignoring attempt to configure it on port %d\n", - device_get_nameunit(sc->dev), sc->vxlan_port, v->port); + sc->vxlan_port, v->port); } end_synchronized_op(sc, 0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 07:29:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 285C45E2764; Fri, 23 Apr 2021 07:29: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 4FRQsd0g4Nz3lNs; Fri, 23 Apr 2021 07:29: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 098FEB6B; Fri, 23 Apr 2021 07:29: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 13N7TerN004968; Fri, 23 Apr 2021 07:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N7TeXU004967; Fri, 23 Apr 2021 07:29:40 GMT (envelope-from git) Date: Fri, 23 Apr 2021 07:29:40 GMT Message-Id: <202104230729.13N7TeXU004967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: d76eb0da7283 - stable/13 - tcp: keep SACK scoreboard sorted when doing rescue retransmission 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d76eb0da7283f83b09d5491d81e25485d87298ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 07:29:41 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=d76eb0da7283f83b09d5491d81e25485d87298ab commit d76eb0da7283f83b09d5491d81e25485d87298ab Author: Richard Scheffenegger AuthorDate: 2021-04-18 20:14:14 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-23 07:25:57 +0000 tcp: keep SACK scoreboard sorted when doing rescue retransmission Reviewed By: tuexen, kbowling, #transport MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29825 (cherry picked from commit b87cf2bc841b2a336b7f0c6cd89573610412a84f) --- sys/netinet/tcp_sack.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index f8d983da723b..08ce2a0882b1 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -491,7 +491,7 @@ static struct sackhole * tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, struct sackhole *after) { - struct sackhole *hole; + struct sackhole *hole, *tail; /* Allocate a new SACK hole. */ hole = tcp_sackhole_alloc(tp, start, end); @@ -502,7 +502,15 @@ tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, if (after != NULL) TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink); else - TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); + /* + * With Rescue Retransmission, new holes may need to + * be inserted just before the tail. + */ + if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole, + scblink)) != NULL) && SEQ_LEQ(end, tail->start)) + TAILQ_INSERT_BEFORE(tail, hole, scblink); + else + TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); /* Update SACK hint. */ if (tp->sackhint.nexthole == NULL) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 07:29:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F6ED5E2A5C; Fri, 23 Apr 2021 07:29: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 4FRQsf2DYWz3lkj; Fri, 23 Apr 2021 07:29: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 35204E32; Fri, 23 Apr 2021 07:29: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 13N7Tg1X004989; Fri, 23 Apr 2021 07:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N7TgXS004988; Fri, 23 Apr 2021 07:29:42 GMT (envelope-from git) Date: Fri, 23 Apr 2021 07:29:42 GMT Message-Id: <202104230729.13N7TgXS004988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: ab9104cbe4d5 - stable/13 - tcp: Deal with DSACKs, and adjust rescue hole on success. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ab9104cbe4d53ee337a7281151540e32bfcb8d25 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 07:29:42 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=ab9104cbe4d53ee337a7281151540e32bfcb8d25 commit ab9104cbe4d53ee337a7281151540e32bfcb8d25 Author: Richard Scheffenegger AuthorDate: 2021-04-20 12:53:56 +0000 Commit: Richard Scheffenegger CommitDate: 2021-04-23 07:26:18 +0000 tcp: Deal with DSACKs, and adjust rescue hole on success. When a rescue retransmission is successful, rather than inserting new holes to the left of it, adjust the old rescue entry to cover the missed sequence space. Also, as snd_fack may be stale by that point, pull it forward in order to never create a hole left of snd_una/th_ack. Finally, with DSACKs, tcp_sack_doack() may be called with new full ACKs but a DSACK block. Account for this eventuality properly to keep sacked_bytes >= 0. MFC after: 3 days Reviewed By: kbowling, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D29835 (cherry picked from commit a649f1f6fd7a098ab173a69fe87916c04a8c6f8d) --- sys/netinet/tcp_sack.c | 76 +++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index 08ce2a0882b1..40d63bd3832f 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -491,7 +491,7 @@ static struct sackhole * tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, struct sackhole *after) { - struct sackhole *hole, *tail; + struct sackhole *hole; /* Allocate a new SACK hole. */ hole = tcp_sackhole_alloc(tp, start, end); @@ -502,15 +502,7 @@ tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, if (after != NULL) TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink); else - /* - * With Rescue Retransmission, new holes may need to - * be inserted just before the tail. - */ - if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole, - scblink)) != NULL) && SEQ_LEQ(end, tail->start)) - TAILQ_INSERT_BEFORE(tail, hole, scblink); - else - TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); + TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink); /* Update SACK hint. */ if (tp->sackhint.nexthole == NULL) @@ -567,6 +559,15 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) left_edge_delta = th_ack - tp->snd_una; sack_blocks[num_sack_blks].start = tp->snd_una; sack_blocks[num_sack_blks++].end = th_ack; + /* + * Pulling snd_fack forward if we got here + * due to DSACK blocks + */ + if (SEQ_LT(tp->snd_fack, th_ack)) { + delivered_data += th_ack - tp->snd_una; + tp->snd_fack = th_ack; + sack_changed = 1; + } } /* * Append received valid SACK blocks to sack_blocks[], but only if we @@ -636,35 +637,52 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) tp->sackhint.last_sack_ack = sblkp->end; if (SEQ_LT(tp->snd_fack, sblkp->start)) { /* - * The highest SACK block is beyond fack. Append new SACK - * hole at the tail. If the second or later highest SACK - * blocks are also beyond the current fack, they will be - * inserted by way of hole splitting in the while-loop below. + * The highest SACK block is beyond fack. First, + * check if there was a successful Rescue Retransmission, + * and move this hole left. With normal holes, snd_fack + * is always to the right of the end. */ - temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL); - if (temp != NULL) { + if (((temp = TAILQ_LAST(&tp->snd_holes, sackhole_head)) != NULL) && + SEQ_LEQ(tp->snd_fack,temp->end)) { + temp->start = SEQ_MAX(tp->snd_fack, SEQ_MAX(tp->snd_una, th_ack)); + temp->end = sblkp->start; + temp->rxmit = temp->start; delivered_data += sblkp->end - sblkp->start; tp->snd_fack = sblkp->end; - /* Go to the previous sack block. */ sblkp--; sack_changed = 1; } else { /* - * We failed to add a new hole based on the current - * sack block. Skip over all the sack blocks that - * fall completely to the right of snd_fack and - * proceed to trim the scoreboard based on the - * remaining sack blocks. This also trims the - * scoreboard for th_ack (which is sack_blocks[0]). + * Append a new SACK hole at the tail. If the + * second or later highest SACK blocks are also + * beyond the current fack, they will be inserted + * by way of hole splitting in the while-loop below. */ - while (sblkp >= sack_blocks && - SEQ_LT(tp->snd_fack, sblkp->start)) - sblkp--; - if (sblkp >= sack_blocks && - SEQ_LT(tp->snd_fack, sblkp->end)) { - delivered_data += sblkp->end - tp->snd_fack; + temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL); + if (temp != NULL) { + delivered_data += sblkp->end - sblkp->start; tp->snd_fack = sblkp->end; + /* Go to the previous sack block. */ + sblkp--; sack_changed = 1; + } else { + /* + * We failed to add a new hole based on the current + * sack block. Skip over all the sack blocks that + * fall completely to the right of snd_fack and + * proceed to trim the scoreboard based on the + * remaining sack blocks. This also trims the + * scoreboard for th_ack (which is sack_blocks[0]). + */ + while (sblkp >= sack_blocks && + SEQ_LT(tp->snd_fack, sblkp->start)) + sblkp--; + if (sblkp >= sack_blocks && + SEQ_LT(tp->snd_fack, sblkp->end)) { + delivered_data += sblkp->end - tp->snd_fack; + tp->snd_fack = sblkp->end; + sack_changed = 1; + } } } } else if (SEQ_LT(tp->snd_fack, sblkp->end)) { From owner-dev-commits-src-all@freebsd.org Fri Apr 23 09:58:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B41A95EBD1B; Fri, 23 Apr 2021 09:58: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 4FRV8r4krxz4SDd; Fri, 23 Apr 2021 09:58: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 94CCB2D6D; Fri, 23 Apr 2021 09:58: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 13N9w4bx005048; Fri, 23 Apr 2021 09:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13N9w4Jf005047; Fri, 23 Apr 2021 09:58:04 GMT (envelope-from git) Date: Fri, 23 Apr 2021 09:58:04 GMT Message-Id: <202104230958.13N9w4Jf005047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 3183d0b68072 - main - iflib: initialize LRO unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3183d0b68072dda0e80bb6e03c970625f2823e97 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 09:58:04 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=3183d0b68072dda0e80bb6e03c970625f2823e97 commit 3183d0b68072dda0e80bb6e03c970625f2823e97 Author: Andrew Gallatin AuthorDate: 2021-04-23 09:51:22 +0000 Commit: Andrew Gallatin CommitDate: 2021-04-23 09:55:20 +0000 iflib: initialize LRO unconditionally Changes to the LRO code have exposed a bug in iflib where devices which are not capable of doing LRO are still calling tcp_lro_flush_all(), even when they have not initialized the LRO context. This used to be mostly harmless, but the LRO code now sets the VNET based on the ifp in the lro context and will try to access it through a NULL ifp resulting in a panic at boot. To fix this, we unconditionally initializes LRO so that we have a valid LRO context when calling tcp_lro_flush_all(). One alternative is to check the device capabilities before calling tcp_lro_flush_all() or adding a new state flag in the ctx. However, it seems unwise to add an extra, mostly useless test for higher performance devices when we can just initialize LRO for all devices. Reviewed by: erj, hselasky, markj, olivier Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29928 --- sys/net/iflib.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 6dbaff556a15..fc0814d0fc19 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5891,15 +5891,13 @@ iflib_rx_structures_setup(if_ctx_t ctx) for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) { #if defined(INET6) || defined(INET) - if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) { - err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, - TCP_LRO_ENTRIES, min(1024, - ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset])); - if (err != 0) { - device_printf(ctx->ifc_dev, - "LRO Initialization failed!\n"); - goto fail; - } + err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, + TCP_LRO_ENTRIES, min(1024, + ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset])); + if (err != 0) { + device_printf(ctx->ifc_dev, + "LRO Initialization failed!\n"); + goto fail; } #endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); @@ -5914,8 +5912,7 @@ fail: */ rxq = ctx->ifc_rxqs; for (i = 0; i < q; ++i, rxq++) { - if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) - tcp_lro_free(&rxq->ifr_lc); + tcp_lro_free(&rxq->ifr_lc); } return (err); #endif @@ -5938,8 +5935,7 @@ iflib_rx_structures_free(if_ctx_t ctx) iflib_dma_free(&rxq->ifr_ifdi[j]); iflib_rx_sds_free(rxq); #if defined(INET6) || defined(INET) - if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) - tcp_lro_free(&rxq->ifr_lc); + tcp_lro_free(&rxq->ifr_lc); #endif } free(ctx->ifc_rxqs, M_IFLIB); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 10:41:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD72F5ECE35; Fri, 23 Apr 2021 10:41: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 4FRW7W5Ws4z4V5F; Fri, 23 Apr 2021 10:41: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 B0C9E3AAE; Fri, 23 Apr 2021 10:41: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 13NAfxM1071003; Fri, 23 Apr 2021 10:41:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NAfxHi071002; Fri, 23 Apr 2021 10:41:59 GMT (envelope-from git) Date: Fri, 23 Apr 2021 10:41:59 GMT Message-Id: <202104231041.13NAfxHi071002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 8845eea6e288 - stable/13 - Fix leak in libc NFSv4 ACL flags parsing 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8845eea6e288e96e7114f41fb3d8e25aae810a2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 10:41:59 -0000 The branch stable/13 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=8845eea6e288e96e7114f41fb3d8e25aae810a2d commit 8845eea6e288e96e7114f41fb3d8e25aae810a2d Author: Andrew Walker AuthorDate: 2021-04-20 19:34:44 +0000 Commit: Ryan Moeller CommitDate: 2021-04-23 10:41:23 +0000 Fix leak in libc NFSv4 ACL flags parsing Free memory allocated by strdup() in parse_flags_verbose(). Submitted by: Andrew Walker Reported by: valgrind Reviewed by: allanjude, freqlabs, rpokala Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29871 (cherry picked from commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56) --- lib/libc/posix1e/acl_support_nfs4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/posix1e/acl_support_nfs4.c b/lib/libc/posix1e/acl_support_nfs4.c index 3962eaa6daa8..92ec666b2313 100644 --- a/lib/libc/posix1e/acl_support_nfs4.c +++ b/lib/libc/posix1e/acl_support_nfs4.c @@ -142,9 +142,10 @@ parse_flags_verbose(const char *strp, uint32_t *var, int *try_compact) { int i, found, ever_found = 0; - char *str, *flag; + char *str, *flag, *to_free; str = strdup(strp); + to_free = str; *try_compact = 0; *var = 0; @@ -166,12 +167,12 @@ parse_flags_verbose(const char *strp, uint32_t *var, "invalid flag \"%s\"", flags_name, flag); else *try_compact = 1; - free(str); + free(to_free); return (-1); } } - free(str); + free(to_free); return (0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 10:43:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC5CF5ED29E; Fri, 23 Apr 2021 10:43: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 4FRW933yRzz4VMd; Fri, 23 Apr 2021 10:43: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 7AC493ABC; Fri, 23 Apr 2021 10:43: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 13NAhJlo071242; Fri, 23 Apr 2021 10:43:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NAhJvl071241; Fri, 23 Apr 2021 10:43:19 GMT (envelope-from git) Date: Fri, 23 Apr 2021 10:43:19 GMT Message-Id: <202104231043.13NAhJvl071241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 7b61f67f398a - stable/12 - Fix leak in libc NFSv4 ACL flags parsing 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 7b61f67f398ab589f629ee7c4ea705d65d700630 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 10:43:19 -0000 The branch stable/12 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=7b61f67f398ab589f629ee7c4ea705d65d700630 commit 7b61f67f398ab589f629ee7c4ea705d65d700630 Author: Andrew Walker AuthorDate: 2021-04-20 19:34:44 +0000 Commit: Ryan Moeller CommitDate: 2021-04-23 10:42:37 +0000 Fix leak in libc NFSv4 ACL flags parsing Free memory allocated by strdup() in parse_flags_verbose(). Submitted by: Andrew Walker Reported by: valgrind Reviewed by: allanjude, freqlabs, rpokala Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29871 (cherry picked from commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56) --- lib/libc/posix1e/acl_support_nfs4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/posix1e/acl_support_nfs4.c b/lib/libc/posix1e/acl_support_nfs4.c index fe6f6f69cf21..845db5cc7b28 100644 --- a/lib/libc/posix1e/acl_support_nfs4.c +++ b/lib/libc/posix1e/acl_support_nfs4.c @@ -143,9 +143,10 @@ parse_flags_verbose(const char *strp, uint32_t *var, int *try_compact) { int i, found, ever_found = 0; - char *str, *flag; + char *str, *flag, *to_free; str = strdup(strp); + to_free = str; *try_compact = 0; *var = 0; @@ -167,12 +168,12 @@ parse_flags_verbose(const char *strp, uint32_t *var, "invalid flag \"%s\"", flags_name, flag); else *try_compact = 1; - free(str); + free(to_free); return (-1); } } - free(str); + free(to_free); return (0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 10:44:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F5D95ED305; Fri, 23 Apr 2021 10:44: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 4FRWBM1Kykz4VMy; Fri, 23 Apr 2021 10:44: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 20A7D3C36; Fri, 23 Apr 2021 10:44: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 13NAiRIE071464; Fri, 23 Apr 2021 10:44:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NAiRiV071463; Fri, 23 Apr 2021 10:44:27 GMT (envelope-from git) Date: Fri, 23 Apr 2021 10:44:27 GMT Message-Id: <202104231044.13NAiRiV071463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 550fcd830db7 - stable/11 - Fix leak in libc NFSv4 ACL flags parsing 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/stable/11 X-Git-Reftype: branch X-Git-Commit: 550fcd830db7e8d644795e5fc9bd83ef4604a1c1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 10:44:27 -0000 The branch stable/11 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=550fcd830db7e8d644795e5fc9bd83ef4604a1c1 commit 550fcd830db7e8d644795e5fc9bd83ef4604a1c1 Author: Andrew Walker AuthorDate: 2021-04-20 19:34:44 +0000 Commit: Ryan Moeller CommitDate: 2021-04-23 10:43:51 +0000 Fix leak in libc NFSv4 ACL flags parsing Free memory allocated by strdup() in parse_flags_verbose(). Submitted by: Andrew Walker Reported by: valgrind Reviewed by: allanjude, freqlabs, rpokala Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D29871 (cherry picked from commit dd559118ab3f065ae230b324c3fe4bb1c9b7ca56) --- lib/libc/posix1e/acl_support_nfs4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/posix1e/acl_support_nfs4.c b/lib/libc/posix1e/acl_support_nfs4.c index 7dd7f04daaf3..ffed4446c1b2 100644 --- a/lib/libc/posix1e/acl_support_nfs4.c +++ b/lib/libc/posix1e/acl_support_nfs4.c @@ -141,9 +141,10 @@ parse_flags_verbose(const char *strp, uint32_t *var, int *try_compact) { int i, found, ever_found = 0; - char *str, *flag; + char *str, *flag, *to_free; str = strdup(strp); + to_free = str; *try_compact = 0; *var = 0; @@ -165,12 +166,12 @@ parse_flags_verbose(const char *strp, uint32_t *var, "invalid flag \"%s\"", flags_name, flag); else *try_compact = 1; - free(str); + free(to_free); return (-1); } } - free(str); + free(to_free); return (0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 10:49:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B46D35ED279; Fri, 23 Apr 2021 10:49: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 4FRWJ54lD7z4VdR; Fri, 23 Apr 2021 10:49:25 +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 918133AC1; Fri, 23 Apr 2021 10:49: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 13NAnPfa071973; Fri, 23 Apr 2021 10:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NAnPe5071972; Fri, 23 Apr 2021 10:49:25 GMT (envelope-from git) Date: Fri, 23 Apr 2021 10:49:25 GMT Message-Id: <202104231049.13NAnPe5071972@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: 694407528fb5 - main - Correctly skip rtsock_l3 test when if_epair is not available 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: 694407528fb506755f1e1f0fa2d343b7e2c3177e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 10:49:25 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=694407528fb506755f1e1f0fa2d343b7e2c3177e commit 694407528fb506755f1e1f0fa2d343b7e2c3177e Author: Alex Richardson AuthorDate: 2021-04-23 10:21:28 +0000 Commit: Alex Richardson CommitDate: 2021-04-23 10:28:26 +0000 Correctly skip rtsock_l3 test when if_epair is not available This logic was accidentally changed in 67f2f67fc8ce8484066e95dabac5af892888fca1 Reported By: olivier X-MFC-With: 67f2f67fc8ce8484066e95dabac5af892888fca1 Tested By: kp Reviewed By: kp, melifaro Fixes: 67f2f67fc8ce ("Update rtsock_l3 test after 2fe5a79425c7") Differential Revision: https://reviews.freebsd.org/D29944 --- tests/sys/net/routing/rtsock_config.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/sys/net/routing/rtsock_config.h b/tests/sys/net/routing/rtsock_config.h index d9eccb6a19f6..ff89814a61da 100644 --- a/tests/sys/net/routing/rtsock_config.h +++ b/tests/sys/net/routing/rtsock_config.h @@ -129,13 +129,11 @@ config_setup(const atf_tc_t *tc, struct rtsock_config_options *co) ATF_CHECK_ERRNO(0, true); if (co->num_interfaces > 0) { - if (kldload("if_epair") == -1) { - /* Any errno other than EEXIST is fatal. */ - ATF_REQUIRE_ERRNO(EEXIST, true); - /* Clear errno for the following tests. */ - errno = 0; - } + /* Try loading if_epair and if that fails skip the test. */ + kldload("if_epair"); ATF_REQUIRE_KERNEL_MODULE("if_epair"); + /* Clear errno for the following tests. */ + errno = 0; c->ifnames = calloc(co->num_interfaces, sizeof(char *)); for (int i = 0; i < co->num_interfaces; i++) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A38355EDE3A; Fri, 23 Apr 2021 11:14: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 4FRWsC4Fggz4WlH; Fri, 23 Apr 2021 11:14: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 849F84689; Fri, 23 Apr 2021 11:14: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 13NBEdLx012670; Fri, 23 Apr 2021 11:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEdba012669; Fri, 23 Apr 2021 11:14:39 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:39 GMT Message-Id: <202104231114.13NBEdba012669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cd317a921331 - stable/13 - linuxkpi: copy ldev into local to test and free the same pointer 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/stable/13 X-Git-Reftype: branch X-Git-Commit: cd317a92133140ad78f296af5315cd8ffb08b046 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:39 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cd317a92133140ad78f296af5315cd8ffb08b046 commit cd317a92133140ad78f296af5315cd8ffb08b046 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:41:00 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: copy ldev into local to test and free the same pointer (cherry picked from commit 7b0125cbec1579a0a1bf38f7abe583b5f6fd79e7) --- sys/compat/linuxkpi/common/src/linux_compat.c | 5 +- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 2598 ++++++++++++++++++++ 2 files changed, 2601 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 5f7e2664bee1..a9fa50ded219 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1513,8 +1513,9 @@ linux_file_close(struct file *file, struct thread *td) if (filp->f_vnode != NULL) vdrop(filp->f_vnode); linux_drop_fop(ldev); - if (filp->f_cdev != NULL) - linux_cdev_deref(filp->f_cdev); + ldev = filp->f_cdev; + if (ldev != NULL) + linux_cdev_deref(ldev); kfree(filp); return (error); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig new file mode 100644 index 000000000000..42f47b6e510a --- /dev/null +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -0,0 +1,2598 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_stack.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#if defined(__i386__) || defined(__amd64__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__i386__) || defined(__amd64__) +#include +#endif + +SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "LinuxKPI parameters"); + +int linuxkpi_debug; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, + &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); + +static struct timeval lkpi_net_lastlog; +static int lkpi_net_curpps; +static int lkpi_net_maxpps = 99; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, net_ratelimit, CTLFLAG_RWTUN, + &lkpi_net_maxpps, 0, "Limit number of LinuxKPI net messages per second."); + +MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); + +#include +/* Undo Linux compat changes. */ +#undef RB_ROOT +#undef file +#undef cdev +#define RB_ROOT(head) (head)->rbh_root + +static void linux_cdev_deref(struct linux_cdev *ldev); +static struct vm_area_struct *linux_cdev_handle_find(void *handle); + +struct kobject linux_class_root; +struct device linux_root_device; +struct class linux_class_misc; +struct list_head pci_drivers; +struct list_head pci_devices; +spinlock_t pci_lock; + +unsigned long linux_timer_hz_mask; + +wait_queue_head_t linux_bit_waitq; +wait_queue_head_t linux_var_waitq; + +int +panic_cmp(struct rb_node *one, struct rb_node *two) +{ + panic("no cmp"); +} + +RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); + +int +kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) +{ + va_list tmp_va; + int len; + char *old; + char *name; + char dummy; + + old = kobj->name; + + if (old && fmt == NULL) + return (0); + + /* compute length of string */ + va_copy(tmp_va, args); + len = vsnprintf(&dummy, 0, fmt, tmp_va); + va_end(tmp_va); + + /* account for zero termination */ + len++; + + /* check for error */ + if (len < 1) + return (-EINVAL); + + /* allocate memory for string */ + name = kzalloc(len, GFP_KERNEL); + if (name == NULL) + return (-ENOMEM); + vsnprintf(name, len, fmt, args); + kobj->name = name; + + /* free old string */ + kfree(old); + + /* filter new string */ + for (; *name != '\0'; name++) + if (*name == '/') + *name = '!'; + return (0); +} + +int +kobject_set_name(struct kobject *kobj, const char *fmt, ...) +{ + va_list args; + int error; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + + return (error); +} + +static int +kobject_add_complete(struct kobject *kobj, struct kobject *parent) +{ + const struct kobj_type *t; + int error; + + kobj->parent = parent; + error = sysfs_create_dir(kobj); + if (error == 0 && kobj->ktype && kobj->ktype->default_attrs) { + struct attribute **attr; + t = kobj->ktype; + + for (attr = t->default_attrs; *attr != NULL; attr++) { + error = sysfs_create_file(kobj, *attr); + if (error) + break; + } + if (error) + sysfs_remove_dir(kobj); + } + return (error); +} + +int +kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...) +{ + va_list args; + int error; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + if (error) + return (error); + + return kobject_add_complete(kobj, parent); +} + +void +linux_kobject_release(struct kref *kref) +{ + struct kobject *kobj; + char *name; + + kobj = container_of(kref, struct kobject, kref); + sysfs_remove_dir(kobj); + name = kobj->name; + if (kobj->ktype && kobj->ktype->release) + kobj->ktype->release(kobj); + kfree(name); +} + +static void +linux_kobject_kfree(struct kobject *kobj) +{ + kfree(kobj); +} + +static void +linux_kobject_kfree_name(struct kobject *kobj) +{ + if (kobj) { + kfree(kobj->name); + } +} + +const struct kobj_type linux_kfree_type = { + .release = linux_kobject_kfree +}; + +static void +linux_device_release(struct device *dev) +{ + pr_debug("linux_device_release: %s\n", dev_name(dev)); + kfree(dev); +} + +static ssize_t +linux_class_show(struct kobject *kobj, struct attribute *attr, char *buf) +{ + struct class_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct class_attribute, attr); + error = -EIO; + if (dattr->show) + error = dattr->show(container_of(kobj, struct class, kobj), + dattr, buf); + return (error); +} + +static ssize_t +linux_class_store(struct kobject *kobj, struct attribute *attr, const char *buf, + size_t count) +{ + struct class_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct class_attribute, attr); + error = -EIO; + if (dattr->store) + error = dattr->store(container_of(kobj, struct class, kobj), + dattr, buf, count); + return (error); +} + +static void +linux_class_release(struct kobject *kobj) +{ + struct class *class; + + class = container_of(kobj, struct class, kobj); + if (class->class_release) + class->class_release(class); +} + +static const struct sysfs_ops linux_class_sysfs = { + .show = linux_class_show, + .store = linux_class_store, +}; + +const struct kobj_type linux_class_ktype = { + .release = linux_class_release, + .sysfs_ops = &linux_class_sysfs +}; + +static void +linux_dev_release(struct kobject *kobj) +{ + struct device *dev; + + dev = container_of(kobj, struct device, kobj); + /* This is the precedence defined by linux. */ + if (dev->release) + dev->release(dev); + else if (dev->class && dev->class->dev_release) + dev->class->dev_release(dev); +} + +static ssize_t +linux_dev_show(struct kobject *kobj, struct attribute *attr, char *buf) +{ + struct device_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct device_attribute, attr); + error = -EIO; + if (dattr->show) + error = dattr->show(container_of(kobj, struct device, kobj), + dattr, buf); + return (error); +} + +static ssize_t +linux_dev_store(struct kobject *kobj, struct attribute *attr, const char *buf, + size_t count) +{ + struct device_attribute *dattr; + ssize_t error; + + dattr = container_of(attr, struct device_attribute, attr); + error = -EIO; + if (dattr->store) + error = dattr->store(container_of(kobj, struct device, kobj), + dattr, buf, count); + return (error); +} + +static const struct sysfs_ops linux_dev_sysfs = { + .show = linux_dev_show, + .store = linux_dev_store, +}; + +const struct kobj_type linux_dev_ktype = { + .release = linux_dev_release, + .sysfs_ops = &linux_dev_sysfs +}; + +struct device * +device_create(struct class *class, struct device *parent, dev_t devt, + void *drvdata, const char *fmt, ...) +{ + struct device *dev; + va_list args; + + dev = kzalloc(sizeof(*dev), M_WAITOK); + dev->parent = parent; + dev->class = class; + dev->devt = devt; + dev->driver_data = drvdata; + dev->release = linux_device_release; + va_start(args, fmt); + kobject_set_name_vargs(&dev->kobj, fmt, args); + va_end(args); + device_register(dev); + + return (dev); +} + +int +kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, + struct kobject *parent, const char *fmt, ...) +{ + va_list args; + int error; + + kobject_init(kobj, ktype); + kobj->ktype = ktype; + kobj->parent = parent; + kobj->name = NULL; + + va_start(args, fmt); + error = kobject_set_name_vargs(kobj, fmt, args); + va_end(args); + if (error) + return (error); + return kobject_add_complete(kobj, parent); +} + +static void +linux_kq_lock(void *arg) +{ + spinlock_t *s = arg; + + spin_lock(s); +} +static void +linux_kq_unlock(void *arg) +{ + spinlock_t *s = arg; + + spin_unlock(s); +} + +static void +linux_kq_assert_lock(void *arg, int what) +{ +#ifdef INVARIANTS + spinlock_t *s = arg; + + if (what == LA_LOCKED) + mtx_assert(&s->m, MA_OWNED); + else + mtx_assert(&s->m, MA_NOTOWNED); +#endif +} + +static void +linux_file_kqfilter_poll(struct linux_file *, int); + +struct linux_file * +linux_file_alloc(void) +{ + struct linux_file *filp; + + filp = kzalloc(sizeof(*filp), GFP_KERNEL); + + /* set initial refcount */ + filp->f_count = 1; + + /* setup fields needed by kqueue support */ + spin_lock_init(&filp->f_kqlock); + knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, + linux_kq_lock, linux_kq_unlock, linux_kq_assert_lock); + + return (filp); +} + +void +linux_file_free(struct linux_file *filp) +{ + if (filp->_file == NULL) { + if (filp->f_shmem != NULL) + vm_object_deallocate(filp->f_shmem); + kfree(filp); + } else { + /* + * The close method of the character device or file + * will free the linux_file structure: + */ + _fdrop(filp->_file, curthread); + } +} + +static int +linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, + vm_page_t *mres) +{ + struct vm_area_struct *vmap; + + vmap = linux_cdev_handle_find(vm_obj->handle); + + MPASS(vmap != NULL); + MPASS(vmap->vm_private_data == vm_obj->handle); + + if (likely(vmap->vm_ops != NULL && offset < vmap->vm_len)) { + vm_paddr_t paddr = IDX_TO_OFF(vmap->vm_pfn) + offset; + vm_page_t page; + + if (((*mres)->flags & PG_FICTITIOUS) != 0) { + /* + * If the passed in result page is a fake + * page, update it with the new physical + * address. + */ + page = *mres; + vm_page_updatefake(page, paddr, vm_obj->memattr); + } else { + /* + * Replace the passed in "mres" page with our + * own fake page and free up the all of the + * original pages. + */ + VM_OBJECT_WUNLOCK(vm_obj); + page = vm_page_getfake(paddr, vm_obj->memattr); + VM_OBJECT_WLOCK(vm_obj); + + vm_page_replace(page, vm_obj, (*mres)->pindex, *mres); + *mres = page; + } + vm_page_valid(page); + return (VM_PAGER_OK); + } + return (VM_PAGER_FAIL); +} + +static int +linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + struct vm_area_struct *vmap; + int err; + + /* get VM area structure */ + vmap = linux_cdev_handle_find(vm_obj->handle); + MPASS(vmap != NULL); + MPASS(vmap->vm_private_data == vm_obj->handle); + + VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); + + down_write(&vmap->vm_mm->mmap_sem); + if (unlikely(vmap->vm_ops == NULL)) { + err = VM_FAULT_SIGBUS; + } else { + struct vm_fault vmf; + + /* fill out VM fault structure */ + vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); + vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; + vmf.pgoff = 0; + vmf.page = NULL; + vmf.vma = vmap; + + vmap->vm_pfn_count = 0; + vmap->vm_pfn_pcount = &vmap->vm_pfn_count; + vmap->vm_obj = vm_obj; + + err = vmap->vm_ops->fault(vmap, &vmf); + + while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) { + kern_yield(PRI_USER); + err = vmap->vm_ops->fault(vmap, &vmf); + } + } + + /* translate return code */ + switch (err) { + case VM_FAULT_OOM: + err = VM_PAGER_AGAIN; + break; + case VM_FAULT_SIGBUS: + err = VM_PAGER_BAD; + break; + case VM_FAULT_NOPAGE: + /* + * By contract the fault handler will return having + * busied all the pages itself. If pidx is already + * found in the object, it will simply xbusy the first + * page and return with vm_pfn_count set to 1. + */ + *first = vmap->vm_pfn_first; + *last = *first + vmap->vm_pfn_count - 1; + err = VM_PAGER_OK; + break; + default: + err = VM_PAGER_ERROR; + break; + } + up_write(&vmap->vm_mm->mmap_sem); + VM_OBJECT_WLOCK(vm_obj); + return (err); +} + +static struct rwlock linux_vma_lock; +static TAILQ_HEAD(, vm_area_struct) linux_vma_head = + TAILQ_HEAD_INITIALIZER(linux_vma_head); + +static void +linux_cdev_handle_free(struct vm_area_struct *vmap) +{ + /* Drop reference on vm_file */ + if (vmap->vm_file != NULL) + fput(vmap->vm_file); + + /* Drop reference on mm_struct */ + mmput(vmap->vm_mm); + + kfree(vmap); +} + +static void +linux_cdev_handle_remove(struct vm_area_struct *vmap) +{ + rw_wlock(&linux_vma_lock); + TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry); + rw_wunlock(&linux_vma_lock); +} + +static struct vm_area_struct * +linux_cdev_handle_find(void *handle) +{ + struct vm_area_struct *vmap; + + rw_rlock(&linux_vma_lock); + TAILQ_FOREACH(vmap, &linux_vma_head, vm_entry) { + if (vmap->vm_private_data == handle) + break; + } + rw_runlock(&linux_vma_lock); + return (vmap); +} + +static int +linux_cdev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + + MPASS(linux_cdev_handle_find(handle) != NULL); + *color = 0; + return (0); +} + +static void +linux_cdev_pager_dtor(void *handle) +{ + const struct vm_operations_struct *vm_ops; + struct vm_area_struct *vmap; + + vmap = linux_cdev_handle_find(handle); + MPASS(vmap != NULL); + + /* + * Remove handle before calling close operation to prevent + * other threads from reusing the handle pointer. + */ + linux_cdev_handle_remove(vmap); + + down_write(&vmap->vm_mm->mmap_sem); + vm_ops = vmap->vm_ops; + if (likely(vm_ops != NULL)) + vm_ops->close(vmap); + up_write(&vmap->vm_mm->mmap_sem); + + linux_cdev_handle_free(vmap); +} + +static struct cdev_pager_ops linux_cdev_pager_ops[2] = { + { + /* OBJT_MGTDEVICE */ + .cdev_pg_populate = linux_cdev_pager_populate, + .cdev_pg_ctor = linux_cdev_pager_ctor, + .cdev_pg_dtor = linux_cdev_pager_dtor + }, + { + /* OBJT_DEVICE */ + .cdev_pg_fault = linux_cdev_pager_fault, + .cdev_pg_ctor = linux_cdev_pager_ctor, + .cdev_pg_dtor = linux_cdev_pager_dtor + }, +}; + +int +zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size) +{ + vm_object_t obj; + vm_page_t m; + + obj = vma->vm_obj; + if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) + return (-ENOTSUP); + VM_OBJECT_RLOCK(obj); + for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); + m != NULL && m->pindex < OFF_TO_IDX(address + size); + m = TAILQ_NEXT(m, listq)) + pmap_remove_all(m); + VM_OBJECT_RUNLOCK(obj); + return (0); +} + +static struct file_operations dummy_ldev_ops = { + /* XXXKIB */ +}; + +static struct linux_cdev dummy_ldev = { + .ops = &dummy_ldev_ops, +}; + +#define LDEV_SI_DTR 0x0001 +#define LDEV_SI_REF 0x0002 + +static void +linux_get_fop(struct linux_file *filp, const struct file_operations **fop, + struct linux_cdev **dev) +{ + struct linux_cdev *ldev; + u_int siref; + + ldev = filp->f_cdev; + *fop = filp->f_op; + if (ldev != NULL) { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + siref = ldev->siref; + *fop = ldev->ops; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, &siref, + siref + LDEV_SI_REF)) { + break; + } + } + } + *dev = ldev; +} + +static void +linux_drop_fop(struct linux_cdev *ldev) +{ + + if (ldev == NULL) + return; + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); +} + +#define OPW(fp,td,code) ({ \ + struct file *__fpop; \ + __typeof(code) __retval; \ + \ + __fpop = (td)->td_fpop; \ + (td)->td_fpop = (fp); \ + __retval = (code); \ + (td)->td_fpop = __fpop; \ + __retval; \ +}) + +static int +linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, + struct file *file) +{ + struct linux_cdev *ldev; + struct linux_file *filp; + const struct file_operations *fop; + int error; + + ldev = dev->si_drv1; + + filp = linux_file_alloc(); + filp->f_dentry = &filp->f_dentry_store; + filp->f_op = ldev->ops; + filp->f_mode = file->f_flag; + filp->f_flags = file->f_flag; + filp->f_vnode = file->f_vnode; + filp->_file = file; + refcount_acquire(&ldev->refs); + filp->f_cdev = ldev; + + linux_set_current(td); + linux_get_fop(filp, &fop, &ldev); + + if (fop->open != NULL) { + error = -fop->open(file->f_vnode, filp); + if (error != 0) { + linux_drop_fop(ldev); + linux_cdev_deref(filp->f_cdev); + kfree(filp); + return (error); + } + } + + /* hold on to the vnode - used for fstat() */ + vhold(filp->f_vnode); + + /* release the file from devfs */ + finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + linux_drop_fop(ldev); + return (ENXIO); +} + +#define LINUX_IOCTL_MIN_PTR 0x10000UL +#define LINUX_IOCTL_MAX_PTR (LINUX_IOCTL_MIN_PTR + IOCPARM_MAX) + +static inline int +linux_remap_address(void **uaddr, size_t len) +{ + uintptr_t uaddr_val = (uintptr_t)(*uaddr); + + if (unlikely(uaddr_val >= LINUX_IOCTL_MIN_PTR && + uaddr_val < LINUX_IOCTL_MAX_PTR)) { + struct task_struct *pts = current; + if (pts == NULL) { + *uaddr = NULL; + return (1); + } + + /* compute data offset */ + uaddr_val -= LINUX_IOCTL_MIN_PTR; + + /* check that length is within bounds */ + if ((len > IOCPARM_MAX) || + (uaddr_val + len) > pts->bsd_ioctl_len) { + *uaddr = NULL; + return (1); + } + + /* re-add kernel buffer address */ + uaddr_val += (uintptr_t)pts->bsd_ioctl_data; + + /* update address location */ + *uaddr = (void *)uaddr_val; + return (1); + } + return (0); +} + +int +linux_copyin(const void *uaddr, void *kaddr, size_t len) +{ + if (linux_remap_address(__DECONST(void **, &uaddr), len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(kaddr, uaddr, len); + return (0); + } + return (-copyin(uaddr, kaddr, len)); +} + +int +linux_copyout(const void *kaddr, void *uaddr, size_t len) +{ + if (linux_remap_address(&uaddr, len)) { + if (uaddr == NULL) + return (-EFAULT); + memcpy(uaddr, kaddr, len); + return (0); + } + return (-copyout(kaddr, uaddr, len)); +} + +size_t +linux_clear_user(void *_uaddr, size_t _len) +{ + uint8_t *uaddr = _uaddr; + size_t len = _len; + + /* make sure uaddr is aligned before going into the fast loop */ + while (((uintptr_t)uaddr & 7) != 0 && len > 7) { + if (subyte(uaddr, 0)) + return (_len); + uaddr++; + len--; + } + + /* zero 8 bytes at a time */ + while (len > 7) { +#ifdef __LP64__ + if (suword64(uaddr, 0)) + return (_len); +#else + if (suword32(uaddr, 0)) + return (_len); + if (suword32(uaddr + 4, 0)) + return (_len); +#endif + uaddr += 8; + len -= 8; + } + + /* zero fill end, if any */ + while (len > 0) { + if (subyte(uaddr, 0)) + return (_len); + uaddr++; + len--; + } + return (0); +} + +int +linux_access_ok(const void *uaddr, size_t len) +{ + uintptr_t saddr; + uintptr_t eaddr; + + /* get start and end address */ + saddr = (uintptr_t)uaddr; + eaddr = (uintptr_t)uaddr + len; + + /* verify addresses are valid for userspace */ + return ((saddr == eaddr) || + (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); +} + +/* + * This function should return either EINTR or ERESTART depending on + * the signal type sent to this thread: + */ +static int +linux_get_error(struct task_struct *task, int error) +{ + /* check for signal type interrupt code */ + if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { + error = -linux_schedule_get_interrupt_value(task); + if (error == 0) + error = EINTR; + } + return (error); +} + +static int +linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, + const struct file_operations *fop, u_long cmd, caddr_t data, + struct thread *td) +{ + struct task_struct *task = current; + unsigned size; + int error; + + size = IOCPARM_LEN(cmd); + /* refer to logic in sys_ioctl() */ + if (size > 0) { + /* + * Setup hint for linux_copyin() and linux_copyout(). + * + * Background: Linux code expects a user-space address + * while FreeBSD supplies a kernel-space address. + */ + task->bsd_ioctl_data = data; *** 1651 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B83755EDCCE; Fri, 23 Apr 2021 11:14: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 4FRWsD5KVGz4WtC; Fri, 23 Apr 2021 11:14:40 +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 A77F340ED; Fri, 23 Apr 2021 11:14:40 +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 13NBEeFM012691; Fri, 23 Apr 2021 11:14:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEee2012690; Fri, 23 Apr 2021 11:14:40 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:40 GMT Message-Id: <202104231114.13NBEee2012690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1f13502192bc - stable/13 - linuxkpi: rename cdev to ldev 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f13502192bc42a517c618ed1ada494e6a5471a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:41 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1f13502192bc42a517c618ed1ada494e6a5471a5 commit 1f13502192bc42a517c618ed1ada494e6a5471a5 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:43:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: rename cdev to ldev (cherry picked from commit 28b482e2baf43cdd30e8b9bd090e6d9f405cf4b3) --- sys/compat/linuxkpi/common/src/linux_compat.c | 6 +++--- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index a9fa50ded219..45ccd1279057 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2213,12 +2213,12 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { - struct linux_cdev *cdev; + struct linux_cdev *ldev; struct kobject *parent; - cdev = container_of(kobj, struct linux_cdev, kobj); + ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(cdev); + linux_destroy_dev(ldev); kobject_put(parent); } diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 42f47b6e510a..b7a7ba8b4f18 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -1520,8 +1520,9 @@ linux_file_close(struct file *file, struct thread *td) if (filp->f_vnode != NULL) vdrop(filp->f_vnode); linux_drop_fop(ldev); - if (filp->f_cdev != NULL) - linux_cdev_deref(filp->f_cdev); + ldev = filp->f_cdev; + if (ldev != NULL) + linux_cdev_deref(ldev); kfree(filp); return (error); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF9FA5EDDC3; Fri, 23 Apr 2021 11:14: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 4FRWsF6nHxz4Wp8; Fri, 23 Apr 2021 11:14: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 C7DE64156; Fri, 23 Apr 2021 11:14: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 13NBEfbR012712; Fri, 23 Apr 2021 11:14:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEfgp012711; Fri, 23 Apr 2021 11:14:41 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:41 GMT Message-Id: <202104231114.13NBEfgp012711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 520085b20e04 - stable/13 - linuxkpi: do not destroy/free embedded linux cdevs 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 520085b20e045dbcb6e9c6389f67c9e0c849ad45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:42 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=520085b20e045dbcb6e9c6389f67c9e0c849ad45 commit 520085b20e045dbcb6e9c6389f67c9e0c849ad45 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:44:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: do not destroy/free embedded linux cdevs (cherry picked from commit 7f9867f8c65b1b3e590dba4dc432a4bc8cf01f68) --- sys/compat/linuxkpi/common/src/linux_compat.c | 13 ++++++++++--- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 45ccd1279057..1d75644105dd 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2192,8 +2192,8 @@ linux_completion_done(struct completion *c) static void linux_cdev_deref(struct linux_cdev *ldev) { - - if (refcount_release(&ldev->refs)) + if (refcount_release(&ldev->refs) && + ldev->kobj.ktype == &linux_cdev_ktype) kfree(ldev); } @@ -2213,12 +2213,17 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { + struct cdev *cdev; struct linux_cdev *ldev; struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(ldev); + cdev = ldev->cdev; + if (cdev != NULL) { + destroy_dev(cdev); + ldev->cdev = NULL; + } kobject_put(parent); } @@ -2230,6 +2235,8 @@ linux_destroy_dev(struct linux_cdev *ldev) return; MPASS((ldev->siref & LDEV_SI_DTR) == 0); + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) pause("ldevdtr", hz / 4); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index b7a7ba8b4f18..0731859e7a53 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -2220,12 +2220,12 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { - struct linux_cdev *cdev; + struct linux_cdev *ldev; struct kobject *parent; - cdev = container_of(kobj, struct linux_cdev, kobj); + ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(cdev); + linux_destroy_dev(ldev); kobject_put(parent); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE8DC5EDE55; Fri, 23 Apr 2021 11:14: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 4FRWsH0P8Tz4WtD; Fri, 23 Apr 2021 11:14: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 00315468A; Fri, 23 Apr 2021 11:14: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 13NBEgre012733; Fri, 23 Apr 2021 11:14:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEgQv012732; Fri, 23 Apr 2021 11:14:42 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:42 GMT Message-Id: <202104231114.13NBEgQv012732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e49760d9efda - stable/13 - linuxkpi: avoid counting per-thread use for the embedded linux cdevs 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e49760d9efda09a390476d64e6328fdd17aa3117 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:44 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e49760d9efda09a390476d64e6328fdd17aa3117 commit e49760d9efda09a390476d64e6328fdd17aa3117 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:45:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: avoid counting per-thread use for the embedded linux cdevs (cherry picked from commit f6b108837e7df7d7bfb35ec447f7cb62afa79441) --- sys/compat/linuxkpi/common/src/linux_compat.c | 31 ++++++++++++++-------- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 13 ++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 1d75644105dd..f8b939a5ec16 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -710,15 +710,19 @@ linux_get_fop(struct linux_file *filp, const struct file_operations **fop, ldev = filp->f_cdev; *fop = filp->f_op; if (ldev != NULL) { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - siref = ldev->siref; - *fop = ldev->ops; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, &siref, - siref + LDEV_SI_REF)) { - break; + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + refcount_acquire(&ldev->refs); + } else { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + *fop = ldev->ops; + siref = ldev->siref; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, + &siref, siref + LDEV_SI_REF)) { + break; + } } } } @@ -731,8 +735,13 @@ linux_drop_fop(struct linux_cdev *ldev) if (ldev == NULL) return; - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + linux_cdev_deref(ldev); + } else { + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + } } #define OPW(fp,td,code) ({ \ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 0731859e7a53..71ea7e0844dc 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -2199,8 +2199,8 @@ linux_completion_done(struct completion *c) static void linux_cdev_deref(struct linux_cdev *ldev) { - - if (refcount_release(&ldev->refs)) + if (refcount_release(&ldev->refs) && + ldev->kobj.ktype == &linux_cdev_ktype) kfree(ldev); } @@ -2220,12 +2220,17 @@ linux_cdev_release(struct kobject *kobj) static void linux_cdev_static_release(struct kobject *kobj) { + struct cdev *cdev; struct linux_cdev *ldev; struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; - linux_destroy_dev(ldev); + cdev = ldev->cdev; + if (cdev != NULL) { + destroy_dev(cdev); + ldev->cdev = NULL; + } kobject_put(parent); } @@ -2237,6 +2242,8 @@ linux_destroy_dev(struct linux_cdev *ldev) return; MPASS((ldev->siref & LDEV_SI_DTR) == 0); + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) pause("ldevdtr", hz / 4); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCBF95EE117; Fri, 23 Apr 2021 11:14: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 4FRWsJ3tCCz4WpH; Fri, 23 Apr 2021 11:14: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 0148144A9; Fri, 23 Apr 2021 11:14: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 13NBEhq8012762; Fri, 23 Apr 2021 11:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEhhO012761; Fri, 23 Apr 2021 11:14:43 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:43 GMT Message-Id: <202104231114.13NBEhhO012761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9c410fc7ce11 - stable/13 - linuxkpi: drop single-use variable 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c410fc7ce116dfabf3ebd246bbfb416699a2a40 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:45 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9c410fc7ce116dfabf3ebd246bbfb416699a2a40 commit 9c410fc7ce116dfabf3ebd246bbfb416699a2a40 Author: Konstantin Belousov AuthorDate: 2021-03-30 08:46:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: drop single-use variable (cherry picked from commit 8011fb795baa59ba14371d6db5ab661a5db77615) --- sys/compat/linuxkpi/common/src/linux_compat.c | 4 +-- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 31 ++++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index f8b939a5ec16..8fe4f4509571 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2224,16 +2224,14 @@ linux_cdev_static_release(struct kobject *kobj) { struct cdev *cdev; struct linux_cdev *ldev; - struct kobject *parent; ldev = container_of(kobj, struct linux_cdev, kobj); - parent = kobj->parent; cdev = ldev->cdev; if (cdev != NULL) { destroy_dev(cdev); ldev->cdev = NULL; } - kobject_put(parent); + kobject_put(kobj->parent); } void diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig index 71ea7e0844dc..28413c59bb76 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ b/sys/compat/linuxkpi/common/src/linux_compat.c.orig @@ -717,15 +717,19 @@ linux_get_fop(struct linux_file *filp, const struct file_operations **fop, ldev = filp->f_cdev; *fop = filp->f_op; if (ldev != NULL) { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - siref = ldev->siref; - *fop = ldev->ops; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, &siref, - siref + LDEV_SI_REF)) { - break; + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + refcount_acquire(&ldev->refs); + } else { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + *fop = ldev->ops; + siref = ldev->siref; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, + &siref, siref + LDEV_SI_REF)) { + break; + } } } } @@ -738,8 +742,13 @@ linux_drop_fop(struct linux_cdev *ldev) if (ldev == NULL) return; - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + if (ldev->kobj.ktype == &linux_cdev_static_ktype) { + linux_cdev_deref(ldev); + } else { + MPASS(ldev->kobj.ktype == &linux_cdev_ktype); + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); + } } #define OPW(fp,td,code) ({ \ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 73D325EDCD5; Fri, 23 Apr 2021 11:14: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 4FRWsK1qGBz4WlS; Fri, 23 Apr 2021 11:14: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 282764157; Fri, 23 Apr 2021 11:14: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 13NBEjRI012784; Fri, 23 Apr 2021 11:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEjnA012783; Fri, 23 Apr 2021 11:14:45 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:45 GMT Message-Id: <202104231114.13NBEjnA012783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a574fbf34ba9 - stable/13 - linuxkpi: remove erronously committed diff save file 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a574fbf34ba94be106c8c8dea11cdb13ab2fbe54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:45 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a574fbf34ba94be106c8c8dea11cdb13ab2fbe54 commit a574fbf34ba94be106c8c8dea11cdb13ab2fbe54 Author: Konstantin Belousov AuthorDate: 2021-04-06 00:42:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 linuxkpi: remove erronously committed diff save file (cherry picked from commit 5b3b19db7305f8255f021d6f8d94d17ab778660f) --- sys/compat/linuxkpi/common/src/linux_compat.c.orig | 2615 -------------------- 1 file changed, 2615 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c.orig b/sys/compat/linuxkpi/common/src/linux_compat.c.orig deleted file mode 100644 index 28413c59bb76..000000000000 --- a/sys/compat/linuxkpi/common/src/linux_compat.c.orig +++ /dev/null @@ -1,2615 +0,0 @@ -/*- - * Copyright (c) 2010 Isilon Systems, Inc. - * Copyright (c) 2010 iX Systems, Inc. - * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "opt_stack.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#if defined(__i386__) || defined(__amd64__) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__i386__) || defined(__amd64__) -#include -#endif - -SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, - "LinuxKPI parameters"); - -int linuxkpi_debug; -SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, - &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); - -static struct timeval lkpi_net_lastlog; -static int lkpi_net_curpps; -static int lkpi_net_maxpps = 99; -SYSCTL_INT(_compat_linuxkpi, OID_AUTO, net_ratelimit, CTLFLAG_RWTUN, - &lkpi_net_maxpps, 0, "Limit number of LinuxKPI net messages per second."); - -MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); - -#include -/* Undo Linux compat changes. */ -#undef RB_ROOT -#undef file -#undef cdev -#define RB_ROOT(head) (head)->rbh_root - -static void linux_cdev_deref(struct linux_cdev *ldev); -static struct vm_area_struct *linux_cdev_handle_find(void *handle); - -struct kobject linux_class_root; -struct device linux_root_device; -struct class linux_class_misc; -struct list_head pci_drivers; -struct list_head pci_devices; -spinlock_t pci_lock; - -unsigned long linux_timer_hz_mask; - -wait_queue_head_t linux_bit_waitq; -wait_queue_head_t linux_var_waitq; - -int -panic_cmp(struct rb_node *one, struct rb_node *two) -{ - panic("no cmp"); -} - -RB_GENERATE(linux_root, rb_node, __entry, panic_cmp); - -int -kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args) -{ - va_list tmp_va; - int len; - char *old; - char *name; - char dummy; - - old = kobj->name; - - if (old && fmt == NULL) - return (0); - - /* compute length of string */ - va_copy(tmp_va, args); - len = vsnprintf(&dummy, 0, fmt, tmp_va); - va_end(tmp_va); - - /* account for zero termination */ - len++; - - /* check for error */ - if (len < 1) - return (-EINVAL); - - /* allocate memory for string */ - name = kzalloc(len, GFP_KERNEL); - if (name == NULL) - return (-ENOMEM); - vsnprintf(name, len, fmt, args); - kobj->name = name; - - /* free old string */ - kfree(old); - - /* filter new string */ - for (; *name != '\0'; name++) - if (*name == '/') - *name = '!'; - return (0); -} - -int -kobject_set_name(struct kobject *kobj, const char *fmt, ...) -{ - va_list args; - int error; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - - return (error); -} - -static int -kobject_add_complete(struct kobject *kobj, struct kobject *parent) -{ - const struct kobj_type *t; - int error; - - kobj->parent = parent; - error = sysfs_create_dir(kobj); - if (error == 0 && kobj->ktype && kobj->ktype->default_attrs) { - struct attribute **attr; - t = kobj->ktype; - - for (attr = t->default_attrs; *attr != NULL; attr++) { - error = sysfs_create_file(kobj, *attr); - if (error) - break; - } - if (error) - sysfs_remove_dir(kobj); - } - return (error); -} - -int -kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...) -{ - va_list args; - int error; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - if (error) - return (error); - - return kobject_add_complete(kobj, parent); -} - -void -linux_kobject_release(struct kref *kref) -{ - struct kobject *kobj; - char *name; - - kobj = container_of(kref, struct kobject, kref); - sysfs_remove_dir(kobj); - name = kobj->name; - if (kobj->ktype && kobj->ktype->release) - kobj->ktype->release(kobj); - kfree(name); -} - -static void -linux_kobject_kfree(struct kobject *kobj) -{ - kfree(kobj); -} - -static void -linux_kobject_kfree_name(struct kobject *kobj) -{ - if (kobj) { - kfree(kobj->name); - } -} - -const struct kobj_type linux_kfree_type = { - .release = linux_kobject_kfree -}; - -static void -linux_device_release(struct device *dev) -{ - pr_debug("linux_device_release: %s\n", dev_name(dev)); - kfree(dev); -} - -static ssize_t -linux_class_show(struct kobject *kobj, struct attribute *attr, char *buf) -{ - struct class_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct class_attribute, attr); - error = -EIO; - if (dattr->show) - error = dattr->show(container_of(kobj, struct class, kobj), - dattr, buf); - return (error); -} - -static ssize_t -linux_class_store(struct kobject *kobj, struct attribute *attr, const char *buf, - size_t count) -{ - struct class_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct class_attribute, attr); - error = -EIO; - if (dattr->store) - error = dattr->store(container_of(kobj, struct class, kobj), - dattr, buf, count); - return (error); -} - -static void -linux_class_release(struct kobject *kobj) -{ - struct class *class; - - class = container_of(kobj, struct class, kobj); - if (class->class_release) - class->class_release(class); -} - -static const struct sysfs_ops linux_class_sysfs = { - .show = linux_class_show, - .store = linux_class_store, -}; - -const struct kobj_type linux_class_ktype = { - .release = linux_class_release, - .sysfs_ops = &linux_class_sysfs -}; - -static void -linux_dev_release(struct kobject *kobj) -{ - struct device *dev; - - dev = container_of(kobj, struct device, kobj); - /* This is the precedence defined by linux. */ - if (dev->release) - dev->release(dev); - else if (dev->class && dev->class->dev_release) - dev->class->dev_release(dev); -} - -static ssize_t -linux_dev_show(struct kobject *kobj, struct attribute *attr, char *buf) -{ - struct device_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct device_attribute, attr); - error = -EIO; - if (dattr->show) - error = dattr->show(container_of(kobj, struct device, kobj), - dattr, buf); - return (error); -} - -static ssize_t -linux_dev_store(struct kobject *kobj, struct attribute *attr, const char *buf, - size_t count) -{ - struct device_attribute *dattr; - ssize_t error; - - dattr = container_of(attr, struct device_attribute, attr); - error = -EIO; - if (dattr->store) - error = dattr->store(container_of(kobj, struct device, kobj), - dattr, buf, count); - return (error); -} - -static const struct sysfs_ops linux_dev_sysfs = { - .show = linux_dev_show, - .store = linux_dev_store, -}; - -const struct kobj_type linux_dev_ktype = { - .release = linux_dev_release, - .sysfs_ops = &linux_dev_sysfs -}; - -struct device * -device_create(struct class *class, struct device *parent, dev_t devt, - void *drvdata, const char *fmt, ...) -{ - struct device *dev; - va_list args; - - dev = kzalloc(sizeof(*dev), M_WAITOK); - dev->parent = parent; - dev->class = class; - dev->devt = devt; - dev->driver_data = drvdata; - dev->release = linux_device_release; - va_start(args, fmt); - kobject_set_name_vargs(&dev->kobj, fmt, args); - va_end(args); - device_register(dev); - - return (dev); -} - -int -kobject_init_and_add(struct kobject *kobj, const struct kobj_type *ktype, - struct kobject *parent, const char *fmt, ...) -{ - va_list args; - int error; - - kobject_init(kobj, ktype); - kobj->ktype = ktype; - kobj->parent = parent; - kobj->name = NULL; - - va_start(args, fmt); - error = kobject_set_name_vargs(kobj, fmt, args); - va_end(args); - if (error) - return (error); - return kobject_add_complete(kobj, parent); -} - -static void -linux_kq_lock(void *arg) -{ - spinlock_t *s = arg; - - spin_lock(s); -} -static void -linux_kq_unlock(void *arg) -{ - spinlock_t *s = arg; - - spin_unlock(s); -} - -static void -linux_kq_assert_lock(void *arg, int what) -{ -#ifdef INVARIANTS - spinlock_t *s = arg; - - if (what == LA_LOCKED) - mtx_assert(&s->m, MA_OWNED); - else - mtx_assert(&s->m, MA_NOTOWNED); -#endif -} - -static void -linux_file_kqfilter_poll(struct linux_file *, int); - -struct linux_file * -linux_file_alloc(void) -{ - struct linux_file *filp; - - filp = kzalloc(sizeof(*filp), GFP_KERNEL); - - /* set initial refcount */ - filp->f_count = 1; - - /* setup fields needed by kqueue support */ - spin_lock_init(&filp->f_kqlock); - knlist_init(&filp->f_selinfo.si_note, &filp->f_kqlock, - linux_kq_lock, linux_kq_unlock, linux_kq_assert_lock); - - return (filp); -} - -void -linux_file_free(struct linux_file *filp) -{ - if (filp->_file == NULL) { - if (filp->f_shmem != NULL) - vm_object_deallocate(filp->f_shmem); - kfree(filp); - } else { - /* - * The close method of the character device or file - * will free the linux_file structure: - */ - _fdrop(filp->_file, curthread); - } -} - -static int -linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot, - vm_page_t *mres) -{ - struct vm_area_struct *vmap; - - vmap = linux_cdev_handle_find(vm_obj->handle); - - MPASS(vmap != NULL); - MPASS(vmap->vm_private_data == vm_obj->handle); - - if (likely(vmap->vm_ops != NULL && offset < vmap->vm_len)) { - vm_paddr_t paddr = IDX_TO_OFF(vmap->vm_pfn) + offset; - vm_page_t page; - - if (((*mres)->flags & PG_FICTITIOUS) != 0) { - /* - * If the passed in result page is a fake - * page, update it with the new physical - * address. - */ - page = *mres; - vm_page_updatefake(page, paddr, vm_obj->memattr); - } else { - /* - * Replace the passed in "mres" page with our - * own fake page and free up the all of the - * original pages. - */ - VM_OBJECT_WUNLOCK(vm_obj); - page = vm_page_getfake(paddr, vm_obj->memattr); - VM_OBJECT_WLOCK(vm_obj); - - vm_page_replace(page, vm_obj, (*mres)->pindex, *mres); - *mres = page; - } - vm_page_valid(page); - return (VM_PAGER_OK); - } - return (VM_PAGER_FAIL); -} - -static int -linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type, - vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) -{ - struct vm_area_struct *vmap; - int err; - - /* get VM area structure */ - vmap = linux_cdev_handle_find(vm_obj->handle); - MPASS(vmap != NULL); - MPASS(vmap->vm_private_data == vm_obj->handle); - - VM_OBJECT_WUNLOCK(vm_obj); - - linux_set_current(curthread); - - down_write(&vmap->vm_mm->mmap_sem); - if (unlikely(vmap->vm_ops == NULL)) { - err = VM_FAULT_SIGBUS; - } else { - struct vm_fault vmf; - - /* fill out VM fault structure */ - vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); - vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; - vmf.pgoff = 0; - vmf.page = NULL; - vmf.vma = vmap; - - vmap->vm_pfn_count = 0; - vmap->vm_pfn_pcount = &vmap->vm_pfn_count; - vmap->vm_obj = vm_obj; - - err = vmap->vm_ops->fault(vmap, &vmf); - - while (vmap->vm_pfn_count == 0 && err == VM_FAULT_NOPAGE) { - kern_yield(PRI_USER); - err = vmap->vm_ops->fault(vmap, &vmf); - } - } - - /* translate return code */ - switch (err) { - case VM_FAULT_OOM: - err = VM_PAGER_AGAIN; - break; - case VM_FAULT_SIGBUS: - err = VM_PAGER_BAD; - break; - case VM_FAULT_NOPAGE: - /* - * By contract the fault handler will return having - * busied all the pages itself. If pidx is already - * found in the object, it will simply xbusy the first - * page and return with vm_pfn_count set to 1. - */ - *first = vmap->vm_pfn_first; - *last = *first + vmap->vm_pfn_count - 1; - err = VM_PAGER_OK; - break; - default: - err = VM_PAGER_ERROR; - break; - } - up_write(&vmap->vm_mm->mmap_sem); - VM_OBJECT_WLOCK(vm_obj); - return (err); -} - -static struct rwlock linux_vma_lock; -static TAILQ_HEAD(, vm_area_struct) linux_vma_head = - TAILQ_HEAD_INITIALIZER(linux_vma_head); - -static void -linux_cdev_handle_free(struct vm_area_struct *vmap) -{ - /* Drop reference on vm_file */ - if (vmap->vm_file != NULL) - fput(vmap->vm_file); - - /* Drop reference on mm_struct */ - mmput(vmap->vm_mm); - - kfree(vmap); -} - -static void -linux_cdev_handle_remove(struct vm_area_struct *vmap) -{ - rw_wlock(&linux_vma_lock); - TAILQ_REMOVE(&linux_vma_head, vmap, vm_entry); - rw_wunlock(&linux_vma_lock); -} - -static struct vm_area_struct * -linux_cdev_handle_find(void *handle) -{ - struct vm_area_struct *vmap; - - rw_rlock(&linux_vma_lock); - TAILQ_FOREACH(vmap, &linux_vma_head, vm_entry) { - if (vmap->vm_private_data == handle) - break; - } - rw_runlock(&linux_vma_lock); - return (vmap); -} - -static int -linux_cdev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred, u_short *color) -{ - - MPASS(linux_cdev_handle_find(handle) != NULL); - *color = 0; - return (0); -} - -static void -linux_cdev_pager_dtor(void *handle) -{ - const struct vm_operations_struct *vm_ops; - struct vm_area_struct *vmap; - - vmap = linux_cdev_handle_find(handle); - MPASS(vmap != NULL); - - /* - * Remove handle before calling close operation to prevent - * other threads from reusing the handle pointer. - */ - linux_cdev_handle_remove(vmap); - - down_write(&vmap->vm_mm->mmap_sem); - vm_ops = vmap->vm_ops; - if (likely(vm_ops != NULL)) - vm_ops->close(vmap); - up_write(&vmap->vm_mm->mmap_sem); - - linux_cdev_handle_free(vmap); -} - -static struct cdev_pager_ops linux_cdev_pager_ops[2] = { - { - /* OBJT_MGTDEVICE */ - .cdev_pg_populate = linux_cdev_pager_populate, - .cdev_pg_ctor = linux_cdev_pager_ctor, - .cdev_pg_dtor = linux_cdev_pager_dtor - }, - { - /* OBJT_DEVICE */ - .cdev_pg_fault = linux_cdev_pager_fault, - .cdev_pg_ctor = linux_cdev_pager_ctor, - .cdev_pg_dtor = linux_cdev_pager_dtor - }, -}; - -int -zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, - unsigned long size) -{ - vm_object_t obj; - vm_page_t m; - - obj = vma->vm_obj; - if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) - return (-ENOTSUP); - VM_OBJECT_RLOCK(obj); - for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); - m != NULL && m->pindex < OFF_TO_IDX(address + size); - m = TAILQ_NEXT(m, listq)) - pmap_remove_all(m); - VM_OBJECT_RUNLOCK(obj); - return (0); -} - -static struct file_operations dummy_ldev_ops = { - /* XXXKIB */ -}; - -static struct linux_cdev dummy_ldev = { - .ops = &dummy_ldev_ops, -}; - -#define LDEV_SI_DTR 0x0001 -#define LDEV_SI_REF 0x0002 - -static void -linux_get_fop(struct linux_file *filp, const struct file_operations **fop, - struct linux_cdev **dev) -{ - struct linux_cdev *ldev; - u_int siref; - - ldev = filp->f_cdev; - *fop = filp->f_op; - if (ldev != NULL) { - if (ldev->kobj.ktype == &linux_cdev_static_ktype) { - refcount_acquire(&ldev->refs); - } else { - for (siref = ldev->siref;;) { - if ((siref & LDEV_SI_DTR) != 0) { - ldev = &dummy_ldev; - *fop = ldev->ops; - siref = ldev->siref; - MPASS((ldev->siref & LDEV_SI_DTR) == 0); - } else if (atomic_fcmpset_int(&ldev->siref, - &siref, siref + LDEV_SI_REF)) { - break; - } - } - } - } - *dev = ldev; -} - -static void -linux_drop_fop(struct linux_cdev *ldev) -{ - - if (ldev == NULL) - return; - if (ldev->kobj.ktype == &linux_cdev_static_ktype) { - linux_cdev_deref(ldev); - } else { - MPASS(ldev->kobj.ktype == &linux_cdev_ktype); - MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); - atomic_subtract_int(&ldev->siref, LDEV_SI_REF); - } -} - -#define OPW(fp,td,code) ({ \ - struct file *__fpop; \ - __typeof(code) __retval; \ - \ - __fpop = (td)->td_fpop; \ - (td)->td_fpop = (fp); \ - __retval = (code); \ - (td)->td_fpop = __fpop; \ - __retval; \ -}) - -static int -linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, - struct file *file) -{ - struct linux_cdev *ldev; - struct linux_file *filp; - const struct file_operations *fop; - int error; - - ldev = dev->si_drv1; - - filp = linux_file_alloc(); - filp->f_dentry = &filp->f_dentry_store; - filp->f_op = ldev->ops; - filp->f_mode = file->f_flag; - filp->f_flags = file->f_flag; - filp->f_vnode = file->f_vnode; - filp->_file = file; - refcount_acquire(&ldev->refs); - filp->f_cdev = ldev; - - linux_set_current(td); - linux_get_fop(filp, &fop, &ldev); - - if (fop->open != NULL) { - error = -fop->open(file->f_vnode, filp); - if (error != 0) { - linux_drop_fop(ldev); - linux_cdev_deref(filp->f_cdev); - kfree(filp); - return (error); - } - } - - /* hold on to the vnode - used for fstat() */ - vhold(filp->f_vnode); - - /* release the file from devfs */ - finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); - linux_drop_fop(ldev); - return (ENXIO); -} - -#define LINUX_IOCTL_MIN_PTR 0x10000UL -#define LINUX_IOCTL_MAX_PTR (LINUX_IOCTL_MIN_PTR + IOCPARM_MAX) - -static inline int -linux_remap_address(void **uaddr, size_t len) -{ - uintptr_t uaddr_val = (uintptr_t)(*uaddr); - - if (unlikely(uaddr_val >= LINUX_IOCTL_MIN_PTR && - uaddr_val < LINUX_IOCTL_MAX_PTR)) { - struct task_struct *pts = current; - if (pts == NULL) { - *uaddr = NULL; - return (1); - } - - /* compute data offset */ - uaddr_val -= LINUX_IOCTL_MIN_PTR; - - /* check that length is within bounds */ - if ((len > IOCPARM_MAX) || - (uaddr_val + len) > pts->bsd_ioctl_len) { - *uaddr = NULL; - return (1); - } - - /* re-add kernel buffer address */ - uaddr_val += (uintptr_t)pts->bsd_ioctl_data; - - /* update address location */ - *uaddr = (void *)uaddr_val; - return (1); - } - return (0); -} - -int -linux_copyin(const void *uaddr, void *kaddr, size_t len) -{ - if (linux_remap_address(__DECONST(void **, &uaddr), len)) { - if (uaddr == NULL) - return (-EFAULT); - memcpy(kaddr, uaddr, len); - return (0); - } - return (-copyin(uaddr, kaddr, len)); -} - -int -linux_copyout(const void *kaddr, void *uaddr, size_t len) -{ - if (linux_remap_address(&uaddr, len)) { - if (uaddr == NULL) - return (-EFAULT); - memcpy(uaddr, kaddr, len); - return (0); - } - return (-copyout(kaddr, uaddr, len)); -} - -size_t -linux_clear_user(void *_uaddr, size_t _len) -{ - uint8_t *uaddr = _uaddr; - size_t len = _len; - - /* make sure uaddr is aligned before going into the fast loop */ - while (((uintptr_t)uaddr & 7) != 0 && len > 7) { - if (subyte(uaddr, 0)) - return (_len); - uaddr++; - len--; - } - - /* zero 8 bytes at a time */ - while (len > 7) { -#ifdef __LP64__ - if (suword64(uaddr, 0)) - return (_len); -#else - if (suword32(uaddr, 0)) - return (_len); - if (suword32(uaddr + 4, 0)) - return (_len); -#endif - uaddr += 8; - len -= 8; - } - - /* zero fill end, if any */ - while (len > 0) { - if (subyte(uaddr, 0)) - return (_len); - uaddr++; - len--; - } - return (0); -} - -int -linux_access_ok(const void *uaddr, size_t len) -{ - uintptr_t saddr; - uintptr_t eaddr; - - /* get start and end address */ - saddr = (uintptr_t)uaddr; - eaddr = (uintptr_t)uaddr + len; - - /* verify addresses are valid for userspace */ - return ((saddr == eaddr) || - (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); -} - -/* - * This function should return either EINTR or ERESTART depending on - * the signal type sent to this thread: - */ -static int -linux_get_error(struct task_struct *task, int error) -{ - /* check for signal type interrupt code */ - if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { - error = -linux_schedule_get_interrupt_value(task); - if (error == 0) - error = EINTR; - } - return (error); -} - -static int -linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, - const struct file_operations *fop, u_long cmd, caddr_t data, - struct thread *td) -{ - struct task_struct *task = current; - unsigned size; - int error; - - size = IOCPARM_LEN(cmd); - /* refer to logic in sys_ioctl() */ - if (size > 0) { - /* - * Setup hint for linux_copyin() and linux_copyout(). - * - * Background: Linux code expects a user-space address - * while FreeBSD supplies a kernel-space address. - */ - task->bsd_ioctl_data = data; - task->bsd_ioctl_len = size; - data = (void *)LINUX_IOCTL_MIN_PTR; - } else { - /* fetch user-space pointer */ - data = *(void **)data; - } -#if defined(__amd64__) - if (td->td_proc->p_elf_machine == EM_386) { *** 1651 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2B305EE0A4; Fri, 23 Apr 2021 11:14: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 4FRWsM4NYYz4X4b; Fri, 23 Apr 2021 11:14: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 68419458A; Fri, 23 Apr 2021 11:14: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 13NBElDY012826; Fri, 23 Apr 2021 11:14:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBElff012825; Fri, 23 Apr 2021 11:14:47 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:47 GMT Message-Id: <202104231114.13NBElff012825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1bcab3da2bb1 - stable/13 - rtld_lock.h: remove tautological extern's 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bcab3da2bb1c13ab3d4f128d40eb88def5813df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:48 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1bcab3da2bb1c13ab3d4f128d40eb88def5813df commit 1bcab3da2bb1c13ab3d4f128d40eb88def5813df Author: Konstantin Belousov AuthorDate: 2021-04-05 04:11:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 rtld_lock.h: remove tautological extern's (cherry picked from commit 38e0610df7d5cd5ddd43a477c139ec6ce342c5c2) --- libexec/rtld-elf/rtld_lock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index 339028c568dc..cc1fd83169f8 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -46,9 +46,9 @@ struct RtldLockInfo void (*at_fork)(void); }; -extern void _rtld_thread_init(struct RtldLockInfo *) __exported; -extern void _rtld_atfork_pre(int *) __exported; -extern void _rtld_atfork_post(int *) __exported; +void _rtld_thread_init(struct RtldLockInfo *) __exported; +void _rtld_atfork_pre(int *) __exported; +void _rtld_atfork_post(int *) __exported; #ifdef IN_RTLD From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D8045EDE56; Fri, 23 Apr 2021 11:14: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 4FRWsN6FwKz4Wrf; Fri, 23 Apr 2021 11:14: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 8B4523DDA; Fri, 23 Apr 2021 11:14: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 13NBEmuP012847; Fri, 23 Apr 2021 11:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEm59012846; Fri, 23 Apr 2021 11:14:48 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:48 GMT Message-Id: <202104231114.13NBEm59012846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d252df1e1154 - stable/13 - rtld/x86/reloc.c: style 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/stable/13 X-Git-Reftype: branch X-Git-Commit: d252df1e1154bca19cc52470d71d1002895a5521 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:49 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d252df1e1154bca19cc52470d71d1002895a5521 commit d252df1e1154bca19cc52470d71d1002895a5521 Author: Konstantin Belousov AuthorDate: 2021-04-07 06:12:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 rtld/x86/reloc.c: style (cherry picked from commit f61ecf60cfce6172df803a9e5e099aab2d4aedcd) --- libexec/rtld-elf/amd64/reloc.c | 3 ++- libexec/rtld-elf/i386/reloc.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 00e538d4b647..309e105d8b5e 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -538,7 +538,8 @@ allocate_initial_tls(Obj_Entry *objs) sysarch(AMD64_SET_FSBASE, &addr); } -void *__tls_get_addr(tls_index *ti) +void * +__tls_get_addr(tls_index *ti) { Elf_Addr** segbase; diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 7f8ecfa40f8f..5ed3abf65b31 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -519,7 +519,8 @@ allocate_initial_tls(Obj_Entry *objs) /* GNU ABI */ __attribute__((__regparm__(1))) -void *___tls_get_addr(tls_index *ti) +void * +___tls_get_addr(tls_index *ti) { Elf_Addr** segbase; @@ -529,7 +530,8 @@ void *___tls_get_addr(tls_index *ti) } /* Sun ABI */ -void *__tls_get_addr(tls_index *ti) +void * +__tls_get_addr(tls_index *ti) { Elf_Addr** segbase; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 919A75EE04F; Fri, 23 Apr 2021 11:14: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 4FRWsV301mz4Wwy; Fri, 23 Apr 2021 11:14: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 447263DDB; Fri, 23 Apr 2021 11:14: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 13NBEs7Z012960; Fri, 23 Apr 2021 11:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEslw012959; Fri, 23 Apr 2021 11:14:54 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:54 GMT Message-Id: <202104231114.13NBEslw012959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 41331ef7f618 - stable/13 - libc: add _get_tp() private function 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 41331ef7f618e15732b84f960cc236e70e38e253 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:54 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=41331ef7f618e15732b84f960cc236e70e38e253 commit 41331ef7f618e15732b84f960cc236e70e38e253 Author: Konstantin Belousov AuthorDate: 2021-04-05 03:30:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 libc: add _get_tp() private function (cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac) --- lib/libc/aarch64/gen/Makefile.inc | 1 + lib/libc/aarch64/gen/_get_tp.c | 45 +++++++++++++++ lib/libc/amd64/gen/Makefile.inc | 2 +- lib/libc/amd64/gen/_get_tp.c | 46 ++++++++++++++++ lib/libc/arm/gen/Makefile.inc | 1 + lib/libc/arm/gen/_get_tp.c | 51 +++++++++++++++++ lib/libc/i386/gen/Makefile.inc | 2 +- lib/libc/i386/gen/_get_tp.c | 45 +++++++++++++++ lib/libc/include/libc_private.h | 3 +- lib/libc/mips/gen/Makefile.inc | 2 +- lib/libc/mips/gen/_get_tp.c | 103 +++++++++++++++++++++++++++++++++++ lib/libc/powerpc/gen/Makefile.common | 4 +- lib/libc/powerpc/gen/_get_tp.c | 47 ++++++++++++++++ lib/libc/powerpc64/gen/Makefile.inc | 3 +- lib/libc/powerpc64/gen/_get_tp.c | 47 ++++++++++++++++ lib/libc/riscv/gen/Makefile.inc | 3 + lib/libc/riscv/gen/_get_tp.c | 47 ++++++++++++++++ 17 files changed, 446 insertions(+), 6 deletions(-) diff --git a/lib/libc/aarch64/gen/Makefile.inc b/lib/libc/aarch64/gen/Makefile.inc index fe39136f5b41..7c530b93b4e4 100644 --- a/lib/libc/aarch64/gen/Makefile.inc +++ b/lib/libc/aarch64/gen/Makefile.inc @@ -7,6 +7,7 @@ SRCS+= _ctx_start.S \ flt_rounds.c \ fpgetmask.c \ fpsetmask.c \ + _get_tp.c \ infinity.c \ ldexp.c \ makecontext.c \ diff --git a/lib/libc/aarch64/gen/_get_tp.c b/lib/libc/aarch64/gen/_get_tp.c new file mode 100644 index 000000000000..ce51b400b542 --- /dev/null +++ b/lib/libc/aarch64/gen/_get_tp.c @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +void * +_get_tp(void) +{ + void *res; + + __asm __volatile("mrs %0, tpidr_el0" : "=r" (res)); + return (res); +} diff --git a/lib/libc/amd64/gen/Makefile.inc b/lib/libc/amd64/gen/Makefile.inc index 30fb05f89cb7..4df3c044493e 100644 --- a/lib/libc/amd64/gen/Makefile.inc +++ b/lib/libc/amd64/gen/Makefile.inc @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -SRCS+= _setjmp.S _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ +SRCS+= _setjmp.S _get_tp.c _set_tp.c rfork_thread.S setjmp.S sigsetjmp.S \ fabs.S \ infinity.c ldexp.c makecontext.c signalcontext.c \ flt_rounds.c fpgetmask.c fpsetmask.c fpgetprec.c fpsetprec.c \ diff --git a/lib/libc/amd64/gen/_get_tp.c b/lib/libc/amd64/gen/_get_tp.c new file mode 100644 index 000000000000..3c74b9e769c1 --- /dev/null +++ b/lib/libc/amd64/gen/_get_tp.c @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +void * +_get_tp(void) +{ + void **res; + + /* This function is used by rtld, avoid ifuncs. */ + __asm __volatile("movq %%fs:0, %0" : "=r" (res)); + return (&res[1]); +} diff --git a/lib/libc/arm/gen/Makefile.inc b/lib/libc/arm/gen/Makefile.inc index 6cc9b69d2b0e..35aa465e4904 100644 --- a/lib/libc/arm/gen/Makefile.inc +++ b/lib/libc/arm/gen/Makefile.inc @@ -4,6 +4,7 @@ SRCS+= \ __aeabi_read_tp.S \ _ctx_start.S \ + _get_tp.c \ _set_tp.c \ _setjmp.S \ alloca.S \ diff --git a/lib/libc/arm/gen/_get_tp.c b/lib/libc/arm/gen/_get_tp.c new file mode 100644 index 000000000000..7e0285f7d6f2 --- /dev/null +++ b/lib/libc/arm/gen/_get_tp.c @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include "libc_private.h" + +void * +_get_tp(void) +{ + void *res; + +#ifdef ARM_TP_ADDRESS + res = (void *)ARM_TP_ADDRESS +#else + __asm __volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (res)); +#endif + return (res); +} diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc index 45e69cad1d0f..bad73852f6eb 100644 --- a/lib/libc/i386/gen/Makefile.inc +++ b/lib/libc/i386/gen/Makefile.inc @@ -1,6 +1,6 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -SRCS+= _ctx_start.S _setjmp.S _set_tp.c fabs.S \ +SRCS+= _ctx_start.S _setjmp.S _set_tp.c _get_tp.c fabs.S \ flt_rounds.c infinity.c ldexp.c makecontext.c \ rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S diff --git a/lib/libc/i386/gen/_get_tp.c b/lib/libc/i386/gen/_get_tp.c new file mode 100644 index 000000000000..f96695247928 --- /dev/null +++ b/lib/libc/i386/gen/_get_tp.c @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +void * +_get_tp(void) +{ + void **res; + + __asm __volatile("movl %%gs:0, %0" : "=r" (res)); + return (&res[1]); +} diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 363e1057986b..5a524c0211d1 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -261,8 +261,9 @@ void _init_tls(void); int _once(pthread_once_t *, void (*)(void)); /* - * Set the TLS thread pointer + * Get/set the TLS thread pointer */ +void *_get_tp(void); void _set_tp(void *tp); /* diff --git a/lib/libc/mips/gen/Makefile.inc b/lib/libc/mips/gen/Makefile.inc index 56fa380f7777..d2dc9b5f4bdb 100644 --- a/lib/libc/mips/gen/Makefile.inc +++ b/lib/libc/mips/gen/Makefile.inc @@ -6,6 +6,6 @@ SRCS+= infinity.c fabs.c ldexp.c flt_rounds.c # SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ # fpsetround.c fpsetsticky.c -SRCS+= _ctx_start.S _set_tp.c _setjmp.S makecontext.c \ +SRCS+= _ctx_start.S _get_tp.c _set_tp.c _setjmp.S makecontext.c \ setjmp.S signalcontext.c sigsetjmp.S \ trivial-getcontextx.c diff --git a/lib/libc/mips/gen/_get_tp.c b/lib/libc/mips/gen/_get_tp.c new file mode 100644 index 000000000000..45c5f8f35d42 --- /dev/null +++ b/lib/libc/mips/gen/_get_tp.c @@ -0,0 +1,103 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "libc_private.h" + +#ifdef __mips_n64 +static void * +_mips_get_tls(void) +{ + uint64_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips64r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=r" (_rv)); + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; + + return (void *)_rv; +} + +#else /* mips 32 */ + +static void * +_mips_get_tls(void) +{ + uint32_t _rv; + + __asm__ __volatile__ ( + ".set\tpush\n\t" + ".set\tmips32r2\n\t" + "rdhwr\t%0, $29\n\t" + ".set\tpop" + : "=r" (_rv)); + /* + * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' + * + * Remove the offset since this really a request to get the TLS + * pointer via sysarch() (in theory). Of course, this may go away + * once the TLS code is rewritten. + */ + _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; + + return (void *)_rv; +} +#endif /* ! __mips_n64 */ + +void * +_get_tp(void) +{ + void *res; + +#ifdef TLS_USE_SYSARCH + sysarch(MIPS_GET_TLS, &res); +#else + res = _mips_get_tls(); +#endif + return (res); +} diff --git a/lib/libc/powerpc/gen/Makefile.common b/lib/libc/powerpc/gen/Makefile.common index 4ba72799a5cf..b2f898c9faae 100644 --- a/lib/libc/powerpc/gen/Makefile.common +++ b/lib/libc/powerpc/gen/Makefile.common @@ -3,4 +3,6 @@ .PATH: ${LIBC_SRCTOP}/powerpc/gen SRCS += _ctx_start.S eabi.S infinity.c ldexp.c makecontext.c \ - signalcontext.c syncicache.c _set_tp.c trivial-getcontextx.c + signalcontext.c syncicache.c _get_tp.c _set_tp.c trivial-getcontextx.c + +CFLAGS._get_tp.c+= ${RTLD_HDRS} diff --git a/lib/libc/powerpc/gen/_get_tp.c b/lib/libc/powerpc/gen/_get_tp.c new file mode 100644 index 000000000000..0d08b707ff1a --- /dev/null +++ b/lib/libc/powerpc/gen/_get_tp.c @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" +#include "rtld.h" + +void * +_get_tp(void) +{ + Elf_Addr tp; + + __asm __volatile("mr %0,2" : "=r" (tp)); + return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE)); +} diff --git a/lib/libc/powerpc64/gen/Makefile.inc b/lib/libc/powerpc64/gen/Makefile.inc index 864fb9ede4f4..0e40aee2d11f 100644 --- a/lib/libc/powerpc64/gen/Makefile.inc +++ b/lib/libc/powerpc64/gen/Makefile.inc @@ -1,10 +1,11 @@ # $FreeBSD$ SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ - fpgetsticky.c fpsetmask.c fpsetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c _get_tp.c \ infinity.c ldexp.c makecontext.c _setjmp.S \ setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ _set_tp.c \ trivial-getcontextx.c +CFLAGS._get_tp.c+= ${RTLD_HDRS} diff --git a/lib/libc/powerpc64/gen/_get_tp.c b/lib/libc/powerpc64/gen/_get_tp.c new file mode 100644 index 000000000000..16f5c952276e --- /dev/null +++ b/lib/libc/powerpc64/gen/_get_tp.c @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" +#include "rtld.h" + +void * +_get_tp(void) +{ + Elf_Addr tp; + + __asm __volatile("mr %0,13" : "=r" (tp)); + return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE)); +} diff --git a/lib/libc/riscv/gen/Makefile.inc b/lib/libc/riscv/gen/Makefile.inc index f13800829d7f..1c1a90bda730 100644 --- a/lib/libc/riscv/gen/Makefile.inc +++ b/lib/libc/riscv/gen/Makefile.inc @@ -5,6 +5,7 @@ SRCS+= _ctx_start.S \ flt_rounds.c \ fpgetmask.c \ fpsetmask.c \ + _get_tp.c \ infinity.c \ ldexp.c \ makecontext.c \ @@ -13,3 +14,5 @@ SRCS+= _ctx_start.S \ setjmp.S \ sigsetjmp.S \ trivial-getcontextx.c + +CFLAGS._get_tp.c+= ${RTLD_HDRS} diff --git a/lib/libc/riscv/gen/_get_tp.c b/lib/libc/riscv/gen/_get_tp.c new file mode 100644 index 000000000000..0477e3ab8ca9 --- /dev/null +++ b/lib/libc/riscv/gen/_get_tp.c @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" +#include "rtld.h" + +void * +_get_tp(void) +{ + Elf_Addr tp; + + __asm __volatile("mv %0, tp" : "=r" (tp)); + return ((void *)(tp - TLS_TP_OFFSET - TLS_TCB_SIZE)); +} From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 898435EDCE3; Fri, 23 Apr 2021 11:14: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 4FRWsT2rGwz4Wm0; Fri, 23 Apr 2021 11:14: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 2B70D458C; Fri, 23 Apr 2021 11:14: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 13NBEr8e012939; Fri, 23 Apr 2021 11:14:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEr9e012938; Fri, 23 Apr 2021 11:14:53 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:53 GMT Message-Id: <202104231114.13NBEr9e012938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4bcc2e90a093 - stable/13 - rtld: define TLS_DTV_OFFSET on all architectures 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4bcc2e90a09330711bcc32f1f6d100c5d7989152 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:53 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4bcc2e90a09330711bcc32f1f6d100c5d7989152 commit 4bcc2e90a09330711bcc32f1f6d100c5d7989152 Author: Konstantin Belousov AuthorDate: 2021-04-07 06:25:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld: define TLS_DTV_OFFSET on all architectures (cherry picked from commit 99c2ce7ef12f0852f25155d1d6718beccafbae0e) --- libexec/rtld-elf/aarch64/rtld_machdep.h | 2 ++ libexec/rtld-elf/amd64/rtld_machdep.h | 2 ++ libexec/rtld-elf/arm/rtld_machdep.h | 2 ++ libexec/rtld-elf/i386/rtld_machdep.h | 2 ++ libexec/rtld-elf/mips/rtld_machdep.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index 0824219c00c2..bdd5620867ba 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -93,4 +93,6 @@ extern void *__tls_get_addr(tls_index *ti); #define md_abi_variant_hook(x) +#define TLS_DTV_OFFSET 0 + #endif diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 86027a04788f..30c82dcb0625 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -73,6 +73,8 @@ void *__tls_get_addr(tls_index *ti) __exported; #define md_abi_variant_hook(x) +#define TLS_DTV_OFFSET 0 + size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_tls_offset(size_t prev_offset, size_t prev_size, size_t size, size_t align, size_t offset); diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index 57420c65593f..b333b1f153eb 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -86,4 +86,6 @@ extern void arm_abi_variant_hook(Elf_Auxinfo **); #define md_abi_variant_hook(x) #endif +#define TLS_DTV_OFFSET 0 + #endif diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index 5116f9707337..78154a1992d4 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -74,6 +74,8 @@ void *__tls_get_addr(tls_index *ti) __exported; #define md_abi_variant_hook(x) +#define TLS_DTV_OFFSET 0 + size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); size_t calculate_tls_offset(size_t prev_offset, size_t prev_size, size_t size, size_t align, size_t offset); diff --git a/libexec/rtld-elf/mips/rtld_machdep.h b/libexec/rtld-elf/mips/rtld_machdep.h index b1556c93c3d6..d2498dbb9aa4 100644 --- a/libexec/rtld-elf/mips/rtld_machdep.h +++ b/libexec/rtld-elf/mips/rtld_machdep.h @@ -80,4 +80,6 @@ extern void *__tls_get_addr(tls_index *ti); #define md_abi_variant_hook(x) +#define TLS_DTV_OFFSET 0 + #endif From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD0725EE200; Fri, 23 Apr 2021 11:14: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 4FRWsW46Cdz4Wx8; Fri, 23 Apr 2021 11:14: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 696D94158; Fri, 23 Apr 2021 11:14: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 13NBEtoi012983; Fri, 23 Apr 2021 11:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEtTm012982; Fri, 23 Apr 2021 11:14:55 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:55 GMT Message-Id: <202104231114.13NBEtTm012982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4959d4f3eaab - stable/13 - libc: implement __tls_get_addr() for static binaries 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4959d4f3eaab7e592657032a0b42b34c5d5c174b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:55 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4959d4f3eaab7e592657032a0b42b34c5d5c174b commit 4959d4f3eaab7e592657032a0b42b34c5d5c174b Author: Konstantin Belousov AuthorDate: 2021-04-05 03:29:47 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 libc: implement __tls_get_addr() for static binaries (cherry picked from commit ca46b5698e8ac38ab45d781d592700be59e7de97) --- lib/libc/gen/tls.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 2a64b5266f4a..69b87aea52bf 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -103,25 +103,32 @@ static size_t libc_tls_init_align; static void *libc_tls_init; #endif +void * +__libc_tls_get_addr(void *vti) +{ + Elf_Addr **dtvp, *dtv; + tls_index *ti; + + dtvp = _get_tp(); + dtv = *dtvp; + ti = vti; + return ((char *)(dtv[ti->ti_module + 1] + ti->ti_offset) + + TLS_DTV_OFFSET); +} + #ifdef __i386__ /* GNU ABI */ __attribute__((__regparm__(1))) void * -___libc_tls_get_addr(void *ti __unused) +___libc_tls_get_addr(void *vti) { - return (0); + return (__libc_tls_get_addr(vti)); } #endif -void * -__libc_tls_get_addr(void *ti __unused) -{ - return (0); -} - #ifndef PIC static void * From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37D675EE28D; Fri, 23 Apr 2021 11:15: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 4FRWsd4n85z4XDG; Fri, 23 Apr 2021 11:15: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 347DF44AA; Fri, 23 Apr 2021 11:15: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 13NBF1vL013104; Fri, 23 Apr 2021 11:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF1Pf013103; Fri, 23 Apr 2021 11:15:01 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:01 GMT Message-Id: <202104231115.13NBF1Pf013103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b26e7715b072 - stable/13 - rtld: use _get_tp() in __tls_get_addr() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b26e7715b072ad9c67c80e74d7b8e80de4159bee Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:02 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b26e7715b072ad9c67c80e74d7b8e80de4159bee commit b26e7715b072ad9c67c80e74d7b8e80de4159bee Author: Konstantin Belousov AuthorDate: 2021-04-07 03:49:28 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld: use _get_tp() in __tls_get_addr() (cherry picked from commit e8b9c508b7ae5be618ada089103468c400e465cd) --- libexec/rtld-elf/amd64/reloc.c | 7 ++-- libexec/rtld-elf/i386/reloc.c | 14 ++++---- libexec/rtld-elf/mips/reloc.c | 62 +++--------------------------------- libexec/rtld-elf/mips/rtld_machdep.h | 2 -- 4 files changed, 13 insertions(+), 72 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 309e105d8b5e..689b0d8635d4 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -541,11 +541,10 @@ allocate_initial_tls(Obj_Entry *objs) void * __tls_get_addr(tls_index *ti) { - Elf_Addr** segbase; + Elf_Addr **dtvp; - __asm __volatile("movq %%fs:0, %0" : "=r" (segbase)); - - return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); + dtvp = _get_tp(); + return (tls_get_addr_common(dtvp, ti->ti_module, ti->ti_offset)); } size_t diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 5ed3abf65b31..cab163b35e6a 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -522,22 +522,20 @@ __attribute__((__regparm__(1))) void * ___tls_get_addr(tls_index *ti) { - Elf_Addr** segbase; + Elf_Addr **dtvp; - __asm __volatile("movl %%gs:0, %0" : "=r" (segbase)); - - return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); + dtvp = _get_tp(); + return (tls_get_addr_common(dtvp, ti->ti_module, ti->ti_offset)); } /* Sun ABI */ void * __tls_get_addr(tls_index *ti) { - Elf_Addr** segbase; - - __asm __volatile("movl %%gs:0, %0" : "=r" (segbase)); + Elf_Addr **dtvp; - return tls_get_addr_common(&segbase[1], ti->ti_module, ti->ti_offset); + dtvp = _get_tp(); + return (tls_get_addr_common(dtvp, ti->ti_module, ti->ti_offset)); } size_t diff --git a/libexec/rtld-elf/mips/reloc.c b/libexec/rtld-elf/mips/reloc.c index 163f9a170872..44ecbd66a707 100644 --- a/libexec/rtld-elf/mips/reloc.c +++ b/libexec/rtld-elf/mips/reloc.c @@ -776,69 +776,15 @@ allocate_initial_tls(Obj_Entry *objs) sysarch(MIPS_SET_TLS, tls); } -#ifdef __mips_n64 -void * -_mips_get_tls(void) -{ - uint64_t _rv; - - __asm__ __volatile__ ( - ".set\tpush\n\t" - ".set\tmips64r2\n\t" - "rdhwr\t%0, $29\n\t" - ".set\tpop" - : "=r" (_rv)); - /* - * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' - * - * Remove the offset since this really a request to get the TLS - * pointer via sysarch() (in theory). Of course, this may go away - * once the TLS code is rewritten. - */ - _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; - - return (void *)_rv; -} - -#else /* mips 32 */ - -void * -_mips_get_tls(void) -{ - uint32_t _rv; - - __asm__ __volatile__ ( - ".set\tpush\n\t" - ".set\tmips32r2\n\t" - "rdhwr\t%0, $29\n\t" - ".set\tpop" - : "=r" (_rv)); - /* - * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' - * - * Remove the offset since this really a request to get the TLS - * pointer via sysarch() (in theory). Of course, this may go away - * once the TLS code is rewritten. - */ - _rv = _rv - TLS_TP_OFFSET - TLS_TCB_SIZE; - - return (void *)_rv; -} -#endif /* ! __mips_n64 */ - void * __tls_get_addr(tls_index* ti) { - Elf_Addr** tls; + Elf_Addr **tls; char *p; -#ifdef TLS_USE_SYSARCH - sysarch(MIPS_GET_TLS, &tls); -#else - tls = _mips_get_tls(); -#endif - - p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); + tls = _get_tp(); + p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset + + TLS_DTP_OFFSET); return (p); } diff --git a/libexec/rtld-elf/mips/rtld_machdep.h b/libexec/rtld-elf/mips/rtld_machdep.h index d2498dbb9aa4..041a5d05f9a7 100644 --- a/libexec/rtld-elf/mips/rtld_machdep.h +++ b/libexec/rtld-elf/mips/rtld_machdep.h @@ -44,8 +44,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, const Elf_Rel *rel); Elf_Addr _mips_rtld_bind(struct Struct_Obj_Entry *obj, Elf_Size reloff); -void *_mips_get_tls(void); - #define make_function_pointer(def, defobj) \ ((defobj)->relocbase + (def)->st_value) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D62A5EE1AC; Fri, 23 Apr 2021 11:15: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 4FRWsj6BBdz4XB1; Fri, 23 Apr 2021 11:15: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 9EF6340F3; Fri, 23 Apr 2021 11:15: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 13NBF5Tn013197; Fri, 23 Apr 2021 11:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF5mt013196; Fri, 23 Apr 2021 11:15:05 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:05 GMT Message-Id: <202104231115.13NBF5mt013196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 13e0ef823047 - stable/13 - rtld_lock.h: add some comments about versioning of struct RtldLockInfo 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 13e0ef823047491f8c246dd721ec22778c4d5384 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13e0ef823047491f8c246dd721ec22778c4d5384 commit 13e0ef823047491f8c246dd721ec22778c4d5384 Author: Konstantin Belousov AuthorDate: 2021-04-11 08:12:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 rtld_lock.h: add some comments about versioning of struct RtldLockInfo (cherry picked from commit 9b33518ada2ebda727ca3c7979cdcdb30716f737) --- libexec/rtld-elf/rtld_lock.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index fdbdc9917075..c88b558b72b8 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -35,9 +35,20 @@ #define MAX_RTLD_LOCKS 8 +/* + * This structure is part of the ABI between rtld and threading + * libraries, like libthr and even libc_r. Its layout is fixed and + * can be changed only by appending new fields at the end, with the + * bump of RTLI_VERSION. + */ struct RtldLockInfo { + /* + * Valid if the object calling _rtld_thread_init() exported + * symbol _pli_rtli_version. Otherwise assume RTLI_VERSION_ONE. + */ unsigned int rtli_version; + void *(*lock_create)(void); void (*lock_destroy)(void *); void (*rlock_acquire)(void *); @@ -46,6 +57,8 @@ struct RtldLockInfo int (*thread_set_flag)(int); int (*thread_clr_flag)(int); void (*at_fork)(void); + + /* Version 2 fields */ char *(*dlerror_loc)(void); int *(*dlerror_seen)(void); int dlerror_loc_sz; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 280035EE142; Fri, 23 Apr 2021 11:14: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 4FRWsX68Mrz4WxD; Fri, 23 Apr 2021 11:14: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 9652E40EF; Fri, 23 Apr 2021 11:14: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 13NBEuEV013010; Fri, 23 Apr 2021 11:14:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEung013009; Fri, 23 Apr 2021 11:14:56 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:56 GMT Message-Id: <202104231114.13NBEung013009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 17ef58221ccc - stable/13 - libc dl_iterate_phdr(): dlpi_tls_data is wrong 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 17ef58221ccc39072eea716d4d68b2f0335ef3b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:57 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=17ef58221ccc39072eea716d4d68b2f0335ef3b6 commit 17ef58221ccc39072eea716d4d68b2f0335ef3b6 Author: Konstantin Belousov AuthorDate: 2021-04-05 03:38:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 libc dl_iterate_phdr(): dlpi_tls_data is wrong (cherry picked from commit dbd2053026a6af28adb1aa32e27603ae0d4efea6) --- lib/libc/gen/dlfcn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 16afdb6bf5d1..337ad48fd691 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -196,8 +196,6 @@ dl_init_phdr_info(void) for (i = 0; i < phdr_info.dlpi_phnum; i++) { if (phdr_info.dlpi_phdr[i].p_type == PT_TLS) { phdr_info.dlpi_tls_modid = 1; - phdr_info.dlpi_tls_data = - (void*)phdr_info.dlpi_phdr[i].p_vaddr; } } phdr_info.dlpi_adds = 1; @@ -210,13 +208,17 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused, void *data __unused) { #ifndef IN_LIBDL + tls_index ti; int ret; __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (1); _once(&dl_phdr_info_once, dl_init_phdr_info); + ti.ti_module = 1; + ti.ti_offset = 0; mutex_lock(&dl_phdr_info_lock); + phdr_info.dlpi_tls_data = __tls_get_addr(&ti); ret = callback(&phdr_info, sizeof(phdr_info), data); mutex_unlock(&dl_phdr_info_lock); return (ret); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88A505EE0A2; Fri, 23 Apr 2021 11:14: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 4FRWsL4Xwsz4Wyn; Fri, 23 Apr 2021 11:14: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 465144589; Fri, 23 Apr 2021 11:14: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 13NBEkDC012805; Fri, 23 Apr 2021 11:14:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEkSR012804; Fri, 23 Apr 2021 11:14:46 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:46 GMT Message-Id: <202104231114.13NBEkSR012804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c3f97dd75a1c - stable/13 - rtld dl_iterate_phdr(): dlpi_tls_data is wrong 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c3f97dd75a1c294c4f60f42b604ee8bcda17be09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:47 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c3f97dd75a1c294c4f60f42b604ee8bcda17be09 commit c3f97dd75a1c294c4f60f42b604ee8bcda17be09 Author: Konstantin Belousov AuthorDate: 2021-04-05 03:05:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:06 +0000 rtld dl_iterate_phdr(): dlpi_tls_data is wrong (cherry picked from commit d36d6816151705907393889d661cbfd25c630ca8) --- lib/libc/gen/dl_iterate_phdr.3 | 7 +++++-- libexec/rtld-elf/Symbol.map | 1 + libexec/rtld-elf/rtld.1 | 7 +++++++ libexec/rtld-elf/rtld.c | 8 +++++++- sys/sys/param.h | 2 +- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/libc/gen/dl_iterate_phdr.3 b/lib/libc/gen/dl_iterate_phdr.3 index 6e952dc13b57..fe4face9eeb7 100644 --- a/lib/libc/gen/dl_iterate_phdr.3 +++ b/lib/libc/gen/dl_iterate_phdr.3 @@ -15,7 +15,7 @@ .\" .\" $OpenBSD: dl_iterate_phdr.3,v 1.3 2007/05/31 19:19:48 jmc Exp $ .\" $FreeBSD$ -.Dd October 9, 2014 +.Dd April 5, 2021 .Dt DL_ITERATE_PHDR 3 .Os .Sh NAME @@ -80,7 +80,10 @@ The counter of the object unloads performed by the dynamic linker. .It Fa dlpi_tls_modid The TLS index of the object. .It Fa dlpi_tls_data -A pointer to the initialization data for the object TLS segment. +A pointer to the calling thread' TLS data segment for this module, +if it was allocated, +.Dv NULL +otherwise. .El .Pp Future versions of diff --git a/libexec/rtld-elf/Symbol.map b/libexec/rtld-elf/Symbol.map index 13068c5626dc..0a9eac82cf05 100644 --- a/libexec/rtld-elf/Symbol.map +++ b/libexec/rtld-elf/Symbol.map @@ -34,4 +34,5 @@ FBSDprivate_1.0 { _r_debug_postinit; _rtld_version__FreeBSD_version; _rtld_version_laddr_offset; + _rtld_version_dlpi_tls_data; }; diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 10dd7986903a..47bdc028b22d 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -416,6 +416,13 @@ See Also it indicates the presence of .Va l_refname member of the structure. +.It Dv _rtld_version_dlpi_tls_data +The +.Va dlpi_tls_data +member of the structure +.Vt dl_phdr_info +contains the address of the module TLS segment for the calling thread, +and not the address of the initialization segment. .El .Sh FILES .Bl -tag -width ".Pa /var/run/ld-elf32.so.hints" -compact diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index b186bebbfefc..4749e3a50d72 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3889,13 +3889,16 @@ dlinfo(void *handle, int request, void *p) static void rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) { + tls_index ti; phdr_info->dlpi_addr = (Elf_Addr)obj->relocbase; phdr_info->dlpi_name = obj->path; phdr_info->dlpi_phdr = obj->phdr; phdr_info->dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); phdr_info->dlpi_tls_modid = obj->tlsindex; - phdr_info->dlpi_tls_data = obj->tlsinit; + ti.ti_module = obj->tlsindex; + ti.ti_offset = 0; + phdr_info->dlpi_tls_data = __tls_get_addr(&ti); phdr_info->dlpi_adds = obj_loads; phdr_info->dlpi_subs = obj_loads - obj_count; } @@ -5894,3 +5897,6 @@ int _rtld_version__FreeBSD_version = __FreeBSD_version; extern char _rtld_version_laddr_offset __exported; char _rtld_version_laddr_offset; + +extern char _rtld_version_dlpi_tls_data __exported; +char _rtld_version_dlpi_tls_data; diff --git a/sys/sys/param.h b/sys/sys/param.h index 28a1cf981a58..1930af51f7da 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 1300500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 566FF5EE129; Fri, 23 Apr 2021 11:14:50 +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 4FRWsP5rLQz4X00; Fri, 23 Apr 2021 11:14: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 A4BEA460C; Fri, 23 Apr 2021 11:14: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 13NBEnYH012870; Fri, 23 Apr 2021 11:14:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEnP9012869; Fri, 23 Apr 2021 11:14:49 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:49 GMT Message-Id: <202104231114.13NBEnP9012869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 520806c476b9 - stable/13 - rtld_lock.h: Expand scope for IN_RTLD to avoid some conflicts with libc 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 520806c476b9f628c2e8bfbc4c3835aeeec26c2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:50 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=520806c476b9f628c2e8bfbc4c3835aeeec26c2e commit 520806c476b9f628c2e8bfbc4c3835aeeec26c2e Author: Konstantin Belousov AuthorDate: 2021-04-05 04:12:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld_lock.h: Expand scope for IN_RTLD to avoid some conflicts with libc (cherry picked from commit 34ca6025ddfea9899024eb6e7617091c5bc5149a) --- libexec/rtld-elf/rtld_lock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index cc1fd83169f8..9aa769b1f7e6 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -46,10 +46,14 @@ struct RtldLockInfo void (*at_fork)(void); }; +#if defined(IN_RTLD) || defined(PTHREAD_KERNEL) + void _rtld_thread_init(struct RtldLockInfo *) __exported; void _rtld_atfork_pre(int *) __exported; void _rtld_atfork_post(int *) __exported; +#endif /* IN_RTLD || PTHREAD_KERNEL */ + #ifdef IN_RTLD struct rtld_lock; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8924C5EE19E; Fri, 23 Apr 2021 11:15: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 4FRWsg61cTz4X5J; Fri, 23 Apr 2021 11:15: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 791CF4159; Fri, 23 Apr 2021 11:15: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 13NBF3bo013150; Fri, 23 Apr 2021 11:15:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF3P0013149; Fri, 23 Apr 2021 11:15:03 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:03 GMT Message-Id: <202104231115.13NBF3P0013149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b75aa0eaf3de - stable/13 - rtld: workaround for broken ABI 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b75aa0eaf3de1343a349c867bfcff993188f9231 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:04 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b75aa0eaf3de1343a349c867bfcff993188f9231 commit b75aa0eaf3de1343a349c867bfcff993188f9231 Author: Konstantin Belousov AuthorDate: 2021-04-10 12:32:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 rtld: workaround for broken ABI (cherry picked from commit 08bfbd43594b7642de0d2487550f36b0ee1eceba) --- lib/libthr/pthread.map | 3 +++ lib/libthr/thread/thr_rtld.c | 8 ++++++++ libexec/rtld-elf/rtld_lock.c | 17 ++++++++++++++++- libexec/rtld-elf/rtld_lock.h | 4 +++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map index 232d65084ba9..15195ce0847b 100644 --- a/lib/libthr/pthread.map +++ b/lib/libthr/pthread.map @@ -296,6 +296,9 @@ FBSDprivate_1.0 { _thread_size_key; _thread_state_running; _thread_state_zoombie; + + /* ABI bug workaround, indicate that pli->rtli_version is valid */ + _pli_rtli_version; }; FBSD_1.1 { diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 291ca17e2068..5848fc6d5f61 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -182,6 +182,13 @@ _thr_rtld_clr_flag(int mask __unused) return (0); } +/* + * ABI bug workaround: This symbol must be present for rtld to accept + * RTLI_VERSION from RtldLockInfo + */ +extern char _pli_rtli_version; +char _pli_rtli_version; + void _thr_rtld_init(void) { @@ -205,6 +212,7 @@ _thr_rtld_init(void) mprotect(NULL, 0, 0); _rtld_get_stack_prot(); + li.rtli_version = RTLI_VERSION; li.lock_create = _thr_rtld_lock_create; li.lock_destroy = _thr_rtld_lock_destroy; li.rlock_acquire = _thr_rtld_rlock_acquire; diff --git a/libexec/rtld-elf/rtld_lock.c b/libexec/rtld-elf/rtld_lock.c index d94bd1a283e9..4d54c687ee6f 100644 --- a/libexec/rtld-elf/rtld_lock.c +++ b/libexec/rtld-elf/rtld_lock.c @@ -344,8 +344,23 @@ lockdflt_init(void) void _rtld_thread_init(struct RtldLockInfo *pli) { - int flags, i; + const Obj_Entry *obj; + SymLook req; void *locks[RTLD_LOCK_CNT]; + int flags, i, res; + + if (pli == NULL) { + lockinfo.rtli_version = RTLI_VERSION; + } else { + lockinfo.rtli_version = RTLI_VERSION_ONE; + obj = obj_from_addr(pli->lock_create); + if (obj != NULL) { + symlook_init(&req, "_pli_rtli_version"); + res = symlook_obj(&req, obj); + if (res == 0) + lockinfo.rtli_version = pli->rtli_version; + } + } /* disable all locking while this function is running */ flags = thread_mask_set(~0); diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index ecc733a06e44..7a61a1a525e2 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -30,7 +30,9 @@ #ifndef _RTLD_LOCK_H_ #define _RTLD_LOCK_H_ -#define RTLI_VERSION 0x01 +#define RTLI_VERSION_ONE 0x01 +#define RTLI_VERSION 0x01 + #define MAX_RTLD_LOCKS 8 struct RtldLockInfo From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E0C55EE191; Fri, 23 Apr 2021 11:14: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 4FRWsY6XYRz4X7H; Fri, 23 Apr 2021 11:14: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 C0797458D; Fri, 23 Apr 2021 11:14: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 13NBEvb7013032; Fri, 23 Apr 2021 11:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEvCN013031; Fri, 23 Apr 2021 11:14:57 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:57 GMT Message-Id: <202104231114.13NBEvCN013031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 127849157ab9 - stable/13 - rtld: style tls_get_addr_slow 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 127849157ab94c630533fdd7201422b36d3cf96f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:58 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=127849157ab94c630533fdd7201422b36d3cf96f commit 127849157ab94c630533fdd7201422b36d3cf96f Author: Konstantin Belousov AuthorDate: 2021-04-06 18:55:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld: style tls_get_addr_slow (cherry picked from commit 85d846b369f4d8c0033993d3d1307779d3b9aa62) --- libexec/rtld-elf/rtld.c | 54 ++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 4749e3a50d72..134c2566b4cd 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4855,35 +4855,35 @@ static void *tls_get_addr_slow(Elf_Addr **, int, size_t) __noinline; static void * tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) { - Elf_Addr *newdtv, *dtv; - RtldLockState lockstate; - int to_copy; + Elf_Addr *newdtv, *dtv; + RtldLockState lockstate; + int to_copy; - dtv = *dtvp; - /* Check dtv generation in case new modules have arrived */ - if (dtv[0] != tls_dtv_generation) { - wlock_acquire(rtld_bind_lock, &lockstate); - newdtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - to_copy = dtv[1]; - if (to_copy > tls_max_index) - to_copy = tls_max_index; - memcpy(&newdtv[2], &dtv[2], to_copy * sizeof(Elf_Addr)); - newdtv[0] = tls_dtv_generation; - newdtv[1] = tls_max_index; - free(dtv); - lock_release(rtld_bind_lock, &lockstate); - dtv = *dtvp = newdtv; - } + dtv = *dtvp; + /* Check dtv generation in case new modules have arrived */ + if (dtv[0] != tls_dtv_generation) { + wlock_acquire(rtld_bind_lock, &lockstate); + newdtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); + to_copy = dtv[1]; + if (to_copy > tls_max_index) + to_copy = tls_max_index; + memcpy(&newdtv[2], &dtv[2], to_copy * sizeof(Elf_Addr)); + newdtv[0] = tls_dtv_generation; + newdtv[1] = tls_max_index; + free(dtv); + lock_release(rtld_bind_lock, &lockstate); + dtv = *dtvp = newdtv; + } - /* Dynamically allocate module TLS if necessary */ - if (dtv[index + 1] == 0) { - /* Signal safe, wlock will block out signals. */ - wlock_acquire(rtld_bind_lock, &lockstate); - if (!dtv[index + 1]) - dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); - lock_release(rtld_bind_lock, &lockstate); - } - return ((void *)(dtv[index + 1] + offset)); + /* Dynamically allocate module TLS if necessary */ + if (dtv[index + 1] == 0) { + /* Signal safe, wlock will block out signals. */ + wlock_acquire(rtld_bind_lock, &lockstate); + if (!dtv[index + 1]) + dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); + lock_release(rtld_bind_lock, &lockstate); + } + return ((void *)(dtv[index + 1] + offset)); } void * From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34B375EE1CF; Fri, 23 Apr 2021 11:15: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 4FRWss1Pj8z4WyB; Fri, 23 Apr 2021 11:15:13 +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 7D24C4590; Fri, 23 Apr 2021 11:15: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 13NBFCDw013337; Fri, 23 Apr 2021 11:15:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFCaO013336; Fri, 23 Apr 2021 11:15:12 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:12 GMT Message-Id: <202104231115.13NBFCaO013336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ed6b9e2ff0b3 - stable/13 - ptrace: remove dead call to FIX_SSTEP() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed6b9e2ff0b31b748c9433121649ded190d734a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:14 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ed6b9e2ff0b31b748c9433121649ded190d734a8 commit ed6b9e2ff0b31b748c9433121649ded190d734a8 Author: Konstantin Belousov AuthorDate: 2021-04-11 09:02:34 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 ptrace: remove dead call to FIX_SSTEP() (cherry picked from commit 9d7e450b64f1e605c718fba0f357d49541c8147b) --- sys/kern/sys_process.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 3a184f1d678f..a63cf9a80834 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -784,13 +784,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) /* Keep this process around until we finish this request. */ _PHOLD(p); -#ifdef FIX_SSTEP - /* - * Single step fixup ala procfs - */ - FIX_SSTEP(td2); -#endif - /* * Actually do the requests */ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 723B85EE150; Fri, 23 Apr 2021 11:15: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 4FRWsh6jtsz4X7l; Fri, 23 Apr 2021 11:15: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 92D75450D; Fri, 23 Apr 2021 11:15: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 13NBF42D013173; Fri, 23 Apr 2021 11:15:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF4K4013172; Fri, 23 Apr 2021 11:15:04 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:04 GMT Message-Id: <202104231115.13NBF4K4013172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7bbfb5d95932 - stable/13 - rtld: make dlerror() thread-local 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7bbfb5d959329fe0c322c0b59c9268b75ddddace Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:05 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7bbfb5d959329fe0c322c0b59c9268b75ddddace commit 7bbfb5d959329fe0c322c0b59c9268b75ddddace Author: Konstantin Belousov AuthorDate: 2021-04-07 22:02:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 rtld: make dlerror() thread-local (cherry picked from commit 4d9128da54f8f8e2a29190ffb18880c4f116a205) --- lib/libthr/thread/thr_private.h | 4 ++++ lib/libthr/thread/thr_rtld.c | 21 +++++++++++++++++++++ libexec/rtld-elf/rtld.c | 38 ++++++++++++++++++++------------------ libexec/rtld-elf/rtld_lock.c | 33 +++++++++++++++++++++++++++++++++ libexec/rtld-elf/rtld_lock.h | 7 ++++++- 5 files changed, 84 insertions(+), 19 deletions(-) diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index a1258940a896..a5bbc5997d30 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -577,6 +577,10 @@ struct pthread { /* pthread_set/get_name_np */ char *name; + + /* rtld thread-local dlerror message and seen control */ + char dlerror_msg[512]; + int dlerror_seen; }; #define THR_SHOULD_GC(thrd) \ diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 5848fc6d5f61..1967ea14859d 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -189,6 +189,24 @@ _thr_rtld_clr_flag(int mask __unused) extern char _pli_rtli_version; char _pli_rtli_version; +static char * +_thr_dlerror_loc(void) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + return (curthread->dlerror_msg); +} + +static int * +_thr_dlerror_seen(void) +{ + struct pthread *curthread; + + curthread = _get_curthread(); + return (&curthread->dlerror_seen); +} + void _thr_rtld_init(void) { @@ -221,6 +239,9 @@ _thr_rtld_init(void) li.thread_set_flag = _thr_rtld_set_flag; li.thread_clr_flag = _thr_rtld_clr_flag; li.at_fork = NULL; + li.dlerror_loc = _thr_dlerror_loc; + li.dlerror_loc_sz = sizeof(curthread->dlerror_msg); + li.dlerror_seen = _thr_dlerror_seen; /* * Preresolve the symbols needed for the fork interposer. We diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5e99b8db8ff7..d50774868908 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -195,7 +195,6 @@ int __sys_openat(int, const char *, int, ...); /* * Data declarations. */ -static char *error_message; /* Message for dlerror(), or NULL */ struct r_debug r_debug __exported; /* for GDB; */ static bool libmap_disable; /* Disable libmap */ static bool ld_loadfltr; /* Immediate filters processing */ @@ -441,6 +440,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) assert(aux_info[AT_BASE] != NULL); init_rtld((caddr_t) aux_info[AT_BASE]->a_un.a_ptr, aux_info); + dlerror_dflt_init(); + __progname = obj_rtld.path; argv0 = argv[0] != NULL ? argv[0] : "(null)"; environ = env; @@ -919,14 +920,14 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff) void _rtld_error(const char *fmt, ...) { - static char buf[512]; - va_list ap; + va_list ap; - va_start(ap, fmt); - rtld_vsnprintf(buf, sizeof buf, fmt, ap); - error_message = buf; - va_end(ap); - LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, error_message); + va_start(ap, fmt); + rtld_vsnprintf(lockinfo.dlerror_loc(), lockinfo.dlerror_loc_sz, + fmt, ap); + va_end(ap); + *lockinfo.dlerror_seen() = 0; + LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, lockinfo.dlerror_loc()); } /* @@ -935,7 +936,7 @@ _rtld_error(const char *fmt, ...) static char * errmsg_save(void) { - return error_message == NULL ? NULL : xstrdup(error_message); + return (xstrdup(lockinfo.dlerror_loc())); } /* @@ -945,12 +946,12 @@ errmsg_save(void) static void errmsg_restore(char *saved_msg) { - if (saved_msg == NULL) - error_message = NULL; - else { - _rtld_error("%s", saved_msg); - free(saved_msg); - } + if (saved_msg == NULL) + _rtld_error(""); + else { + _rtld_error("%s", saved_msg); + free(saved_msg); + } } static const char * @@ -3369,9 +3370,10 @@ dlclose_locked(void *handle, RtldLockState *lockstate) char * dlerror(void) { - char *msg = error_message; - error_message = NULL; - return msg; + if (*(lockinfo.dlerror_seen()) != 0) + return (NULL); + *lockinfo.dlerror_seen() = 1; + return (lockinfo.dlerror_loc()); } /* diff --git a/libexec/rtld-elf/rtld_lock.c b/libexec/rtld-elf/rtld_lock.c index 4d54c687ee6f..94e931c2f760 100644 --- a/libexec/rtld-elf/rtld_lock.c +++ b/libexec/rtld-elf/rtld_lock.c @@ -59,6 +59,21 @@ void _rtld_thread_init(struct RtldLockInfo *) __exported; void _rtld_atfork_pre(int *) __exported; void _rtld_atfork_post(int *) __exported; +static char def_dlerror_msg[512]; +static int def_dlerror_seen_val; + +static char * +def_dlerror_loc(void) +{ + return (def_dlerror_msg); +} + +static int * +def_dlerror_seen(void) +{ + return (&def_dlerror_seen_val); +} + #define WAFLAG 0x1 /* A writer holds the lock */ #define RC_INCR 0x2 /* Adjusts count of readers desiring lock */ @@ -299,6 +314,14 @@ lock_restart_for_upgrade(RtldLockState *lockstate) } } +void +dlerror_dflt_init(void) +{ + lockinfo.dlerror_loc = def_dlerror_loc; + lockinfo.dlerror_loc_sz = sizeof(def_dlerror_msg); + lockinfo.dlerror_seen = def_dlerror_seen; +} + void lockdflt_init(void) { @@ -313,6 +336,9 @@ lockdflt_init(void) deflockinfo.thread_set_flag = def_thread_set_flag; deflockinfo.thread_clr_flag = def_thread_clr_flag; deflockinfo.at_fork = NULL; + deflockinfo.dlerror_loc = def_dlerror_loc; + deflockinfo.dlerror_loc_sz = sizeof(def_dlerror_msg); + deflockinfo.dlerror_seen = def_dlerror_seen; for (i = 0; i < RTLD_LOCK_CNT; i++) { rtld_locks[i].mask = (1 << i); @@ -404,6 +430,13 @@ _rtld_thread_init(struct RtldLockInfo *pli) lockinfo.thread_set_flag = pli->thread_set_flag; lockinfo.thread_clr_flag = pli->thread_clr_flag; lockinfo.at_fork = pli->at_fork; + if (lockinfo.rtli_version > RTLI_VERSION_ONE && pli != NULL) { + strlcpy(pli->dlerror_loc(), lockinfo.dlerror_loc(), + lockinfo.dlerror_loc_sz); + lockinfo.dlerror_loc = pli->dlerror_loc; + lockinfo.dlerror_loc_sz = pli->dlerror_loc_sz; + lockinfo.dlerror_seen = pli->dlerror_seen; + } /* restore thread locking state, this time with new locks */ thread_mask_clear(~0); diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index 7a61a1a525e2..fdbdc9917075 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -31,7 +31,7 @@ #define _RTLD_LOCK_H_ #define RTLI_VERSION_ONE 0x01 -#define RTLI_VERSION 0x01 +#define RTLI_VERSION 0x02 #define MAX_RTLD_LOCKS 8 @@ -46,6 +46,9 @@ struct RtldLockInfo int (*thread_set_flag)(int); int (*thread_clr_flag)(int); void (*at_fork)(void); + char *(*dlerror_loc)(void); + int *(*dlerror_seen)(void); + int dlerror_loc_sz; }; #if defined(IN_RTLD) || defined(PTHREAD_KERNEL) @@ -80,6 +83,8 @@ void lock_release(rtld_lock_t, RtldLockState *); void lock_upgrade(rtld_lock_t, RtldLockState *); void lock_restart_for_upgrade(RtldLockState *); +void dlerror_dflt_init(void); + #endif /* IN_RTLD */ #endif From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C4E55EDCE0; Fri, 23 Apr 2021 11:14:51 +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 4FRWsR1Sghz4Wrp; Fri, 23 Apr 2021 11:14:50 +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 D193940EE; Fri, 23 Apr 2021 11:14:50 +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 13NBEo9l012897; Fri, 23 Apr 2021 11:14:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEobW012896; Fri, 23 Apr 2021 11:14:50 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:50 GMT Message-Id: <202104231114.13NBEobW012896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 083df155ef5b - stable/13 - libc: constify dummy error message string for dlfcn 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 083df155ef5b6f718a04e21d7f47597b02d8b371 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:51 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=083df155ef5b6f718a04e21d7f47597b02d8b371 commit 083df155ef5b6f718a04e21d7f47597b02d8b371 Author: Konstantin Belousov AuthorDate: 2021-04-05 04:14:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 libc: constify dummy error message string for dlfcn (cherry picked from commit 93c14c55ec0da311dc09c1c8c1c7ecd5f2fae51a) --- lib/libc/gen/dlfcn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 395a6d9402e8..6047f7ddd4d7 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "reentrant.h" -static char sorry[] = "Service unavailable"; +static const char sorry[] = "Service unavailable"; void _rtld_thread_init(void *); void _rtld_atfork_pre(int *); @@ -91,7 +91,7 @@ char * dlerror(void) { - return (sorry); + return (__DECONST(char *, sorry)); } #pragma weak dllockinit From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92DE05EDCE2; Fri, 23 Apr 2021 11:14: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 4FRWsS2nTvz4X6x; Fri, 23 Apr 2021 11:14: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 02242468B; Fri, 23 Apr 2021 11:14: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 13NBEpYO012918; Fri, 23 Apr 2021 11:14:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEps5012917; Fri, 23 Apr 2021 11:14:51 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:51 GMT Message-Id: <202104231114.13NBEps5012917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 166b390bc586 - stable/13 - libc: include rtld.h into static implementations of rtld interface 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 166b390bc5869f5ac0f534291f49ff98e9291b42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:52 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=166b390bc5869f5ac0f534291f49ff98e9291b42 commit 166b390bc5869f5ac0f534291f49ff98e9291b42 Author: Konstantin Belousov AuthorDate: 2021-04-05 03:41:46 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 libc: include rtld.h into static implementations of rtld interface (cherry picked from commit 7f7489eba391a858b3930a34e7749d642b374c5c) --- lib/libc/Makefile | 8 +++++ lib/libc/gen/Makefile.inc | 3 ++ lib/libc/gen/dlfcn.c | 1 + lib/libc/gen/tls.c | 76 ++++++++++++++++++++++++----------------------- lib/libdl/Makefile | 7 +++++ 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index d93091530721..958270e6ddf5 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -68,6 +68,14 @@ LIBADD+= ssp_nonshared # Extras that live in either libc.a or libc_nonshared.a LIBC_NONSHARED_SRCS= +RTLD_ELF_DIR=${SRCTOP}/libexec/rtld-elf +.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/}) +RTLD_ARCH= ${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.else +RTLD_ARCH= ${MACHINE_CPUARCH} +.endif +RTLD_HDRS= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} + # Define (empty) variables so that make doesn't give substitution # errors if the included makefiles don't change these: MDSRCS= diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 0ab717600e56..aa9a4c0cbf67 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -172,6 +172,9 @@ SRCS+= __getosreldate.c \ CFLAGS.arc4random.c= -I${SRCTOP}/sys -I${SRCTOP}/sys/crypto/chacha20 +CFLAGS.dlfcn.c= ${RTLD_HDRS} +CFLAGS.tls.c= ${RTLD_HDRS} + .PATH: ${SRCTOP}/contrib/libc-pwcache SRCS+= pwcache.c pwcache.h diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 6047f7ddd4d7..16afdb6bf5d1 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include "un-namespace.h" +#include "rtld.h" #include "libc_private.h" #include "reentrant.h" diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 719391130827..2a64b5266f4a 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -41,6 +41,7 @@ #include #include +#include "rtld.h" #include "libc_private.h" #define tls_assert(cond) ((cond) ? (void) 0 : \ @@ -96,10 +97,10 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign); #ifndef PIC -static size_t tls_static_space; -static size_t tls_init_size; -static size_t tls_init_align; -static void *tls_init; +static size_t libc_tls_static_space; +static size_t libc_tls_init_size; +static size_t libc_tls_init_align; +static void *libc_tls_init; #endif #ifdef __i386__ @@ -124,7 +125,7 @@ __libc_tls_get_addr(void *ti __unused) #ifndef PIC static void * -malloc_aligned(size_t size, size_t align) +libc_malloc_aligned(size_t size, size_t align) { void *mem, *res; @@ -138,7 +139,7 @@ malloc_aligned(size_t size, size_t align) } static void -free_aligned(void *ptr) +libc_free_aligned(void *ptr) { void *mem; uintptr_t x; @@ -188,8 +189,6 @@ free_aligned(void *ptr) * [5] I'm not able to validate "values are biased" assertions. */ -#define TLS_TCB_SIZE (2 * sizeof(void *)) - /* * Return pointer to allocated TLS block */ @@ -201,12 +200,13 @@ get_tls_block_ptr(void *tcb, size_t tcbsize) /* Compute fragments sizes. */ extra_size = tcbsize - TLS_TCB_SIZE; #if defined(__aarch64__) || defined(__arm__) - post_size = roundup2(TLS_TCB_SIZE, tls_init_align) - TLS_TCB_SIZE; + post_size = roundup2(TLS_TCB_SIZE, libc_tls_init_align) - TLS_TCB_SIZE; #else post_size = 0; #endif tls_block_size = tcbsize + post_size; - pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + pre_size = roundup2(tls_block_size, libc_tls_init_align) - + tls_block_size; return ((char *)tcb - pre_size - extra_size); } @@ -225,7 +225,7 @@ __libc_free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) tls = (Elf_Addr **)tcb; dtv = tls[0]; __je_bootstrap_free(dtv); - free_aligned(get_tls_block_ptr(tcb, tcbsize)); + libc_free_aligned(get_tls_block_ptr(tcb, tcbsize)); } /* @@ -259,21 +259,22 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) return (oldtcb); tls_assert(tcbalign >= TLS_TCB_ALIGN); - maxalign = MAX(tcbalign, tls_init_align); + maxalign = MAX(tcbalign, libc_tls_init_align); /* Compute fragmets sizes. */ extra_size = tcbsize - TLS_TCB_SIZE; #if defined(__aarch64__) || defined(__arm__) - post_size = roundup2(TLS_TCB_SIZE, tls_init_align) - TLS_TCB_SIZE; + post_size = roundup2(TLS_TCB_SIZE, libc_tls_init_align) - TLS_TCB_SIZE; #else post_size = 0; #endif tls_block_size = tcbsize + post_size; - pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; - tls_block_size += pre_size + tls_static_space; + pre_size = roundup2(tls_block_size, libc_tls_init_align) - + tls_block_size; + tls_block_size += pre_size + libc_tls_static_space; /* Allocate whole TLS block */ - tls_block = malloc_aligned(tls_block_size, maxalign); + tls_block = libc_malloc_aligned(tls_block_size, maxalign); if (tls_block == NULL) { tls_msg("__libc_allocate_tls: Out of memory.\n"); abort(); @@ -285,7 +286,7 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) if (oldtcb != NULL) { memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), tls_block_size); - free_aligned(oldtcb); + libc_free_aligned(oldtcb); /* Adjust the DTV. */ dtv = tcb[0]; @@ -302,8 +303,8 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) dtv[1] = 1; /* Segments count. */ dtv[2] = (Elf_Addr)(tls + DTV_OFFSET); - if (tls_init_size > 0) - memcpy(tls, tls_init, tls_init_size); + if (libc_tls_init_size > 0) + memcpy(tls, libc_tls_init, libc_tls_init_size); } return (tcb); @@ -329,13 +330,13 @@ __libc_free_tls(void *tcb, size_t tcbsize __unused, size_t tcbalign) * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ - tcbalign = MAX(tcbalign, tls_init_align); - size = roundup2(tls_static_space, tcbalign); + tcbalign = MAX(tcbalign, libc_tls_init_align); + size = roundup2(libc_tls_static_space, tcbalign); dtv = ((Elf_Addr**)tcb)[1]; tlsend = (Elf_Addr) tcb; tlsstart = tlsend - size; - free_aligned((void*)tlsstart); + libc_free_aligned((void*)tlsstart); __je_bootstrap_free(dtv); } @@ -350,12 +351,12 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign) Elf_Addr *dtv; Elf_Addr segbase, oldsegbase; - tcbalign = MAX(tcbalign, tls_init_align); - size = roundup2(tls_static_space, tcbalign); + tcbalign = MAX(tcbalign, libc_tls_init_align); + size = roundup2(libc_tls_static_space, tcbalign); if (tcbsize < 2 * sizeof(Elf_Addr)) tcbsize = 2 * sizeof(Elf_Addr); - tls = malloc_aligned(size + tcbsize, tcbalign); + tls = libc_malloc_aligned(size + tcbsize, tcbalign); if (tls == NULL) { tls_msg("__libc_allocate_tls: Out of memory.\n"); abort(); @@ -373,16 +374,16 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign) dtv[0] = 1; dtv[1] = 1; - dtv[2] = segbase - tls_static_space; + dtv[2] = segbase - libc_tls_static_space; if (oldtls) { /* * Copy the static TLS block over whole. */ oldsegbase = (Elf_Addr) oldtls; - memcpy((void *)(segbase - tls_static_space), - (const void *)(oldsegbase - tls_static_space), - tls_static_space); + memcpy((void *)(segbase - libc_tls_static_space), + (const void *)(oldsegbase - libc_tls_static_space), + libc_tls_static_space); /* * We assume that this block was the one we created with @@ -390,10 +391,11 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign) */ _rtld_free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); } else { - memcpy((void *)(segbase - tls_static_space), - tls_init, tls_init_size); - memset((void *)(segbase - tls_static_space + tls_init_size), - 0, tls_static_space - tls_init_size); + memcpy((void *)(segbase - libc_tls_static_space), + libc_tls_init, libc_tls_init_size); + memset((void *)(segbase - libc_tls_static_space + + libc_tls_init_size), 0, + libc_tls_static_space - libc_tls_init_size); } return (void*) segbase; @@ -457,11 +459,11 @@ _init_tls(void) for (i = 0; (unsigned) i < phnum; i++) { if (phdr[i].p_type == PT_TLS) { - tls_static_space = roundup2(phdr[i].p_memsz, + libc_tls_static_space = roundup2(phdr[i].p_memsz, phdr[i].p_align); - tls_init_size = phdr[i].p_filesz; - tls_init_align = phdr[i].p_align; - tls_init = (void*) phdr[i].p_vaddr; + libc_tls_init_size = phdr[i].p_filesz; + libc_tls_init_align = phdr[i].p_align; + libc_tls_init = (void *)phdr[i].p_vaddr; break; } } diff --git a/lib/libdl/Makefile b/lib/libdl/Makefile index d91547352de4..c37449691e0b 100644 --- a/lib/libdl/Makefile +++ b/lib/libdl/Makefile @@ -6,6 +6,13 @@ SHLIB_MAJOR=1 .PATH: ${SRCTOP}/lib/libc/gen CFLAGS+=-I${SRCTOP}/lib/libc/include +RTLD_ELF_DIR=${SRCTOP}/libexec/rtld-elf +.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/}) +RTLD_ARCH= ${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.else +RTLD_ARCH= ${MACHINE_CPUARCH} +.endif +CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} CFLAGS+=-DIN_LIBDL LDFLAGS+=-Wl,-F,libc.so.7 VERSION_DEF=${SRCTOP}/lib/libc/Versions.def From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25E655EE316; Fri, 23 Apr 2021 11:15: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 4FRWst6LXPz4XDt; Fri, 23 Apr 2021 11:15: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 9F98D460D; Fri, 23 Apr 2021 11:15: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 13NBFDwa013364; Fri, 23 Apr 2021 11:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFDlS013363; Fri, 23 Apr 2021 11:15:13 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:13 GMT Message-Id: <202104231115.13NBFDlS013363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a635232c7614 - stable/13 - ptrace: restructure comments around reparenting on PT_DETACH 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a635232c76145209adeb2157c394a12cc6b8313e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:15 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a635232c76145209adeb2157c394a12cc6b8313e commit a635232c76145209adeb2157c394a12cc6b8313e Author: Konstantin Belousov AuthorDate: 2021-04-11 09:06:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 ptrace: restructure comments around reparenting on PT_DETACH (cherry picked from commit a091c353235e0ee97d2531e80d9d64e1648350f4) --- sys/kern/sys_process.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index a63cf9a80834..0b1305f49a93 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1005,14 +1005,16 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; case PT_DETACH: /* - * Reset the process parent. - * - * NB: This clears P_TRACED before reparenting + * Clear P_TRACED before reparenting * a detached process back to its original * parent. Otherwise the debugee will be set * as an orphan of the debugger. */ p->p_flag &= ~(P_TRACED | P_WAITED); + + /* + * Reset the process parent. + */ if (p->p_oppid != p->p_pptr->p_pid) { PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); @@ -1025,9 +1027,11 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) CTR3(KTR_PTRACE, "PT_DETACH: pid %d reparented to pid %d, sig %d", p->p_pid, pp->p_pid, data); - } else + } else { CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); + } + p->p_ptevents = 0; FOREACH_THREAD_IN_PROC(p, td3) { if ((td3->td_dbgflags & TDB_FSTP) != 0) { From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E5645EE388; Fri, 23 Apr 2021 11:15: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 4FRWsq380pz4X1D; Fri, 23 Apr 2021 11:15: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 2F63C458F; Fri, 23 Apr 2021 11:15: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 13NBFA5f013295; Fri, 23 Apr 2021 11:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFA18013294; Fri, 23 Apr 2021 11:15:10 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:10 GMT Message-Id: <202104231115.13NBFA18013294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f06f6654303a - stable/13 - x86: use x86_clear_dbregs() on fork 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f06f6654303acc8ac5957b01787582b5d1e26a0f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f06f6654303acc8ac5957b01787582b5d1e26a0f commit f06f6654303acc8ac5957b01787582b5d1e26a0f Author: Konstantin Belousov AuthorDate: 2021-04-09 23:20:55 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 x86: use x86_clear_dbregs() on fork (cherry picked from commit 290b0d123ae2136ad84b268cd1884b1624d1d37f) --- sys/amd64/amd64/vm_machdep.c | 7 +------ sys/i386/i386/vm_machdep.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 98d212dc8771..1acc5dc55c85 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -230,12 +230,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) copy_thread(td1, td2); /* Reset debug registers in the new process */ - pcb2->pcb_dr0 = 0; - pcb2->pcb_dr1 = 0; - pcb2->pcb_dr2 = 0; - pcb2->pcb_dr3 = 0; - pcb2->pcb_dr6 = 0; - pcb2->pcb_dr7 = 0; + x86_clear_dbregs(pcb2); /* Point mdproc and then copy over p1's contents */ mdp2 = &p2->p_md; diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index ed40ebe5d1c8..57377575b9bf 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -242,12 +242,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) copy_thread(td1, td2); /* Reset debug registers in the new process */ - pcb2->pcb_dr0 = 0; - pcb2->pcb_dr1 = 0; - pcb2->pcb_dr2 = 0; - pcb2->pcb_dr3 = 0; - pcb2->pcb_dr6 = 0; - pcb2->pcb_dr7 = 0; + x86_clear_dbregs(pcb2); /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A84C65EE324; Fri, 23 Apr 2021 11:15: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 4FRWsz6sj5z4XMH; Fri, 23 Apr 2021 11:15: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 51689415A; Fri, 23 Apr 2021 11:15: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 13NBFIeq013448; Fri, 23 Apr 2021 11:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFIrK013447; Fri, 23 Apr 2021 11:15:18 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:18 GMT Message-Id: <202104231115.13NBFIrK013447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 131336da4072 - stable/13 - pseudofs: limit writes to 1M 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 131336da407264e9876a69291a028b91e804df16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:20 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=131336da407264e9876a69291a028b91e804df16 commit 131336da407264e9876a69291a028b91e804df16 Author: Konstantin Belousov AuthorDate: 2021-04-13 19:48:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 pseudofs: limit writes to 1M (cherry picked from commit 5edf7227ec339f651c7328e63df323f6ef10345f) --- sys/fs/pseudofs/pseudofs_vnops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index e386ceba71f8..29bb1544e7ad 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -1102,6 +1102,9 @@ pfs_write(struct vop_write_args *va) if (pn->pn_fill == NULL) PFS_RETURN (EIO); + if (uio->uio_resid > PFS_MAXBUFSIZ) + PFS_RETURN (EIO); + /* * This is necessary because either process' privileges may * have changed since the open() call. From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:14:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 946755EE20A; Fri, 23 Apr 2021 11:14: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 4FRWsb19zrz4WxF; Fri, 23 Apr 2021 11:14: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 ED4FD40F0; Fri, 23 Apr 2021 11:14: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 13NBEwnQ013054; Fri, 23 Apr 2021 11:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBEw1e013053; Fri, 23 Apr 2021 11:14:58 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:58 GMT Message-Id: <202104231114.13NBEw1e013053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ab349605821f - stable/13 - rtld: allow to use tls_get_addr_slow() from context where rtld_bind_lock is locked 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ab349605821f7e2bfc609ed69faccd068b402cb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:14:59 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ab349605821f7e2bfc609ed69faccd068b402cb6 commit ab349605821f7e2bfc609ed69faccd068b402cb6 Author: Konstantin Belousov AuthorDate: 2021-04-06 18:56:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld: allow to use tls_get_addr_slow() from context where rtld_bind_lock is locked (cherry picked from commit 89508048424837ffdb32c8444dab02261711f77d) --- libexec/rtld-elf/rtld.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 134c2566b4cd..882aab4d76d8 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -166,6 +166,7 @@ static int symlook_list(SymLook *, const Objlist *, DoneList *); static int symlook_needed(SymLook *, const Needed_Entry *, DoneList *); static int symlook_obj1_sysv(SymLook *, const Obj_Entry *); static int symlook_obj1_gnu(SymLook *, const Obj_Entry *); +static void *tls_get_addr_slow(Elf_Addr **, int, size_t, bool) __noinline; static void trace_loaded_objects(Obj_Entry *); static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *, RtldLockState *lockstate); @@ -4851,9 +4852,8 @@ unref_dag(Obj_Entry *root) /* * Common code for MD __tls_get_addr(). */ -static void *tls_get_addr_slow(Elf_Addr **, int, size_t) __noinline; static void * -tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) +tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset, bool locked) { Elf_Addr *newdtv, *dtv; RtldLockState lockstate; @@ -4862,7 +4862,8 @@ tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) dtv = *dtvp; /* Check dtv generation in case new modules have arrived */ if (dtv[0] != tls_dtv_generation) { - wlock_acquire(rtld_bind_lock, &lockstate); + if (!locked) + wlock_acquire(rtld_bind_lock, &lockstate); newdtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); to_copy = dtv[1]; if (to_copy > tls_max_index) @@ -4871,17 +4872,20 @@ tls_get_addr_slow(Elf_Addr **dtvp, int index, size_t offset) newdtv[0] = tls_dtv_generation; newdtv[1] = tls_max_index; free(dtv); - lock_release(rtld_bind_lock, &lockstate); + if (!locked) + lock_release(rtld_bind_lock, &lockstate); dtv = *dtvp = newdtv; } /* Dynamically allocate module TLS if necessary */ if (dtv[index + 1] == 0) { /* Signal safe, wlock will block out signals. */ - wlock_acquire(rtld_bind_lock, &lockstate); + if (!locked) + wlock_acquire(rtld_bind_lock, &lockstate); if (!dtv[index + 1]) dtv[index + 1] = (Elf_Addr)allocate_module_tls(index); - lock_release(rtld_bind_lock, &lockstate); + if (!locked) + lock_release(rtld_bind_lock, &lockstate); } return ((void *)(dtv[index + 1] + offset)); } @@ -4896,7 +4900,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int index, size_t offset) if (__predict_true(dtv[0] == tls_dtv_generation && dtv[index + 1] != 0)) return ((void *)(dtv[index + 1] + offset)); - return (tls_get_addr_slow(dtvp, index, offset)); + return (tls_get_addr_slow(dtvp, index, offset, false)); } #if defined(__aarch64__) || defined(__arm__) || defined(__mips__) || \ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3FFC5EDE6A; Fri, 23 Apr 2021 11:15: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 4FRWsc3Tj4z4X9f; Fri, 23 Apr 2021 11:15: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 1BB4340F1; Fri, 23 Apr 2021 11:15: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 13NBEx15013075; Fri, 23 Apr 2021 11:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBExFb013074; Fri, 23 Apr 2021 11:14:59 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:14:59 GMT Message-Id: <202104231114.13NBExFb013074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e703bd6341a3 - stable/13 - rtld: avoid recursing on rtld_bind_lock for write 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/stable/13 X-Git-Reftype: branch X-Git-Commit: e703bd6341a34b1fb49642b7fbf2a1d1b9078e6e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:01 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e703bd6341a34b1fb49642b7fbf2a1d1b9078e6e commit e703bd6341a34b1fb49642b7fbf2a1d1b9078e6e Author: Konstantin Belousov AuthorDate: 2021-04-06 19:02:23 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:07 +0000 rtld: avoid recursing on rtld_bind_lock for write (cherry picked from commit 7cb32a0d03437f881169b1c55cce89cf70ed43dd) --- libexec/rtld-elf/rtld-libc/Makefile.inc | 2 ++ libexec/rtld-elf/rtld.c | 8 ++++---- libexec/rtld-elf/rtld.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index d682472c3cca..94d6cbb5b39f 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -67,6 +67,8 @@ _libc_other_objects+=syncicache abs _libc_other_objects+=syncicache .endif +_libc_other_objects+=_get_tp + # Extract all the .o files from libc_nossp_pic.a. This ensures that # we don't accidentally pull in the interposing table or similar by linking # directly against libc_nossp_pic.a diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 882aab4d76d8..69e096ad3e6e 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3890,16 +3890,16 @@ dlinfo(void *handle, int request, void *p) static void rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info) { - tls_index ti; + Elf_Addr **dtvp; phdr_info->dlpi_addr = (Elf_Addr)obj->relocbase; phdr_info->dlpi_name = obj->path; phdr_info->dlpi_phdr = obj->phdr; phdr_info->dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); phdr_info->dlpi_tls_modid = obj->tlsindex; - ti.ti_module = obj->tlsindex; - ti.ti_offset = 0; - phdr_info->dlpi_tls_data = __tls_get_addr(&ti); + dtvp = _get_tp(); + phdr_info->dlpi_tls_data = (char *)tls_get_addr_slow(dtvp, + obj->tlsindex, 0, true) + TLS_DTV_OFFSET; phdr_info->dlpi_adds = obj_loads; phdr_info->dlpi_subs = obj_loads - obj_count; } diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 85472826a4ec..6a2f62fc6189 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -401,6 +401,7 @@ bool allocate_tls_offset(Obj_Entry *obj); void free_tls_offset(Obj_Entry *obj); const Ver_Entry *fetch_ventry(const Obj_Entry *obj, unsigned long); int convert_prot(int elfflags); +void *_get_tp(void); /* libc implementation */ /* * MD function declarations. From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18B855EE0DF; Fri, 23 Apr 2021 11:15: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 4FRWsv432Mz4XDx; Fri, 23 Apr 2021 11:15:15 +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 BE19E460E; Fri, 23 Apr 2021 11:15: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 13NBFE1K013385; Fri, 23 Apr 2021 11:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFEgw013384; Fri, 23 Apr 2021 11:15:14 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:14 GMT Message-Id: <202104231115.13NBFEgw013384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8bffc9b49248 - stable/13 - link(2): correct descriptor name in AT_RESOLVE_BENEATH description 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8bffc9b49248a21a6b5943dc17f4fc47fc122fb0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:17 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8bffc9b49248a21a6b5943dc17f4fc47fc122fb0 commit 8bffc9b49248a21a6b5943dc17f4fc47fc122fb0 Author: Konstantin Belousov AuthorDate: 2021-03-30 21:56:28 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 link(2): correct descriptor name in AT_RESOLVE_BENEATH description (cherry picked from commit c78e124535febc6c0bc7c0756b42d6b845428d2e) --- lib/libc/sys/link.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index de0efd5e510f..bcf03f17f3bb 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -117,7 +117,7 @@ names a symbolic link, a new link for the target of the symbolic link is created. .It Dv AT_RESOLVE_BENEATH Only walk paths below the directory specified by the -.Ar fd +.Ar fd1 descriptor. See the description of the .Dv O_RESOLVE_BENEATH From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CBE05EE21F; Fri, 23 Apr 2021 11:15: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 4FRWsf5Z2wz4X9m; Fri, 23 Apr 2021 11:15: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 4F79940F2; Fri, 23 Apr 2021 11:15: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 13NBF27l013129; Fri, 23 Apr 2021 11:15:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF2px013128; Fri, 23 Apr 2021 11:15:02 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:02 GMT Message-Id: <202104231115.13NBF2px013128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fe86eb8f346e - stable/13 - rtld: unstaticise lockinfo and obj_from_addr() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: fe86eb8f346eb6706833bf34d5837ef68a40f887 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:03 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fe86eb8f346eb6706833bf34d5837ef68a40f887 commit fe86eb8f346eb6706833bf34d5837ef68a40f887 Author: Konstantin Belousov AuthorDate: 2021-04-10 12:30:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 rtld: unstaticise lockinfo and obj_from_addr() (cherry picked from commit 4d7f08c84bcfcd75ba23b06e07a8e5dba1d4a44f) --- libexec/rtld-elf/rtld.c | 3 +-- libexec/rtld-elf/rtld.h | 1 + libexec/rtld-elf/rtld_lock.c | 2 +- libexec/rtld-elf/rtld_lock.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 69e096ad3e6e..5e99b8db8ff7 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -124,7 +124,6 @@ static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); static int obj_disable_relro(Obj_Entry *); static int obj_enforce_relro(Obj_Entry *); -static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); static void objlist_call_init(Objlist *, RtldLockState *); static void objlist_clear(Objlist *); @@ -2668,7 +2667,7 @@ errp: return (NULL); } -static Obj_Entry * +Obj_Entry * obj_from_addr(const void *addr) { Obj_Entry *obj; diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 6a2f62fc6189..060b83b2cdad 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -389,6 +389,7 @@ Obj_Entry *globallist_curr(const Obj_Entry *obj); Obj_Entry *globallist_next(const Obj_Entry *obj); void obj_free(Obj_Entry *); Obj_Entry *obj_new(void); +Obj_Entry *obj_from_addr(const void *); void _rtld_bind_start(void); void *rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def); void symlook_init(SymLook *, const char *); diff --git a/libexec/rtld-elf/rtld_lock.c b/libexec/rtld-elf/rtld_lock.c index c453584b96e2..d94bd1a283e9 100644 --- a/libexec/rtld-elf/rtld_lock.c +++ b/libexec/rtld-elf/rtld_lock.c @@ -192,7 +192,7 @@ def_thread_clr_flag(int mask) /* * Public interface exposed to the rest of the dynamic linker. */ -static struct RtldLockInfo lockinfo; +struct RtldLockInfo lockinfo; static struct RtldLockInfo deflockinfo; static __inline int diff --git a/libexec/rtld-elf/rtld_lock.h b/libexec/rtld-elf/rtld_lock.h index 9aa769b1f7e6..ecc733a06e44 100644 --- a/libexec/rtld-elf/rtld_lock.h +++ b/libexec/rtld-elf/rtld_lock.h @@ -63,6 +63,8 @@ extern rtld_lock_t rtld_bind_lock; extern rtld_lock_t rtld_libc_lock; extern rtld_lock_t rtld_phdr_lock; +extern struct RtldLockInfo lockinfo; + #define RTLD_LOCK_UNLOCKED 0 #define RTLD_LOCK_RLOCKED 1 #define RTLD_LOCK_WLOCKED 2 From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AE005EE389; Fri, 23 Apr 2021 11:15: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 4FRWsr0mmdz4X1J; Fri, 23 Apr 2021 11:15: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 58A0344AB; Fri, 23 Apr 2021 11:15: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 13NBFBdL013316; Fri, 23 Apr 2021 11:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFBXG013315; Fri, 23 Apr 2021 11:15:11 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:11 GMT Message-Id: <202104231115.13NBFBXG013315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6c74b122953d - stable/13 - amd64 linux64: use x86_clear_dbregs() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6c74b122953d6981278c2061bc1b60d1d764c020 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6c74b122953d6981278c2061bc1b60d1d764c020 commit 6c74b122953d6981278c2061bc1b60d1d764c020 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 amd64 linux64: use x86_clear_dbregs() (cherry picked from commit 2f1588474768f61f3a983af207e753bd0340a9e7) --- sys/amd64/linux/linux_sysvec.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index abc750c63682..252579a4809e 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -477,27 +477,7 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - clear_pcb_flags(pcb, PCB_DBREGS); - } + x86_clear_dbregs(pcb); /* * Drop the FP state if we hold it, so that the process gets a From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D207C5EE17B; Fri, 23 Apr 2021 11:15: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 4FRWsx135Wz4XGQ; Fri, 23 Apr 2021 11:15: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 E9D2940F5; Fri, 23 Apr 2021 11:15: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 13NBFFFC013406; Fri, 23 Apr 2021 11:15:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFFwh013405; Fri, 23 Apr 2021 11:15:15 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:15 GMT Message-Id: <202104231115.13NBFFwh013405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7f4d5d3cb4ef - stable/13 - nfs client: depend on xdr 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f4d5d3cb4ef368f7b3e022ac72d3f9b239b552b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:18 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7f4d5d3cb4ef368f7b3e022ac72d3f9b239b552b commit 7f4d5d3cb4ef368f7b3e022ac72d3f9b239b552b Author: Konstantin Belousov AuthorDate: 2021-04-13 11:47:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 nfs client: depend on xdr (cherry picked from commit 8cca7b7f28feaf0c5e2dfedb985ae334a4013ef6) --- sys/fs/nfsclient/nfs_clvfsops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 365b1c387cc2..08a25c6fe632 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -155,6 +155,7 @@ MODULE_VERSION(nfs, 1); MODULE_DEPEND(nfs, nfscommon, 1, 1, 1); MODULE_DEPEND(nfs, krpc, 1, 1, 1); MODULE_DEPEND(nfs, nfssvc, 1, 1, 1); +MODULE_DEPEND(nfs, xdr, 1, 1, 1); /* * This structure is now defined in sys/nfs/nfs_diskless.c so that it From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C87B5EE2CA; Fri, 23 Apr 2021 11:15: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 4FRWt4516Cz4XC3; Fri, 23 Apr 2021 11:15: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 D478D415C; Fri, 23 Apr 2021 11:15: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 13NBFM6l013538; Fri, 23 Apr 2021 11:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFMGj013537; Fri, 23 Apr 2021 11:15:22 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:22 GMT Message-Id: <202104231115.13NBFMGj013537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a753730ca0aa - stable/13 - Stop arming kqueue timers on knote owner suspend or terminate 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a753730ca0aae7b540ff8fbb24197b4e159b40fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:25 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a753730ca0aae7b540ff8fbb24197b4e159b40fa commit a753730ca0aae7b540ff8fbb24197b4e159b40fa Author: Konstantin Belousov AuthorDate: 2021-03-05 23:29:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 Stop arming kqueue timers on knote owner suspend or terminate (cherry picked from commit 2fd1ffefaa4d2cd99a19f866a949cb2cd58ef998) --- sys/kern/init_main.c | 1 + sys/kern/kern_event.c | 60 ++++++++++++++++++++++++++++++++++++++++++++------ sys/kern/kern_fork.c | 1 + sys/kern/kern_sig.c | 1 + sys/kern/sys_process.c | 1 + sys/sys/proc.h | 4 ++++ 6 files changed, 61 insertions(+), 7 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 5eb8186c23ca..e46f8f74c83d 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -524,6 +524,7 @@ proc0_init(void *dummy __unused) callout_init_mtx(&p->p_itcallout, &p->p_mtx, 0); callout_init_mtx(&p->p_limco, &p->p_mtx, 0); callout_init(&td->td_slpcallout, 1); + TAILQ_INIT(&p->p_kqtim_stop); /* Create credentials. */ newcred = crget(); diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 5e9f1fc35dfe..31b091e20984 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -676,8 +676,10 @@ timer2sbintime(int64_t data, int flags) struct kq_timer_cb_data { struct callout c; + struct proc *p; struct knote *kn; int cpuid; + TAILQ_ENTRY(kq_timer_cb_data) link; sbintime_t next; /* next timer event fires at */ sbintime_t to; /* precalculated timer period, 0 for abs */ }; @@ -689,22 +691,65 @@ kqtimer_sched_callout(struct kq_timer_cb_data *kc) kc->cpuid, C_ABSOLUTE); } +void +kqtimer_proc_continue(struct proc *p) +{ + struct kq_timer_cb_data *kc, *kc1; + struct bintime bt; + sbintime_t now; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + getboottimebin(&bt); + now = bttosbt(bt); + + TAILQ_FOREACH_SAFE(kc, &p->p_kqtim_stop, link, kc1) { + TAILQ_REMOVE(&p->p_kqtim_stop, kc, link); + if (kc->next <= now) + filt_timerexpire(kc->kn); + else + kqtimer_sched_callout(kc); + } +} + static void filt_timerexpire(void *knx) { struct knote *kn; struct kq_timer_cb_data *kc; + struct proc *p; + sbintime_t now; kn = knx; - kn->kn_data++; - KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ - - if ((kn->kn_flags & EV_ONESHOT) != 0) - return; kc = kn->kn_ptr.p_v; - if (kc->to == 0) + + if ((kn->kn_flags & EV_ONESHOT) != 0 || kc->to == 0) { + kn->kn_data++; + KNOTE_ACTIVATE(kn, 0); return; - kc->next += kc->to; + } + + for (now = sbinuptime(); kc->next <= now; kc->next += kc->to) + kn->kn_data++; + KNOTE_ACTIVATE(kn, 0); /* XXX - handle locking */ + + /* + * Initial check for stopped kc->p is racy. It is fine to + * miss the set of the stop flags, at worst we would schedule + * one more callout. On the other hand, it is not fine to not + * schedule when we we missed clearing of the flags, we + * recheck them under the lock and observe consistent state. + */ + p = kc->p; + if (P_SHOULDSTOP(p) || P_KILLED(p)) { + PROC_LOCK(p); + if (P_SHOULDSTOP(p) || P_KILLED(p)) { + TAILQ_INSERT_TAIL(&p->p_kqtim_stop, kc, link); + PROC_UNLOCK(p); + return; + } + PROC_UNLOCK(p); + } kqtimer_sched_callout(kc); } @@ -762,6 +807,7 @@ filt_timerattach(struct knote *kn) kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ kn->kn_ptr.p_v = kc = malloc(sizeof(*kc), M_KQUEUE, M_WAITOK); kc->kn = kn; + kc->p = curproc; kc->cpuid = PCPU_GET(cpuid); callout_init(&kc->c, 1); filt_timerstart(kn, to); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 3da8205d8ab0..2a092b192878 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -606,6 +606,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * LIST_INIT(&p2->p_orphans); callout_init_mtx(&p2->p_itcallout, &p2->p_mtx, 0); + TAILQ_INIT(&p2->p_kqtim_stop); /* * This begins the section where we must prevent the parent diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 212b4997dd5e..46b520030dcd 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2424,6 +2424,7 @@ runfast: PROC_SUNLOCK(p); out_cont: itimer_proc_continue(p); + kqtimer_proc_continue(p); out: /* If we jump here, proc slock should not be owned. */ PROC_SLOCK_ASSERT(p, MA_NOTOWNED); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index f00aa57c95d2..c4dfc2def72a 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1092,6 +1092,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) thread_unsuspend(p); PROC_SUNLOCK(p); itimer_proc_continue(p); + kqtimer_proc_continue(p); break; case PT_WRITE_I: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index c0cf0be7e7d7..3e5a96185e0c 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -183,6 +183,7 @@ struct kaudit_record; struct kcov_info; struct kdtrace_proc; struct kdtrace_thread; +struct kq_timer_cb_data; struct mqueue_notifier; struct p_sched; struct proc; @@ -715,6 +716,8 @@ struct proc { */ LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */ LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */ + + TAILQ_HEAD(, kq_timer_cb_data) p_kqtim_stop; /* (c) */ }; #define p_session p_pgrp->pg_session @@ -1081,6 +1084,7 @@ void fork_exit(void (*)(void *, struct trapframe *), void *, void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); void itimer_proc_continue(struct proc *p); +void kqtimer_proc_continue(struct proc *p); void kern_proc_vmmap_resident(struct vm_map *map, struct vm_map_entry *entry, int *resident_count, bool *super); void kern_yield(int); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 953A95EE27E; Fri, 23 Apr 2021 11:15: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 4FRWt31p8Mz4XFL; Fri, 23 Apr 2021 11:15: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 B0E5B4591; Fri, 23 Apr 2021 11: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 13NBFLdu013517; Fri, 23 Apr 2021 11: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 13NBFLaw013516; Fri, 23 Apr 2021 11:15:21 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:21 GMT Message-Id: <202104231115.13NBFLaw013516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3cb7188a310c - stable/13 - Add helper for kqueue timers callout scheduling 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3cb7188a310c36359cf0493a2abf58df5d8bfec6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:23 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3cb7188a310c36359cf0493a2abf58df5d8bfec6 commit 3cb7188a310c36359cf0493a2abf58df5d8bfec6 Author: Konstantin Belousov AuthorDate: 2021-03-05 23:31:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 Add helper for kqueue timers callout scheduling (cherry picked from commit 533e5057ed2503013643bf8450588e4aa58c2b7e) --- sys/kern/kern_event.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 5185723b8d10..5e9f1fc35dfe 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -676,10 +676,19 @@ timer2sbintime(int64_t data, int flags) struct kq_timer_cb_data { struct callout c; + struct knote *kn; + int cpuid; sbintime_t next; /* next timer event fires at */ sbintime_t to; /* precalculated timer period, 0 for abs */ }; +static void +kqtimer_sched_callout(struct kq_timer_cb_data *kc) +{ + callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kc->kn, + kc->cpuid, C_ABSOLUTE); +} + static void filt_timerexpire(void *knx) { @@ -696,8 +705,7 @@ filt_timerexpire(void *knx) if (kc->to == 0) return; kc->next += kc->to; - callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, - PCPU_GET(cpuid), C_ABSOLUTE); + kqtimer_sched_callout(kc); } /* @@ -753,6 +761,8 @@ filt_timerattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ kn->kn_ptr.p_v = kc = malloc(sizeof(*kc), M_KQUEUE, M_WAITOK); + kc->kn = kn; + kc->cpuid = PCPU_GET(cpuid); callout_init(&kc->c, 1); filt_timerstart(kn, to); @@ -772,8 +782,7 @@ filt_timerstart(struct knote *kn, sbintime_t to) kc->next = to + sbinuptime(); kc->to = to; } - callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, - PCPU_GET(cpuid), C_ABSOLUTE); + kqtimer_sched_callout(kc); } static void From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68D055EE383; Fri, 23 Apr 2021 11:15: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 4FRWsm3jM6z4Wxy; Fri, 23 Apr 2021 11:15: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 E10F03DDC; Fri, 23 Apr 2021 11:15: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 13NBF7KR013253; Fri, 23 Apr 2021 11:15:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF7e8013252; Fri, 23 Apr 2021 11:15:07 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:07 GMT Message-Id: <202104231115.13NBF7e8013252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0d5114825576 - stable/13 - amd64: clear debug registers on execing 32bit Linux binary 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0d511482557677ef7aecb3109955d1596d5cf9d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:09 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0d511482557677ef7aecb3109955d1596d5cf9d9 commit 0d511482557677ef7aecb3109955d1596d5cf9d9 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:25:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 amd64: clear debug registers on execing 32bit Linux binary (cherry picked from commit 94172affa43af15fe3b50293a96c292eca30c386) --- sys/amd64/linux32/linux32_sysvec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index bb86baefaec4..3790d0fcb69c 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -722,6 +722,8 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, regs->tf_cs = _ucode32sel; regs->tf_rbx = (register_t)imgp->ps_strings; + x86_clear_dbregs(pcb); + fpstate_drop(td); /* Do full restore on return so that we can change to a different %cs */ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55D975EE0F5; Fri, 23 Apr 2021 11:15: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 4FRWsy3Z6gz4XGd; Fri, 23 Apr 2021 11:15: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 1CBCF460F; Fri, 23 Apr 2021 11:15: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 13NBFHLu013427; Fri, 23 Apr 2021 11:15:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFHWs013426; Fri, 23 Apr 2021 11:15:17 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:17 GMT Message-Id: <202104231115.13NBFHWs013426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2df5e7711bee - stable/13 - sbuf_uionew(): sbuf_new() takes int as length 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2df5e7711bee3c35209d576aa57ef09a7a839d79 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:19 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2df5e7711bee3c35209d576aa57ef09a7a839d79 commit 2df5e7711bee3c35209d576aa57ef09a7a839d79 Author: Konstantin Belousov AuthorDate: 2021-04-13 19:12:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 sbuf_uionew(): sbuf_new() takes int as length (cherry picked from commit 116f26f947b8bbf868dcd85d79226406029a45ee) --- sys/kern/subr_sbuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index cdeaf690208f..b7f135e81206 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -266,6 +266,10 @@ sbuf_uionew(struct sbuf *s, struct uio *uio, int *error) KASSERT(error != NULL, ("%s called with NULL error pointer", __func__)); + if (uio->uio_resid >= INT_MAX || uio->uio_resid < SBUF_MINSIZE - 1) { + *error = EINVAL; + return (NULL); + } s = sbuf_new(s, NULL, uio->uio_resid + 1, 0); if (s == NULL) { *error = ENOMEM; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1B885EE0FE; Fri, 23 Apr 2021 11: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 4FRWt03Lbbz4X8f; Fri, 23 Apr 2021 11:15: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 7238E415B; Fri, 23 Apr 2021 11:15: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 13NBFJrC013475; Fri, 23 Apr 2021 11:15:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFJuP013474; Fri, 23 Apr 2021 11:15:19 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:19 GMT Message-Id: <202104231115.13NBFJuP013474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6d608fc5ab9c - stable/13 - Stop arming periodic process timers on suspend or terminate 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d608fc5ab9c6c8eedc85d739b4e58b21c16d19d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:22 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6d608fc5ab9c6c8eedc85d739b4e58b21c16d19d commit 6d608fc5ab9c6c8eedc85d739b4e58b21c16d19d Author: Konstantin Belousov AuthorDate: 2021-03-05 21:19:35 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 Stop arming periodic process timers on suspend or terminate (cherry picked from commit dc47fdf1319f18be1aadbcdef17c721a83415d84) --- sys/kern/kern_sig.c | 6 ++++-- sys/kern/kern_time.c | 38 ++++++++++++++++++++++++++++++++++++-- sys/kern/sys_process.c | 1 + sys/sys/proc.h | 2 ++ 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 3d55405d3151..212b4997dd5e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2322,7 +2322,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) thread_unsuspend(p); PROC_SUNLOCK(p); sigqueue_delete(sigqueue, sig); - goto out; + goto out_cont; } if (action == SIG_CATCH) { /* @@ -2337,7 +2337,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) */ thread_unsuspend(p); PROC_SUNLOCK(p); - goto out; + goto out_cont; } if (prop & SIGPROP_STOP) { @@ -2422,6 +2422,8 @@ runfast: PROC_SLOCK(p); thread_unsuspend(p); PROC_SUNLOCK(p); +out_cont: + itimer_proc_continue(p); out: /* If we jump here, proc slock should not be owned. */ PROC_SLOCK_ASSERT(p, MA_NOTOWNED); diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 44f6b4ad07f2..3010ee326105 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -881,6 +881,33 @@ kern_setitimer(struct thread *td, u_int which, struct itimerval *aitv, return (0); } +static void +realitexpire_reset_callout(struct proc *p, sbintime_t *isbtp) +{ + sbintime_t prec; + + prec = isbtp == NULL ? tvtosbt(p->p_realtimer.it_interval) : *isbtp; + callout_reset_sbt(&p->p_itcallout, tvtosbt(p->p_realtimer.it_value), + prec >> tc_precexp, realitexpire, p, C_ABSOLUTE); +} + +void +itimer_proc_continue(struct proc *p) +{ + struct timeval ctv; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((p->p_flag2 & P2_ITSTOPPED) != 0) { + p->p_flag2 &= ~P2_ITSTOPPED; + microuptime(&ctv); + if (timevalcmp(&p->p_realtimer.it_value, &ctv, >=)) + realitexpire(p); + else + realitexpire_reset_callout(p, NULL); + } +} + /* * Real interval timer expired: * send process whose timer expired an alarm signal. @@ -908,6 +935,7 @@ realitexpire(void *arg) wakeup(&p->p_itcallout); return; } + isbt = tvtosbt(p->p_realtimer.it_interval); if (isbt >= sbt_timethreshold) getmicrouptime(&ctv); @@ -917,8 +945,14 @@ realitexpire(void *arg) timevaladd(&p->p_realtimer.it_value, &p->p_realtimer.it_interval); } while (timevalcmp(&p->p_realtimer.it_value, &ctv, <=)); - callout_reset_sbt(&p->p_itcallout, tvtosbt(p->p_realtimer.it_value), - isbt >> tc_precexp, realitexpire, p, C_ABSOLUTE); + + if (P_SHOULDSTOP(p) || P_KILLED(p)) { + p->p_flag2 |= P2_ITSTOPPED; + return; + } + + p->p_flag2 &= ~P2_ITSTOPPED; + realitexpire_reset_callout(p, &isbt); } /* diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 0b1305f49a93..f00aa57c95d2 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1091,6 +1091,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) p->p_flag &= ~(P_STOPPED_TRACE | P_STOPPED_SIG | P_WAITED); thread_unsuspend(p); PROC_SUNLOCK(p); + itimer_proc_continue(p); break; case PT_WRITE_I: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 783c3896298c..c0cf0be7e7d7 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -813,6 +813,7 @@ struct proc { MAP_STACK */ #define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled after exec */ +#define P2_ITSTOPPED 0x00002000 /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ @@ -1079,6 +1080,7 @@ void fork_exit(void (*)(void *, struct trapframe *), void *, struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); +void itimer_proc_continue(struct proc *p); void kern_proc_vmmap_resident(struct vm_map *map, struct vm_map_entry *entry, int *resident_count, bool *super); void kern_yield(int); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98CBD5EDDFF; Fri, 23 Apr 2021 11:15: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 4FRWsk6bynz4X0s; Fri, 23 Apr 2021 11:15: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 C82E9458E; Fri, 23 Apr 2021 11:15: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 13NBF6BW013226; Fri, 23 Apr 2021 11:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF6Bq013225; Fri, 23 Apr 2021 11:15:06 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:06 GMT Message-Id: <202104231115.13NBF6Bq013225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 88d6f049c12f - stable/13 - x86: add x86_clear_dbregs() helper 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 88d6f049c12f5d6945209c8805d4399a766de524 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:07 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=88d6f049c12f5d6945209c8805d4399a766de524 commit 88d6f049c12f5d6945209c8805d4399a766de524 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:19:23 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 x86: add x86_clear_dbregs() helper (cherry picked from commit a8b75a57c9b2cb3388746f097a55086a0f8c5d38) --- sys/amd64/amd64/machdep.c | 50 +++++++++++++++++++++++++++-------------------- sys/i386/i386/machdep.c | 50 +++++++++++++++++++++++++++-------------------- sys/x86/include/x86_var.h | 1 + 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 458d700a21e0..2901ef15e69a 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -581,6 +581,34 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) } #endif +/* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ +void +x86_clear_dbregs(struct pcb *pcb) +{ + if ((pcb->pcb_flags & PCB_DBREGS) == 0) + return; + + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + + if (pcb == curpcb) { + /* + * Clear the debug registers on the running CPU, + * otherwise they will end up affecting the next + * process we switch to. + */ + reset_dbregs(); + } + clear_pcb_flags(pcb, PCB_DBREGS); +} + /* * Reset registers to default values on exec. */ @@ -617,27 +645,7 @@ exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - clear_pcb_flags(pcb, PCB_DBREGS); - } + x86_clear_dbregs(pcb); /* * Drop the FP state if we hold it, so that the process gets a diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index e847d97b8bcf..888550eab6ad 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1121,6 +1121,34 @@ setup_priv_lcall_gate(struct proc *p) } #endif +/* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ +void +x86_clear_dbregs(struct pcb *pcb) +{ + if ((pcb->pcb_flags & PCB_DBREGS) == 0) + return; + + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + + if (pcb == curpcb) { + /* + * Clear the debug registers on the running CPU, + * otherwise they will end up affecting the next + * process we switch to. + */ + reset_dbregs(); + } + pcb->pcb_flags &= ~PCB_DBREGS; +} + /* * Reset registers to default values on exec. */ @@ -1174,27 +1202,7 @@ exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ regs->tf_ebx = (register_t)imgp->ps_strings; - /* - * Reset the hardware debug registers if they were in use. - * They won't have any meaning for the newly exec'd process. - */ - if (pcb->pcb_flags & PCB_DBREGS) { - pcb->pcb_dr0 = 0; - pcb->pcb_dr1 = 0; - pcb->pcb_dr2 = 0; - pcb->pcb_dr3 = 0; - pcb->pcb_dr6 = 0; - pcb->pcb_dr7 = 0; - if (pcb == curpcb) { - /* - * Clear the debug registers on the running - * CPU, otherwise they will end up affecting - * the next process we switch to. - */ - reset_dbregs(); - } - pcb->pcb_flags &= ~PCB_DBREGS; - } + x86_clear_dbregs(pcb); pcb->pcb_initial_npxcw = __INITIAL_NPXCW__; diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index a802068d6fb4..cc730fcd1bf1 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -122,6 +122,7 @@ void cpu_setregs(void); int dbreg_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); int dbreg_clr_watchpoint(vm_offset_t addr, vm_size_t size); void dbreg_list_watchpoints(void); +void x86_clear_dbregs(struct pcb *pcb); bool disable_wp(void); void restore_wp(bool old_wp); void finishidentcpu(void); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 273045EE30C; Fri, 23 Apr 2021 11:15: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 4FRWsn44vtz4X89; Fri, 23 Apr 2021 11:15: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 0C77640F4; Fri, 23 Apr 2021 11:15: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 13NBF8vH013274; Fri, 23 Apr 2021 11:15:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBF8d4013273; Fri, 23 Apr 2021 11:15:08 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:08 GMT Message-Id: <202104231115.13NBF8d4013273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f6b3c49256ed - stable/13 - amd64: clear debug registers on execing 32bit native binary 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6b3c49256edd4f402393a1d0276bd3ff3b5d458 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f6b3c49256edd4f402393a1d0276bd3ff3b5d458 commit f6b3c49256edd4f402393a1d0276bd3ff3b5d458 Author: Konstantin Belousov AuthorDate: 2021-04-09 23:23:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:08 +0000 amd64: clear debug registers on execing 32bit native binary (cherry picked from commit d50adfec9ee73e88e8d365525f1acef2c1db798a) --- sys/amd64/ia32/ia32_signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index 51dd1f38090f..c114cf1d240a 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -968,6 +968,8 @@ ia32_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; + x86_clear_dbregs(pcb); + fpstate_drop(td); /* Return via doreti so that we can change to a different %cs */ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 365835EE44A; Fri, 23 Apr 2021 11:15: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 4FRWt70BcXz4X8x; Fri, 23 Apr 2021 11:15: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 1C84E4592; Fri, 23 Apr 2021 11:15: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 13NBFPED013586; Fri, 23 Apr 2021 11:15:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFPS1013585; Fri, 23 Apr 2021 11:15:25 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:25 GMT Message-Id: <202104231115.13NBFPS1013585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c35473f4ab3a - stable/13 - realtimer_expire: avoid proc lock recursion when called from itimer_proc_continue() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: c35473f4ab3a58dcc2846713c131d6983d9ed009 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c35473f4ab3a58dcc2846713c131d6983d9ed009 commit c35473f4ab3a58dcc2846713c131d6983d9ed009 Author: Konstantin Belousov AuthorDate: 2021-04-13 13:47:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 realtimer_expire: avoid proc lock recursion when called from itimer_proc_continue() (cherry picked from commit 5cc1d199412ead0b4c234e21e881a31ef893a4f0) --- sys/kern/kern_time.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index d3b19111b0f3..ab22ac4a1697 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -105,6 +105,7 @@ static int realtimer_settime(struct itimer *, int, static int realtimer_delete(struct itimer *); static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); +static void realtimer_expire_l(struct itimer *it, bool proc_locked); static int register_posix_clock(int, const struct kclock *); static void itimer_fire(struct itimer *it); @@ -919,7 +920,7 @@ itimer_proc_continue(struct proc *p) if ((it->it_flags & ITF_PSTOPPED) != 0) { it->it_flags &= ~ITF_PSTOPPED; if ((it->it_flags & ITF_DELETING) == 0) - realtimer_expire(it); + realtimer_expire_l(it, true); } ITIMER_UNLOCK(it); } @@ -1663,18 +1664,14 @@ itimespecfix(struct timespec *ts) .tv_nsec = (ns) % 1000000000 \ } -/* Timeout callback for realtime timer */ static void -realtimer_expire(void *arg) +realtimer_expire_l(struct itimer *it, bool proc_locked) { struct timespec cts, ts; struct timeval tv; - struct itimer *it; struct proc *p; uint64_t interval, now, overruns, value; - it = (struct itimer *)arg; - realtimer_clocktime(it->it_clockid, &cts); /* Only fire if time is reached. */ if (timespeccmp(&cts, &it->it_time.it_value, >=)) { @@ -1708,8 +1705,9 @@ realtimer_expire(void *arg) /* single shot timer ? */ timespecclear(&it->it_time.it_value); } + + p = it->it_proc; if (timespecisset(&it->it_time.it_value)) { - p = it->it_proc; if (P_SHOULDSTOP(p) || P_KILLED(p)) { it->it_flags |= ITF_PSTOPPED; } else { @@ -1719,9 +1717,14 @@ realtimer_expire(void *arg) realtimer_expire, it); } } + itimer_enter(it); ITIMER_UNLOCK(it); + if (proc_locked) + PROC_UNLOCK(p); itimer_fire(it); + if (proc_locked) + PROC_LOCK(p); ITIMER_LOCK(it); itimer_leave(it); } else if (timespecisset(&it->it_time.it_value)) { @@ -1738,6 +1741,13 @@ realtimer_expire(void *arg) } } +/* Timeout callback for realtime timer */ +static void +realtimer_expire(void *arg) +{ + realtimer_expire_l(arg, false); +} + static void itimer_fire(struct itimer *it) { From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CEB55EE495; Fri, 23 Apr 2021 11: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 4FRWtC1tPFz4X42; Fri, 23 Apr 2021 11:15: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 A98FD415D; Fri, 23 Apr 2021 11:15: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 13NBFTA2013681; Fri, 23 Apr 2021 11:15:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFTFh013680; Fri, 23 Apr 2021 11:15:29 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:29 GMT Message-Id: <202104231115.13NBFTFh013680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b82fb18ee28f - stable/13 - vfs_vnops.c: Make vn_statfile() non-static 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b82fb18ee28f1e23c5fa6ebb3a420b2d43f0fa42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:32 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b82fb18ee28f1e23c5fa6ebb3a420b2d43f0fa42 commit b82fb18ee28f1e23c5fa6ebb3a420b2d43f0fa42 Author: Konstantin Belousov AuthorDate: 2021-03-18 10:41:07 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 vfs_vnops.c: Make vn_statfile() non-static (cherry picked from commit 437c241d0c78f77a9d9e54494a353db01ce1a3de) --- sys/kern/vfs_vnops.c | 3 +-- sys/sys/file.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 44cbf1a7893b..98f37d26ea8c 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -102,7 +102,6 @@ static fo_truncate_t vn_truncate; static fo_ioctl_t vn_ioctl; static fo_poll_t vn_poll; static fo_kqfilter_t vn_kqfilter; -static fo_stat_t vn_statfile; static fo_close_t vn_closefile; static fo_mmap_t vn_mmap; static fo_fallocate_t vn_fallocate; @@ -1616,7 +1615,7 @@ vn_truncate_locked(struct vnode *vp, off_t length, bool sync, /* * File table vnode stat routine. */ -static int +int vn_statfile(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) { diff --git a/sys/sys/file.h b/sys/sys/file.h index c42ab09a7e03..c4fc70f517a4 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -262,7 +262,7 @@ fo_kqfilter_t invfo_kqfilter; fo_chmod_t invfo_chmod; fo_chown_t invfo_chown; fo_sendfile_t invfo_sendfile; - +fo_stat_t vn_statfile; fo_sendfile_t vn_sendfile; fo_seek_t vn_seek; fo_fill_kinfo_t vn_fill_kinfo; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F5A5EE44E; Fri, 23 Apr 2021 11:15: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 4FRWt90Hbbz4XCN; Fri, 23 Apr 2021 11:15: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 761CF468C; Fri, 23 Apr 2021 11:15: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 13NBFRpl013639; Fri, 23 Apr 2021 11:15:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFRZZ013638; Fri, 23 Apr 2021 11:15:27 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:27 GMT Message-Id: <202104231115.13NBFRZZ013638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9418bb8a1984 - stable/13 - AT_RESOLVE_BENEATH is bsd-specific 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9418bb8a198455c6b7a478a5e1cdd997bbf55621 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:30 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9418bb8a198455c6b7a478a5e1cdd997bbf55621 commit 9418bb8a198455c6b7a478a5e1cdd997bbf55621 Author: Konstantin Belousov AuthorDate: 2021-03-11 15:07:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 AT_RESOLVE_BENEATH is bsd-specific (cherry picked from commit d51b4b0aac43d9d25f7eb3f17b2d3034a5c851d8) --- sys/sys/fcntl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 8db9b1fe80b9..bc2011c31e88 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -219,10 +219,12 @@ typedef __pid_t pid_t; #define AT_SYMLINK_NOFOLLOW 0x0200 /* Do not follow symbolic links */ #define AT_SYMLINK_FOLLOW 0x0400 /* Follow symbolic link */ #define AT_REMOVEDIR 0x0800 /* Remove directory instead of file */ +#endif /* __POSIX_VISIBLE >= 200809 */ +#if __BSD_VISIBLE /* #define AT_UNUSED1 0x1000 *//* Was AT_BENEATH */ #define AT_RESOLVE_BENEATH 0x2000 /* Do not allow name resolution to walk out of dirfd */ -#endif +#endif /* __BSD_VISIBLE */ /* * Constants used for fcntl(2) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 495D15EE4C7; Fri, 23 Apr 2021 11:15: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 4FRWtS4cjGz4XWR; Fri, 23 Apr 2021 11:15: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 C53D24162; Fri, 23 Apr 2021 11:15: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 13NBFdIS013905; Fri, 23 Apr 2021 11:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFdPJ013904; Fri, 23 Apr 2021 11:15:39 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:39 GMT Message-Id: <202104231115.13NBFdPJ013904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 44a0bdad29d7 - stable/13 - sysctl vm.objects: report backing object and swap use 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 44a0bdad29d71e350ba752fc5414e17021485f6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:45 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44a0bdad29d71e350ba752fc5414e17021485f6b commit 44a0bdad29d71e350ba752fc5414e17021485f6b Author: Konstantin Belousov AuthorDate: 2021-04-15 09:27:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:11 +0000 sysctl vm.objects: report backing object and swap use (cherry picked from commit ecfbddf0cde3d4151217e3eb2d7c5388a423d397) --- sys/kern/kern_proc.c | 3 +++ sys/sys/user.h | 20 ++++++++++++++++---- sys/vm/swap_pager.c | 23 +++++++++++++++++++++++ sys/vm/swap_pager.h | 1 + sys/vm/vm_object.c | 13 ++++++++++++- 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f8fed2573712..d2414df60d7a 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2538,6 +2538,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) bzero(kve, sizeof(*kve)); obj = entry->object.vm_object; if (obj != NULL) { + if ((obj->flags & OBJ_ANON) != 0) + kve->kve_obj = (uintptr_t)obj; + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { VM_OBJECT_RLOCK(tobj); diff --git a/sys/sys/user.h b/sys/sys/user.h index f882e7dcd699..14471c91572f 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -529,12 +529,17 @@ struct kinfo_vmentry { uint32_t kve_vn_rdev_freebsd11; /* Device id if device. */ uint16_t kve_vn_mode; /* File mode. */ uint16_t kve_status; /* Status flags. */ - uint64_t kve_vn_fsid; /* dev_t of vnode location */ + union { + uint64_t _kve_vn_fsid; /* dev_t of vnode location */ + uint64_t _kve_obj; /* handle of anon obj */ + } kve_type_spec; uint64_t kve_vn_rdev; /* Device id if device. */ int _kve_ispare[8]; /* Space for more stuff. */ /* Truncated before copyout in sysctl */ char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ }; +#define kve_vn_fsid kve_type_spec._kve_vn_fsid +#define kve_obj kve_type_spec._kve_obj /* * The "vm.objects" sysctl provides a list of all VM objects in the system @@ -552,11 +557,18 @@ struct kinfo_vmobject { uint64_t kvo_resident; /* Number of resident pages. */ uint64_t kvo_active; /* Number of active pages. */ uint64_t kvo_inactive; /* Number of inactive pages. */ - uint64_t kvo_vn_fsid; - uint64_t _kvo_qspare[7]; - uint32_t _kvo_ispare[8]; + union { + uint64_t _kvo_vn_fsid; + uint64_t _kvo_backing_obj; /* Handle for the backing obj */ + } kvo_type_spec; /* Type-specific union */ + uint64_t kvo_me; /* Uniq handle for anon obj */ + uint64_t _kvo_qspare[6]; + uint32_t kvo_swapped; /* Number of swapped pages */ + uint32_t _kvo_ispare[7]; char kvo_path[PATH_MAX]; /* Pathname, if any. */ }; +#define kvo_vn_fsid kvo_type_spec._kvo_vn_fsid +#define kvo_backing_obj kvo_type_spec._kvo_backing_obj /* * The KERN_PROC_KSTACK sysctl allows a process to dump the kernel stacks of diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 3789a0217252..888df04741b4 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1763,6 +1763,29 @@ swp_pager_force_dirty(vm_page_t m) vm_page_launder(m); } +u_long +swap_pager_swapped_pages(vm_object_t object) +{ + struct swblk *sb; + vm_pindex_t pi; + u_long res; + int i; + + VM_OBJECT_ASSERT_LOCKED(object); + if (object->type != OBJT_SWAP) + return (0); + + for (res = 0, pi = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( + &object->un_pager.swp.swp_blks, pi)) != NULL; + pi = sb->p + SWAP_META_PAGES) { + for (i = 0; i < SWAP_META_PAGES; i++) { + if (sb->d[i] != SWAPBLK_NONE) + res++; + } + } + return (res); +} + /* * swap_pager_swapoff_object: * diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 80dca93fbf85..59ca2cc2cfdb 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -81,6 +81,7 @@ void swap_pager_swap_init(void); int swap_pager_nswapdev(void); int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_status(int *total, int *used); +u_long swap_pager_swapped_pages(vm_object_t object); void swapoff_all(void); #endif /* _KERNEL */ diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 35ea9cc45fae..1f5194464b69 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2524,6 +2525,7 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) struct vattr va; vm_object_t obj; vm_page_t m; + u_long sp; int count, error; if (req->oldptr == NULL) { @@ -2590,8 +2592,17 @@ sysctl_vm_object_list(SYSCTL_HANDLER_ARGS) freepath = NULL; fullpath = ""; kvo->kvo_type = vm_object_kvme_type(obj, &vp); - if (vp != NULL) + if (vp != NULL) { vref(vp); + } else if ((obj->flags & OBJ_ANON) != 0) { + MPASS(kvo->kvo_type == KVME_TYPE_DEFAULT || + kvo->kvo_type == KVME_TYPE_SWAP); + kvo->kvo_me = (uintptr_t)obj; + /* tmpfs objs are reported as vnodes */ + kvo->kvo_backing_obj = (uintptr_t)obj->backing_object; + sp = swap_pager_swapped_pages(obj); + kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; + } VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7610B5EE50D; Fri, 23 Apr 2021 11:15: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 4FRWt61WgKz4XC8; Fri, 23 Apr 2021 11:15: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 01A0C4610; Fri, 23 Apr 2021 11:15: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 13NBFNVV013559; Fri, 23 Apr 2021 11:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFNYD013558; Fri, 23 Apr 2021 11:15:23 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:23 GMT Message-Id: <202104231115.13NBFNYD013558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 107bc3da39d3 - stable/13 - filt_timerexpire: avoid process lock recursion 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 107bc3da39d37bf81b1c9fd3d8b58452d4606404 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:27 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=107bc3da39d37bf81b1c9fd3d8b58452d4606404 commit 107bc3da39d37bf81b1c9fd3d8b58452d4606404 Author: Konstantin Belousov AuthorDate: 2021-04-13 14:25:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 filt_timerexpire: avoid process lock recursion (cherry picked from commit 75c5cf7a720f5a73f17aff60adbc4a7b2fa86f84) --- sys/kern/kern_event.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 31b091e20984..45d505fca757 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -161,6 +161,7 @@ static void filt_procdetach(struct knote *kn); static int filt_proc(struct knote *kn, long hint); static int filt_fileattach(struct knote *kn); static void filt_timerexpire(void *knx); +static void filt_timerexpire_l(struct knote *kn, bool proc_locked); static int filt_timerattach(struct knote *kn); static void filt_timerdetach(struct knote *kn); static void filt_timerstart(struct knote *kn, sbintime_t to); @@ -706,21 +707,19 @@ kqtimer_proc_continue(struct proc *p) TAILQ_FOREACH_SAFE(kc, &p->p_kqtim_stop, link, kc1) { TAILQ_REMOVE(&p->p_kqtim_stop, kc, link); if (kc->next <= now) - filt_timerexpire(kc->kn); + filt_timerexpire_l(kc->kn, true); else kqtimer_sched_callout(kc); } } static void -filt_timerexpire(void *knx) +filt_timerexpire_l(struct knote *kn, bool proc_locked) { - struct knote *kn; struct kq_timer_cb_data *kc; struct proc *p; sbintime_t now; - kn = knx; kc = kn->kn_ptr.p_v; if ((kn->kn_flags & EV_ONESHOT) != 0 || kc->to == 0) { @@ -742,17 +741,26 @@ filt_timerexpire(void *knx) */ p = kc->p; if (P_SHOULDSTOP(p) || P_KILLED(p)) { - PROC_LOCK(p); + if (!proc_locked) + PROC_LOCK(p); if (P_SHOULDSTOP(p) || P_KILLED(p)) { TAILQ_INSERT_TAIL(&p->p_kqtim_stop, kc, link); - PROC_UNLOCK(p); + if (!proc_locked) + PROC_UNLOCK(p); return; } - PROC_UNLOCK(p); + if (!proc_locked) + PROC_UNLOCK(p); } kqtimer_sched_callout(kc); } +static void +filt_timerexpire(void *knx) +{ + filt_timerexpire_l(knx, false); +} + /* * data contains amount of time to sleep */ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 818695EE48F; Fri, 23 Apr 2021 11:15: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 4FRWt86R4Cz4XCK; Fri, 23 Apr 2021 11:15: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 505894593; Fri, 23 Apr 2021 11:15: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 13NBFQ2Q013609; Fri, 23 Apr 2021 11:15:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFQUc013608; Fri, 23 Apr 2021 11:15:26 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:26 GMT Message-Id: <202104231115.13NBFQUc013608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 22f23299b7ed - stable/13 - b_vflags update requries bufobj lock 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 22f23299b7ed96932a4b9e8b3a93fc233af1f2d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:29 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=22f23299b7ed96932a4b9e8b3a93fc233af1f2d4 commit 22f23299b7ed96932a4b9e8b3a93fc233af1f2d4 Author: Konstantin Belousov AuthorDate: 2021-04-13 10:22:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 b_vflags update requries bufobj lock (cherry picked from commit e3d675958539eee899d42438f5b46a26f3c64902) --- sys/ufs/ffs/ffs_softdep.c | 2 ++ sys/ufs/ffs/ffs_vnops.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 786fb43c7d81..2cc16ab2a2c1 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -7523,7 +7523,9 @@ cleanrestart: BO_LOCK(bo); goto cleanrestart; } + BO_LOCK(bo); bp->b_vflags |= BV_SCANNED; + BO_UNLOCK(bo); bremfree(bp); if (blkoff != 0) { allocbuf(bp, blkoff); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 582ccccc2e12..4e4e0b78fe4d 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -321,8 +321,9 @@ loop: if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { + BO_LOCK(bo); bp->b_vflags &= ~BV_SCANNED; - goto next; + goto next_locked; } } else continue; @@ -385,6 +386,7 @@ next: * to start from a known point. */ BO_LOCK(bo); +next_locked: nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd); } if (waitfor != MNT_WAIT) { From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABF7F5EE456; Fri, 23 Apr 2021 11:15: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 4FRWtB1691z4X99; Fri, 23 Apr 2021 11:15: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 89D8440F8; Fri, 23 Apr 2021 11:15: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 13NBFSMs013660; Fri, 23 Apr 2021 11:15:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFSD9013659; Fri, 23 Apr 2021 11:15:28 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:28 GMT Message-Id: <202104231115.13NBFSD9013659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9a05597b8fee - stable/13 - Style. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9a05597b8fee85d0193fdb4f31aef79c5e2e88b7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:30 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9a05597b8fee85d0193fdb4f31aef79c5e2e88b7 commit 9a05597b8fee85d0193fdb4f31aef79c5e2e88b7 Author: Konstantin Belousov AuthorDate: 2021-03-18 10:40:20 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 Style. (cherry picked from commit 42be0a7b10b14113ba9c4e4a738e8f20e235b736) --- sys/kern/kern_descrip.c | 2 +- sys/kern/vfs_syscalls.c | 8 ++++---- sys/kern/vfs_vnops.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 67350f4ad71e..7a43fbb2eb80 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -550,7 +550,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; tmp |= FFLAGS(arg & ~O_ACCMODE) & FCNTLFLAGS; - } while(atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); + } while (atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); tmp = fp->f_flag & FNONBLOCK; error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); if (error != 0) { diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 3db34c3689de..48df8a3e9051 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1881,8 +1881,8 @@ restart: if (vp->v_type == VDIR && oldinum == 0) { error = EPERM; /* POSIX */ } else if (oldinum != 0 && - ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && - sb.st_ino != oldinum) { + ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && + sb.st_ino != oldinum) { error = EIDRM; /* Identifier removed */ } else if (fp != NULL && fp->f_vnode != vp) { if (VN_IS_DOOMED(fp->f_vnode)) @@ -3818,8 +3818,8 @@ kern_frmdirat(struct thread *td, int dfd, const char *path, int fd, fp = NULL; if (fd != FD_NONE) { - error = getvnode(td, fd, cap_rights_init_one(&rights, CAP_LOOKUP), - &fp); + error = getvnode(td, fd, cap_rights_init_one(&rights, + CAP_LOOKUP), &fp); if (error != 0) return (error); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f0914c569828..44cbf1a7893b 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1775,7 +1775,7 @@ vn_closefile(struct file *fp, struct thread *td) vp = fp->f_vnode; fp->f_ops = &badfileops; - ref= (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; + ref = (fp->f_flag & FHASLOCK) != 0 && fp->f_type == DTYPE_VNODE; error = vn_close1(vp, fp->f_flag, fp->f_cred, td, ref); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57FC95EE3BD; Fri, 23 Apr 2021 11:15: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 4FRWtJ3V3sz4XQC; Fri, 23 Apr 2021 11:15: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 6880B4160; Fri, 23 Apr 2021 11:15: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 13NBFZOM013806; Fri, 23 Apr 2021 11:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFZD6013805; Fri, 23 Apr 2021 11:15:35 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:35 GMT Message-Id: <202104231115.13NBFZD6013805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f1d1021fde37 - stable/13 - O_PATH: allow vnode kevent filter on such files 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f1d1021fde37a4709162a1acbc28427206f66acc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:37 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f1d1021fde37a4709162a1acbc28427206f66acc commit f1d1021fde37a4709162a1acbc28427206f66acc Author: Konstantin Belousov AuthorDate: 2021-04-07 18:31:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 O_PATH: allow vnode kevent filter on such files (cherry picked from commit bbf7a4e878ed6828d13c7029c128a7e60dc25391) --- lib/libc/sys/open.2 | 3 +++ sys/kern/kern_descrip.c | 2 +- sys/kern/vfs_syscalls.c | 3 ++- sys/kern/vfs_vnops.c | 14 +++++++++++++- sys/sys/fcntl.h | 2 ++ sys/sys/file.h | 1 + 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 06a877e34460..a7806df69daf 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -342,6 +342,9 @@ can be passed over a socket using a .Dv SCM_RIGHTS message +.It Xr kqueue 2 +using for +.Dv EVFILT_VNODE .El But operations like .Xr read 2 , diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index a28e94634326..30ac40ffe296 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -4988,7 +4988,7 @@ struct fileops path_fileops = { .fo_truncate = badfo_truncate, .fo_ioctl = badfo_ioctl, .fo_poll = path_poll, - .fo_kqfilter = badfo_kqfilter, + .fo_kqfilter = vn_kqfilter_opath, .fo_stat = vn_statfile, .fo_close = path_close, .fo_chmod = badfo_chmod, diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 9130843f6761..43104a472b5b 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1192,7 +1192,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, KASSERT(vp->v_type != VFIFO || (flags & O_PATH) != 0, ("Unexpected fifo fp %p vp %p", fp, vp)); if ((flags & O_PATH) != 0) { - finit_vnode(fp, flags, NULL, &path_fileops); + finit(fp, (flags & FMASK) | (fp->f_flag & FKQALLOWED), + DTYPE_VNODE, NULL, &path_fileops); vhold(vp); vunref(vp); } else { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index bb9ee2cceb79..9da35721def4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -426,8 +426,12 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, if (error != 0) return (error); } - if ((fmode & O_PATH) != 0) + if ((fmode & O_PATH) != 0) { + error = VOP_ACCESS(vp, VREAD, cred, td); + if (error == 0) + fp->f_flag |= FKQALLOWED; return (0); + } if (vp->v_type == VFIFO && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vn_lock(vp, LK_UPGRADE | LK_RETRY); @@ -2139,6 +2143,14 @@ vn_kqfilter(struct file *fp, struct knote *kn) return (VOP_KQFILTER(fp->f_vnode, kn)); } +int +vn_kqfilter_opath(struct file *fp, struct knote *kn) +{ + if ((fp->f_flag & FKQALLOWED) == 0) + return (EBADF); + return (vn_kqfilter(fp, kn)); +} + /* * Simplified in-kernel wrapper calls for extended attribute access. * Both calls pass in a NULL credential, authorizing as "kernel" access. diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index c328abaa02af..58d46ae26338 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -153,6 +153,8 @@ typedef __pid_t pid_t; #define FREVOKE O_VERIFY /* Only for fo_close() from half-succeeded open */ #define FOPENFAILED O_TTY_INIT +/* Only for O_PATH files which passed ACCESS FREAD check on open */ +#define FKQALLOWED O_RESOLVE_BENEATH /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) diff --git a/sys/sys/file.h b/sys/sys/file.h index 9237ee5ceb9d..b16e23bdfbcf 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -267,6 +267,7 @@ fo_stat_t vn_statfile; fo_sendfile_t vn_sendfile; fo_seek_t vn_seek; fo_fill_kinfo_t vn_fill_kinfo; +fo_kqfilter_t vn_kqfilter_opath; int vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif); void finit(struct file *, u_int, short, void *, struct fileops *); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CB1C5EE5CF; Fri, 23 Apr 2021 11:15: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 4FRWtL5LS2z4XNH; Fri, 23 Apr 2021 11:15:38 +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 76B3840FA; Fri, 23 Apr 2021 11:15: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 13NBFaGF013834; Fri, 23 Apr 2021 11:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFaSN013833; Fri, 23 Apr 2021 11:15:36 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:36 GMT Message-Id: <202104231115.13NBFaSN013833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bd881b1f1dc2 - stable/13 - linkat(2): check NIRES_EMPTYPATH on the first fd arg 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bd881b1f1dc2e80b9ef3ab13861f64dc61016b62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:39 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd881b1f1dc2e80b9ef3ab13861f64dc61016b62 commit bd881b1f1dc2e80b9ef3ab13861f64dc61016b62 Author: Konstantin Belousov AuthorDate: 2021-04-19 13:35:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 linkat(2): check NIRES_EMPTYPATH on the first fd arg (cherry picked from commit 578c26f31c0c90c9e6b2f7125a8539c307a51dff) --- sys/kern/vfs_syscalls.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 43104a472b5b..26a8d31e4456 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1575,6 +1575,13 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); + if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) { + error = priv_check(td, PRIV_VFS_FHOPEN); + if (error != 0) { + vrele(nd.ni_vp); + return (error); + } + } error = kern_linkat_vp(td, nd.ni_vp, fd2, path2, segflag); } while (error == EAGAIN || error == ERELOOKUP); return (error); @@ -1596,23 +1603,6 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, LOCKPARENT | SAVENAME | AUDITVNODE2 | NOCACHE, segflag, path, fd, &cap_linkat_target_rights, td); if ((error = namei(&nd)) == 0) { - if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) { - error = priv_check(td, PRIV_VFS_FHOPEN); - if (error != 0) { - NDFREE(&nd, NDF_ONLY_PNBUF); - if (nd.ni_vp != NULL) { - if (nd.ni_dvp == nd.ni_vp) - vrele(nd.ni_dvp); - else - vput(nd.ni_dvp); - vrele(nd.ni_vp); - } else { - vput(nd.ni_dvp); - } - vrele(vp); - return (error); - } - } if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp == nd.ni_vp) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CE9F5EE1E3; Fri, 23 Apr 2021 11:15: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 4FRWt165lcz4X8k; Fri, 23 Apr 2021 11: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 8EE2B40F6; Fri, 23 Apr 2021 11:15: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 13NBFKZ6013496; Fri, 23 Apr 2021 11:15:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFKxG013495; Fri, 23 Apr 2021 11:15:20 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:20 GMT Message-Id: <202104231115.13NBFKxG013495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 057e390dadaf - stable/13 - Stop arming realtime posix process timers on suspend or terminate 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 057e390dadaf942bb2bfb66a2c3d68f79ff6506a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:23 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=057e390dadaf942bb2bfb66a2c3d68f79ff6506a commit 057e390dadaf942bb2bfb66a2c3d68f79ff6506a Author: Konstantin Belousov AuthorDate: 2021-03-11 08:16:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:09 +0000 Stop arming realtime posix process timers on suspend or terminate (cherry picked from commit 4d27d8d2f3b8ae4ef3efc86b220c7ff2dbdbac5a) --- sys/kern/kern_time.c | 48 +++++++++++++++++++++++++++++++++++++++--------- sys/sys/timers.h | 1 + 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 3010ee326105..d3b19111b0f3 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -895,6 +895,8 @@ void itimer_proc_continue(struct proc *p) { struct timeval ctv; + struct itimer *it; + int id; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -906,6 +908,23 @@ itimer_proc_continue(struct proc *p) else realitexpire_reset_callout(p, NULL); } + + if (p->p_itimers != NULL) { + for (id = 3; id < TIMER_MAX; id++) { + it = p->p_itimers->its_timers[id]; + if (it == NULL) + continue; + if ((it->it_flags & ITF_PSTOPPED) != 0) { + ITIMER_LOCK(it); + if ((it->it_flags & ITF_PSTOPPED) != 0) { + it->it_flags &= ~ITF_PSTOPPED; + if ((it->it_flags & ITF_DELETING) == 0) + realtimer_expire(it); + } + ITIMER_UNLOCK(it); + } + } + } } /* @@ -1651,6 +1670,7 @@ realtimer_expire(void *arg) struct timespec cts, ts; struct timeval tv; struct itimer *it; + struct proc *p; uint64_t interval, now, overruns, value; it = (struct itimer *)arg; @@ -1689,10 +1709,15 @@ realtimer_expire(void *arg) timespecclear(&it->it_time.it_value); } if (timespecisset(&it->it_time.it_value)) { - timespecsub(&it->it_time.it_value, &cts, &ts); - TIMESPEC_TO_TIMEVAL(&tv, &ts); - callout_reset(&it->it_callout, tvtohz(&tv), - realtimer_expire, it); + p = it->it_proc; + if (P_SHOULDSTOP(p) || P_KILLED(p)) { + it->it_flags |= ITF_PSTOPPED; + } else { + timespecsub(&it->it_time.it_value, &cts, &ts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + callout_reset(&it->it_callout, tvtohz(&tv), + realtimer_expire, it); + } } itimer_enter(it); ITIMER_UNLOCK(it); @@ -1700,11 +1725,16 @@ realtimer_expire(void *arg) ITIMER_LOCK(it); itimer_leave(it); } else if (timespecisset(&it->it_time.it_value)) { - ts = it->it_time.it_value; - timespecsub(&ts, &cts, &ts); - TIMESPEC_TO_TIMEVAL(&tv, &ts); - callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, - it); + p = it->it_proc; + if (P_SHOULDSTOP(p) || P_KILLED(p)) { + it->it_flags |= ITF_PSTOPPED; + } else { + ts = it->it_time.it_value; + timespecsub(&ts, &cts, &ts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + callout_reset(&it->it_callout, tvtohz(&tv), + realtimer_expire, it); + } } } diff --git a/sys/sys/timers.h b/sys/sys/timers.h index aa1912149452..5d6f0c95afa2 100644 --- a/sys/sys/timers.h +++ b/sys/sys/timers.h @@ -82,6 +82,7 @@ struct itimer { #define ITF_DELETING 0x01 #define ITF_WANTED 0x02 +#define ITF_PSTOPPED 0x04 #define ITCF_ONWORKLIST 0x01 From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A345EE497; Fri, 23 Apr 2021 11: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 4FRWtG0QKcz4XN9; Fri, 23 Apr 2021 11:15: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 1F1EF415E; Fri, 23 Apr 2021 11: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 13NBFWX1013751; Fri, 23 Apr 2021 11: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 13NBFWtU013750; Fri, 23 Apr 2021 11:15:32 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:32 GMT Message-Id: <202104231115.13NBFWtU013750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7a2452308633 - stable/13 - Make files opened with O_PATH to not block non-forced unmount 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a2452308633ad62081f641b2fc8751dab49106c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:35 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7a2452308633ad62081f641b2fc8751dab49106c commit 7a2452308633ad62081f641b2fc8751dab49106c Author: Konstantin Belousov AuthorDate: 2021-04-03 18:55:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 Make files opened with O_PATH to not block non-forced unmount (cherry picked from commit a5970a529c2d952714f20e4bc6e529c74fd2b3b5) --- lib/libc/sys/open.2 | 3 +++ sys/kern/kern_descrip.c | 6 +++--- sys/kern/vfs_lookup.c | 2 +- sys/kern/vfs_syscalls.c | 11 ++++++++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index f9c54bfc7581..06a877e34460 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -349,6 +349,9 @@ But operations like and any other that operate on file and not on file descriptor (except .Xr fstat 2 ), are not allowed. +File opened with the +.Dv O_PATH +flag does not prevent non-forced unmount of the volume it belongs to. See also the description of .Dv AT_EMPTY_PATH flag for diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 81af58fbddd1..a28e94634326 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -3430,7 +3430,7 @@ _fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp, error = EINVAL; } else { *vpp = fp->f_vnode; - vrefact(*vpp); + vref(*vpp); } fdrop(fp, td); @@ -3466,7 +3466,7 @@ fgetvp_rights(struct thread *td, int fd, cap_rights_t *needrightsp, *havecaps = caps; *vpp = fp->f_vnode; - vrefact(*vpp); + vref(*vpp); fdrop(fp, td); return (0); @@ -4978,7 +4978,7 @@ path_close(struct file *fp, struct thread *td) { MPASS(fp->f_type == DTYPE_VNODE); fp->f_ops = &badfileops; - vrele(fp->f_vnode); + vdrop(fp->f_vnode); return (0); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index f979676f4c7d..3050275c1b6f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -380,7 +380,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) error = ENOTDIR; } else { *dpp = dfp->f_vnode; - vrefact(*dpp); + vref(*dpp); if ((dfp->f_flag & FSEARCH) != 0) cnp->cn_flags |= NOEXECCHECK; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 5a1efcdec467..9130843f6761 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -896,7 +896,7 @@ sys_fchdir(struct thread *td, struct fchdir_args *uap) if (error != 0) return (error); vp = fp->f_vnode; - vrefact(vp); + vref(vp); fdrop(fp, td); vn_lock(vp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(vp); @@ -1191,8 +1191,13 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, if (fp->f_ops == &badfileops) { KASSERT(vp->v_type != VFIFO || (flags & O_PATH) != 0, ("Unexpected fifo fp %p vp %p", fp, vp)); - finit_vnode(fp, flags, NULL, (flags & O_PATH) != 0 ? - &path_fileops : &vnops); + if ((flags & O_PATH) != 0) { + finit_vnode(fp, flags, NULL, &path_fileops); + vhold(vp); + vunref(vp); + } else { + finit_vnode(fp, flags, NULL, &vnops); + } } VOP_UNLOCK(vp); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C6215EE51B; Fri, 23 Apr 2021 11:15: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 4FRWtG6HP1z4X47; Fri, 23 Apr 2021 11: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 3F2AC415F; Fri, 23 Apr 2021 11:15: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 13NBFYHo013775; Fri, 23 Apr 2021 11:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFYYO013774; Fri, 23 Apr 2021 11:15:34 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:34 GMT Message-Id: <202104231115.13NBFYYO013774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b5e557fda373 - stable/13 - O_PATH: Allow to open symlink 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b5e557fda3739992ff722c4eaeb535da31aa7ab9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:35 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b5e557fda3739992ff722c4eaeb535da31aa7ab9 commit b5e557fda3739992ff722c4eaeb535da31aa7ab9 Author: Konstantin Belousov AuthorDate: 2021-04-07 03:23:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 O_PATH: Allow to open symlink (cherry picked from commit f9b923af34a6749c7703b957742f33cc02a485a2) --- sys/kern/vfs_vnops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6339295b0556..bb9ee2cceb79 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -385,8 +385,10 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, accmode_t accmode; int error; - if (vp->v_type == VLNK) - return (EMLINK); + if (vp->v_type == VLNK) { + if ((fmode & O_PATH) == 0 || (fmode & FEXEC) != 0) + return (EMLINK); + } if (vp->v_type == VSOCK) return (EOPNOTSUPP); if (vp->v_type != VDIR && fmode & O_DIRECTORY) From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B12D25EE5E2; Fri, 23 Apr 2021 11:15: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 4FRWtR1SHbz4Xbw; Fri, 23 Apr 2021 11:15: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 B26304594; Fri, 23 Apr 2021 11:15:38 +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 13NBFcm4013884; Fri, 23 Apr 2021 11:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFcHJ013883; Fri, 23 Apr 2021 11:15:38 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:38 GMT Message-Id: <202104231115.13NBFcHJ013883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1f3d09306bf5 - stable/13 - sysctl_handle_string: do not malloc when SYSCTL_IN cannot fault 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f3d09306bf5d3572c0cda033a4c83603216c598 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:44 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1f3d09306bf5d3572c0cda033a4c83603216c598 commit 1f3d09306bf5d3572c0cda033a4c83603216c598 Author: Konstantin Belousov AuthorDate: 2021-04-18 16:09:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:11 +0000 sysctl_handle_string: do not malloc when SYSCTL_IN cannot fault (cherry picked from commit 4342ba184c15f3b8912e95f93fe313731963f065) --- sys/kern/kern_sysctl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index ffb6ac196ba3..4bfe7073e5a3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1785,6 +1785,15 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS) sx_xlock(&sysctlstringlock); ((char *)arg1)[0] = '\0'; sx_xunlock(&sysctlstringlock); + } else if (req->newfunc == sysctl_new_kernel) { + arg2 = req->newlen - req->newidx; + sx_xlock(&sysctlstringlock); + error = SYSCTL_IN(req, arg1, arg2); + if (error == 0) { + ((char *)arg1)[arg2] = '\0'; + req->newidx += arg2; + } + sx_xunlock(&sysctlstringlock); } else { arg2 = req->newlen - req->newidx; tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09D085EE3B6; Fri, 23 Apr 2021 11:15: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 4FRWtD1Wjcz4XFs; Fri, 23 Apr 2021 11: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 C0A1C468D; Fri, 23 Apr 2021 11:15: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 13NBFUSN013708; Fri, 23 Apr 2021 11:15:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFUvB013707; Fri, 23 Apr 2021 11:15:30 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:30 GMT Message-Id: <202104231115.13NBFUvB013707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 73a642c47955 - stable/13 - Add AT_EMPTY_PATH for several *at(2) 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 73a642c479550ea46b56d1f25cc32a99f917b891 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:33 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73a642c479550ea46b56d1f25cc32a99f917b891 commit 73a642c479550ea46b56d1f25cc32a99f917b891 Author: Konstantin Belousov AuthorDate: 2021-03-07 14:29:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 Add AT_EMPTY_PATH for several *at(2) syscalls (cherry picked from commit 509124b62616f73dcdc42263ee109392dafafd99) --- lib/libc/sys/access.2 | 13 +++++++++- lib/libc/sys/chflags.2 | 13 +++++++++- lib/libc/sys/chmod.2 | 13 +++++++++- lib/libc/sys/chown.2 | 13 +++++++++- lib/libc/sys/link.2 | 11 ++++++++- lib/libc/sys/stat.2 | 13 +++++++++- lib/libc/sys/utimensat.2 | 13 +++++++++- sys/kern/vfs_lookup.c | 63 ++++++++++++++++++++++++++++++++++++++++++------ sys/kern/vfs_syscalls.c | 63 +++++++++++++++++++++++++++++++++--------------- sys/sys/fcntl.h | 1 + sys/sys/namei.h | 3 +++ 11 files changed, 185 insertions(+), 34 deletions(-) diff --git a/lib/libc/sys/access.2 b/lib/libc/sys/access.2 index 13bfd7e5a88a..12af63385780 100644 --- a/lib/libc/sys/access.2 +++ b/lib/libc/sys/access.2 @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt ACCESS 2 .Os .Sh NAME @@ -129,6 +129,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Pp Even if a process's real or effective user has appropriate privileges diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2 index a44713904599..f8dfd59c39d3 100644 --- a/lib/libc/sys/chflags.2 +++ b/lib/libc/sys/chflags.2 @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt CHFLAGS 2 .Os .Sh NAME @@ -103,6 +103,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Pp If diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2 index 0127a5b629e4..44a1b18718f1 100644 --- a/lib/libc/sys/chmod.2 +++ b/lib/libc/sys/chmod.2 @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt CHMOD 2 .Os .Sh NAME @@ -110,6 +110,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Pp If diff --git a/lib/libc/sys/chown.2 b/lib/libc/sys/chown.2 index 4c45ce9174bb..467ff8a87e55 100644 --- a/lib/libc/sys/chown.2 +++ b/lib/libc/sys/chown.2 @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt CHOWN 2 .Os .Sh NAME @@ -127,6 +127,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Pp If diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2 index bcf03f17f3bb..37225f9571d0 100644 --- a/lib/libc/sys/link.2 +++ b/lib/libc/sys/link.2 @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt LINK 2 .Os .Sh NAME @@ -124,6 +124,15 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path2 +argument is an empty string, link the file referenced by the descriptor +.Fa fd2 . +The operation requires that the calling process has the +.Dv PRIV_VFS_FHOPEN +privilege, effectively being executed with effective user +.Dv root . .El .Pp If diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 0ed70620af63..55221d05a60e 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt STAT 2 .Os .Sh NAME @@ -111,6 +111,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Pp If diff --git a/lib/libc/sys/utimensat.2 b/lib/libc/sys/utimensat.2 index d31ee1f1515a..2af452898c9d 100644 --- a/lib/libc/sys/utimensat.2 +++ b/lib/libc/sys/utimensat.2 @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 30, 2021 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -155,6 +155,17 @@ See the description of the flag in the .Xr open 2 manual page. +.It Dv AT_EMPTY_PATH +If the +.Fa path +argument is an empty string, operate on the file or directory +referenced by the descriptor +.Fa fd . +If +.Fa fd +is equal to +.Dv AT_FDCWD , +operate on the current working directory. .El .Sh RETURN VALUES .Rv -std diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 07c89e634de4..f4ec3cea9fff 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -401,7 +401,9 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) } #endif } - if (error == 0 && (*dpp)->v_type != VDIR) + if (error == 0 && (*dpp)->v_type != VDIR && + (cnp->cn_pnbuf[0] != '\0' || + (cnp->cn_flags & EMPTYPATH) == 0)) error = ENOTDIR; } if (error == 0 && (cnp->cn_flags & RBENEATH) != 0) { @@ -458,23 +460,62 @@ namei_getpath(struct nameidata *ndp) &ndp->ni_pathlen); } - if (__predict_false(error != 0)) { - namei_cleanup_cnp(cnp); + if (__predict_false(error != 0)) return (error); - } /* - * Don't allow empty pathnames. + * Don't allow empty pathnames unless EMPTYPATH is specified. + * Caller checks for ENOENT as an indication for the empty path. */ - if (__predict_false(*cnp->cn_pnbuf == '\0')) { - namei_cleanup_cnp(cnp); + if (__predict_false(*cnp->cn_pnbuf == '\0')) return (ENOENT); - } cnp->cn_nameptr = cnp->cn_pnbuf; return (0); } +static int +namei_emptypath(struct nameidata *ndp) +{ + struct componentname *cnp; + struct pwd *pwd; + struct vnode *dp; + int error; + + cnp = &ndp->ni_cnd; + MPASS(*cnp->cn_pnbuf == '\0'); + MPASS((cnp->cn_flags & EMPTYPATH) != 0); + MPASS((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0); + + error = namei_setup(ndp, &dp, &pwd); + if (error != 0) { + namei_cleanup_cnp(cnp); + goto errout; + } + + ndp->ni_vp = dp; + vref(dp); + namei_cleanup_cnp(cnp); + pwd_drop(pwd); + ndp->ni_resflags |= NIRES_EMPTYPATH; + NDVALIDATE(ndp); + if ((cnp->cn_flags & LOCKLEAF) != 0) { + VOP_LOCK(dp, (cnp->cn_flags & LOCKSHARED) != 0 ? + LK_SHARED : LK_EXCLUSIVE); + if (VN_IS_DOOMED(dp)) { + vput(dp); + error = ENOENT; + goto errout; + } + } + SDT_PROBE4(vfs, namei, lookup, return, 0, ndp->ni_vp, false, ndp); + return (0); + +errout: + SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); + return (error); +} + /* * Convert a pathname into a pointer to a locked vnode. * @@ -555,6 +596,11 @@ namei(struct nameidata *ndp) error = namei_getpath(ndp); if (__predict_false(error != 0)) { + if (error == ENOENT && (cnp->cn_flags & EMPTYPATH) != 0) + return (namei_emptypath(ndp)); + namei_cleanup_cnp(cnp); + SDT_PROBE4(vfs, namei, lookup, return, error, NULL, + false, ndp); return (error); } @@ -588,6 +634,7 @@ namei(struct nameidata *ndp) ndp->ni_loopcnt = 0; error = namei_getpath(ndp); if (__predict_false(error != 0)) { + namei_cleanup_cnp(cnp); return (error); } /* FALLTHROUGH */ diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 48df8a3e9051..45f155ebff3d 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -129,6 +129,8 @@ at2cnpflags(u_int at_flags, u_int mask) res |= (at_flags & AT_SYMLINK_NOFOLLOW) != 0 ? NOFOLLOW : FOLLOW; } + if ((mask & AT_EMPTY_PATH) != 0 && (at_flags & AT_EMPTY_PATH) != 0) + res |= EMPTYPATH; return (res); } @@ -1496,12 +1498,13 @@ sys_linkat(struct thread *td, struct linkat_args *uap) int flag; flag = uap->flag; - if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | - AT_RESOLVE_BENEATH))); + AT_RESOLVE_BENEATH | AT_EMPTY_PATH))); } int hardlink_check_uid = 0; @@ -1578,6 +1581,23 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, LOCKPARENT | SAVENAME | AUDITVNODE2 | NOCACHE, segflag, path, fd, &cap_linkat_target_rights, td); if ((error = namei(&nd)) == 0) { + if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) { + error = priv_check(td, PRIV_VFS_FHOPEN); + if (error != 0) { + NDFREE(&nd, NDF_ONLY_PNBUF); + if (nd.ni_vp != NULL) { + if (nd.ni_dvp == nd.ni_vp) + vrele(nd.ni_dvp); + else + vput(nd.ni_dvp); + vrele(nd.ni_vp); + } else { + vput(nd.ni_dvp); + } + vrele(vp); + return (error); + } + } if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp == nd.ni_vp) @@ -2075,7 +2095,7 @@ kern_accessat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_EACCESS | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_EACCESS | AT_RESOLVE_BENEATH | AT_EMPTY_PATH)) != 0) return (EINVAL); if (amode != F_OK && (amode & ~(R_OK | W_OK | X_OK)) != 0) return (EINVAL); @@ -2096,8 +2116,8 @@ kern_accessat(struct thread *td, int fd, const char *path, usecred = cred; AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | - AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), - pathseg, path, fd, &cap_fstat_rights, td); + AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH | + AT_EMPTY_PATH), pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) goto out; vp = nd.ni_vp; @@ -2387,12 +2407,13 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, struct nameidata nd; int error; - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_RESOLVE_BENEATH | - AT_SYMLINK_NOFOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1, - pathseg, path, fd, &cap_fstat_rights, td); + AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF | + AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); if ((error = namei(&nd)) != 0) return (error); @@ -2710,7 +2731,8 @@ int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { - if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE, @@ -2743,8 +2765,8 @@ kern_chflagsat(struct thread *td, int fd, const char *path, AUDIT_ARG_FFLAGS(flags); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(atflag, AT_SYMLINK_NOFOLLOW | - AT_RESOLVE_BENEATH) | AUDITVNODE1, pathseg, path, fd, - &cap_fchflags_rights, td); + AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, + fd, &cap_fchflags_rights, td); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -2838,7 +2860,8 @@ int sys_fchmodat(struct thread *td, struct fchmodat_args *uap) { - if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); return (kern_fchmodat(td, uap->fd, uap->path, UIO_USERSPACE, @@ -2871,8 +2894,8 @@ kern_fchmodat(struct thread *td, int fd, const char *path, AUDIT_ARG_MODE(mode); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | - AT_RESOLVE_BENEATH) | AUDITVNODE1, pathseg, path, fd, - &cap_fchmod_rights, td); + AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, + fd, &cap_fchmod_rights, td); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -2966,7 +2989,8 @@ int sys_fchownat(struct thread *td, struct fchownat_args *uap) { - if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); return (kern_fchownat(td, uap->fd, uap->path, UIO_USERSPACE, uap->uid, @@ -2982,8 +3006,8 @@ kern_fchownat(struct thread *td, int fd, const char *path, AUDIT_ARG_OWNER(uid, gid); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | - AT_RESOLVE_BENEATH) | AUDITVNODE1, pathseg, path, fd, - &cap_fchown_rights, td); + AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, + fd, &cap_fchown_rights, td); if ((error = namei(&nd)) != 0) return (error); @@ -3334,13 +3358,14 @@ kern_utimensat(struct thread *td, int fd, const char *path, struct timespec ts[2]; int error, flags; - if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) return (EINVAL); if ((error = getutimens(tptr, tptrseg, ts, &flags)) != 0) return (error); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | - AT_RESOLVE_BENEATH) | AUDITVNODE1, + AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, fd, &cap_futimes_rights, td); if ((error = namei(&nd)) != 0) return (error); diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index bc2011c31e88..0fa4e7758c9d 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -224,6 +224,7 @@ typedef __pid_t pid_t; /* #define AT_UNUSED1 0x1000 *//* Was AT_BENEATH */ #define AT_RESOLVE_BENEATH 0x2000 /* Do not allow name resolution to walk out of dirfd */ +#define AT_EMPTY_PATH 0x4000 /* Operate on dirfd if path is empty */ #endif /* __BSD_VISIBLE */ /* diff --git a/sys/sys/namei.h b/sys/sys/namei.h index b6985f1fa6ff..5f3d917083a5 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -144,10 +144,12 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define WANTPARENT 0x0010 /* want parent vnode returned unlocked */ #define FAILIFEXISTS 0x0020 /* return EEXIST if found */ #define FOLLOW 0x0040 /* follow symbolic links */ +#define EMPTYPATH 0x0080 /* Allow empty path for *at */ #define LOCKSHARED 0x0100 /* Shared lock leaf */ #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ #define RBENEATH 0x100000000ULL /* No escape, even tmp, from start dir */ #define MODMASK 0xf000001ffULL /* mask of operational modifiers */ + /* * Namei parameter descriptors. * @@ -198,6 +200,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, */ #define NIRES_ABS 0x00000001 /* Path was absolute */ #define NIRES_STRICTREL 0x00000002 /* Restricted lookup result */ +#define NIRES_EMPTYPATH 0x00000004 /* EMPTYPATH used */ /* * Flags in ni_lcf, valid for the duration of the namei call. From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7407B5EE463; Fri, 23 Apr 2021 11:15: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 4FRWtF0xvJz4XSR; Fri, 23 Apr 2021 11: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 EAEDF40F9; Fri, 23 Apr 2021 11: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 13NBFVNH013730; Fri, 23 Apr 2021 11: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 13NBFV2H013729; Fri, 23 Apr 2021 11:15:31 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:31 GMT Message-Id: <202104231115.13NBFV2H013729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b0c1b3827e2f - stable/13 - open(2): Implement O_PATH 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/stable/13 X-Git-Reftype: branch X-Git-Commit: b0c1b3827e2f88bbde26d461417d8c25f9645d12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:33 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0c1b3827e2f88bbde26d461417d8c25f9645d12 commit b0c1b3827e2f88bbde26d461417d8c25f9645d12 Author: Konstantin Belousov AuthorDate: 2021-03-18 10:41:47 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 open(2): Implement O_PATH (cherry picked from commit 8d9ed174f3afba5f114742447e622fc1173d4774) --- lib/libc/sys/open.2 | 41 ++++++++++++++++++++++++++++++++- sys/kern/kern_descrip.c | 46 +++++++++++++++++++++++++++++++++---- sys/kern/vfs_aio.c | 5 ++++ sys/kern/vfs_lookup.c | 6 +++-- sys/kern/vfs_syscalls.c | 61 ++++++++++++++++++++++++++++++++++++++----------- sys/kern/vfs_vnops.c | 34 ++++++++++++++++----------- sys/sys/fcntl.h | 8 ++++--- sys/sys/file.h | 1 + sys/sys/filedesc.h | 2 ++ 9 files changed, 168 insertions(+), 36 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index e24c823d039a..f9c54bfc7581 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd February 23, 2021 +.Dd March 18, 2021 .Dt OPEN 2 .Os .Sh NAME @@ -168,6 +168,7 @@ O_DIRECTORY error if file is not a directory O_CLOEXEC set FD_CLOEXEC upon open O_VERIFY verify the contents of the file O_RESOLVE_BENEATH path resolution must not cross the fd directory +O_PATH record only the target path in the opened descriptor .Ed .Pp Opening a file with @@ -316,6 +317,44 @@ The primary use for this descriptor will be as the lookup descriptor for the .Fn *at family of functions. .Pp +.Dv O_PATH +returns a file descriptor that can be used as a directory file descriptor for +.Xr openat 2 +and other system calls taking a file descriptor argument, like +.Xr fstatat 2 +and others. +The other functionality of the returned file descriptor is limited to +the descriptor-level operations. +It can be used for +.Bl -tag -width SCM_RIGHTS -offset indent -compact +.It Xr fcntl 2 +but advisory locking is not allowed +.It Xr dup 2 +.It Xr close 2 +.It Xr fstat 2 +.It Xr fexecve 2 +requires that +.Dv O_EXEC +was also specified at open time +.It Dv SCM_RIGHTS +can be passed over a +.Xr unix 4 +socket using a +.Dv SCM_RIGHTS +message +.El +But operations like +.Xr read 2 , +.Xr ftruncate 2 , +and any other that operate on file and not on file descriptor (except +.Xr fstat 2 ), +are not allowed. +See also the description of +.Dv AT_EMPTY_PATH +flag for +.Xr fstatat 2 +and related syscalls. +.Pp If successful, .Fn open returns a non-negative integer, termed a file descriptor. diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 7a43fbb2eb80..81af58fbddd1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -546,6 +547,11 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, &fp); if (error != 0) break; + if (fp->f_ops == &path_fileops) { + fdrop(fp, td); + error = EBADF; + break; + } do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; @@ -610,7 +616,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp); if (error != 0) break; - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE || fp->f_ops == &path_fileops) { error = EBADF; fdrop(fp, td); break; @@ -715,7 +721,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp); if (error != 0) break; - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE || fp->f_ops == &path_fileops) { error = EBADF; fdrop(fp, td); break; @@ -771,7 +777,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) error = fget_unlocked(fdp, fd, &cap_no_rights, &fp); if (error != 0) break; - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE || fp->f_ops == &path_fileops) { fdrop(fp, td); error = EBADF; break; @@ -3544,7 +3550,7 @@ sys_flock(struct thread *td, struct flock_args *uap) error = fget(td, uap->fd, &cap_flock_rights, &fp); if (error != 0) return (error); - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE || fp->f_ops == &path_fileops) { fdrop(fp, td); return (EOPNOTSUPP); } @@ -4960,6 +4966,38 @@ struct fileops badfileops = { .fo_fill_kinfo = badfo_fill_kinfo, }; +static int +path_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) +{ + return (POLLNVAL); +} + +static int +path_close(struct file *fp, struct thread *td) +{ + MPASS(fp->f_type == DTYPE_VNODE); + fp->f_ops = &badfileops; + vrele(fp->f_vnode); + return (0); +} + +struct fileops path_fileops = { + .fo_read = badfo_readwrite, + .fo_write = badfo_readwrite, + .fo_truncate = badfo_truncate, + .fo_ioctl = badfo_ioctl, + .fo_poll = path_poll, + .fo_kqfilter = badfo_kqfilter, + .fo_stat = vn_statfile, + .fo_close = path_close, + .fo_chmod = badfo_chmod, + .fo_chown = badfo_chown, + .fo_sendfile = badfo_sendfile, + .fo_fill_kinfo = vn_fill_kinfo, + .fo_flags = DFLAG_PASSABLE, +}; + int invfo_rdwr(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 9b45a06c5f9f..640e82b6f0ff 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1619,6 +1619,11 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, goto err3; } + if (fp != NULL && fp->f_ops == &path_fileops) { + error = EBADF; + goto err3; + } + job->fd_file = fp; mtx_lock(&aio_job_mtx); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index f4ec3cea9fff..f979676f4c7d 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -360,8 +360,10 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd **pwdp) if (cnp->cn_flags & AUDITVNODE2) AUDIT_ARG_ATFD2(ndp->ni_dirfd); /* - * Effectively inlined fgetvp_rights, because we need to - * inspect the file as well as grabbing the vnode. + * Effectively inlined fgetvp_rights, because + * we need to inspect the file as well as + * grabbing the vnode. No check for O_PATH, + * files to implement its semantic. */ error = fget_cap(td, ndp->ni_dirfd, &rights, &dfp, &ndp->ni_filecaps); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 45f155ebff3d..5a1efcdec467 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -375,7 +375,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) int error; AUDIT_ARG_FD(fd); - error = getvnode(td, fd, &cap_fstatfs_rights, &fp); + error = getvnode_path(td, fd, &cap_fstatfs_rights, &fp); if (error != 0) return (error); vp = fp->f_vnode; @@ -891,7 +891,7 @@ sys_fchdir(struct thread *td, struct fchdir_args *uap) int error; AUDIT_ARG_FD(uap->fd); - error = getvnode(td, uap->fd, &cap_fchdir_rights, + error = getvnode_path(td, uap->fd, &cap_fchdir_rights, &fp); if (error != 0) return (error); @@ -1023,9 +1023,10 @@ change_dir(struct vnode *vp, struct thread *td) static __inline void flags_to_rights(int flags, cap_rights_t *rightsp) { - if (flags & O_EXEC) { cap_rights_set_one(rightsp, CAP_FEXECVE); + if (flags & O_PATH) + return; } else { switch ((flags & O_ACCMODE)) { case O_RDONLY: @@ -1112,11 +1113,15 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, AUDIT_ARG_MODE(mode); cap_rights_init_one(&rights, CAP_LOOKUP); flags_to_rights(flags, &rights); + /* * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags - * may be specified. + * may be specified. On the other hand, for O_PATH any mode + * except O_EXEC is ignored. */ - if (flags & O_EXEC) { + if ((flags & O_PATH) != 0) { + flags &= ~(O_CREAT | O_ACCMODE); + } else if ((flags & O_EXEC) != 0) { if (flags & O_ACCMODE) return (EINVAL); } else if ((flags & O_ACCMODE) == O_ACCMODE) { @@ -1145,8 +1150,10 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, * wonderous happened deep below and we just pass it up * pretending we know what we do. */ - if (error == ENXIO && fp->f_ops != &badfileops) + if (error == ENXIO && fp->f_ops != &badfileops) { + MPASS((flags & O_PATH) == 0); goto success; + } /* * Handle special fdopen() case. bleh. @@ -1176,14 +1183,16 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, * files that switched type in the cdevsw fdopen() method. */ fp->f_vnode = vp; + /* * If the file wasn't claimed by devfs bind it to the normal * vnode operations here. */ if (fp->f_ops == &badfileops) { - KASSERT(vp->v_type != VFIFO, + KASSERT(vp->v_type != VFIFO || (flags & O_PATH) != 0, ("Unexpected fifo fp %p vp %p", fp, vp)); - finit_vnode(fp, flags, NULL, &vnops); + finit_vnode(fp, flags, NULL, (flags & O_PATH) != 0 ? + &path_fileops : &vnops); } VOP_UNLOCK(vp); @@ -1882,7 +1891,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, fp = NULL; if (fd != FD_NONE) { - error = getvnode(td, fd, &cap_no_rights, &fp); + error = getvnode_path(td, fd, &cap_no_rights, &fp); if (error != 0) return (error); } @@ -4255,12 +4264,13 @@ out: } /* - * Convert a user file descriptor to a kernel file entry and check that, if it - * is a capability, the correct rights are present. A reference on the file - * entry is held upon returning. + * This variant of getvnode() allows O_PATH files. Caller should + * ensure that returned file and vnode are only used for compatible + * semantics. */ int -getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, + struct file **fpp) { struct file *fp; int error; @@ -4285,10 +4295,35 @@ getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) fdrop(fp, td); return (EINVAL); } + *fpp = fp; return (0); } +/* + * Convert a user file descriptor to a kernel file entry and check + * that, if it is a capability, the correct rights are present. + * A reference on the file entry is held upon returning. + */ +int +getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) +{ + int error; + + error = getvnode_path(td, fd, rightsp, fpp); + + /* + * Filter out O_PATH file descriptors, most getvnode() callers + * do not call fo_ methods. + */ + if (error == 0 && (*fpp)->f_ops == &path_fileops) { + fdrop(*fpp, td); + error = EBADF; + } + + return (error); +} + /* * Get an (NFS) file handle. */ diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 98f37d26ea8c..6339295b0556 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -391,25 +391,30 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, return (EOPNOTSUPP); if (vp->v_type != VDIR && fmode & O_DIRECTORY) return (ENOTDIR); + accmode = 0; - if (fmode & (FWRITE | O_TRUNC)) { - if (vp->v_type == VDIR) - return (EISDIR); - accmode |= VWRITE; + if ((fmode & O_PATH) == 0) { + if ((fmode & (FWRITE | O_TRUNC)) != 0) { + if (vp->v_type == VDIR) + return (EISDIR); + accmode |= VWRITE; + } + if ((fmode & FREAD) != 0) + accmode |= VREAD; + if ((fmode & O_APPEND) && (fmode & FWRITE)) + accmode |= VAPPEND; +#ifdef MAC + if ((fmode & O_CREAT) != 0) + accmode |= VCREAT; +#endif } - if (fmode & FREAD) - accmode |= VREAD; - if (fmode & FEXEC) + if ((fmode & FEXEC) != 0) accmode |= VEXEC; - if ((fmode & O_APPEND) && (fmode & FWRITE)) - accmode |= VAPPEND; #ifdef MAC - if (fmode & O_CREAT) - accmode |= VCREAT; - if (fmode & O_VERIFY) + if ((fmode & O_VERIFY) != 0) accmode |= VVERIFY; error = mac_vnode_check_open(cred, vp, accmode); - if (error) + if (error != 0) return (error); accmode &= ~(VCREAT | VVERIFY); @@ -419,6 +424,9 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, if (error != 0) return (error); } + if ((fmode & O_PATH) != 0) + return (0); + if (vp->v_type == VFIFO && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vn_lock(vp, LK_UPGRADE | LK_RETRY); error = VOP_OPEN(vp, fmode, cred, td, fp); diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 0fa4e7758c9d..c328abaa02af 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -135,7 +135,7 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE #define O_VERIFY 0x00200000 /* open only after verification */ -/* #define O_UNUSED1 0x00400000 */ /* Was O_BENEATH */ +#define O_PATH 0x00400000 /* fd is only a path */ #define O_RESOLVE_BENEATH 0x00800000 /* Do not allow name resolution to walk out of cwd */ #endif @@ -156,10 +156,12 @@ typedef __pid_t pid_t; /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) -#define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1) +#define OFLAGS(fflags) \ + (((fflags) & (O_EXEC | O_PATH)) != 0 ? (fflags) : (fflags) - 1) /* bits to save after open */ -#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|O_DIRECT|FEXEC) +#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK| \ + O_DIRECT|FEXEC|O_PATH) /* bits settable by fcntl(F_SETFL, ...) */ #define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FDSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT) diff --git a/sys/sys/file.h b/sys/sys/file.h index c4fc70f517a4..9237ee5ceb9d 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -239,6 +239,7 @@ struct xfile { extern struct fileops vnops; extern struct fileops badfileops; +extern struct fileops path_fileops; extern struct fileops socketops; extern int maxfiles; /* kernel limit on number of open files */ extern int maxfilesperproc; /* per process limit on number of open files */ diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 8c5aa258ed28..7f18d8a2286c 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -265,6 +265,8 @@ struct filedesc_to_leader * struct filedesc *fdp, struct proc *leader); int getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp); +int getvnode_path(struct thread *td, int fd, cap_rights_t *rightsp, + struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); int fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, From owner-dev-commits-src-all@freebsd.org Fri Apr 23 11:15:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF42C5EE5D9; Fri, 23 Apr 2021 11:15: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 4FRWtP1pl4z4XWD; Fri, 23 Apr 2021 11:15: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 910154161; Fri, 23 Apr 2021 11:15: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 13NBFbBT013863; Fri, 23 Apr 2021 11:15:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NBFbeK013862; Fri, 23 Apr 2021 11:15:37 GMT (envelope-from git) Date: Fri, 23 Apr 2021 11:15:37 GMT Message-Id: <202104231115.13NBFbeK013862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3df91ba10f31 - stable/13 - vn_open_vnode(): handle error when fp == NULL 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3df91ba10f31942067c55edd2f493daac19a81e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 11:15:41 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3df91ba10f31942067c55edd2f493daac19a81e4 commit 3df91ba10f31942067c55edd2f493daac19a81e4 Author: Konstantin Belousov AuthorDate: 2021-04-19 10:25:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-04-23 11:14:10 +0000 vn_open_vnode(): handle error when fp == NULL PR: 255119 (cherry picked from commit 54f98c4dbf9b1203a4e3e1b13fd0738441226991) --- sys/kern/vfs_vnops.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 9da35721def4..f715c9828d04 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -451,16 +451,34 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, /* * Error from advlock or VOP_ADD_WRITECOUNT() still requires * calling VOP_CLOSE() to pair with earlier VOP_OPEN(). - * Arrange for that by having fdrop() to use vn_closefile(). */ if (error != 0) { - fp->f_flag |= FOPENFAILED; - fp->f_vnode = vp; - if (fp->f_ops == &badfileops) { - fp->f_type = DTYPE_VNODE; - fp->f_ops = &vnops; + if (fp != NULL) { + /* + * Arrange the call by having fdrop() to use + * vn_closefile(). This is to satisfy + * filesystems like devfs or tmpfs, which + * override fo_close(). + */ + fp->f_flag |= FOPENFAILED; + fp->f_vnode = vp; + if (fp->f_ops == &badfileops) { + fp->f_type = DTYPE_VNODE; + fp->f_ops = &vnops; + } + vref(vp); + } else { + /* + * If there is no fp, due to kernel-mode open, + * we can call VOP_CLOSE() now. + */ + if (vp->v_type != VFIFO && (fmode & FWRITE) != 0 && + !MNT_EXTENDED_SHARED(vp->v_mount) && + VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + vn_lock(vp, LK_UPGRADE | LK_RETRY); + (void)VOP_CLOSE(vp, fmode & (FREAD | FWRITE | FEXEC), + cred, td); } - vref(vp); } ASSERT_VOP_LOCKED(vp, "vn_open_vnode"); From owner-dev-commits-src-all@freebsd.org Fri Apr 23 13:29:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEEDA5F365C; Fri, 23 Apr 2021 13:29: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 4FRZs1510yz4gYD; Fri, 23 Apr 2021 13:29: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 9A4945EFA; Fri, 23 Apr 2021 13:29: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 13NDTfBI088079; Fri, 23 Apr 2021 13:29:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NDTfbB088078; Fri, 23 Apr 2021 13:29:41 GMT (envelope-from git) Date: Fri, 23 Apr 2021 13:29:41 GMT Message-Id: <202104231329.13NDTfbB088078@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: 8e8f1cc9bb94 - main - Re-enable network ioctls in capability mode 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: 8e8f1cc9bb945ffaa4b49231e1ebcead1baa62ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 13:29:41 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8f1cc9bb945ffaa4b49231e1ebcead1baa62ce commit 8e8f1cc9bb945ffaa4b49231e1ebcead1baa62ce Author: Mark Johnston AuthorDate: 2021-04-23 13:14:42 +0000 Commit: Mark Johnston CommitDate: 2021-04-23 13:22:49 +0000 Re-enable network ioctls in capability mode This reverts a portion of 274579831b61 ("capsicum: Limit socket operations in capability mode") as at least rtsol and dhcpcd rely on being able to configure network interfaces while in capability mode. Reported by: bapt, Greg V Sponsored by: The FreeBSD Foundation --- contrib/capsicum-test/capmode.cc | 5 +++++ sys/kern/sys_socket.c | 2 +- sys/net/if.c | 9 --------- sys/net/route.c | 5 +---- sys/net/route.h | 4 +--- sys/netinet/in.c | 4 ---- sys/netinet6/in6.c | 4 ---- 7 files changed, 8 insertions(+), 25 deletions(-) diff --git a/contrib/capsicum-test/capmode.cc b/contrib/capsicum-test/capmode.cc index ba2de19879a0..f32d9e038744 100644 --- a/contrib/capsicum-test/capmode.cc +++ b/contrib/capsicum-test/capmode.cc @@ -227,6 +227,10 @@ FORK_TEST_F(WithFiles, AllowedSocketSyscallsIfRoot) { // Interface configuration ioctls are not permitted in capability // mode. + // + // This test is disabled for now as the corresponding kernel change was + // disabled. +#if 0 #ifdef __FreeBSD__ struct if_clonereq req; @@ -238,6 +242,7 @@ FORK_TEST_F(WithFiles, AllowedSocketSyscallsIfRoot) { free(req.ifcr_buffer); #endif +#endif } #ifdef HAVE_SEND_RECV_MMSG diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 52f4b6cdf7f9..e53b0367960b 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -271,7 +271,7 @@ soo_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, error = ifioctl(so, cmd, data, td); else if (IOCGROUP(cmd) == 'r') { CURVNET_SET(so->so_vnet); - error = rtioctl_fib(cmd, data, so->so_fibnum, td); + error = rtioctl_fib(cmd, data, so->so_fibnum); CURVNET_RESTORE(); } else { CURVNET_SET(so->so_vnet); diff --git a/sys/net/if.c b/sys/net/if.c index 5bf44d014db3..1e410142747f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2968,15 +2968,6 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) bool shutdown; #endif - /* - * Interface ioctls access a global namespace. There is currently no - * capability-based representation for interfaces, so the configuration - * interface is simply unaccessible from capability mode. If necessary, - * select ioctls may be permitted here. - */ - if (IN_CAPABILITY_MODE(td)) - return (ECAPMODE); - CURVNET_SET(so->so_vnet); #ifdef VIMAGE /* Make sure the VNET is stable. */ diff --git a/sys/net/route.c b/sys/net/route.c index f093a71b7585..2416aa9a983f 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -43,7 +43,6 @@ #include #include -#include #include #include #include @@ -246,10 +245,8 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, * Routing table ioctl interface. */ int -rtioctl_fib(u_long req, caddr_t data, u_int fibnum, struct thread *td) +rtioctl_fib(u_long req, caddr_t data, u_int fibnum) { - if (IN_CAPABILITY_MODE(td)) - return (ECAPMODE); /* * If more ioctl commands are added here, make sure the proper diff --git a/sys/net/route.h b/sys/net/route.h index 64e89965f9cd..67217f237e0b 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -431,13 +431,11 @@ void rt_updatemtu(struct ifnet *); void rt_flushifroutes(struct ifnet *ifp); -struct thread; - /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. */ -int rtioctl_fib(u_long, caddr_t, u_int, struct thread *); +int rtioctl_fib(u_long, caddr_t, u_int); int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 5f70dd1ec824..bcf071a81e0e 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -238,9 +237,6 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, if (ifp == NULL) return (EADDRNOTAVAIL); - if (td != NULL && IN_CAPABILITY_MODE(td)) - return (ECAPMODE); - /* * Filter out 4 ioctls we implement directly. Forward the rest * to specific functions and ifp->if_ioctl(). diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index de3db6dc7d33..02cb9df7da3a 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include -#include #include #include #include @@ -255,9 +254,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, int error; u_long ocmd = cmd; - if (td != NULL && IN_CAPABILITY_MODE(td)) - return (ECAPMODE); - /* * Compat to make pre-10.x ifconfig(8) operable. */ From owner-dev-commits-src-all@freebsd.org Fri Apr 23 14:28:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD2655F49D3; Fri, 23 Apr 2021 14:28: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 4FRc8h5zqqz4jvW; Fri, 23 Apr 2021 14:28: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 C05D769EC; Fri, 23 Apr 2021 14:28: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 13NESKD7066986; Fri, 23 Apr 2021 14:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NESKqC066985; Fri, 23 Apr 2021 14:28:20 GMT (envelope-from git) Date: Fri, 23 Apr 2021 14:28:20 GMT Message-Id: <202104231428.13NESKqC066985@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: d500a85e640d - main - dtrace tests: Fix tst.system.d after ping/ping6 unification 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: d500a85e640d1cd270747c12e17c511b53864436 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 14:28:20 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d500a85e640d1cd270747c12e17c511b53864436 commit d500a85e640d1cd270747c12e17c511b53864436 Author: Mark Johnston AuthorDate: 2021-04-23 14:28:09 +0000 Commit: Mark Johnston CommitDate: 2021-04-23 14:28:09 +0000 dtrace tests: Fix tst.system.d after ping/ping6 unification MFC after: 1 week Sponsored by: The FreeBSD Foundation --- .../opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d index 63a850133b3f..4d5cced71c79 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d @@ -35,11 +35,11 @@ BEGIN this->b = -2; system("echo %s %d %d", "foo", this->a, this->b); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -4 -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); - system("ping -q -c 1 localhost 2>/dev/null | grep -v '^round-trip '"); + system("ping -4 -q -c 1 127.0.0.1 2>/dev/null | grep -v '^round-trip '"); system("echo %d", ++this->a); exit(0); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 15:38:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44D9B5F6AA5; Fri, 23 Apr 2021 15:38: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 4FRdjy1Sykz4ml5; Fri, 23 Apr 2021 15:38: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 2558F78FB; Fri, 23 Apr 2021 15:38: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 13NFckLr061696; Fri, 23 Apr 2021 15:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NFcktZ061695; Fri, 23 Apr 2021 15:38:46 GMT (envelope-from git) Date: Fri, 23 Apr 2021 15:38:46 GMT Message-Id: <202104231538.13NFcktZ061695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f4c3c0189f7d - stable/13 - readelf: return error in case of invalid file 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f4c3c0189f7ddc324643c843097247f6df316ec5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 15:38:46 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f4c3c0189f7ddc324643c843097247f6df316ec5 commit f4c3c0189f7ddc324643c843097247f6df316ec5 Author: Ed Maste AuthorDate: 2021-04-23 15:37:49 +0000 Commit: Ed Maste CommitDate: 2021-04-23 15:37:49 +0000 readelf: return error in case of invalid file GNU readelf exits with an error for a number of invalid file cases. Previously ELF Tool Chain readelf always exited with 0. Now we exit 1 upon detecting an error with one or more input files, but in any case all of them are processed. This should catch common failure cases. We still do not report an error for some types of malformed ELF files, but this is consistent with GNU readelf. PR: 252727 Reviewed by: jkoshy, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29377 (cherry picked from commit ea444392bb5b351c930f28a02a4e68f51b25ba69) --- contrib/elftoolchain/readelf/readelf.c | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 022c9e9066ab..81e6897cf3cd 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -285,7 +285,7 @@ static const char *elf_osabi(unsigned int abi); static const char *elf_type(unsigned int type); static const char *elf_ver(unsigned int ver); static const char *dt_type(unsigned int mach, unsigned int dtype); -static void dump_ar(struct readelf *re, int); +static bool dump_ar(struct readelf *re, int); static void dump_arm_attributes(struct readelf *re, uint8_t *p, uint8_t *pe); static void dump_attributes(struct readelf *re); static uint8_t *dump_compatibility_tag(uint8_t *p, uint8_t *pe); @@ -315,7 +315,7 @@ static void dump_dwarf_ranges_foreach(struct readelf *re, Dwarf_Die die, Dwarf_Addr base); static void dump_dwarf_str(struct readelf *re); static void dump_eflags(struct readelf *re, uint64_t e_flags); -static void dump_elf(struct readelf *re); +static bool dump_elf(struct readelf *re); static void dump_flags(struct flag_desc *fd, uint64_t flags); static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); static void dump_dynamic(struct readelf *re); @@ -7211,18 +7211,18 @@ unload_sections(struct readelf *re) } } -static void +static bool dump_elf(struct readelf *re) { /* Fetch ELF header. No need to continue if it fails. */ if (gelf_getehdr(re->elf, &re->ehdr) == NULL) { warnx("gelf_getehdr failed: %s", elf_errmsg(-1)); - return; + return (false); } if ((re->ec = gelf_getclass(re->elf)) == ELFCLASSNONE) { warnx("gelf_getclass failed: %s", elf_errmsg(-1)); - return; + return (false); } if (re->ehdr.e_ident[EI_DATA] == ELFDATA2MSB) { re->dw_read = _read_msb; @@ -7266,6 +7266,7 @@ dump_elf(struct readelf *re) dump_dwarf(re); if (re->options & ~RE_H) unload_sections(re); + return (true); } static void @@ -7311,7 +7312,7 @@ dump_dwarf(struct readelf *re) dwarf_finish(re->dbg, &de); } -static void +static bool dump_ar(struct readelf *re, int fd) { Elf_Arsym *arsym; @@ -7362,14 +7363,14 @@ dump_ar(struct readelf *re, int fd) } if (elf_rand(re->ar, SARMAG) != SARMAG) { warnx("elf_rand() failed: %s", elf_errmsg(-1)); - return; + return (false); } } process_members: if ((re->options & ~RE_C) == 0) - return; + return (true); cmd = ELF_C_READ; while ((re->elf = elf_begin(fd, cmd, re->ar)) != NULL) { @@ -7389,11 +7390,14 @@ process_members: elf_end(re->elf); } re->elf = re->ar; + return (true); } -static void +static bool dump_object(struct readelf *re, int fd) { + bool rv = false; + if ((re->flags & DISPLAY_FILENAME) != 0) printf("\nFile: %s\n", re->filename); @@ -7407,10 +7411,10 @@ dump_object(struct readelf *re, int fd) warnx("Not an ELF file."); goto done; case ELF_K_ELF: - dump_elf(re); + rv = dump_elf(re); break; case ELF_K_AR: - dump_ar(re, fd); + rv = dump_ar(re, fd); break; default: warnx("Internal: libelf returned unknown elf kind."); @@ -7418,6 +7422,7 @@ dump_object(struct readelf *re, int fd) done: elf_end(re->elf); + return (rv); } static void @@ -7765,7 +7770,7 @@ main(int argc, char **argv) fileargs_t *fa; struct readelf *re, re_storage; unsigned long si; - int fd, opt, i; + int fd, opt, i, exit_code; char *ep; re = &re_storage; @@ -7906,16 +7911,19 @@ main(int argc, char **argv) err(1, "Unable to enter capability mode"); } + exit_code = EXIT_SUCCESS; for (i = 0; i < argc; i++) { re->filename = argv[i]; fd = fileargs_open(fa, re->filename); if (fd < 0) { warn("open %s failed", re->filename); + exit_code = EXIT_FAILURE; } else { - dump_object(re, fd); + if (!dump_object(re, fd)) + exit_code = EXIT_FAILURE; close(fd); } } - exit(EXIT_SUCCESS); + exit(exit_code); } From owner-dev-commits-src-all@freebsd.org Fri Apr 23 15:46:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF6E35F6FA3; Fri, 23 Apr 2021 15:46: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 4FRdvN6QFcz4nSR; Fri, 23 Apr 2021 15:46: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 CB5AF7DAC; Fri, 23 Apr 2021 15:46: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 13NFkunB075000; Fri, 23 Apr 2021 15:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NFkugl074999; Fri, 23 Apr 2021 15:46:56 GMT (envelope-from git) Date: Fri, 23 Apr 2021 15:46:56 GMT Message-Id: <202104231546.13NFkugl074999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: bba9922d9995 - stable/13 - flex: Regen bootstrap files 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bba9922d99959d1ec17e9869eda20ed023dab9e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 15:46:57 -0000 The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=bba9922d99959d1ec17e9869eda20ed023dab9e3 commit bba9922d99959d1ec17e9869eda20ed023dab9e3 Author: Jung-uk Kim AuthorDate: 2021-04-19 18:20:51 +0000 Commit: Jung-uk Kim CommitDate: 2021-04-23 15:46:30 +0000 flex: Regen bootstrap files This also partially reverts r326025 (8a16b7a18f5d). I do not see any point of adding SPDX tag in generated file. Submitted by: Dan McGregor (initial version) Differential Revision: https://reviews.freebsd.org/D28596 (cherry picked from commit 686cf5468c4a85c2a6385cdbab2383900876a41d) --- usr.bin/lex/initparse.c | 17 ++++++++++------- usr.bin/lex/initparse.h | 1 - usr.bin/lex/initscan.c | 5 ++++- usr.bin/lex/initskel.c | 9 ++++----- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/usr.bin/lex/initparse.c b/usr.bin/lex/initparse.c index c723c5b45c40..c95305aa1a91 100644 --- a/usr.bin/lex/initparse.c +++ b/usr.bin/lex/initparse.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* original parser id follows */ /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ @@ -6,7 +5,7 @@ #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 -#define YYPATCH 20170430 +#define YYPATCH 20200330 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -19,8 +18,6 @@ #define YYPURE 0 #line 35 "parse.y" -/* SPDX-License-Identifier: BSD-2-Clause */ - /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */ @@ -130,6 +127,10 @@ typedef int YYSTYPE; # define YYLEX yylex() #endif +#if !(defined(yylex) || defined(YYSTATE)) +int YYLEX_DECL(); +#endif + /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) @@ -488,13 +489,15 @@ static const char *const yyrule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE @@ -655,7 +658,7 @@ void yyerror( const char *msg ) { (void)msg; } -#line 656 "parse.c" +#line 662 "parse.c" #if YYDEBUG #include /* needed for printf */ @@ -1781,7 +1784,7 @@ case 96: #line 946 "parse.y" { yyval = mkstate( SYM_EPSILON ); } break; -#line 1782 "parse.c" +#line 1788 "parse.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/usr.bin/lex/initparse.h b/usr.bin/lex/initparse.h index fb0742445d55..b630d282c635 100644 --- a/usr.bin/lex/initparse.h +++ b/usr.bin/lex/initparse.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #define CHAR 257 #define NUMBER 258 #define SECTEND 259 diff --git a/usr.bin/lex/initscan.c b/usr.bin/lex/initscan.c index 46070a4c6dc5..9b6fb4ae5183 100644 --- a/usr.bin/lex/initscan.c +++ b/usr.bin/lex/initscan.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ #line 2 "" @@ -4578,7 +4577,11 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) +#ifdef YY_FLEX_LEX_COMPAT return 0; +#else + return EOF; +#endif if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; diff --git a/usr.bin/lex/initskel.c b/usr.bin/lex/initskel.c index a7a69875521d..53a0ae452aa8 100644 --- a/usr.bin/lex/initskel.c +++ b/usr.bin/lex/initskel.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* File created from flex.skl via mkskel.sh */ #include "flexdef.h" @@ -448,11 +447,7 @@ const char *skel[] = { "/* First, we deal with platform-specific or compiler-specific issues. */", "", "#if defined(__FreeBSD__)", - "#ifndef __STDC_LIMIT_MACROS", - "#define __STDC_LIMIT_MACROS", - "#endif", "#include ", - "#include ", "#else", "#define __dead2", "#endif", @@ -2301,7 +2296,11 @@ const char *skel[] = { " case EOB_ACT_END_OF_FILE:", " {", " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )", + "#ifdef YY_FLEX_LEX_COMPAT", " return 0;", + "#else", + " return EOF;", + "#endif", "", " if ( ! YY_G(yy_did_buffer_switch_on_eof) )", " YY_NEW_FILE;", From owner-dev-commits-src-all@freebsd.org Fri Apr 23 15:59:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9CBF5F7823; Fri, 23 Apr 2021 15:59: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 4FRfBB4vm8z4ndg; Fri, 23 Apr 2021 15:59: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 9BF7D7BC1; Fri, 23 Apr 2021 15:59: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 13NFxkNR089300; Fri, 23 Apr 2021 15:59:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NFxkNA089299; Fri, 23 Apr 2021 15:59:46 GMT (envelope-from git) Date: Fri, 23 Apr 2021 15:59:46 GMT Message-Id: <202104231559.13NFxkNA089299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: f1dab9dbdf12 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: f1dab9dbdf125d010213a7ac5ee778cd8fbf0a1a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 15:59:46 -0000 The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=f1dab9dbdf125d010213a7ac5ee778cd8fbf0a1a commit f1dab9dbdf125d010213a7ac5ee778cd8fbf0a1a Author: Jung-uk Kim AuthorDate: 2021-02-11 23:31:53 +0000 Commit: Jung-uk Kim CommitDate: 2021-04-23 15:59:29 +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. (cherry picked from commit 34e67bb5977049afb3e965b52b86ac12ea4899b4) --- 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-all@freebsd.org Fri Apr 23 16:06:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 219BF5F7A3B; Fri, 23 Apr 2021 16:06: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 4FRfKx0Qdxz4pRl; Fri, 23 Apr 2021 16:06: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 01B251068F; Fri, 23 Apr 2021 16:06: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 13NG6SQd003049; Fri, 23 Apr 2021 16:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NG6Shs003048; Fri, 23 Apr 2021 16:06:28 GMT (envelope-from git) Date: Fri, 23 Apr 2021 16:06:28 GMT Message-Id: <202104231606.13NG6Shs003048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 87c0db9d0174 - stable/13 - Cirrus-CI: use FreeBSD 13.0 image for base system CI build 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 87c0db9d0174fb1906a58d2f3bd5aff6dad528de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 16:06:29 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87c0db9d0174fb1906a58d2f3bd5aff6dad528de commit 87c0db9d0174fb1906a58d2f3bd5aff6dad528de Author: Ed Maste AuthorDate: 2021-04-19 18:36:21 +0000 Commit: Ed Maste CommitDate: 2021-04-23 16:05:34 +0000 Cirrus-CI: use FreeBSD 13.0 image for base system CI build We generally want to build and test on the highest release version, and FreeBSD 13.0 also brings some performance benefits. Reviewed by: lwhsu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29842 (cherry picked from commit 407abff2b91847e23711625ad7c69c17e99b3d1d) --- .cirrus.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 323567685b68..ff144699675e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,9 +1,9 @@ # $FreeBSD$ freebsd_instance: - # image: freebsd-12-1-stable-amd64 - # We need a newer image to install llvm11 - image_family: freebsd-12-1-snap + # Image list available via + # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images + image: freebsd-13-0-release-amd64 cpu: 8 memory: 24G From owner-dev-commits-src-all@freebsd.org Fri Apr 23 16:45:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53E495F8E62; Fri, 23 Apr 2021 16:45: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 4FRgBS1zWHz4rBJ; Fri, 23 Apr 2021 16:45: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 3700510AD6; Fri, 23 Apr 2021 16:45: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 13NGj4Qb056228; Fri, 23 Apr 2021 16:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NGj414056227; Fri, 23 Apr 2021 16:45:04 GMT (envelope-from git) Date: Fri, 23 Apr 2021 16:45:04 GMT Message-Id: <202104231645.13NGj414056227@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: b0df36580d5b - main - etcupdate: Remove the old pre-world tree when rotating for -p. 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: b0df36580d5b0df67a0f58ded8f6356b268f7f71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 16:45:04 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b0df36580d5b0df67a0f58ded8f6356b268f7f71 commit b0df36580d5b0df67a0f58ded8f6356b268f7f71 Author: John Baldwin AuthorDate: 2021-04-23 16:40:04 +0000 Commit: John Baldwin CommitDate: 2021-04-23 16:44:18 +0000 etcupdate: Remove the old pre-world tree when rotating for -p. This fixes a bug in an earlier change to move tree rotation to the end of the update where the step to make room for the new preworld tree was deleting the old "current" tree instead of the old "preworld" tree. Reported by: olivier, dhw Fixes: 0611aec3cf3a373e6a06f103699dbc91c3d6d472 MFC after: 2 weeks --- usr.sbin/etcupdate/etcupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index bb9eb00bc646..254a72abae08 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -1644,7 +1644,7 @@ EOF if [ -z "$preworld" ]; then panic "New tree should be rotated to old" fi - if ! remove_tree $old; then + if ! remove_tree $new; then echo "Unable to remove previous pre-world tree." exit 1 fi From owner-dev-commits-src-all@freebsd.org Fri Apr 23 19:15:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 760835FD095 for ; Fri, 23 Apr 2021 19:15: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 4FRkXF2hTNz3Fj3; Fri, 23 Apr 2021 19:15: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 4A22E12E8D; Fri, 23 Apr 2021 19:15: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 13NJFf5C055962; Fri, 23 Apr 2021 19:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NJFee1055959; Fri, 23 Apr 2021 19:15:40 GMT (envelope-from git) Date: Fri, 23 Apr 2021 19:15:40 GMT Message-Id: <202104231915.13NJFee1055959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 206be79acbde - vendor/openssh - Vendor import of OpenSSH 8.5p1 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/vendor/openssh X-Git-Reftype: branch X-Git-Commit: 206be79acbdeb88ea254ac622a60a4ee8015c5f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 19:15:41 -0000 The branch vendor/openssh has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=206be79acbdeb88ea254ac622a60a4ee8015c5f6 commit 206be79acbdeb88ea254ac622a60a4ee8015c5f6 Author: Ed Maste AuthorDate: 2021-04-23 19:10:38 +0000 Commit: Ed Maste CommitDate: 2021-04-23 19:10:38 +0000 Vendor import of OpenSSH 8.5p1 --- .depend | 197 +- .github/configs | 110 + .github/configure.sh | 6 + .github/run_test.sh | 29 +- .github/setup_ci.sh | 60 +- .github/workflows/c-cpp.yml | 56 +- .github/workflows/selfhosted.yml | 68 + .skipped-commit-ids | 1 + ChangeLog | 16567 ++++++++++--------- INSTALL | 1 + LICENCE | 62 + Makefile.in | 20 +- PROTOCOL | 62 +- PROTOCOL.agent | 8 +- README | 2 +- README.md | 10 +- README.platform | 16 +- addr.c | 423 + addr.h | 60 + addrmatch.c | 349 +- auth-options.c | 15 +- auth-pam.c | 6 + auth-passwd.c | 6 +- auth-rhosts.c | 6 +- auth.c | 192 +- auth.h | 8 +- auth2-chall.c | 37 +- auth2-gss.c | 29 +- auth2-hostbased.c | 60 +- auth2-kbdint.c | 4 +- auth2-none.c | 4 +- auth2-passwd.c | 4 +- auth2-pubkey.c | 131 +- auth2.c | 58 +- authfd.c | 67 +- buildpkg.sh.in | 8 +- canohost.c | 8 +- channels.c | 490 +- cipher.c | 4 +- clientloop.c | 563 +- compat.c | 48 +- compat.h | 12 +- config.h.in | 21 +- configure | 508 +- configure.ac | 78 +- contrib/redhat/openssh.spec | 2 +- contrib/ssh-copy-id | 185 +- contrib/ssh-copy-id.1 | 9 +- contrib/suse/openssh.spec | 2 +- crypto_api.h | 18 +- defines.h | 7 + dh.c | 6 +- digest-openssl.c | 10 +- dns.c | 7 +- fatal.c | 7 +- gss-genr.c | 19 +- hostfile.c | 201 +- hostfile.h | 24 +- int32_minmax.inc | 0 kex.c | 133 +- kex.h | 18 +- kexdh.c | 3 +- kexgen.c | 24 +- kexgexc.c | 14 +- kexgexs.c | 7 +- kexsntrup4591761x25519.c => kexsntrup761x25519.c | 84 +- krl.c | 100 +- log.c | 198 +- log.h | 88 +- m4/openssh.m4 | 17 +- match.c | 8 +- misc.c | 373 +- misc.h | 28 +- moduli | 859 +- monitor.c | 392 +- monitor_fdpass.c | 24 +- monitor_wrap.c | 255 +- monitor_wrap.h | 5 +- msg.c | 16 +- mux.c | 562 +- myproposal.h | 14 +- nchan.c | 67 +- openbsd-compat/explicit_bzero.c | 10 +- openbsd-compat/mktemp.c | 4 +- openbsd-compat/openbsd-compat.h | 6 +- openbsd-compat/openssl-compat.h | 4 + openbsd-compat/port-linux.c | 25 +- openbsd-compat/port-net.c | 1 + openbsd-compat/sha2.c | 2 +- packet.c | 96 +- readconf.c | 747 +- readconf.h | 18 +- readpass.c | 71 +- regress/Makefile | 9 +- regress/agent.sh | 6 +- regress/cert-hostkey.sh | 6 +- regress/cert-userkey.sh | 22 +- regress/connect-privsep.sh | 2 +- regress/dhgex.sh | 4 +- regress/hostkey-rotate.sh | 7 +- regress/key-options.sh | 2 +- regress/keytype.sh | 6 +- regress/knownhosts-command.sh | 53 + regress/limit-keytype.sh | 18 +- regress/misc/Makefile | 2 +- regress/misc/fuzz-harness/Makefile | 46 +- regress/misc/fuzz-harness/agent_fuzz.cc | 15 + regress/misc/fuzz-harness/agent_fuzz_helper.c | 177 + regress/misc/fuzz-harness/fixed-keys.h | 119 + regress/misc/fuzz-harness/kex_fuzz.cc | 461 + regress/misc/fuzz-harness/testdata/README | 4 + .../fuzz-harness/testdata/create-agent-corpus.sh | 44 + regress/misc/fuzz-harness/testdata/id_dsa | 21 + regress/misc/fuzz-harness/testdata/id_dsa-cert.pub | 1 + regress/misc/fuzz-harness/testdata/id_dsa.pub | 1 + regress/misc/fuzz-harness/testdata/id_ecdsa | 8 + .../misc/fuzz-harness/testdata/id_ecdsa-cert.pub | 1 + regress/misc/fuzz-harness/testdata/id_ecdsa.pub | 1 + regress/misc/fuzz-harness/testdata/id_ecdsa_sk | 14 + .../fuzz-harness/testdata/id_ecdsa_sk-cert.pub | 1 + regress/misc/fuzz-harness/testdata/id_ecdsa_sk.pub | 1 + regress/misc/fuzz-harness/testdata/id_ed25519 | 7 + .../misc/fuzz-harness/testdata/id_ed25519-cert.pub | 1 + regress/misc/fuzz-harness/testdata/id_ed25519.pub | 2 + regress/misc/fuzz-harness/testdata/id_ed25519_sk | 8 + .../fuzz-harness/testdata/id_ed25519_sk-cert.pub | 1 + .../misc/fuzz-harness/testdata/id_ed25519_sk.pub | 1 + regress/misc/fuzz-harness/testdata/id_rsa | 27 + regress/misc/fuzz-harness/testdata/id_rsa-cert.pub | 1 + regress/misc/fuzz-harness/testdata/id_rsa.pub | 1 + regress/misc/kexfuzz/Makefile | 101 - regress/misc/kexfuzz/README | 34 - regress/misc/kexfuzz/kexfuzz.c | 453 - regress/misc/sk-dummy/fatal.c | 11 +- regress/misc/sk-dummy/sk-dummy.c | 7 + regress/netcat.c | 3 + regress/percent.sh | 2 +- regress/sshcfgparse.sh | 26 +- regress/test-exec.sh | 32 +- regress/unittests/conversion/Makefile | 3 +- regress/unittests/conversion/tests.c | 34 +- regress/unittests/hostkeys/Makefile | 4 +- regress/unittests/hostkeys/test_iterate.c | 91 +- regress/unittests/kex/Makefile | 8 +- regress/unittests/kex/test_kex.c | 4 +- regress/unittests/match/Makefile | 4 +- regress/unittests/misc/tests.c | 43 +- regress/unittests/sshbuf/Makefile | 3 +- regress/unittests/sshkey/Makefile | 4 +- regress/unittests/sshsig/Makefile | 4 +- sandbox-pledge.c | 8 +- sandbox-rlimit.c | 18 +- sandbox-seccomp-filter.c | 9 + scp.0 | 19 +- scp.1 | 17 +- scp.c | 6 +- servconf.c | 200 +- servconf.h | 17 +- serverloop.c | 88 +- session.c | 162 +- sftp-client.c | 234 +- sftp-client.h | 15 +- sftp-common.c | 4 +- sftp-server.c | 163 +- sftp.0 | 28 +- sftp.1 | 36 +- sftp.c | 77 +- sk-api.h | 4 +- sk-usbhid.c | 9 +- sntrup4591761.c | 1083 -- sntrup4591761.sh | 57 - sntrup761.c | 1273 ++ sntrup761.sh | 85 + srclimit.c | 140 + srclimit.h | 18 + ssh-add.c | 40 +- ssh-agent.c | 599 +- ssh-ed25519-sk.c | 5 +- ssh-ed25519.c | 5 +- ssh-gss.h | 4 +- ssh-keygen.0 | 28 +- ssh-keygen.1 | 23 +- ssh-keygen.c | 323 +- ssh-keyscan.c | 26 +- ssh-keysign.c | 55 +- ssh-pkcs11-client.c | 53 +- ssh-pkcs11-helper.c | 72 +- ssh-pkcs11.c | 100 +- ssh-sk-client.c | 77 +- ssh-sk-helper.c | 47 +- ssh-sk.c | 98 +- ssh-xmss.c | 9 +- ssh.0 | 8 +- ssh.1 | 10 +- ssh.c | 406 +- ssh2.h | 4 +- ssh_api.c | 33 +- ssh_config.0 | 207 +- ssh_config.5 | 233 +- sshconnect.c | 544 +- sshconnect.h | 47 +- sshconnect2.c | 372 +- sshd.c | 231 +- sshd_config.0 | 135 +- sshd_config.5 | 115 +- sshkey-xmss.c | 18 +- sshkey-xmss.h | 6 +- sshkey.c | 68 +- sshkey.h | 19 +- sshlogin.c | 4 +- sshpty.c | 1 + sshsig.c | 120 +- ttymodes.c | 44 +- version.h | 4 +- 214 files changed, 19091 insertions(+), 16088 deletions(-) diff --git a/.depend b/.depend index f05bd9d7483c..c7bff499c5a3 100644 --- a/.depend +++ b/.depend @@ -2,103 +2,104 @@ # Run "make depend" to rebuild. # DO NOT DELETE -addrmatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h match.h log.h +addr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h +addrmatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h match.h log.h ./ssherr.h atomicio.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h audit-bsm.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h audit-linux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h audit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-bsdauth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h sshbuf.h sshkey.h misc.h servconf.h uidswap.h hostfile.h auth.h auth-pam.h audit.h loginrec.h -auth-options.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h log.h sshbuf.h misc.h sshkey.h match.h ssh2.h auth-options.h +auth-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h sshbuf.h sshkey.h misc.h servconf.h uidswap.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth-options.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ./ssherr.h log.h sshbuf.h misc.h sshkey.h match.h ssh2.h auth-options.h auth-pam.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h ssherr.h log.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h -auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h misc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h ./ssherr.h log.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h +auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h ./ssherr.h misc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-shadow.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-sia.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch.h authfile. h -auth.o: monitor_wrap.h ssherr.h compat.h channels.h -auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h misc.h servconf.h +auth.o: authfile.h monitor_wrap.h compat.h channels.h +auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h ./ssherr.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch. h +auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ./ssherr.h log.h misc.h servconf.h auth2-gss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h log.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h canohost.h monitor_wrap.h pathnames.h -auth2-hostbased.o: ssherr.h match.h -auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h misc.h servconf.h ssherr.h -auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h misc.h servconf.h compat.h ssh2.h ssherr.h monitor_wrap.h -auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h -auth2-pubkey.o: canohost.h monitor_wrap.h authfile.h match.h ssherr.h channels.h session.h sk-api.h -auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h log.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h uidswap.h auth-options.h +auth2-hostbased.o: canohost.h monitor_wrap.h pathnames.h match.h +auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ./ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h ./ssherr.h misc.h servconf.h +auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h misc.h servconf.h compat.h ssh2.h monitor_wrap.h +auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ./ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h +auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ./ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h auth2.o: digest.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h ssherr.h monitor_wrap.h -authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h atomicio.h misc.h ssherr.h -authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h ssherr.h krl.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h +authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h ./ssherr.h atomicio.h misc.h +authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ./ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h -canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h canohost.h misc.h +canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h canohost.h misc.h chacha.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h chacha.h -channels.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h ssherr.h sshbuf.h packet.h dispatch.h log.h misc.h channels.h compat.h canohost.h sshkey.h authfd.h pathnames.h match.h +channels.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h ./ssherr.h sshbuf.h packet.h dispatch.h log.h misc.h channels.h compat.h canohost.h sshkey.h authfd.h pathnames.h match.h cipher-aes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h cipher-aesctr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher-aesctr.h rijndael.h cipher-chachapoly-libcrypto.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -cipher-chachapoly.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h sshbuf.h ssherr.h cipher-chachapoly.h chacha.h poly1305.h +cipher-chachapoly.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshbuf.h cipher-chachapoly.h chacha.h poly1305.h cipher-ctr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h misc.h sshbuf.h ssherr.h digest.h openbsd-compat/openssl-compat.h -cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h +cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h misc.h sshbuf.h ./ssherr.h digest.h openbsd-compat/openssl-compat.h +cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h clientloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h packet.h dispatch.h sshbuf.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h -clientloop.o: myproposal.h log.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h ssherr.h hostfile.h -compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h match.h kex.h mac.h crypto_api.h +clientloop.o: myproposal.h log.h ./ssherr.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h hostfile.h +compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ./ssherr.h match.h kex.h mac.h crypto_api.h dh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h digest.h +digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h digest.h digest-openssl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h ssherr.h -dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ssherr.h dns.h log.h digest.h +dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ./ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h +dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ./ssherr.h dns.h log.h digest.h ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ge25519.h fe25519.h sc25519.h entropy.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -fatal.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h +fatal.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h fe25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h fe25519.h crypto_api.h ge25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h fe25519.h crypto_api.h sc25519.h ge25519.h ge25519_base.data -groupaccess.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h groupaccess.h match.h log.h +groupaccess.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h groupaccess.h match.h log.h ./ssherr.h gss-genr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h gss-serv-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h gss-serv.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h hmac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h digest.h hmac.h -hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h misc.h pathnames.h ssherr.h digest.h hmac.h -kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h match.h -kex.o: misc.h monitor.h ssherr.h sshbuf.h digest.h -kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ssherr.h ssh2.h +hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h ./ssherr.h misc.h pathnames.h digest.h hmac.h sshbuf.h +kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h ./ssherr. h +kex.o: match.h misc.h monitor.h sshbuf.h digest.h +kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ./ssherr.h ssh2.h kexdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h -kexgen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h log.h packet.h openbsd-compat/sys-queue.h dispatch.h ssh2.h sshbuf.h digest.h ssherr.h +kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h +kexgen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h log.h ./ssherr.h packet.h openbsd-compat/sys-queue.h dispatch.h ssh2.h sshbuf.h digest.h kexgex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexgexc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexgexs.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -kexsntrup4591761x25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ssherr.h -krl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h sshbuf.h ssherr.h sshkey.h authfile.h misc.h log.h digest.h bitmap.h utf8.h krl.h -log.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h -loginrec.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h hostfile.h ssh.h loginrec.h log.h atomicio.h packet.h openbsd-compat/sys-queue.h dispatch.h canohost.h auth.h auth-pam.h audit.h sshbuf.h ssherr.h +kexsntrup761x25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h +krl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h sshbuf.h ./ssherr.h sshkey.h authfile.h misc.h log.h digest.h bitmap.h utf8.h krl.h +log.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h match.h +loginrec.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h hostfile.h ssh.h loginrec.h log.h ./ssherr.h atomicio.h packet.h openbsd-compat/sys-queue.h dispatch.h canohost.h auth.h auth-pam.h audit.h sshbuf.h logintest.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h loginrec.h -mac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest.h hmac.h umac.h mac.h misc.h ssherr.h sshbuf.h openbsd-compat/openssl-compat.h +mac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest.h hmac.h umac.h mac.h misc.h ./ssherr.h sshbuf.h openbsd-compat/openssl-compat.h match.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h misc.h md5crypt.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h log.h ssh.h sshbuf.h ssherr.h +misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h log.h ./ssherr.h ssh.h sshbuf.h moduli.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -monitor.o: chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h dh.h packet.h dispatch.h auth-options.h sshpty.h channels.h session.h sshlogin.h canohost.h log.h misc.h servconf.h monitor.h monitor_wrap.h monitor_fdpass.h compat.h ssh2.h authfd.h match.h ssherr.h sk-api.h +monitor.o: chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h dh.h packet.h dispatch.h auth-options.h sshpty.h channels.h session.h sshlogin.h canohost.h log.h ./ssherr.h misc.h servconf.h monitor.h monitor_wrap.h monitor_fdpass.h compat.h ssh2.h authfd.h match.h sk-api.h monitor.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h openbsd-compat/openssl-compat.h atomicio.h xmalloc.h ssh.h sshkey.h sshbuf.h hostfile.h auth.h auth-pam.h audit.h loginrec.h cipher.h cipher-chachapoly.h -monitor_fdpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h monitor_fdpass.h +monitor_fdpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h monitor_fdpass.h monitor_wrap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h -monitor_wrap.o: loginrec.h auth-options.h packet.h dispatch.h log.h monitor.h monitor_wrap.h atomicio.h monitor_fdpass.h misc.h channels.h session.h servconf.h ssherr.h -msg.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h ssherr.h log.h atomicio.h msg.h misc.h -mux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h log.h ssh.h ssh2.h pathnames.h misc.h match.h sshbuf.h channels.h msg.h packet.h dispatch.h monitor_fdpass.h sshpty.h sshkey.h readconf.h clientloop.h ssherr.h -nchan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h ssh2.h sshbuf.h ssherr.h packet.h dispatch.h channels.h compat.h log.h -packet.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h compat.h ssh2.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h digest.h log.h canohost.h misc.h channels.h ssh.h -packet.o: packet.h dispatch.h ssherr.h sshbuf.h +monitor_wrap.o: loginrec.h auth-options.h packet.h dispatch.h log.h ./ssherr.h monitor.h monitor_wrap.h atomicio.h monitor_fdpass.h misc.h channels.h session.h servconf.h +msg.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h ./ssherr.h log.h atomicio.h msg.h misc.h +mux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h log.h ./ssherr.h ssh.h ssh2.h pathnames.h misc.h match.h sshbuf.h channels.h msg.h packet.h dispatch.h monitor_fdpass.h sshpty.h sshkey.h readconf.h clientloop.h +nchan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h ssh2.h sshbuf.h ./ssherr.h packet.h dispatch.h channels.h compat.h log.h +packet.o: channels.h ssh.h packet.h dispatch.h sshbuf.h +packet.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h compat.h ssh2.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h digest.h log.h ./ssherr.h canohost.h misc.h platform-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h platform-pledge.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h -platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h +platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h poly1305.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h poly1305.h progressmeter.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h progressmeter.h atomicio.h misc.h utf8.h -readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h +readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ./ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api. h readconf.o: uidswap.h myproposal.h digest.h -readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ssh.h uidswap.h +readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ./ssherr.h ssh.h uidswap.h rijndael.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h rijndael.h sandbox-capsicum.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-darwin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -109,70 +110,72 @@ sandbox-seccomp-filter.o: includes.h config.h defines.h platform.h openbsd-compa sandbox-solaris.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-systrace.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sc25519.h crypto_api.h -scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h atomicio.h pathnames.h log.h misc.h progressmeter.h utf8.h -servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h -servconf.o: mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h ssherr.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h -serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr .h -serverloop.o: rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h ssherr.h -session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h +scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h atomicio.h pathnames.h log.h ./ssherr.h misc.h progressmeter.h utf8.h +servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ./ssherr.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h +servconf.o: sshkey.h kex.h mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h +serverloop.o: cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h +serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ./ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h +session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ./ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h session.o: rijndael.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h -sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h -sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h +sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ./ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h +sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ./ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h sftp-glob.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h sftp-realpath.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sftp-server-main.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h sftp.h misc.h xmalloc.h -sftp-server.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshbuf.h ssherr.h log.h misc.h match.h uidswap.h sftp.h sftp-common.h -sftp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h pathnames.h misc.h utf8.h sftp.h ssherr.h sshbuf.h sftp-common.h sftp-client.h openbsd-compat/glob.h +sftp-server-main.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sftp.h misc.h xmalloc.h +sftp-server.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshbuf.h ./ssherr.h log.h misc.h match.h uidswap.h sftp.h sftp-common.h +sftp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h pathnames.h misc.h utf8.h sftp.h sshbuf.h sftp-common.h sftp-client.h openbsd-compat/glob.h sk-usbhid.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sntrup4591761.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h -ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h ssherr.h digest.h ssh-sk.h sk-api.h -ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h misc.h digest.h ssherr.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h +sntrup761.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h +srclimit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h canohost.h log.h ./ssherr.h misc.h srclimit.h xmalloc.h +ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h ./ssherr.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h digest.h ssh-sk.h sk-api.h +ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h ./ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h ssh-dss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ssherr.h digest.h sshkey.h +ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ./ssherr.h digest.h sshkey.h ssh-ecdsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h sshbuf.h sshkey.h ssherr.h ssh.h digest.h -ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h sshbuf.h sshkey.h ssherr.h ssh.h -ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssherr.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h -ssh-keyscan.o: atomicio.h misc.h hostfile.h ssherr.h ssh_api.h ssh2.h dns.h +ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ./ssherr.h sshbuf.h sshkey.h ssh.h digest.h +ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ./ssherr.h sshbuf.h sshkey.h ssh.h +ssh-keygen.o: cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h +ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h ./ssherr.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h cipher.h +ssh-keyscan.o: ./ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h dispatch.h log .h -ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h ssherr.h +ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h ssh-pkcs11-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h misc.h sshkey.h authfd.h ssh-pkcs11.h ssherr.h -ssh-pkcs11.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h sshkey.h +ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h ./ssherr.h misc.h sshkey.h authfd.h ssh-pkcs11.h +ssh-pkcs11.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshkey.h ssh-rsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-sk-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sshbuf.h sshkey.h msg.h digest.h pathnames.h ssh-sk.h misc.h -ssh-sk-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h sshkey.h authfd.h misc.h sshbuf.h msg.h uidswap.h ssherr.h ssh-sk.h +ssh-sk-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshbuf.h sshkey.h msg.h digest.h pathnames.h ssh-sk.h misc.h +ssh-sk-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h sshkey.h authfd.h misc.h sshbuf.h msg.h uidswap.h ssh-sk.h ssh-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h canohost.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h packet.h dispatch.h sshbuf.h channels .h -ssh.o: sshkey.h authfd.h authfile.h pathnames.h clientloop.h log.h misc.h readconf.h sshconnect.h kex.h mac.h crypto_api.h sshpty.h match.h msg.h version.h ssherr.h myproposal.h utf8.h -ssh_api.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh_api.h openbsd-compat/sys-queue.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h ssh.h ssh2.h packet.h dispatch.h compat.h log.h authfile.h misc. h -ssh_api.o: version.h myproposal.h ssherr.h sshbuf.h openbsd-compat/openssl-compat.h -sshbuf-getput-basic.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h +ssh.o: sshkey.h authfd.h authfile.h pathnames.h clientloop.h log.h ./ssherr.h misc.h readconf.h sshconnect.h kex.h mac.h crypto_api.h sshpty.h match.h msg.h version.h myproposal.h utf8.h +ssh_api.o: authfile.h misc.h version.h myproposal.h sshbuf.h openbsd-compat/openssl-compat.h +ssh_api.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh_api.h openbsd-compat/sys-queue.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h ssh.h ssh2.h packet.h dispatch.h compat.h log.h ./ssherr.h +sshbuf-getput-basic.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h sshbuf-getput-crypto.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h atomicio.h -sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h -sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h misc.h +sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h atomicio.h +sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h +sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h misc.h sshconnect.o: authfd.h kex.h mac.h crypto_api.h -sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h ssherr.h +sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h ./ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile .h sshconnect2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h packet.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h -sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h ssherr.h utf8.h ssh-sk.h sk-api.h -sshd.o: cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h ssherr.h sk-api.h -sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305. h -ssherr.o: ssherr.h +sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h ./ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h +sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h ./ssherr.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha. h +sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h +ssherr.o: ./ssherr.h sshkey-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h -sshlogin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshlogin.h ssherr.h loginrec.h log.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h -sshpty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h log.h misc.h -sshsig.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h authfd.h authfile.h log.h misc.h sshbuf.h sshsig.h ssherr.h sshkey.h match.h digest.h +sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ./ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h +sshlogin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshlogin.h ./ssherr.h loginrec.h log.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h +sshpty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h log.h ./ssherr.h misc.h +sshsig.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h authfd.h authfile.h log.h ./ssherr.h misc.h sshbuf.h sshsig.h sshkey.h match.h digest.h sshtty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h -ttymodes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h compat.h sshbuf.h ssherr.h ttymodes.h -uidswap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h uidswap.h xmalloc.h +ttymodes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h compat.h sshbuf.h ttymodes.h +uidswap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h uidswap.h xmalloc.h umac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h umac.h misc.h rijndael.h umac128.o: umac.c includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h umac.h misc.h rijndael.h utf8.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h utf8.h verify.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h -xmalloc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h +xmalloc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h xmss_commons.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmss_fast.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmss_hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h diff --git a/.github/configs b/.github/configs new file mode 100755 index 000000000000..1c06e00d110c --- /dev/null +++ b/.github/configs @@ -0,0 +1,110 @@ +#!/bin/sh +# +# usage: configs vmname test_config (or '' for default) +# +# Sets the following variables: +# CONFIGFLAGS options to ./configure +# SSHD_CONFOPTS sshd_config options +# TEST_TARGET make target used when testing. defaults to "tests". +# LTESTS + +config=$1 + +TEST_TARGET="tests" +LTESTS="" +SKIP_LTESTS="" +SUDO=sudo # run with sudo by default +TEST_SSH_UNSAFE_PERMISSIONS=1 + +CONFIGFLAGS="" +LIBCRYPTOFLAGS="" + +case "$config" in + default|sol64) + ;; + kitchensink) + CONFIGFLAGS="--with-kerberos5 --with-libedit --with-pam" + CONFIGFLAGS="${CONFIGFLAGS} --with-security-key-builtin --with-selinux" + CONFIGFLAGS="${CONFIGFLAGS} --with-cflags=-DSK_DEBUG" + ;; + hardenedmalloc) + CONFIGFLAGS="--with-ldflags=-lhardened_malloc" + ;; + kerberos5) + CONFIGFLAGS="--with-kerberos5" + ;; + libedit) + CONFIGFLAGS="--with-libedit" + ;; + *pam) + CONFIGFLAGS="--with-pam" + SSHD_CONFOPTS="UsePam yes" + ;; + libressl-head) + LIBCRYPTOFLAGS="--with-ssl-dir=/opt/libressl/head --with-rpath=-Wl,-rpath," + ;; + openssl-head) + LIBCRYPTOFLAGS="--with-ssl-dir=/opt/openssl/head --with-rpath=-Wl,-rpath," + ;; + selinux) + CONFIGFLAGS="--with-selinux" + ;; + sk) + CONFIGFLAGS="--with-security-key-builtin" + ;; + without-openssl) + LIBCRYPTOFLAGS="--without-openssl" + TEST_TARGET=t-exec + ;; + valgrind-1) + # rlimit sandbox and FORTIFY_SOURCE confuse Valgrind. + CONFIGFLAGS="--without-sandbox --without-hardening" + CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0" + # Valgrind slows things down enough that the agent timeout test + # won't reliably pass, and the unit tests run longer than allowed + # by github. + TEST_TARGET="t-exec USE_VALGRIND=1" + SKIP_LTESTS="agent-timeout rekey try-ciphers cert-userkey integrity" + ;; + valgrind-2) + CONFIGFLAGS="--without-sandbox --without-hardening" + CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0" + # The rekey test takes >30 min so run separately. + TEST_TARGET="t-exec USE_VALGRIND=1" + LTESTS="rekey try-ciphers cert-userkey integrity" + ;; + *) + echo "Unknown configuration $config" + exit 1 + ;; +esac + +# The Solaris 64bit targets are special since they need a non-flag arg. +case "$config" in + sol64*) + CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}" + LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64" + ;; +esac + +case "${TARGET_HOST}" in + sol10|sol11) + # sol10 VM is 32bit and the unit tests are slow. + # sol11 has 4 test configs so skip unit tests to speed up. + TEST_TARGET="tests SKIP_UNIT=1" + ;; +esac + +# If we have a local openssl/libressl, use that. +if [ -z "${LIBCRYPTOFLAGS}" ]; then + # last-match + for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do + if [ -x ${i}/bin/openssl ]; then + LIBCRYPTOFLAGS="--with-ssl-dir=${i}" + fi + done +fi + +CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}" + +export LTESTS SUDO TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS diff --git a/.github/configure.sh b/.github/configure.sh new file mode 100755 index 000000000000..e098730f02d6 --- /dev/null +++ b/.github/configure.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. .github/configs $1 + +set -x +./configure ${CONFIGFLAGS} diff --git a/.github/run_test.sh b/.github/run_test.sh index 93c3a5e9ed9d..66fd5260362f 100755 --- a/.github/run_test.sh +++ b/.github/run_test.sh @@ -1,29 +1,28 @@ #!/usr/bin/env bash -TARGETS=$@ +. .github/configs $1 $2 -TEST_TARGET="tests" -LTESTS="" # all tests by default +[ -z "${SUDO}" ] || ${SUDO} mkdir -p /var/empty set -ex -for TARGET in $TARGETS; do - case $TARGET in - --without-openssl) - # When built without OpenSSL we can't do the file-based RSA key tests. - TEST_TARGET=t-exec - ;; - esac -done - -if [ -z "$LTESTS" ]; then - make $TEST_TARGET +if [ -z "${LTESTS}" ]; then + make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" result=$? else - make $TEST_TARGET LTESTS="$LTESTS" + make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" result=$? fi +if [ ! -z "${SSHD_CONFOPTS}" ]; then + echo "rerunning tests with TEST_SSH_SSHD_CONFOPTS='${SSHD_CONFOPTS}'" + make t-exec TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}" + result2=$? + if [ "${result2}" -ne 0 ]; then + result="${result2}" + fi +fi + if [ "$result" -ne "0" ]; then for i in regress/failed*; do echo ------------------------------------------------------------------------- diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh index e2474ccd7460..e53a351c5bdf 100755 --- a/.github/setup_ci.sh +++ b/.github/setup_ci.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +case $(./config.guess) in +*-darwin*) + brew install automake + exit 0 + ;; +esac + TARGETS=$@ PACKAGES="" @@ -11,29 +18,45 @@ set -ex lsb_release -a +if [ "${TARGETS}" = "kitchensink" ]; then + TARGETS="kerberos5 libedit pam sk selinux" +fi + for TARGET in $TARGETS; do case $TARGET in - ""|--without-openssl|--without-zlib) + default|without-openssl|without-zlib) # nothing to do ;; - "--with-kerberos5") + kerberos5) PACKAGES="$PACKAGES heimdal-dev" #PACKAGES="$PACKAGES libkrb5-dev" ;; - "--with-libedit") + libedit) PACKAGES="$PACKAGES libedit-dev" ;; - "--with-pam") + *pam) PACKAGES="$PACKAGES libpam0g-dev" ;; - "--with-security-key-builtin") + sk) INSTALL_FIDO_PPA="yes" PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev" ;; - "--with-selinux") + selinux) PACKAGES="$PACKAGES libselinux1-dev selinux-policy-dev" ;; - *) echo "Invalid option" + hardenedmalloc) + INSTALL_HARDENED_MALLOC=yes + ;; + openssl-head) + INSTALL_OPENSSL_HEAD=yes + ;; + libressl-head) + INSTALL_LIBRESSL_HEAD=yes + ;; + valgrind*) + PACKAGES="$PACKAGES valgrind" + ;; + *) echo "Invalid option '${TARGET}'" exit 1 ;; esac @@ -49,3 +72,26 @@ if [ "x" != "x$PACKAGES" ]; then sudo apt update -qq sudo apt install -qy $PACKAGES fi + +if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then + (cd ${HOME} && + git clone https://github.com/GrapheneOS/hardened_malloc.git && + cd ${HOME}/hardened_malloc && + make -j2 && sudo cp libhardened_malloc.so /usr/lib/) +fi + +if [ "${INSTALL_OPENSSL_HEAD}" = "yes" ];then + (cd ${HOME} && + git clone https://github.com/openssl/openssl.git && + cd ${HOME}/openssl && + ./config no-threads no-engine no-fips no-shared --prefix=/opt/openssl/head && + make -j2 && sudo make install_sw) +fi + +if [ "${INSTALL_LIBRESSL_HEAD}" = "yes" ];then + (mkdir -p ${HOME}/libressl && cd ${HOME}/libressl && + git clone https://github.com/libressl-portable/portable.git && + cd ${HOME}/libressl/portable && sh update.sh && sh autogen.sh && + ./configure --prefix=/opt/libressl/head && + make -j2 && sudo make install_sw) +fi diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 2189756bbf8f..c2e9c5327ecb 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -7,22 +7,35 @@ on: branches: [ master ] jobs: - build: - - runs-on: ubuntu-latest - + ci: + if: github.repository != 'openssh/openssh-portable-selfhosted' strategy: + fail-fast: false matrix: - configs: - - "" - - "--with-kerberos5" - - "--with-libedit" - - "--with-pam" - - "--with-security-key-builtin" - - "--with-selinux" - - "--with-kerberos5 --with-libedit --with-pam --with-security-key-builtin --with-selinux" - - "--without-openssl --without-zlib" - + # First we test all OSes in the default configuration. + os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, macos-10.15] + configs: [default] + # Then we include any extra configs we want to test for specific VMs. + # Valgrind slows things down quite a bit, so start them first. + include: + - { os: ubuntu-20.04, configs: valgrind-1 } + - { os: ubuntu-20.04, configs: valgrind-2 } + - { os: ubuntu-20.04, configs: pam } + - { os: ubuntu-20.04, configs: kitchensink } + - { os: ubuntu-20.04, configs: hardenedmalloc } + - { os: ubuntu-20.04, configs: libressl-head } + - { os: ubuntu-20.04, configs: openssl-head } + - { os: ubuntu-18.04, configs: pam } + - { os: ubuntu-18.04, configs: kerberos5 } + - { os: ubuntu-18.04, configs: libedit } + - { os: ubuntu-18.04, configs: sk } + - { os: ubuntu-18.04, configs: selinux } + - { os: ubuntu-18.04, configs: kitchensink } + - { os: ubuntu-18.04, configs: without-openssl } + - { os: ubuntu-16.04, configs: pam } + - { os: ubuntu-16.04, configs: kitchensink } + - { os: macos-10.15, configs: pam } + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: setup CI system @@ -30,10 +43,21 @@ jobs: - name: autoreconf run: autoreconf - name: configure - run: ./configure ${{ matrix.configs }} + run: ./.github/configure.sh ${{ matrix.configs }} - name: make - run: make + run: make -j2 + - name: install moduli + run: sudo sh -c "mkdir -p /usr/local/etc/; cp moduli /usr/local/etc/" - name: make tests run: ./.github/run_test.sh ${{ matrix.configs }} env: + SUDO: sudo TEST_SSH_UNSAFE_PERMISSIONS: 1 + - name: save regress logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-${{ matrix.configs }}-regress-logs + path: | + regress/*.log + regress/valgrind-out/ diff --git a/.github/workflows/selfhosted.yml b/.github/workflows/selfhosted.yml new file mode 100644 index 000000000000..aadcb42b4ddc --- /dev/null +++ b/.github/workflows/selfhosted.yml @@ -0,0 +1,68 @@ +name: C/C++ CI self-hosted + +on: + push: + branches: [ master, ci ] + +jobs: + selfhosted: + if: github.repository == 'openssh/openssh-portable-selfhosted' + runs-on: ${{ matrix.os }} + env: + TARGET_HOST: ${{ matrix.os }} + SUDO: sudo + strategy: + fail-fast: false + # We use a matrix in two parts: firstly all of the VMs are tested with the + # default config. "vm" corresponds to a label associated with the worker. + matrix: + os: [bbone, dfly30, dfly48, dfly58, fbsd6, fbsd7, fbsd12, sol10, sol11] + configs: + - default + # Then we include any extra configs we want to test for specific VMs. + include: + - { os: dfly30, configs: without-openssl} + - { os: dfly48, configs: pam } + - { os: dfly58, configs: pam } + - { os: fbsd6, configs: pam } + - { os: fbsd7, configs: pam } + - { os: fbsd12, configs: pam } + - { os: sol10, configs: pam } + - { os: sol11, configs: pam } + - { os: sol11, configs: sol64 } + # - { os: sol11, configs: sol64-pam } + steps: + - uses: actions/checkout@v2 + - name: autoreconf + run: autoreconf + - name: shutdown VM if running + run: vmshutdown + - name: startup VM + run: vmstartup + - name: configure + run: vmrun ./.github/configure.sh ${{ matrix.configs }} + - name: save config files + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-${{ matrix.configs }}-config-files + path: | + config.h + config.log + - name: make + run: vmrun make + - name: install moduli + run: vmrun "sudo mkdir -p /usr/local/etc/; sudo cp moduli /usr/local/etc/" + - name: make tests + run: vmrun ./.github/run_test.sh ${{ matrix.configs }} + - name: save regress logs + if: failure() + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-${{ matrix.configs }}-regress-logs + path: | + regress/*.log + regress/valgrind-out/ + - name: shutdown VM + if: always() + run: vmshutdown diff --git a/.skipped-commit-ids b/.skipped-commit-ids index 6abbb99bca55..495dbf1d1df3 100644 --- a/.skipped-commit-ids +++ b/.skipped-commit-ids @@ -21,6 +21,7 @@ d9b910e412d139141b072a905e66714870c38ac0 Makefile.inc 3bcae7a754db3fc5ad3cab63dd46774edb35b8ae moduli regen script update 52ff0e3205036147b2499889353ac082e505ea54 moduli update 07b5031e9f49f2b69ac5e85b8da4fc9e393992a0 Makefile.inc +cc12a9029833d222043aecd252d654965c351a69 moduli-gen Makefile Old upstream tree: diff --git a/ChangeLog b/ChangeLog index bcaa38f94386..f3216b8c7340 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12492 +1,12631 @@ -commit 279261e1ea8150c7c64ab5fe7cb4a4ea17acbb29 +commit d2afd717e62d76bb41ab5f3ab4ce6f885c8edc98 Author: Damien Miller -Date: Sun Sep 27 17:25:01 2020 +1000 - - update version numbers - -commit 58ca6ab6ff035ed12b5078e3e9c7199fe72c8587 -Author: djm@openbsd.org -Date: Sun Sep 27 07:22:05 2020 +0000 +Date: Tue Mar 2 21:31:47 2021 +1100 - upstream: openssh 8.4 - - OpenBSD-Commit-ID: a29e5b372d2c00e297da8a35a3b87c9beb3b4a58 + update depend -commit 9bb8a303ce05ff13fb421de991b495930be103c3 +commit f0c4eddf7cf224ebcac1f07ac8afdb30c6e9fe0a Author: Damien Miller -Date: Tue Sep 22 10:07:43 2020 +1000 +Date: Tue Mar 2 21:30:14 2021 +1100 - sync with upstream ssh-copy-id rev f0da1a1b7 + update relnotes URL -commit 0a4a5571ada76b1b012bec9cf6ad1203fc19ec8d -Author: djm@openbsd.org -Date: Mon Sep 21 07:29:09 2020 +0000 +commit 67a8bb7fe62a381634db4c261720092e7d514a3d +Author: Damien Miller +Date: Tue Mar 2 21:29:54 2021 +1100 - upstream: close stdin when forking after authentication too; ok markus - - OpenBSD-Commit-ID: 43db17e4abc3e6b4a7b033aa8cdab326a7cb6c24 + update RPM spec version numbers *** 57085 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Apr 23 19:15:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B8FD5FCB7F for ; Fri, 23 Apr 2021 19:15: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 4FRkXG67VTz3GCK; Fri, 23 Apr 2021 19:15: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 B54E512E8E; Fri, 23 Apr 2021 19:15: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 13NJFgD4055983; Fri, 23 Apr 2021 19:15:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NJFgG7055982; Fri, 23 Apr 2021 19:15:42 GMT (envelope-from git) Date: Fri, 23 Apr 2021 19:15:42 GMT Message-Id: <202104231915.13NJFgG7055982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: cbaad7c77fb8 - vendor/openssh - Vendor import of OpenSSH 8.6p1 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/vendor/openssh X-Git-Reftype: branch X-Git-Commit: cbaad7c77fb842fe6b6be03cbdb3e85a6de759bf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 19:15:43 -0000 The branch vendor/openssh has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cbaad7c77fb842fe6b6be03cbdb3e85a6de759bf commit cbaad7c77fb842fe6b6be03cbdb3e85a6de759bf Author: Ed Maste AuthorDate: 2021-04-23 19:13:32 +0000 Commit: Ed Maste CommitDate: 2021-04-23 19:13:32 +0000 Vendor import of OpenSSH 8.6p1 --- .depend | 180 +++---- .github/configs | 38 +- .github/setup_ci.sh | 2 +- .github/workflows/c-cpp.yml | 11 +- .github/workflows/selfhosted.yml | 16 +- .skipped-commit-ids | 1 + ChangeLog | 859 ++++++++++++++++++++++----------- Makefile.in | 77 ++- README | 2 +- addrmatch.c | 4 +- audit-bsm.c | 39 +- auth-krb5.c | 19 +- auth-options.c | 4 +- auth-pam.c | 4 +- auth.c | 4 +- auth2-pubkey.c | 7 +- auth2.c | 6 +- chacha.h | 4 +- channels.c | 10 +- channels.h | 8 +- cipher.c | 8 +- clientloop.c | 6 +- contrib/Makefile | 6 +- contrib/gnome-ssh-askpass1.c | 7 +- contrib/gnome-ssh-askpass2.c | 10 +- contrib/gnome-ssh-askpass3.c | 305 ++++++++++++ contrib/redhat/openssh.spec | 2 +- contrib/suse/openssh.spec | 2 +- dh.c | 25 +- dh.h | 3 +- hostfile.c | 4 +- kex.c | 4 +- kexgen.c | 4 +- log.c | 24 +- log.h | 11 +- loginrec.h | 2 +- logintest.c | 60 +-- misc.c | 13 +- misc.h | 13 +- moduli | 852 ++++++++++++++++---------------- moduli.0 | 2 +- monitor.c | 22 +- monitor_wrap.c | 9 +- monitor_wrap.h | 5 +- mux.c | 10 +- openbsd-compat/base64.c | 2 +- openbsd-compat/bsd-poll.h | 2 +- openbsd-compat/bsd-snprintf.c | 16 +- openbsd-compat/bsd-waitpid.h | 2 +- openbsd-compat/getopt_long.c | 2 +- openbsd-compat/libressl-api-compat.c | 2 +- openbsd-compat/memmem.c | 3 + openbsd-compat/port-net.c | 2 +- openbsd-compat/port-solaris.c | 8 +- openbsd-compat/port-uw.c | 2 +- openbsd-compat/sha2.c | 2 +- openbsd-compat/strtonum.c | 6 +- packet.c | 16 +- readconf.c | 8 +- regress/Makefile | 7 +- regress/connect-privsep.sh | 3 +- regress/sftp-perm.sh | 18 +- regress/test-exec.sh | 48 +- regress/unittests/authopt/tests.c | 4 +- regress/unittests/misc/test_argv.c | 141 ++++++ regress/unittests/misc/test_convtime.c | 57 +++ regress/unittests/misc/test_expand.c | 88 ++++ regress/unittests/misc/test_parse.c | 84 ++++ regress/unittests/misc/tests.c | 164 +------ regress/valgrind-unit.sh | 2 + sandbox-seccomp-filter.c | 9 +- scp.0 | 2 +- scp.c | 7 +- servconf.c | 24 +- servconf.h | 11 +- serverloop.c | 6 +- session.c | 4 +- sftp-client.c | 118 ++++- sftp-client.h | 13 +- sftp-server.0 | 2 +- sftp-server.c | 164 ++++--- sftp.0 | 2 +- sftp.c | 15 +- srclimit.c | 2 +- ssh-add.0 | 2 +- ssh-add.c | 6 +- ssh-agent.0 | 2 +- ssh-agent.c | 8 +- ssh-keygen.0 | 2 +- ssh-keygen.c | 17 +- ssh-keyscan.0 | 2 +- ssh-keysign.0 | 2 +- ssh-pkcs11-helper.0 | 2 +- ssh-sk-client.c | 8 +- ssh.0 | 2 +- ssh.c | 8 +- ssh_api.c | 6 +- ssh_config.0 | 13 +- ssh_config.5 | 13 +- sshconnect.c | 18 +- sshconnect2.c | 6 +- sshd.0 | 4 +- sshd.8 | 6 +- sshd.c | 16 +- sshd_config.0 | 13 +- sshd_config.5 | 19 +- sshkey-xmss.c | 41 +- sshkey-xmss.h | 12 +- sshkey.c | 26 +- uidswap.c | 2 +- umac.c | 4 +- utf8.h | 10 +- version.h | 4 +- xmalloc.h | 7 +- 114 files changed, 2587 insertions(+), 1466 deletions(-) diff --git a/.depend b/.depend index c7bff499c5a3..78629a54c8ad 100644 --- a/.depend +++ b/.depend @@ -3,103 +3,103 @@ # DO NOT DELETE addr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h -addrmatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h match.h log.h ./ssherr.h +addrmatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h match.h log.h ssherr.h atomicio.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h audit-bsm.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h audit-linux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h audit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-bsdauth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h sshbuf.h sshkey.h misc.h servconf.h uidswap.h hostfile.h auth.h auth-pam.h audit.h loginrec.h -auth-options.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ./ssherr.h log.h sshbuf.h misc.h sshkey.h match.h ssh2.h auth-options.h +auth-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h sshkey.h misc.h servconf.h uidswap.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth-options.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h log.h sshbuf.h misc.h sshkey.h match.h ssh2.h auth-options.h auth-pam.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h ./ssherr.h log.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h -auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h ./ssherr.h misc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h sshbuf.h ssherr.h log.h misc.h servconf.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h +auth-rhosts.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h uidswap.h pathnames.h log.h ssherr.h misc.h sshbuf.h sshkey.h servconf.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-shadow.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth-sia.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth.o: authfile.h monitor_wrap.h compat.h channels.h -auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h ./ssherr.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch. h -auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ./ssherr.h log.h misc.h servconf.h +auth.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h groupaccess.h log.h ssherr.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h canohost.h uidswap.h packet.h dispatch.h +auth2-chall.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h misc.h servconf.h auth2-gss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h auth2-hostbased.o: canohost.h monitor_wrap.h pathnames.h match.h -auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ./ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h -auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h ./ssherr.h misc.h servconf.h -auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h misc.h servconf.h compat.h ssh2.h monitor_wrap.h -auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ./ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h -auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ./ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-hostbased.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +auth2-kbdint.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h log.h ssherr.h misc.h servconf.h +auth2-none.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h misc.h servconf.h compat.h ssh2.h monitor_wrap.h +auth2-passwd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h ssherr.h log.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h monitor_wrap.h misc.h servconf.h +auth2-pubkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h kex.h mac.h crypto_api.h sshbuf.h log.h ssherr.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth2-pubkey.o: pathnames.h uidswap.h auth-options.h canohost.h monitor_wrap.h authfile.h match.h channels.h session.h sk-api.h auth2.o: digest.h -auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h -authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h ./ssherr.h atomicio.h misc.h -authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ./ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h +auth2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h atomicio.h xmalloc.h ssh2.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h pathnames.h monitor_wrap.h +authfd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h sshbuf.h sshkey.h authfd.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h compat.h log.h ssherr.h atomicio.h misc.h +authfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h ssh.h log.h ssherr.h authfile.h misc.h atomicio.h sshkey.h sshbuf.h krl.h bitmap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h bitmap.h -canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h canohost.h misc.h +canohost.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h canohost.h misc.h chacha.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h chacha.h -channels.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h ./ssherr.h sshbuf.h packet.h dispatch.h log.h misc.h channels.h compat.h canohost.h sshkey.h authfd.h pathnames.h match.h +channels.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h ssherr.h sshbuf.h packet.h dispatch.h log.h misc.h channels.h compat.h canohost.h sshkey.h authfd.h pathnames.h match.h cipher-aes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h cipher-aesctr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher-aesctr.h rijndael.h cipher-chachapoly-libcrypto.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -cipher-chachapoly.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshbuf.h cipher-chachapoly.h chacha.h poly1305.h +cipher-chachapoly.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sshbuf.h cipher-chachapoly.h chacha.h poly1305.h cipher-ctr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h misc.h sshbuf.h ./ssherr.h digest.h openbsd-compat/openssl-compat.h -cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h +cipher.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h misc.h sshbuf.h ssherr.h digest.h openbsd-compat/openssl-compat.h +cleanup.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h clientloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h packet.h dispatch.h sshbuf.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h -clientloop.o: myproposal.h log.h ./ssherr.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h hostfile.h -compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ./ssherr.h match.h kex.h mac.h crypto_api.h +clientloop.o: myproposal.h log.h ssherr.h misc.h readconf.h clientloop.h sshconnect.h authfd.h atomicio.h sshpty.h match.h msg.h hostfile.h +compat.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h log.h ssherr.h match.h kex.h mac.h crypto_api.h dh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h digest.h +digest-libc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h digest.h digest-openssl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ./ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h -dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ./ssherr.h dns.h log.h digest.h +dispatch.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh2.h log.h ssherr.h dispatch.h packet.h openbsd-compat/sys-queue.h compat.h +dns.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h ssherr.h dns.h log.h digest.h ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ge25519.h fe25519.h sc25519.h entropy.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -fatal.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h +fatal.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h fe25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h fe25519.h crypto_api.h ge25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h fe25519.h crypto_api.h sc25519.h ge25519.h ge25519_base.data -groupaccess.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h groupaccess.h match.h log.h ./ssherr.h +groupaccess.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h groupaccess.h match.h log.h ssherr.h gss-genr.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h gss-serv-krb5.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h gss-serv.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h hmac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h digest.h hmac.h -hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h ./ssherr.h misc.h pathnames.h digest.h hmac.h sshbuf.h -kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h ./ssherr. h +hostfile.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h sshkey.h hostfile.h log.h ssherr.h misc.h pathnames.h digest.h hmac.h sshbuf.h +kex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.h ssh2.h atomicio.h version.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h log.h ssherr.h kex.o: match.h misc.h monitor.h sshbuf.h digest.h -kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ./ssherr.h ssh2.h +kexc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h sshbuf.h digest.h ssherr.h ssh2.h kexdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h -kexgen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h log.h ./ssherr.h packet.h openbsd-compat/sys-queue.h dispatch.h ssh2.h sshbuf.h digest.h +kexecdh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h +kexgen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshkey.h kex.h mac.h crypto_api.h log.h ssherr.h packet.h openbsd-compat/sys-queue.h dispatch.h ssh2.h sshbuf.h digest.h kexgex.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexgexc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h kexgexs.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -kexsntrup761x25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h -krl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h sshbuf.h ./ssherr.h sshkey.h authfile.h misc.h log.h digest.h bitmap.h utf8.h krl.h -log.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h match.h -loginrec.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h hostfile.h ssh.h loginrec.h log.h ./ssherr.h atomicio.h packet.h openbsd-compat/sys-queue.h dispatch.h canohost.h auth.h auth-pam.h audit.h sshbuf.h +kexsntrup761x25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h +krl.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h sshbuf.h ssherr.h sshkey.h authfile.h misc.h log.h digest.h bitmap.h utf8.h krl.h +log.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h match.h +loginrec.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h hostfile.h ssh.h loginrec.h log.h ssherr.h atomicio.h packet.h openbsd-compat/sys-queue.h dispatch.h canohost.h auth.h auth-pam.h audit.h sshbuf.h logintest.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h loginrec.h -mac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest.h hmac.h umac.h mac.h misc.h ./ssherr.h sshbuf.h openbsd-compat/openssl-compat.h +mac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h digest.h hmac.h umac.h mac.h misc.h ssherr.h sshbuf.h openbsd-compat/openssl-compat.h match.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h match.h misc.h md5crypt.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h log.h ./ssherr.h ssh.h sshbuf.h +misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h log.h ssherr.h ssh.h sshbuf.h moduli.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -monitor.o: chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h dh.h packet.h dispatch.h auth-options.h sshpty.h channels.h session.h sshlogin.h canohost.h log.h ./ssherr.h misc.h servconf.h monitor.h monitor_wrap.h monitor_fdpass.h compat.h ssh2.h authfd.h match.h sk-api.h +monitor.o: chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h dh.h packet.h dispatch.h auth-options.h sshpty.h channels.h session.h sshlogin.h canohost.h log.h ssherr.h misc.h servconf.h monitor.h monitor_wrap.h monitor_fdpass.h compat.h ssh2.h authfd.h match.h sk-api.h monitor.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h openbsd-compat/openssl-compat.h atomicio.h xmalloc.h ssh.h sshkey.h sshbuf.h hostfile.h auth.h auth-pam.h audit.h loginrec.h cipher.h cipher-chachapoly.h -monitor_fdpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h monitor_fdpass.h +monitor_fdpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h monitor_fdpass.h monitor_wrap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h -monitor_wrap.o: loginrec.h auth-options.h packet.h dispatch.h log.h ./ssherr.h monitor.h monitor_wrap.h atomicio.h monitor_fdpass.h misc.h channels.h session.h servconf.h -msg.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h ./ssherr.h log.h atomicio.h msg.h misc.h -mux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h log.h ./ssherr.h ssh.h ssh2.h pathnames.h misc.h match.h sshbuf.h channels.h msg.h packet.h dispatch.h monitor_fdpass.h sshpty.h sshkey.h readconf.h clientloop.h -nchan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h ssh2.h sshbuf.h ./ssherr.h packet.h dispatch.h channels.h compat.h log.h +monitor_wrap.o: loginrec.h auth-options.h packet.h dispatch.h log.h ssherr.h monitor.h monitor_wrap.h atomicio.h monitor_fdpass.h misc.h channels.h session.h servconf.h +msg.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshbuf.h ssherr.h log.h atomicio.h msg.h misc.h +mux.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h log.h ssherr.h ssh.h ssh2.h pathnames.h misc.h match.h sshbuf.h channels.h msg.h packet.h dispatch.h monitor_fdpass.h sshpty.h sshkey.h readconf.h clientloop.h +nchan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h ssh2.h sshbuf.h ssherr.h packet.h dispatch.h channels.h compat.h log.h packet.o: channels.h ssh.h packet.h dispatch.h sshbuf.h -packet.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h compat.h ssh2.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h digest.h log.h ./ssherr.h canohost.h misc.h +packet.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h compat.h ssh2.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h digest.h log.h ssherr.h canohost.h misc.h platform-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h platform-pledge.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h -platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h +platform-tracing.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h +platform.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h misc.h servconf.h openbsd-compat/sys-queue.h sshkey.h hostfile.h auth.h auth-pam.h audit.h loginrec.h poly1305.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h poly1305.h progressmeter.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h progressmeter.h atomicio.h misc.h utf8.h -readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ./ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api. h +readconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h xmalloc.h ssh.h ssherr.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h pathnames.h log.h sshkey.h misc.h readconf.h match.h kex.h mac.h crypto_api.h readconf.o: uidswap.h myproposal.h digest.h -readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ./ssherr.h ssh.h uidswap.h +readpass.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h misc.h pathnames.h log.h ssherr.h ssh.h uidswap.h rijndael.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h rijndael.h sandbox-capsicum.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-darwin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h @@ -110,72 +110,72 @@ sandbox-seccomp-filter.o: includes.h config.h defines.h platform.h openbsd-compa sandbox-solaris.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sandbox-systrace.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sc25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sc25519.h crypto_api.h -scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h atomicio.h pathnames.h log.h ./ssherr.h misc.h progressmeter.h utf8.h -servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ./ssherr.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h -servconf.o: sshkey.h kex.h mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h +scp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h atomicio.h pathnames.h log.h ssherr.h misc.h progressmeter.h utf8.h +servconf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/glob.h openbsd-compat/sys-queue.h xmalloc.h ssh.h log.h ssherr.h sshbuf.h misc.h servconf.h compat.h pathnames.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey .h +servconf.o: kex.h mac.h crypto_api.h match.h channels.h groupaccess.h canohost.h packet.h dispatch.h hostfile.h auth.h auth-pam.h audit.h loginrec.h myproposal.h digest.h serverloop.o: cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h hostfile.h auth.h auth-pam.h audit.h loginrec.h session.h auth-options.h serverloop.h -serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ./ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h -session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ./ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h +serverloop.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h packet.h dispatch.h sshbuf.h log.h ssherr.h misc.h servconf.h canohost.h sshpty.h channels.h compat.h ssh2.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h +session.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h sshbuf.h ssherr.h match.h uidswap.h compat.h channels.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h session.o: rijndael.h hostfile.h auth.h auth-pam.h audit.h loginrec.h auth-options.h authfd.h pathnames.h log.h misc.h servconf.h sshlogin.h serverloop.h canohost.h session.h kex.h mac.h crypto_api.h monitor_wrap.h sftp.h atomicio.h -sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ./ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h -sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ./ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h +sftp-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssherr.h sshbuf.h log.h atomicio.h progressmeter.h misc.h utf8.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h +sftp-common.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssherr.h sshbuf.h log.h misc.h sftp.h sftp-common.h sftp-glob.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sftp.h sftp-common.h sftp-client.h openbsd-compat/glob.h sftp-realpath.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sftp-server-main.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sftp.h misc.h xmalloc.h -sftp-server.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshbuf.h ./ssherr.h log.h misc.h match.h uidswap.h sftp.h sftp-common.h -sftp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h pathnames.h misc.h utf8.h sftp.h sshbuf.h sftp-common.h sftp-client.h openbsd-compat/glob.h +sftp-server-main.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sftp.h misc.h xmalloc.h +sftp-server.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshbuf.h ssherr.h log.h misc.h match.h uidswap.h sftp.h sftp-common.h +sftp.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h pathnames.h misc.h utf8.h sftp.h sshbuf.h sftp-common.h sftp-client.h openbsd-compat/glob.h sk-usbhid.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sntrup761.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -srclimit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h canohost.h log.h ./ssherr.h misc.h srclimit.h xmalloc.h -ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h ./ssherr.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h digest.h ssh-sk.h sk-api.h -ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h ./ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h +srclimit.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h addr.h canohost.h log.h ssherr.h misc.h srclimit.h xmalloc.h +ssh-add.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h ssh.h log.h ssherr.h sshkey.h sshbuf.h authfd.h authfile.h pathnames.h misc.h digest.h ssh-sk.h sk-api.h +ssh-agent.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h sshkey.h authfd.h compat.h log.h ssherr.h misc.h digest.h match.h msg.h pathnames.h ssh-pkcs11.h sk-api.h ssh-dss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ./ssherr.h digest.h sshkey.h +ssh-ecdsa-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h sshbuf.h ssherr.h digest.h sshkey.h ssh-ecdsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ./ssherr.h sshbuf.h sshkey.h ssh.h digest.h -ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ./ssherr.h sshbuf.h sshkey.h ssh.h +ssh-ed25519-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ssherr.h sshbuf.h sshkey.h ssh.h digest.h +ssh-ed25519.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h log.h ssherr.h sshbuf.h sshkey.h ssh.h ssh-keygen.o: cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h -ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h ./ssherr.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h cipher.h -ssh-keyscan.o: ./ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h +ssh-keygen.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h sshkey.h authfile.h sshbuf.h pathnames.h log.h ssherr.h misc.h match.h hostfile.h dns.h ssh.h ssh2.h ssh-pkcs11.h atomicio.h krl.h digest.h utf8.h authfd.h sshsig.h ssh-sk.h sk-api.h cipher.h ssh-keyscan.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h sshbuf.h sshkey.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h kex.h mac.h crypto_api.h compat.h myproposal.h packet.h dispatch.h log .h -ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h +ssh-keyscan.o: ssherr.h atomicio.h misc.h hostfile.h ssh_api.h ssh2.h dns.h +ssh-keysign.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h sshkey.h ssh.h ssh2.h misc.h sshbuf.h authfile.h msg.h canohost.h pathnames.h readconf.h uidswap.h ssh-pkcs11-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h ./ssherr.h misc.h sshkey.h authfd.h ssh-pkcs11.h -ssh-pkcs11.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshkey.h +ssh-pkcs11-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h sshbuf.h log.h ssherr.h misc.h sshkey.h authfd.h ssh-pkcs11.h +ssh-pkcs11.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sshkey.h ssh-rsa.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -ssh-sk-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h sshbuf.h sshkey.h msg.h digest.h pathnames.h ssh-sk.h misc.h -ssh-sk-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h sshkey.h authfd.h misc.h sshbuf.h msg.h uidswap.h ssh-sk.h +ssh-sk-client.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h sshbuf.h sshkey.h msg.h digest.h pathnames.h ssh-sk.h misc.h +ssh-sk-helper.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h sshkey.h authfd.h misc.h sshbuf.h msg.h uidswap.h ssh-sk.h ssh-sk.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/openssl-compat.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h canohost.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h packet.h dispatch.h sshbuf.h channels .h -ssh.o: sshkey.h authfd.h authfile.h pathnames.h clientloop.h log.h ./ssherr.h misc.h readconf.h sshconnect.h kex.h mac.h crypto_api.h sshpty.h match.h msg.h version.h myproposal.h utf8.h +ssh.o: sshkey.h authfd.h authfile.h pathnames.h clientloop.h log.h ssherr.h misc.h readconf.h sshconnect.h kex.h mac.h crypto_api.h sshpty.h match.h msg.h version.h myproposal.h utf8.h ssh_api.o: authfile.h misc.h version.h myproposal.h sshbuf.h openbsd-compat/openssl-compat.h -ssh_api.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh_api.h openbsd-compat/sys-queue.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h ssh.h ssh2.h packet.h dispatch.h compat.h log.h ./ssherr.h -sshbuf-getput-basic.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h +ssh_api.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssh_api.h openbsd-compat/sys-queue.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h ssh.h ssh2.h packet.h dispatch.h compat.h log.h ssherr.h +sshbuf-getput-basic.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h sshbuf-getput-crypto.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h atomicio.h -sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h -sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./ssherr.h sshbuf.h misc.h +sshbuf-io.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h atomicio.h +sshbuf-misc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h +sshbuf.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ssherr.h sshbuf.h misc.h sshconnect.o: authfd.h kex.h mac.h crypto_api.h -sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h ./ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile .h +sshconnect.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h hostfile.h ssh.h sshbuf.h packet.h openbsd-compat/sys-queue.h dispatch.h compat.h sshkey.h sshconnect.h log.h ssherr.h misc.h readconf.h atomicio.h dns.h monitor_fdpass.h ssh2.h version.h authfile.h sshconnect2.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshbuf.h packet.h dispatch.h compat.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h sshkey.h kex.h mac.h crypto_api.h -sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h ./ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h -sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h ./ssherr.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha. h -sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h -ssherr.o: ./ssherr.h +sshconnect2.o: myproposal.h sshconnect.h authfile.h dh.h authfd.h log.h ssherr.h misc.h readconf.h match.h canohost.h msg.h pathnames.h uidswap.h hostfile.h utf8.h ssh-sk.h sk-api.h +sshd.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h ./openbsd-compat/sys-tree.h openbsd-compat/sys-queue.h xmalloc.h ssh.h ssh2.h sshpty.h packet.h dispatch.h log.h ssherr.h sshbuf.h misc.h match.h servconf.h uidswap.h compat.h cipher.h cipher-chachapoly.h chacha.h +sshd.o: poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h kex.h mac.h crypto_api.h myproposal.h authfile.h pathnames.h atomicio.h canohost.h hostfile.h auth.h auth-pam.h audit.h loginrec.h authfd.h msg.h channels.h session.h monitor.h monitor_wrap.h ssh-sandbox.h auth-options.h version.h sk-api.h srclimit.h dh.h +ssherr.o: ssherr.h sshkey-xmss.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h -sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ./ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h -sshlogin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshlogin.h ./ssherr.h loginrec.h log.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h -sshpty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h log.h ./ssherr.h misc.h -sshsig.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h authfd.h authfile.h log.h ./ssherr.h misc.h sshbuf.h sshsig.h sshkey.h match.h digest.h +sshkey.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h ssh2.h ssherr.h misc.h sshbuf.h cipher.h cipher-chachapoly.h chacha.h poly1305.h cipher-aesctr.h rijndael.h digest.h sshkey.h match.h ssh-sk.h openbsd-compat/openssl-compat.h +sshlogin.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshlogin.h ssherr.h loginrec.h log.h sshbuf.h misc.h servconf.h openbsd-compat/sys-queue.h +sshpty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h log.h ssherr.h misc.h +sshsig.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h authfd.h authfile.h log.h ssherr.h misc.h sshbuf.h sshsig.h sshkey.h match.h digest.h sshtty.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h sshpty.h -ttymodes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ./ssherr.h compat.h sshbuf.h ttymodes.h -uidswap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ./ssherr.h uidswap.h xmalloc.h +ttymodes.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h packet.h openbsd-compat/sys-queue.h dispatch.h log.h ssherr.h compat.h sshbuf.h ttymodes.h +uidswap.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h log.h ssherr.h uidswap.h xmalloc.h umac.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h umac.h misc.h rijndael.h umac128.o: umac.c includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h umac.h misc.h rijndael.h utf8.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h utf8.h verify.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h crypto_api.h -xmalloc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ./ssherr.h +xmalloc.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmalloc.h log.h ssherr.h xmss_commons.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmss_fast.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h xmss_hash.o: includes.h config.h defines.h platform.h openbsd-compat/openbsd-compat.h openbsd-compat/base64.h openbsd-compat/sigact.h openbsd-compat/readpassphrase.h openbsd-compat/vis.h openbsd-compat/getrrsetbyname.h openbsd-compat/sha1.h openbsd-compat/sha2.h openbsd-compat/md5.h openbsd-compat/blf.h openbsd-compat/fnmatch.h openbsd-compat/getopt.h openbsd-compat/bsd-misc.h openbsd-compat/bsd-setres_id.h openbsd-compat/bsd-signal.h openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-waitpid.h openbsd-compat/bsd-poll.h openbsd-compat/fake-rfc2553.h openbsd-compat/bsd-cygwin_util.h openbsd-compat/port-aix.h openbsd-compat/port-irix.h openbsd-compat/port-linux.h openbsd-compat/port-solaris.h openbsd-compat/port-net.h openbsd-compat/port-uw.h openbsd-compat/bsd-nextstep.h entropy.h diff --git a/.github/configs b/.github/configs index 1c06e00d110c..c47f1a523b16 100755 --- a/.github/configs +++ b/.github/configs @@ -56,22 +56,38 @@ case "$config" in LIBCRYPTOFLAGS="--without-openssl" TEST_TARGET=t-exec ;; - valgrind-1) + valgrind-[1-4]|valgrind-unit) # rlimit sandbox and FORTIFY_SOURCE confuse Valgrind. CONFIGFLAGS="--without-sandbox --without-hardening" CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0" + TEST_TARGET="t-exec USE_VALGRIND=1" + TEST_SSH_ELAPSED_TIMES=1 + export TEST_SSH_ELAPSED_TIMES # Valgrind slows things down enough that the agent timeout test # won't reliably pass, and the unit tests run longer than allowed - # by github. - TEST_TARGET="t-exec USE_VALGRIND=1" - SKIP_LTESTS="agent-timeout rekey try-ciphers cert-userkey integrity" - ;; - valgrind-2) - CONFIGFLAGS="--without-sandbox --without-hardening" - CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0" - # The rekey test takes >30 min so run separately. - TEST_TARGET="t-exec USE_VALGRIND=1" - LTESTS="rekey try-ciphers cert-userkey integrity" + # by github so split into three separate tests. + tests2="rekey integrity" + tests3="krl forward-control sshsig" + tests4="cert-userkey cert-hostkey kextype sftp-perm keygen-comment" + case "$config" in + valgrind-1) + # All tests except agent-timeout (which is flaky under valgrind) + #) and slow ones that run separately to increase parallelism. + SKIP_LTESTS="agent-timeout ${tests2} ${tests3} ${tests4}" + ;; + valgrind-2) + LTESTS="${tests2}" + ;; + valgrind-3) + LTESTS="${tests3}" + ;; + valgrind-4) + LTESTS="${tests4}" + ;; + valgrind-unit) + TEST_TARGET="unit USE_VALGRIND=1" + ;; + esac ;; *) echo "Unknown configuration $config" diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh index e53a351c5bdf..6240ef06ef53 100755 --- a/.github/setup_ci.sh +++ b/.github/setup_ci.sh @@ -39,7 +39,7 @@ for TARGET in $TARGETS; do ;; sk) INSTALL_FIDO_PPA="yes" - PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev" + PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev libcbor-dev" ;; selinux) PACKAGES="$PACKAGES libselinux1-dev selinux-policy-dev" diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index c2e9c5327ecb..c4ae28434305 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -20,6 +20,9 @@ jobs: include: - { os: ubuntu-20.04, configs: valgrind-1 } - { os: ubuntu-20.04, configs: valgrind-2 } + - { os: ubuntu-20.04, configs: valgrind-3 } + - { os: ubuntu-20.04, configs: valgrind-4 } + - { os: ubuntu-20.04, configs: valgrind-unit } - { os: ubuntu-20.04, configs: pam } - { os: ubuntu-20.04, configs: kitchensink } - { os: ubuntu-20.04, configs: hardenedmalloc } @@ -46,18 +49,18 @@ jobs: run: ./.github/configure.sh ${{ matrix.configs }} - name: make run: make -j2 - - name: install moduli - run: sudo sh -c "mkdir -p /usr/local/etc/; cp moduli /usr/local/etc/" - name: make tests run: ./.github/run_test.sh ${{ matrix.configs }} env: SUDO: sudo TEST_SSH_UNSAFE_PERMISSIONS: 1 - - name: save regress logs + - name: save logs if: failure() uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-${{ matrix.configs }}-regress-logs + name: ${{ matrix.os }}-${{ matrix.configs }}-logs path: | + config.h + config.log regress/*.log regress/valgrind-out/ diff --git a/.github/workflows/selfhosted.yml b/.github/workflows/selfhosted.yml index aadcb42b4ddc..1cf6b5da0a34 100644 --- a/.github/workflows/selfhosted.yml +++ b/.github/workflows/selfhosted.yml @@ -41,26 +41,18 @@ jobs: run: vmstartup - name: configure run: vmrun ./.github/configure.sh ${{ matrix.configs }} - - name: save config files - if: failure() - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.os }}-${{ matrix.configs }}-config-files - path: | - config.h - config.log - name: make run: vmrun make - - name: install moduli - run: vmrun "sudo mkdir -p /usr/local/etc/; sudo cp moduli /usr/local/etc/" - name: make tests run: vmrun ./.github/run_test.sh ${{ matrix.configs }} - - name: save regress logs + - name: save logs if: failure() uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-${{ matrix.configs }}-regress-logs + name: ${{ matrix.os }}-${{ matrix.configs }}-logs path: | + config.h + config.log regress/*.log regress/valgrind-out/ - name: shutdown VM diff --git a/.skipped-commit-ids b/.skipped-commit-ids index 495dbf1d1df3..1de78172232a 100644 --- a/.skipped-commit-ids +++ b/.skipped-commit-ids @@ -22,6 +22,7 @@ d9b910e412d139141b072a905e66714870c38ac0 Makefile.inc 52ff0e3205036147b2499889353ac082e505ea54 moduli update 07b5031e9f49f2b69ac5e85b8da4fc9e393992a0 Makefile.inc cc12a9029833d222043aecd252d654965c351a69 moduli-gen Makefile +7ac6c252d2a5be8fbad4c66d9d35db507c9dac5b moduli update Old upstream tree: diff --git a/ChangeLog b/ChangeLog index f3216b8c7340..3e2b682088e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,570 @@ +commit e86968280e358e62649d268d41f698d64d0dc9fa +Author: Damien Miller +Date: Fri Apr 16 13:55:25 2021 +1000 + + depend + +commit 2fb25ca11e8b281363a2a2a4dec4c497a1475d9a +Author: Damien Miller +Date: Fri Apr 16 13:53:02 2021 +1000 + + crank version in README and RPM spec files + +commit b2b60ebab0cb77b5bc02d364d72e13db882f33ae +Author: djm@openbsd.org +Date: Fri Apr 16 03:42:00 2021 +0000 + + upstream: openssh-8.6 + + OpenBSD-Commit-ID: b5f3e133c846127ec114812248bc17eff07c3e19 + +commit faf2b86a46c9281d237bcdec18c99e94a4eb820a +Author: markus@openbsd.org +Date: Thu Apr 15 16:24:31 2021 +0000 + + upstream: do not pass file/func to monitor; noted by Ilja van Sprundel; + + ok djm@ + + OpenBSD-Commit-ID: 85ae5c063845c410283cbdce685515dcd19479fa + +commit 2dc328023f60212cd29504fc05d849133ae47355 +Author: Damien Miller +Date: Wed Apr 14 11:42:55 2021 +1000 + + sshd don't exit on transient read errors + + openssh-8.5 introduced a regression that would cause sshd to exit + because of transient read errors on the network socket (e.g. EINTR, + EAGAIN). Reported by balu.gajjala AT gmail.com via bz3297 + +commit d5d6b7d76d171a2e6861609dcd92e714ee62ad88 +Author: Damien Miller +Date: Sat Apr 10 18:45:00 2021 +1000 + + perform report_failed_grab() inline + +commit ea996ce2d023aa3c6d31125e2c3ebda1cb42db8c +Author: Damien Miller +Date: Sat Apr 10 18:22:57 2021 +1000 + + dedicated gnome-ssk-askpass3 source + + Compatibility with Wayland requires that we use the gdk_seat_grab() + API for grabbing mouse/keyboard, however these API don't exist in + Gtk+2. + + This branches gnome-ssk-askpass2.c => gnome-ssk-askpass3.c and + makes the changes to use the gdk_seat_grab() instead of grabbing + mouse/focus separately via GDK. + + In the future, we can also use the branched file to avoid some + API that has been soft-deprecated in GTK+3, e.g. gtk_widget_modify_fg + +commit bfa5405da05d906ffd58216eb77c4375b62d64c2 +Author: Darren Tucker +Date: Thu Apr 8 15:18:15 2021 +1000 + + Ensure valgrind-out exists. + + Normally the regress tests would create it, but running the unit tests + on their own would fail because the directory did not exist. + +commit 1f189181f3ea09a9b08aa866f78843fec800874f +Author: Darren Tucker +Date: Thu Apr 8 15:17:19 2021 +1000 + + Pass OBJ to unit test make invocation. + + At least the Valgrind unit tests uses $OBJ. + +commit f42b550c281d28bd19e9dd6ce65069164f3482b0 +Author: Darren Tucker +Date: Thu Apr 8 14:20:12 2021 +1000 + + Add pattern for valgrind-unit. + +commit 19e534462710e98737478fd9c44768b50c27c4c6 +Author: Darren Tucker +Date: Thu Apr 8 13:31:08 2021 +1000 + + Run unit tests under valgrind. + + Run a separate build for the unit tests under Valgrind. They take long + enough that running in parallel with the other Valgrind tests helps. + +commit 80032102d05e866dc2a48a5caf760cf42c2e090e +Author: Darren Tucker +Date: Thu Apr 8 13:25:57 2021 +1000 + + ifdef out MIN and MAX. + + In -portable, defines.h ensures that these are defined, so redefining + potentially causes a warning. We don't just delete it to make any + future code syncs a little but easier. bz#3293. + +commit d1bd184046bc310c405f45da3614a1dc5b3e521a +Author: Darren Tucker +Date: Wed Apr 7 10:23:51 2021 +1000 + + Remove only use of warn(). + + The warn() function is only used in one place in portable and does not + exist upstream. Upgrade the only instance it's used to fail() + (the privsep/sandbox+proxyconnect, from back when that was new) and + remove the now-unused function. + +commit fea8f4b1aa85026ad5aee5ad8e1599a8d5141fe0 +Author: Darren Tucker +Date: Wed Apr 7 10:18:32 2021 +1000 + + Move make_tmpdir() into portable-specific area. + + Reduces diff vs OpenBSD and makes it more likely diffs will apply + cleanly. + +commit 13e5fa2acffd26e754c6ee1d070d0afd035d4cb7 +Author: dtucker@openbsd.org +Date: Tue Apr 6 23:57:56 2021 +0000 + + upstream: Add TEST_SSH_ELAPSED_TIMES environment variable to print the + + elapsed time in seconds of each test. This depends on "date +%s" which is + not specified by POSIX but is commonly implemented. + + OpenBSD-Regress-ID: ec3c8c19ff49b2192116a0a646ee7c9b944e8a9c + +commit ef4f46ab4387bb863b471bad124d46e8d911a79a +Author: Darren Tucker +Date: Wed Apr 7 09:59:15 2021 +1000 + + Move the TEST_SSH_PORT section down a bit. + + This groups the portable-specific changes together and makes it a + little more likely that patches will apply cleanly. + +commit 3674e33fa70dfa1fe69b345bf576113af7b7be11 +Author: Darren Tucker +Date: Wed Apr 7 10:05:10 2021 +1000 + + Further split Valgrind tests. + + Even split in two, the Valgrind tests take by far the longest to run, + so split them four ways to further increase parallelism. + +commit 961af266b861e30fce1e26170ee0dbb5bf591f29 +Author: djm@openbsd.org +Date: Tue Apr 6 23:24:30 2021 +0000 + + upstream: include "ssherr.h" not ; from Balu Gajjala via + + bz#3292 + + OpenBSD-Commit-ID: e9535cd9966eb2e69e73d1ede1f44905c30310bd + +commit e7d0a285dbdd65d8df16123ad90f15e91862f959 +Author: Damien Miller +Date: Wed Apr 7 08:50:38 2021 +1000 + + wrap struct rlimit in HAVE_GETRLIMIT too + +commit f283a6c2e0a9bd9369e18462acd00be56fbe5b0d +Author: Damien Miller +Date: Wed Apr 7 08:20:35 2021 +1000 + + wrap getrlimit call in HAVE_GETRLIMIT; bz3291 + +commit 679bdc4a5c9244f427a7aee9c14b0a0ed086da1f +Author: dtucker@openbsd.org +Date: Tue Apr 6 09:07:33 2021 +0000 + + upstream: Don't check return value of unsetenv(). It's part of the + + environment setup and not part of the actual test, and some platforms + -portable runs on declare it as returning void, which prevents the test from + compiling. + + OpenBSD-Regress-ID: 24f08543ee3cdebc404f2951f3e388cc82b844a1 + +commit 320af2f3de6333aa123f1b088eca146a245e968a +Author: jmc@openbsd.org +Date: Sun Apr 4 11:36:56 2021 +0000 + + upstream: remove stray inserts; from matthias schmidt + + OpenBSD-Commit-ID: 2c36ebdc54e14bbf1daad70c6a05479a073d5c63 + +commit 801f710953b24dd2f21939171c622eac77c7484d +Author: jmc@openbsd.org +Date: Sun Apr 4 06:11:24 2021 +0000 + + upstream: missing comma; from kawashima james + + OpenBSD-Commit-ID: 31cec6bf26c6db4ffefc8a070715ebef274e68ea + +commit b3ca08cb174266884d44ec710a84cd64c12414ea +Author: Darren Tucker +Date: Mon Apr 5 23:46:42 2021 +1000 + + Install libcbor with libfido2. + +commit f3ca8af87a4c32ada660da12ae95cf03d190c083 +Author: Damien Miller +Date: Sat Apr 3 18:21:08 2021 +1100 + + enable authopt and misc unit tests + + Neither were wired into the build, both required some build + adaptations for -portable + +commit dc1b45841fb97e3d7f655ddbcfef3839735cae5f +Author: djm@openbsd.org +Date: Sat Apr 3 06:58:30 2021 +0000 + + upstream: typos in comments; GHPR#180 from Vill + + =?UTF-8?q?e=20Skytt=C3=A4?= + MIME-Version: 1.0 + Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit + + OpenBSD-Commit-ID: 93c732381ae0e2b680c79e67c40c1814b7ceed2c + +commit 53ea05e09b04fd7b6dea66b42b34d65fe61b9636 +Author: djm@openbsd.org +Date: Sat Apr 3 06:55:52 2021 +0000 + + upstream: sync CASignatureAlgorithms lists with reality. GHPR#174 from + + Matt Hazinski + + OpenBSD-Commit-ID: f05e4ca54d7e67b90fe58fe1bdb1d2a37e0e2696 + +commit 57ed647ee07bb883a2f2264231bcd1df6a5b9392 +Author: Damien Miller +Date: Sat Apr 3 17:47:37 2021 +1100 + + polish whitespace for portable files + +commit 31d8d231eb9377df474746a822d380c5d68d7ad6 +Author: djm@openbsd.org +Date: Sat Apr 3 06:18:40 2021 +0000 + + upstream: highly polished whitespace, mostly fixing spaces-for-tab + + and bad indentation on continuation lines. Prompted by GHPR#185 + + OpenBSD-Commit-ID: e5c81f0cbdcc6144df1ce468ec1bac366d8ad6e9 + +commit 34afde5c73b5570d6f8cce9b49993b23b77bfb86 +Author: djm@openbsd.org +Date: Sat Apr 3 05:54:14 2021 +0000 + + upstream: whitespace (tab after space) + + OpenBSD-Commit-ID: 0e2b3f7674e985d3f7c27ff5028e690ba1c2efd4 + +commit 7cd262c1c5a08cc7f4f30e3cab108ef089d0a57b +Author: Darren Tucker +Date: Sat Apr 3 16:59:10 2021 +1100 + + Save config.h and config.log on failure too. + +commit 460aee9298f365357e9fd26851c22e0dca51fd6a +Author: djm@openbsd.org +Date: Sat Apr 3 05:46:41 2021 +0000 + + upstream: fix incorrect plural; from Ville Skyt + + =?UTF-8?q?t=C3=A4=20via=20GHPR#181?= + MIME-Version: 1.0 + Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit + + OpenBSD-Commit-ID: 92f31754c6296d8f403d7c293e09dc27292d22c9 + +commit 082804c14e548cada75c81003a3c68ee098138ee +Author: djm@openbsd.org +Date: Sat Apr 3 05:40:39 2021 +0000 + + upstream: ensure that pkcs11_del_provider() is called before exit - + + some PKCS#11 providers get upset if C_Initialize is not matched with + C_Finalize. + + From Adithya Baglody via GHPR#234; ok markus + + OpenBSD-Commit-ID: f8e770e03b416ee9a58f9762e162add900f832b6 + +commit 464ebc82aa926dd132ec75a0b064574ef375675e +Author: djm@openbsd.org +Date: Sat Apr 3 05:28:43 2021 +0000 + + upstream: unused variable + + OpenBSD-Commit-ID: 85f6a394c8e0f60d15ecddda75176f112007b205 + +commit dc3c0be8208c488e64a8bcb7d9efad98514e0ffb +Author: djm@openbsd.org +Date: Sat Apr 3 05:21:46 2021 +0000 + + upstream: Fix two problems in string->argv conversion: 1) multiple + + backslashes were not being dequoted correctly and 2) quoted space in the + middle of a string was being incorrectly split. + MIME-Version: 1.0 + Content-Type: text/plain; charset=UTF-8 + Content-Transfer-Encoding: 8bit + + A unit test for these cases has already been committed + + prompted by and based on GHPR#223 by Eero Häkkinen; ok markus@ + + OpenBSD-Commit-ID: d7ef27abb4eeeaf6e167e9312e4abe9e89faf1e4 + +commit f75bcbba58a08c670727ece5e3f8812125969799 +Author: Damien Miller +Date: Sat Apr 3 16:22:48 2021 +1100 + + missing bits from 259d648e + +commit 4cbc4a722873d9b68cb5496304dc050d7168df78 +Author: djm@openbsd.org +Date: Wed Mar 31 21:59:26 2021 +0000 + + upstream: cannot effectively test posix-rename extension after + + changes in feature advertisment. + + OpenBSD-Regress-ID: 5e390bf88d379162aaa81b60ed86b34cb0c54d29 + +commit 259d648e63e82ade4fe2c2c73c8b67fe57d9d049 +Author: djm@openbsd.org +Date: Fri Mar 19 04:23:50 2021 +0000 + + upstream: add a test for misc.c:argv_split(), currently fails + + OpenBSD-Regress-ID: ad6b96d6ebeb9643b698b3575bdd6f78bb144200 + +commit 473ddfc2d6b602cb2d1d897e0e5c204de145cd9a +Author: djm@openbsd.org +Date: Fri Mar 19 03:25:01 2021 +0000 + + upstream: split + + OpenBSD-Regress-ID: f6c03c0e4c58b3b9e04b161757b8c10dc8378c34 + +commit 1339800fef8d0dfbfeabff71b34670105bcfddd2 +Author: djm@openbsd.org +Date: Wed Mar 31 22:16:34 2021 +0000 + + upstream: Use new limits@openssh.com protocol extension to let the + + client select good limits based on what the server supports. Split the + download and upload buffer sizes to allow them to be chosen independently. + + In practice (and assuming upgraded sftp/sftp-server at each end), this + increases the download buffer 32->64KiB and the upload buffer + 32->255KiB. + + Patches from Mike Frysinger; ok dtucker@ + + OpenBSD-Commit-ID: ebd61c80d85b951b794164acc4b2f2fd8e88606c + +commit 6653c61202d104e59c8e741329fcc567f7bc36b8 +Author: djm@openbsd.org +Date: Wed Mar 31 21:58:07 2021 +0000 + + upstream: do not advertise protocol extensions that have been + + disallowed by the command-line options (e.g. -p/-P/-R); ok dtucker@ + + OpenBSD-Commit-ID: 3a8a76b3f5131741aca4b41bfab8d101c9926205 + +commit 71241fc05db4bbb11bb29340b44b92e2575373d8 +Author: Damien Miller +Date: Mon Mar 29 15:14:25 2021 +1100 + + gnome-ssh-askpass3 is a valid target here + +commit 8a9520836e71830f4fccca066dba73fea3d16bda +Author: djm@openbsd.org +Date: Fri Mar 19 02:22:34 2021 +0000 + + upstream: return non-zero exit status when killed by signal; bz#3281 ok + + dtucker@ + + OpenBSD-Commit-ID: 117b31cf3c807993077b596bd730c24da9e9b816 + +commit 1269b8a686bf1254b03cd38af78167a04aa6ec88 +Author: djm@openbsd.org +Date: Fri Mar 19 02:18:28 2021 +0000 + + upstream: increase maximum SSH2_FXP_READ to match the maximum + + packet size. Also handle zero-length reads that are borderline nonsensical + but not explicitly banned by the spec. Based on patch from Mike Frysinger, + feedback deraadt@ ok dtucker@ + + OpenBSD-Commit-ID: 4e67d60d81bde7b84a742b4ee5a34001bdf80d9c + +commit 860b67604416640e8db14f365adc3f840aebcb1f +Author: djm@openbsd.org +Date: Tue Mar 16 06:15:43 2021 +0000 + + upstream: don't let logging clobber errno before use + + OpenBSD-Commit-ID: ce6cca370005c270c277c51c111bb6911e1680ec + +commit 5ca8a9216559349c56e09039c4335636fd85c241 +Author: Darren Tucker +Date: Sat Mar 13 14:40:43 2021 +1100 + + Only call dh_set_moduli_file if using OpenSSL. + + Fixes link failure when configuring --without-openssl since dh.c is not + linked in. + +commit 867a7dcf003c51d5a83f83565771a35f0d9530ac +Author: Darren Tucker +Date: Sat Mar 13 13:52:53 2021 +1100 + *** 5917 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Apr 23 19:28:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F87D5FD435; Fri, 23 Apr 2021 19:28: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 4FRkqK0lbsz3GTQ; Fri, 23 Apr 2021 19:28: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 0838812FAB; Fri, 23 Apr 2021 19:28: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 13NJSiI6069708; Fri, 23 Apr 2021 19:28:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NJSiAE069707; Fri, 23 Apr 2021 19:28:44 GMT (envelope-from git) Date: Fri, 23 Apr 2021 19:28:44 GMT Message-Id: <202104231928.13NJSiAE069707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 50f5d13eeb88 - main - cxgbe(4): hw.cxgbe.panic_on_fatal_err can be changed any time. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50f5d13eeb8835fe8250d65f033334d7d956d703 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 19:28:45 -0000 The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=50f5d13eeb8835fe8250d65f033334d7d956d703 commit 50f5d13eeb8835fe8250d65f033334d7d956d703 Author: Navdeep Parhar AuthorDate: 2021-04-23 19:17:54 +0000 Commit: Navdeep Parhar CommitDate: 2021-04-23 19:17:54 +0000 cxgbe(4): hw.cxgbe.panic_on_fatal_err can be changed any time. MFC after: 2 weeks Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6e5d263c7649..1650e15d16a0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -593,7 +593,7 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, pcie_relaxed_ordering, CTLFLAG_RDTUN, "PCIe Relaxed Ordering: 0 = disable, 1 = enable, 2 = leave alone"); static int t4_panic_on_fatal_err = 0; -SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RDTUN, +SYSCTL_INT(_hw_cxgbe, OID_AUTO, panic_on_fatal_err, CTLFLAG_RWTUN, &t4_panic_on_fatal_err, 0, "panic on fatal errors"); static int t4_tx_vm_wr = 0; From owner-dev-commits-src-all@freebsd.org Fri Apr 23 19:37:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE8F25FD6E0; Fri, 23 Apr 2021 19:37: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 4FRl1X4bbdz3H5T; Fri, 23 Apr 2021 19:37: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 9007412FCA; Fri, 23 Apr 2021 19:37: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 13NJbao5082564; Fri, 23 Apr 2021 19:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NJba3m082563; Fri, 23 Apr 2021 19:37:36 GMT (envelope-from git) Date: Fri, 23 Apr 2021 19:37:36 GMT Message-Id: <202104231937.13NJba3m082563@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: 576b477ba41c - main - openssh: add a note about pushing vendor updates 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: 576b477ba41c9916fae3a83e6b4dd98c682a0c2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 19:37:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=576b477ba41c9916fae3a83e6b4dd98c682a0c2f commit 576b477ba41c9916fae3a83e6b4dd98c682a0c2f Author: Ed Maste AuthorDate: 2021-04-23 19:35:40 +0000 Commit: Ed Maste CommitDate: 2021-04-23 19:36:42 +0000 openssh: add a note about pushing vendor updates Sponsored by: The FreeBSD Foundation --- crypto/openssh/FREEBSD-upgrade | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index bde003a1d183..397b68dee96f 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -39,6 +39,13 @@ $ git tag -a -m "Tag OpenSSH X.YpZ" vendor/openssh/X.YpZ + At this point the vendor branch can be pushed to the FreeBSD repo via: + + $ git push freebsd vendor/openssh + + (It could also be pushed later on, along with the merge to main, but + pushing now allows others to collaborate.) + 08) Check out head and run the pre-merge script, which strips our RCS tags from files that have them: From owner-dev-commits-src-all@freebsd.org Fri Apr 23 22:28:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFDF55E0DE7; Fri, 23 Apr 2021 22:28:51 +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 4FRpq74T5fz3PYQ; Fri, 23 Apr 2021 22:28:51 +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 7D4EF15233; Fri, 23 Apr 2021 22:28:51 +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 13NMSpbC007604; Fri, 23 Apr 2021 22:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13NMSpI6007603; Fri, 23 Apr 2021 22:28:51 GMT (envelope-from git) Date: Fri, 23 Apr 2021 22:28:51 GMT Message-Id: <202104232228.13NMSpI6007603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 4281bfec3628 - main - nfsd: fix session slot handling for failed callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4281bfec36285e2212f41568459c077bf4dbd91c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 22:28:51 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4281bfec36285e2212f41568459c077bf4dbd91c commit 4281bfec36285e2212f41568459c077bf4dbd91c Author: Rick Macklem AuthorDate: 2021-04-23 22:24:47 +0000 Commit: Rick Macklem CommitDate: 2021-04-23 22:24:47 +0000 nfsd: fix session slot handling for failed callbacks When the NFSv4.1/4.2 server does a callback to a client on the back channel, it will use a session slot in the back channel session. If the back channel has failed, the callback will fail and, without this patch, the session slot will not be released. As more callbacks are attempted, all session slots can become busy and then the nfsd thread gets stuck waiting for a back channel session slot. This patch frees the session slot upon callback failure to avoid this problem. Without this patch, the problem can be avoided by leaving delegations disabled in the NFS server. MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdstate.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 60647ab288d8..430f09844b83 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -166,7 +166,8 @@ static int nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, int trunc, fhandle_t *fhp, struct nfsvattr *nap, nfsattrbit_t *attrbitp, int laytype, NFSPROC_T *p); static int nfsrv_cbcallargs(struct nfsrv_descript *nd, struct nfsclient *clp, - uint32_t callback, int op, const char *optag, struct nfsdsession **sepp); + uint32_t callback, int op, const char *optag, struct nfsdsession **sepp, + int *slotposp); static u_int32_t nfsrv_nextclientindex(void); static u_int32_t nfsrv_nextstateindex(struct nfsclient *clp); static void nfsrv_markstable(struct nfsclient *clp); @@ -201,7 +202,7 @@ static void nfsrv_unlocklf(struct nfslockfile *lfp); static struct nfsdsession *nfsrv_findsession(uint8_t *sessionid); static int nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid); static int nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, - int dont_replycache, struct nfsdsession **sepp); + int dont_replycache, struct nfsdsession **sepp, int *slotposp); static int nfsv4_getcbsession(struct nfsclient *clp, struct nfsdsession **sepp); static int nfsrv_addlayout(struct nfsrv_descript *nd, struct nfslayout **lypp, nfsv4stateid_t *stateidp, char *layp, int *layoutlenp, NFSPROC_T *p); @@ -4434,7 +4435,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, u_int32_t *tl; struct nfsrv_descript *nd; struct ucred *cred; - int error = 0; + int error = 0, slotpos; u_int32_t callback; struct nfsdsession *sep = NULL; uint64_t tval; @@ -4492,7 +4493,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, if (procnum == NFSV4OP_CBGETATTR) { nd->nd_procnum = NFSV4PROC_CBCOMPOUND; error = nfsrv_cbcallargs(nd, clp, callback, NFSV4OP_CBGETATTR, - "CB Getattr", &sep); + "CB Getattr", &sep, &slotpos); if (error != 0) { m_freem(nd->nd_mreq); goto errout; @@ -4502,7 +4503,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, } else if (procnum == NFSV4OP_CBRECALL) { nd->nd_procnum = NFSV4PROC_CBCOMPOUND; error = nfsrv_cbcallargs(nd, clp, callback, NFSV4OP_CBRECALL, - "CB Recall", &sep); + "CB Recall", &sep, &slotpos); if (error != 0) { m_freem(nd->nd_mreq); goto errout; @@ -4521,7 +4522,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, NFSD_DEBUG(4, "docallback layout recall\n"); nd->nd_procnum = NFSV4PROC_CBCOMPOUND; error = nfsrv_cbcallargs(nd, clp, callback, - NFSV4OP_CBLAYOUTRECALL, "CB Reclayout", &sep); + NFSV4OP_CBLAYOUTRECALL, "CB Reclayout", &sep, &slotpos); NFSD_DEBUG(4, "aft cbcallargs=%d\n", error); if (error != 0) { m_freem(nd->nd_mreq); @@ -4570,6 +4571,8 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, if (clp->lc_req.nr_client == NULL) { if ((clp->lc_flags & LCL_NFSV41) != 0) { error = ECONNREFUSED; + if (procnum != NFSV4PROC_CBNULL) + nfsv4_freeslot(&sep->sess_cbsess, slotpos); nfsrv_freesession(sep, NULL); } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, @@ -4601,6 +4604,8 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, error = ECONNREFUSED; } NFSD_DEBUG(4, "aft newnfs_request=%d\n", error); + if (error != 0 && procnum != NFSV4PROC_CBNULL) + nfsv4_freeslot(&sep->sess_cbsess, slotpos); nfsrv_freesession(sep, NULL); } else error = newnfs_request(nd, NULL, clp, &clp->lc_req, @@ -4663,7 +4668,8 @@ errout: */ static int nfsrv_cbcallargs(struct nfsrv_descript *nd, struct nfsclient *clp, - uint32_t callback, int op, const char *optag, struct nfsdsession **sepp) + uint32_t callback, int op, const char *optag, struct nfsdsession **sepp, + int *slotposp) { uint32_t *tl; int error, len; @@ -4679,7 +4685,7 @@ nfsrv_cbcallargs(struct nfsrv_descript *nd, struct nfsclient *clp, *tl++ = txdr_unsigned(callback); *tl++ = txdr_unsigned(2); *tl = txdr_unsigned(NFSV4OP_CBSEQUENCE); - error = nfsv4_setcbsequence(nd, clp, 1, sepp); + error = nfsv4_setcbsequence(nd, clp, 1, sepp, slotposp); if (error != 0) return (error); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -6599,11 +6605,11 @@ nfsrv_teststateid(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, */ static int nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, - int dont_replycache, struct nfsdsession **sepp) + int dont_replycache, struct nfsdsession **sepp, int *slotposp) { struct nfsdsession *sep; uint32_t *tl, slotseq = 0; - int maxslot, slotpos; + int maxslot; uint8_t sessionid[NFSX_V4SESSIONID]; int error; @@ -6611,7 +6617,7 @@ nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, if (error != 0) return (error); sep = *sepp; - (void)nfsv4_sequencelookup(NULL, &sep->sess_cbsess, &slotpos, &maxslot, + (void)nfsv4_sequencelookup(NULL, &sep->sess_cbsess, slotposp, &maxslot, &slotseq, sessionid); KASSERT(maxslot >= 0, ("nfsv4_setcbsequence neg maxslot")); @@ -6621,7 +6627,7 @@ nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; nd->nd_slotseq = tl; *tl++ = txdr_unsigned(slotseq); - *tl++ = txdr_unsigned(slotpos); + *tl++ = txdr_unsigned(*slotposp); *tl++ = txdr_unsigned(maxslot); if (dont_replycache == 0) *tl++ = newnfs_true; From owner-dev-commits-src-all@freebsd.org Sat Apr 24 00:43:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34C895E3EAD; Sat, 24 Apr 2021 00:43: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 4FRspF12WKz3lSb; Sat, 24 Apr 2021 00:43: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 167A416DD2; Sat, 24 Apr 2021 00:43: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 13O0hG4J091882; Sat, 24 Apr 2021 00:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13O0hGoC091881; Sat, 24 Apr 2021 00:43:16 GMT (envelope-from git) Date: Sat, 24 Apr 2021 00:43:16 GMT Message-Id: <202104240043.13O0hGoC091881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: f0077b4c1dcf - stable/13 - mpt(4): Remove incorrect S/G segments limits. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f0077b4c1dcfa7eda6efadf197e8423fe002ac5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 00:43:17 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f0077b4c1dcfa7eda6efadf197e8423fe002ac5d commit f0077b4c1dcfa7eda6efadf197e8423fe002ac5d Author: Alexander Motin AuthorDate: 2021-04-17 14:41:35 +0000 Commit: Alexander Motin CommitDate: 2021-04-24 00:43:14 +0000 mpt(4): Remove incorrect S/G segments limits. First, two of those four checks are unreachable. Second, I don't believe there should be ">=" instead of ">". Third, bus_dma(9) already returns the same EFBIG if ">". This fixes false I/O errors in worst S/G cases with maxphys >= 2MB. MFC after: 1 week (cherry picked from commit 0f29396e493bd87ffa6a63fcb602b12e79d21a1e) --- sys/dev/mpt/mpt_cam.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 90c84eee2442..64776d673674 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -1292,10 +1292,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1315,12 +1311,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { @@ -1694,10 +1684,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1716,12 +1702,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { From owner-dev-commits-src-all@freebsd.org Sat Apr 24 00:43:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69D395E3C4D; Sat, 24 Apr 2021 00:43: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 4FRspW2csDz3lSl; Sat, 24 Apr 2021 00:43: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 4CF8516DD3; Sat, 24 Apr 2021 00:43: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 13O0hV5s092006; Sat, 24 Apr 2021 00:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13O0hVWn092005; Sat, 24 Apr 2021 00:43:31 GMT (envelope-from git) Date: Sat, 24 Apr 2021 00:43:31 GMT Message-Id: <202104240043.13O0hVWn092005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: dd01826ad3ad - stable/12 - mpt(4): Remove incorrect S/G segments limits. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dd01826ad3add7e5285f4f391c9f502906c78600 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 00:43:31 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=dd01826ad3add7e5285f4f391c9f502906c78600 commit dd01826ad3add7e5285f4f391c9f502906c78600 Author: Alexander Motin AuthorDate: 2021-04-17 14:41:35 +0000 Commit: Alexander Motin CommitDate: 2021-04-24 00:43:29 +0000 mpt(4): Remove incorrect S/G segments limits. First, two of those four checks are unreachable. Second, I don't believe there should be ">=" instead of ">". Third, bus_dma(9) already returns the same EFBIG if ">". This fixes false I/O errors in worst S/G cases with maxphys >= 2MB. MFC after: 1 week (cherry picked from commit 0f29396e493bd87ffa6a63fcb602b12e79d21a1e) --- sys/dev/mpt/mpt_cam.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 4fbca1d9fe25..a861dafbd060 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -1293,10 +1293,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1316,12 +1312,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { @@ -1696,10 +1686,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) hdrp = req->req_vbuf; mpt_off = req->req_vbuf; - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - } - if (error == 0) { switch (hdrp->Function) { case MPI_FUNCTION_SCSI_IO_REQUEST: @@ -1718,12 +1704,6 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) } } - if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { - error = EFBIG; - mpt_prt(mpt, "segment count %d too large (max %u)\n", - nseg, mpt->max_seg_cnt); - } - bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { From owner-dev-commits-src-all@freebsd.org Sat Apr 24 03:31:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D83EB5EF76E; Sat, 24 Apr 2021 03:31: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 4FRxXZ5rNbz4RpG; Sat, 24 Apr 2021 03:31: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 BB4A1199C8; Sat, 24 Apr 2021 03:31: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 13O3VgII016428; Sat, 24 Apr 2021 03:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13O3VgLZ016427; Sat, 24 Apr 2021 03:31:42 GMT (envelope-from git) Date: Sat, 24 Apr 2021 03:31:42 GMT Message-Id: <202104240331.13O3VgLZ016427@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tai-hwa Liang Subject: git: 2acbe67787d2 - main - sound(4): fixing panic for INVARIANTS kernel MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avatar X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2acbe67787d2ba08b62713ccc3abcef01e7ced09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 03:31:42 -0000 The branch main has been updated by avatar: URL: https://cgit.FreeBSD.org/src/commit/?id=2acbe67787d2ba08b62713ccc3abcef01e7ced09 commit 2acbe67787d2ba08b62713ccc3abcef01e7ced09 Author: Tai-hwa Liang AuthorDate: 2021-04-22 12:45:18 +0000 Commit: Tai-hwa Liang CommitDate: 2021-04-24 03:27:43 +0000 sound(4): fixing panic for INVARIANTS kernel 3e7bae08210e0 turns the BUS_READ_IVAR() failure from a warning into a KASSERT. For certain PCI audio devices such like snd_csa(4) and snd_emu10kx(4), the ac97_create() keeps the device handler generated by device_add_child(pci_dev, "pcm"), which is not really a PCI device handler. This in turn causes the subsequent pci_get_subdevice() inside ac97_initmixer() triggering a panic. This patch tries to put a bandaid for the aforementioned pcm device children such that they can use the correct PCI handler(from parent) to avoid a KASSERT panic in the INVARIANTS kernel. Tested with: snd_csa(4), snd_ich(4), snd_emu10kx(4) Reviewed by: imp MFC after: 1 month --- sys/dev/sound/pcm/ac97.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c index 960176329b3e..3dc614083660 100644 --- a/sys/dev/sound/pcm/ac97.c +++ b/sys/dev/sound/pcm/ac97.c @@ -602,6 +602,7 @@ ac97_initmixer(struct ac97_info *codec) ac97_patch codec_patch; const char *cname, *vname; char desc[80]; + device_t pdev; u_int8_t model, step; unsigned i, j, k, bit, old; u_int32_t id; @@ -641,9 +642,14 @@ ac97_initmixer(struct ac97_info *codec) return ENODEV; } + pdev = codec->dev; + while (strcmp(device_get_name(device_get_parent(pdev)), "pci") != 0) { + /* find the top-level PCI device handler */ + pdev = device_get_parent(pdev); + } codec->id = id; - codec->subvendor = (u_int32_t)pci_get_subdevice(codec->dev) << 16; - codec->subvendor |= (u_int32_t)pci_get_subvendor(codec->dev) & + codec->subvendor = (u_int32_t)pci_get_subdevice(pdev) << 16; + codec->subvendor |= (u_int32_t)pci_get_subvendor(pdev) & 0x0000ffff; codec->noext = 0; codec_patch = NULL; From owner-dev-commits-src-all@freebsd.org Sat Apr 24 03:36:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37A7A5EF957; Sat, 24 Apr 2021 03:36: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 4FRxfb13qTz4S03; Sat, 24 Apr 2021 03:36: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 17B3A1976E; Sat, 24 Apr 2021 03:36: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 13O3asgb017014; Sat, 24 Apr 2021 03:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13O3asVc017013; Sat, 24 Apr 2021 03:36:54 GMT (envelope-from git) Date: Sat, 24 Apr 2021 03:36:54 GMT Message-Id: <202104240336.13O3asVc017013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: b99419aee49e - main - mpr/mps(4): Make device mapping some more robust. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b99419aee49e2cc53747730be4d0ec4f9b330eb2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 03:36:55 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b99419aee49e2cc53747730be4d0ec4f9b330eb2 commit b99419aee49e2cc53747730be4d0ec4f9b330eb2 Author: Alexander Motin AuthorDate: 2021-04-24 03:18:01 +0000 Commit: Alexander Motin CommitDate: 2021-04-24 03:36:51 +0000 mpr/mps(4): Make device mapping some more robust. Allow new enclosure to replace previously existing one if there is no completely unused table entry, same as it is done for devices. If we can not process DPM due to corruption -- wipe it and restart from scratch. Otherwise I don't see a way to recover persistence if something go wrong and there is no BIOS to recover it for us. Together this solves a problem that appeared when 9300-8i firmware update to 16.00.10.00 somehow switched its mapping mode from Device Persistence to Enclosure/Slot without wiping the DPM table. It made HBA completely unusable, since overflowed and conflicting mapping table was unable to map any of enclosures and so devices. Also while there make some enclosure mapping errors more informative. MFC after: 1 month Sponsored by: iXsystems, Inc. --- sys/dev/mpr/mpr_mapping.c | 71 ++++++++++++++++++++++++++++++----------------- sys/dev/mps/mps_mapping.c | 39 +++++++++++++++++--------- 2 files changed, 71 insertions(+), 39 deletions(-) diff --git a/sys/dev/mpr/mpr_mapping.c b/sys/dev/mpr/mpr_mapping.c index ef97080fb175..6c191672c24e 100644 --- a/sys/dev/mpr/mpr_mapping.c +++ b/sys/dev/mpr/mpr_mapping.c @@ -1213,9 +1213,10 @@ _mapping_get_dev_info(struct mpr_softc *sc, phy_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } if (!((phy_change->device_info & @@ -1368,9 +1369,10 @@ _mapping_get_pcie_dev_info(struct mpr_softc *sc, port_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - port_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + port_change->dev_handle, + topo_change->enc_handle); continue; } if (!(port_change->device_info & @@ -1609,9 +1611,10 @@ _mapping_add_new_device(struct mpr_softc *sc, phy_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } @@ -1865,9 +1868,10 @@ _mapping_add_new_pcie_device(struct mpr_softc *sc, port_change->is_processed = 1; mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - port_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + port_change->dev_handle, + topo_change->enc_handle); continue; } @@ -2205,7 +2209,7 @@ mpr_mapping_free_memory(struct mpr_softc *sc) free(sc->dpm_pg0, M_MPR); } -static bool +static void _mapping_process_dpm_pg0(struct mpr_softc *sc) { u8 missing_cnt, enc_idx; @@ -2331,8 +2335,8 @@ _mapping_process_dpm_pg0(struct mpr_softc *sc) MPR_DPM_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: Conflict in mapping table for " - " enclosure %d\n", __func__, - enc_idx); + "enclosure %d device %d\n", + __func__, enc_idx, map_idx); goto fail; } physical_id = @@ -2371,20 +2375,26 @@ _mapping_process_dpm_pg0(struct mpr_softc *sc) mt_entry->device_info = MPR_DEV_RESERVED; } } /*close the loop for DPM table */ - return (true); + return; fail: + mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " + "Wiping DPM to start from scratch\n", __func__); + dpm_entry = (Mpi2DriverMap0Entry_t *) ((uint8_t *) sc->dpm_pg0 + + sizeof(MPI2_CONFIG_EXTENDED_PAGE_HEADER)); + bzero(dpm_entry, sizeof(Mpi2DriverMap0Entry_t) * sc->max_dpm_entries); for (entry_num = 0; entry_num < sc->max_dpm_entries; entry_num++) { + sc->dpm_flush_entry[entry_num] = 1; sc->dpm_entry_used[entry_num] = 0; /* * for IR firmware, it may be necessary to wipe out * sc->mapping_table volumes tooi */ } + _mapping_flush_dpm_pages(sc); for (enc_idx = 0; enc_idx < sc->num_enc_table_entries; enc_idx++) _mapping_clear_enc_entry(sc->enclosure_table + enc_idx); sc->num_enc_table_entries = 0; - return (false); } /* @@ -2624,10 +2634,8 @@ retry_read_dpm: } } - if (sc->is_dpm_enable) { - if (!_mapping_process_dpm_pg0(sc)) - sc->is_dpm_enable = 0; - } + if (sc->is_dpm_enable) + _mapping_process_dpm_pg0(sc); if (! sc->is_dpm_enable) { mpr_dprint(sc, MPR_MAPPING, "%s: DPM processing is disabled. " "Device mappings will not persist across reboots or " @@ -2823,14 +2831,24 @@ mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *sc, * and the enclosure has enough space in the Mapping * Table to map its devices. */ - enc_idx = sc->num_enc_table_entries; - if (enc_idx >= sc->max_enclosures) { + if (sc->num_enc_table_entries < sc->max_enclosures) { + enc_idx = sc->num_enc_table_entries; + sc->num_enc_table_entries++; + } else { + enc_idx = _mapping_get_high_missing_et_idx(sc); + if (enc_idx != MPR_ENCTABLE_BAD_IDX) { + et_entry = &sc->enclosure_table[enc_idx]; + _mapping_add_to_removal_table(sc, + et_entry->dpm_entry_num); + _mapping_clear_enc_entry(et_entry); + } + } + if (enc_idx == MPR_ENCTABLE_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " "Enclosure cannot be added to mapping " "table because it's full.\n", __func__); goto out; } - sc->num_enc_table_entries++; et_entry = &sc->enclosure_table[enc_idx]; et_entry->enc_handle = le16toh(event_data-> EnclosureHandle); @@ -2857,8 +2875,9 @@ mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *sc, le16toh(event_data->EnclosureHandle)); if (enc_idx == MPR_ENCTABLE_BAD_IDX) { mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: Cannot " - "unmap enclosure %d because it has already been " - "deleted.\n", __func__, enc_idx); + "unmap enclosure with handle 0x%04x because it " + "has already been deleted.\n", __func__, + le16toh(event_data->EnclosureHandle)); goto out; } et_entry = &sc->enclosure_table[enc_idx]; diff --git a/sys/dev/mps/mps_mapping.c b/sys/dev/mps/mps_mapping.c index 71cdb399c271..9e1e0726c574 100644 --- a/sys/dev/mps/mps_mapping.c +++ b/sys/dev/mps/mps_mapping.c @@ -1175,9 +1175,10 @@ _mapping_get_dev_info(struct mps_softc *sc, phy_change->is_processed = 1; mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } if (!((phy_change->device_info & @@ -1420,9 +1421,10 @@ _mapping_add_new_device(struct mps_softc *sc, phy_change->is_processed = 1; mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "failed to add the device with handle " - "0x%04x because the enclosure is not in " - "the mapping table\n", __func__, - phy_change->dev_handle); + "0x%04x because enclosure handle 0x%04x " + "is not in the mapping table\n", __func__, + phy_change->dev_handle, + topo_change->enc_handle); continue; } @@ -1884,8 +1886,8 @@ _mapping_process_dpm_pg0(struct mps_softc *sc) MPS_DPM_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: Conflict in mapping table for " - " enclosure %d\n", __func__, - enc_idx); + "enclosure %d device %d\n", + __func__, enc_idx, map_idx); break; } physical_id = @@ -2359,14 +2361,24 @@ mps_mapping_enclosure_dev_status_change_event(struct mps_softc *sc, * and the enclosure has enough space in the Mapping * Table to map its devices. */ - enc_idx = sc->num_enc_table_entries; - if (enc_idx >= sc->max_enclosures) { + if (sc->num_enc_table_entries < sc->max_enclosures) { + enc_idx = sc->num_enc_table_entries; + sc->num_enc_table_entries++; + } else { + enc_idx = _mapping_get_high_missing_et_idx(sc); + if (enc_idx != MPS_ENCTABLE_BAD_IDX) { + et_entry = &sc->enclosure_table[enc_idx]; + _mapping_add_to_removal_table(sc, + et_entry->dpm_entry_num); + _mapping_clear_enc_entry(et_entry); + } + } + if (enc_idx == MPS_ENCTABLE_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: " "Enclosure cannot be added to mapping " "table because it's full.\n", __func__); goto out; } - sc->num_enc_table_entries++; et_entry = &sc->enclosure_table[enc_idx]; et_entry->enc_handle = le16toh(event_data-> EnclosureHandle); @@ -2393,8 +2405,9 @@ mps_mapping_enclosure_dev_status_change_event(struct mps_softc *sc, le16toh(event_data->EnclosureHandle)); if (enc_idx == MPS_ENCTABLE_BAD_IDX) { mps_dprint(sc, MPS_ERROR | MPS_MAPPING, "%s: Cannot " - "unmap enclosure %d because it has already been " - "deleted.\n", __func__, enc_idx); + "unmap enclosure with handle 0x%04x because it " + "has already been deleted.\n", __func__, + le16toh(event_data->EnclosureHandle)); goto out; } et_entry = &sc->enclosure_table[enc_idx]; From owner-dev-commits-src-all@freebsd.org Sat Apr 24 10:27:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A8FD5FA125; Sat, 24 Apr 2021 10:27: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 4FS6m62zMrz4mGC; Sat, 24 Apr 2021 10:27: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 594BA1EFF1; Sat, 24 Apr 2021 10:27: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 13OARICt061645; Sat, 24 Apr 2021 10:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OARIVn061644; Sat, 24 Apr 2021 10:27:18 GMT (envelope-from git) Date: Sat, 24 Apr 2021 10:27:18 GMT Message-Id: <202104241027.13OARIVn061644@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: a9b66dbd9169 - main - Allow the tcp_lro_flush_all() function to be called when the control structure is zeroed, by setting the VNET after checking the mbuf count for zero. It appears there are some cases with early interrupts on some network devices which still trigger page-faults on accessing a NULL "ifp" pointer before the TCP LRO control structure has been initialized. This basically preserves the old behaviour, prior to 9ca874cf740ee68c5742df8b5f9e20910085c011 . 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: a9b66dbd9169f102dea92ad369a09c0d20cdb41f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 10:27:18 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=a9b66dbd9169f102dea92ad369a09c0d20cdb41f commit a9b66dbd9169f102dea92ad369a09c0d20cdb41f Author: Hans Petter Selasky AuthorDate: 2021-04-24 10:20:33 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-24 10:23:42 +0000 Allow the tcp_lro_flush_all() function to be called when the control structure is zeroed, by setting the VNET after checking the mbuf count for zero. It appears there are some cases with early interrupts on some network devices which still trigger page-faults on accessing a NULL "ifp" pointer before the TCP LRO control structure has been initialized. This basically preserves the old behaviour, prior to 9ca874cf740ee68c5742df8b5f9e20910085c011 . No functional change. Reported by: rscheff@ Differential Revision: https://reviews.freebsd.org/D29564 MFC after: 2 weeks Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/netinet/tcp_lro.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 61c6f218e513..09fc024c3d73 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -1439,12 +1439,12 @@ tcp_lro_flush_all(struct lro_ctrl *lc) uint64_t nseq; unsigned x; - CURVNET_SET(lc->ifp->if_vnet); - /* check if no mbufs to flush */ if (lc->lro_mbuf_count == 0) goto done; + CURVNET_SET(lc->ifp->if_vnet); + /* get current time */ lc->lro_last_queue_time = getsbinuptime(); @@ -1478,13 +1478,12 @@ tcp_lro_flush_all(struct lro_ctrl *lc) lc->lro_flushed++; } } + CURVNET_RESTORE(); done: /* flush active streams */ tcp_lro_rx_done(lc); lc->lro_mbuf_count = 0; - - CURVNET_RESTORE(); } #ifdef TCPHPTS From owner-dev-commits-src-all@freebsd.org Sat Apr 24 10:52:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D5595FB484; Sat, 24 Apr 2021 10:52: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 4FS7KH70mNz4nxR; Sat, 24 Apr 2021 10:52: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 E2C0C1F7AA; Sat, 24 Apr 2021 10:52: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 13OAqZjn001183; Sat, 24 Apr 2021 10:52:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OAqZtb001182; Sat, 24 Apr 2021 10:52:35 GMT (envelope-from git) Date: Sat, 24 Apr 2021 10:52:35 GMT Message-Id: <202104241052.13OAqZtb001182@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: 77651151f3ca - main - linux: make ptrace(2) return EIO when trying to peek invalid address 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: 77651151f3caec7d2440404f8c0f1819757d1d5d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 10:52:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=77651151f3caec7d2440404f8c0f1819757d1d5d commit 77651151f3caec7d2440404f8c0f1819757d1d5d Author: Edward Tomasz Napierala AuthorDate: 2021-04-24 10:37:06 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-24 10:37:50 +0000 linux: make ptrace(2) return EIO when trying to peek invalid address Previously we've returned the error from native ptrace(2), ENOMEM. This confused Linux strace(2). Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29925 --- sys/amd64/linux/linux_ptrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 89fda7979359..76ad9b1e25c4 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -313,6 +313,8 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) error = kern_ptrace(td, PT_READ_I, pid, addr, 0); if (error == 0) error = copyout(td->td_retval, data, sizeof(l_int)); + else if (error == ENOMEM) + error = EIO; td->td_retval[0] = error; return (error); From owner-dev-commits-src-all@freebsd.org Sat Apr 24 12:12:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF62F5FE312; Sat, 24 Apr 2021 12:12:58 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail-out.smeets.xyz (mail-out.smeets.xyz [88.99.165.53]) (using TLSv1.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 4FS96171rqz4sBW; Sat, 24 Apr 2021 12:12:57 +0000 (UTC) (envelope-from flo@smeets.xyz) Received: from mail.smeets.xyz (mail.smeets.xyz [IPv6:2a01:4f8:10a:3543::25:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail-out.smeets.xyz (Postfix) with ESMTPS id 54FBB82788; Sat, 24 Apr 2021 14:12:50 +0200 (CEST) Received: from amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:10a:3543::aa:4]) by mail.smeets.xyz (Postfix) with ESMTP id 4A608B05C7; Sat, 24 Apr 2021 14:12:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at smeets.xyz Received: from mail.smeets.xyz ([IPv6:2a01:4f8:10a:3543::25:3]) by amavis.smeets.xyz (amavis.smeets.xyz [IPv6:2a01:4f8:10a:3543::aa:4]) (amavisd-new, port 10025) with ESMTP id KFO0SPRNoDgd; Sat, 24 Apr 2021 14:12:50 +0200 (CEST) Received: from nibbler.home.lan (p2003000633c28c5344b638d1b5fb5e31.dip0.t-ipconnect.de [IPv6:2003:6:33c2:8c53:44b6:38d1:b5fb:5e31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.smeets.xyz (Postfix) with ESMTPSA id B196CB05BF; Sat, 24 Apr 2021 14:12:47 +0200 (CEST) To: Kristof Provost , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> From: Florian Smeets Subject: Re: git: 5c11c5a36558 - main - pfctl: Move to DIOCADDRULENV Message-ID: <0f7e86c0-3592-0391-7e52-4e6d14bc1eb0@smeets.xyz> Date: Sat, 24 Apr 2021 14:12:46 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EM4iyuFHz25fd1hNjENIlvrZ7QW9LPekL" X-Rspamd-Queue-Id: 4FS96171rqz4sBW X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_ATTACHMENT(0.00)[]; DKIM_TRACE(0.00)[smeets.xyz:+]; DMARC_POLICY_ALLOW(-0.50)[smeets.xyz,reject]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[88.99.165.53:from]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:+,5:~]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_COUNT_FIVE(0.00)[5]; FREEFALL_USER(0.00)[flo]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain,application/pgp-keys]; NEURAL_SPAM_SHORT(1.00)[1.000]; R_DKIM_ALLOW(-0.20)[smeets.xyz:s=dkim]; SPAMHAUS_ZRD(0.00)[88.99.165.53:from:127.0.2.255]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 12:12:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EM4iyuFHz25fd1hNjENIlvrZ7QW9LPekL Content-Type: multipart/mixed; boundary="w5rPKyeBzVGkAUFeGPoHy5uz8zY3eaduK"; protected-headers="v1" From: Florian Smeets To: Kristof Provost , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <0f7e86c0-3592-0391-7e52-4e6d14bc1eb0@smeets.xyz> Subject: Re: git: 5c11c5a36558 - main - pfctl: Move to DIOCADDRULENV References: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> In-Reply-To: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> --w5rPKyeBzVGkAUFeGPoHy5uz8zY3eaduK Content-Type: multipart/mixed; boundary="------------C633B0317775A1E663539072" Content-Language: en-US This is a multi-part message in MIME format. --------------C633B0317775A1E663539072 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 10.04.21 11:16, Kristof Provost wrote: > The branch main has been updated by kp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5c11c5a3655842a176124ef2= 334fcdf830422c8a >=20 > commit 5c11c5a3655842a176124ef2334fcdf830422c8a > Author: Kristof Provost > AuthorDate: 2021-03-12 17:03:14 +0000 > Commit: Kristof Provost > CommitDate: 2021-04-10 09:16:01 +0000 >=20 > pfctl: Move to DIOCADDRULENV > =20 > Start using the new nvlist based ioctl to add rules. > =20 > MFC after: 4 weeks > Sponsored by: Rubicon Communications, LLC ("Netgate") > Differential Revision: https://reviews.freebsd.org/D29558 Hi Kristof, this commit breaks my previously working rule set. Using a pfctl from=20 before this commit works with a kernel from yesterdays sources. This is the smallest rule set I could come up with. It doesn't matter=20 whether I use macros in the list or not. The int_if stuff is only there=20 to not lock myself out of the system. It looks like lists with more than 5 IPv6 host or 6 v4 hosts don't work. int_if=3D"em0" set skip on $int_if # not working with pfctl after 5c11c5a3655842a176124ef2334fcdf830422c8a # each one of the rules below causes "pfctl: DIOCADDRULENV: Invalid=20 argument" on its own pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5,=20 fd01::6 } port ssh pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4,=20 192.168.0.4, 192.168.0.5, 192.168.0.6, 192.168.0.7 } port ssh # working fine with pfctl after 5c11c5a3655842a176124ef2334fcdf830422c8a pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5 }=20 port ssh pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4,=20 192.168.0.4, 192.168.0.5, 192.168.0.6 } port ssh Another interesting point is the following rules work with -o none, but=20 not with -o basic, which I guess points to list or maybe table handling? pass in proto tcp to 192.168.0.1 port ssh pass in proto tcp to 192.168.0.2 port ssh pass in proto tcp to 192.168.0.3 port ssh pass in proto tcp to 192.168.0.4 port ssh pass in proto tcp to 192.168.0.5 port ssh pass in proto tcp to 192.168.0.6 port ssh pass in proto tcp to 192.168.0.7 port ssh I think you should be able to reproduce this easily, if you need=20 anything else, please let me know. Thanks, Florian --------------C633B0317775A1E663539072-- --w5rPKyeBzVGkAUFeGPoHy5uz8zY3eaduK-- --EM4iyuFHz25fd1hNjENIlvrZ7QW9LPekL Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEE7LNouHkIv7aRTXJp71uk3NWp88AFAmCECz4FAwAAAAAACgkQ71uk3NWp88Bg wg/8DRpgTbVDu717PtvQfcLOr2StGyZakheznJ7SsUD9TVSSpL+IKtnhWxKZI9hMJRAPtsu4Rd/8 3efpFKpEb/Xuiug8Wvkn9F6c99Gvt6C8TcByBQrx06AUE0ByarhcABzd1hEp6doyaKapdJTIF5Y5 qR2SsSaPnGU0EP0FYUbbq5hc10QI0SfH/P9jubyPukPiulrvN2nCc0wnlNKxcsa6ynHxHNYbUB6t 3SL0SPuM57JCE238ee0ZFK1FCuDpFDnhqtD3TXKCWmuDeMVRF/6KWv1b3nT7MgToVDd/esBWYcLW PWAGRhymQF+0JA8c9ipbTn68REgun0SRyaryM3nmfWjZ2NTZojVmKT9sKmFkzdKHGuSiumhdlXiP 4D4C3ZwD5rHlh5Db3g2bIsAlO3KWtZ7wKBJfmqiapzlrPqQ+OR4U+wDHi9ZQ37J1PV4sxmRZO80C Qs+MmXLGBnhfRnMqOQP64/8mz9e7p1IIM7N3iFSr+5+tSIbHOTemOZc12L+Gotrwcu1NovBkvrL8 kFz4TisLj5UtLIZjvIi2cI/lVGV272AANHOGCakEBlOmzTpGe2oz+eCabDpYGWnrD/3kUwbf8KEs N8XgIqGU5qkTj0h8Ke64DCFcXxpAP9fIoMh4yL9eGZNhIhy/fYtQJGI3IQbSPJxc53QeN1HjO1Xv hgo= =deOG -----END PGP SIGNATURE----- --EM4iyuFHz25fd1hNjENIlvrZ7QW9LPekL-- From owner-dev-commits-src-all@freebsd.org Sat Apr 24 13:18:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36C685FF8F5; Sat, 24 Apr 2021 13:18:50 +0000 (UTC) (envelope-from kp@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 4FSBZ216zGz3Bs1; Sat, 24 Apr 2021 13:18:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id F298D29A4B; Sat, 24 Apr 2021 13:18:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id C16FF411BC; Sat, 24 Apr 2021 15:18:47 +0200 (CEST) From: "Kristof Provost" To: "Florian Smeets" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5c11c5a36558 - main - pfctl: Move to DIOCADDRULENV Date: Sat, 24 Apr 2021 15:18:47 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <1B2EBD56-08CE-4854-BB3D-F20314247E1C@FreeBSD.org> In-Reply-To: <0f7e86c0-3592-0391-7e52-4e6d14bc1eb0@smeets.xyz> References: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> <0f7e86c0-3592-0391-7e52-4e6d14bc1eb0@smeets.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 13:18:50 -0000 On 24 Apr 2021, at 14:12, Florian Smeets wrote: > On 10.04.21 11:16, Kristof Provost wrote: >> The branch main has been updated by kp: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3D5c11c5a3655842a176124ef2334f= cdf830422c8a >> >> commit 5c11c5a3655842a176124ef2334fcdf830422c8a >> Author: Kristof Provost >> AuthorDate: 2021-03-12 17:03:14 +0000 >> Commit: Kristof Provost >> CommitDate: 2021-04-10 09:16:01 +0000 >> >> pfctl: Move to DIOCADDRULENV >> Start using the new nvlist based ioctl to add rules. >> MFC after: 4 weeks >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> Differential Revision: https://reviews.freebsd.org/D29558 > > Hi Kristof, > > this commit breaks my previously working rule set. Using a pfctl from = > before this commit works with a kernel from yesterdays sources. > > This is the smallest rule set I could come up with. It doesn't matter = > whether I use macros in the list or not. The int_if stuff is only = > there to not lock myself out of the system. > > It looks like lists with more than 5 IPv6 host or 6 v4 hosts don't = > work. > > int_if=3D"em0" > set skip on $int_if > > # not working with pfctl after = > 5c11c5a3655842a176124ef2334fcdf830422c8a > # each one of the rules below causes "pfctl: DIOCADDRULENV: Invalid = > argument" on its own > pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5, = > fd01::6 } port ssh > pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4, = > 192.168.0.4, 192.168.0.5, 192.168.0.6, 192.168.0.7 } port ssh > > # working fine with pfctl after = > 5c11c5a3655842a176124ef2334fcdf830422c8a > pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5 } = > port ssh > pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4, = > 192.168.0.4, 192.168.0.5, 192.168.0.6 } port ssh > > Another interesting point is the following rules work with -o none, = > but not with -o basic, which I guess points to list or maybe table = > handling? > > pass in proto tcp to 192.168.0.1 port ssh > pass in proto tcp to 192.168.0.2 port ssh > pass in proto tcp to 192.168.0.3 port ssh > pass in proto tcp to 192.168.0.4 port ssh > pass in proto tcp to 192.168.0.5 port ssh > pass in proto tcp to 192.168.0.6 port ssh > pass in proto tcp to 192.168.0.7 port ssh > > I think you should be able to reproduce this easily, if you need = > anything else, please let me know. > Yeah, I see what=E2=80=99s happening here. The optimiser creates an autom= atic = table, and the table name is longer than IFNAMSIZ. That=E2=80=99s fine, = because it=E2=80=99s stored in a union that has tblname, which I sufficie= ntly = long for that name. The problem is that the nvlist code unconditionally = reads the ifname as well, and the automatic name is longer than = IFNAMSIZ. It=E2=80=99s a simple matter of (a) cursing the old pf data structures fo= r = being awful and (b) only reading ifname (or tblname) for the appropriate = addr type. I=E2=80=99m testing a patch now. Best regards, Kristof From owner-dev-commits-src-all@freebsd.org Sat Apr 24 14:01:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F06D62180A; Sat, 24 Apr 2021 14:01:10 +0000 (UTC) (envelope-from kp@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 4FSCVt0SRWz3D4k; Sat, 24 Apr 2021 14:01:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id DB4D329DC6; Sat, 24 Apr 2021 14:01:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 610D33EDDD; Sat, 24 Apr 2021 16:01:08 +0200 (CEST) From: "Kristof Provost" To: "Florian Smeets" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 5c11c5a36558 - main - pfctl: Move to DIOCADDRULENV Date: Sat, 24 Apr 2021 16:01:07 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: <23A87E17-BB7C-4DB4-9C60-6F2106204E95@FreeBSD.org> In-Reply-To: <1B2EBD56-08CE-4854-BB3D-F20314247E1C@FreeBSD.org> References: <202104100916.13A9GJpP068955@gitrepo.freebsd.org> <0f7e86c0-3592-0391-7e52-4e6d14bc1eb0@smeets.xyz> <1B2EBD56-08CE-4854-BB3D-F20314247E1C@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 14:01:10 -0000 On 24 Apr 2021, at 15:18, Kristof Provost wrote: > On 24 Apr 2021, at 14:12, Florian Smeets wrote: >> On 10.04.21 11:16, Kristof Provost wrote: >>> The branch main has been updated by kp: >>> >>> URL: = >>> https://cgit.FreeBSD.org/src/commit/?id=3D5c11c5a3655842a176124ef2334= fcdf830422c8a >>> >>> commit 5c11c5a3655842a176124ef2334fcdf830422c8a >>> Author: Kristof Provost >>> AuthorDate: 2021-03-12 17:03:14 +0000 >>> Commit: Kristof Provost >>> CommitDate: 2021-04-10 09:16:01 +0000 >>> >>> pfctl: Move to DIOCADDRULENV >>> Start using the new nvlist based ioctl to add rules. >>> MFC after: 4 weeks >>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>> Differential Revision: https://reviews.freebsd.org/D29558 >> >> Hi Kristof, >> >> this commit breaks my previously working rule set. Using a pfctl from = >> before this commit works with a kernel from yesterdays sources. >> >> This is the smallest rule set I could come up with. It doesn't matter = >> whether I use macros in the list or not. The int_if stuff is only = >> there to not lock myself out of the system. >> >> It looks like lists with more than 5 IPv6 host or 6 v4 hosts don't = >> work. >> >> int_if=3D"em0" >> set skip on $int_if >> >> # not working with pfctl after = >> 5c11c5a3655842a176124ef2334fcdf830422c8a >> # each one of the rules below causes "pfctl: DIOCADDRULENV: Invalid = >> argument" on its own >> pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5, = >> fd01::6 } port ssh >> pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4, = >> 192.168.0.4, 192.168.0.5, 192.168.0.6, 192.168.0.7 } port ssh >> >> # working fine with pfctl after = >> 5c11c5a3655842a176124ef2334fcdf830422c8a >> pass in proto tcp to { fd01::1, fd01::2, fd01::3, fd01::4, fd01::5 } = >> port ssh >> pass in proto tcp to { 192.168.0.1, 192.168.0.2, 192.168.0.4, = >> 192.168.0.4, 192.168.0.5, 192.168.0.6 } port ssh >> >> Another interesting point is the following rules work with -o none, = >> but not with -o basic, which I guess points to list or maybe table = >> handling? >> >> pass in proto tcp to 192.168.0.1 port ssh >> pass in proto tcp to 192.168.0.2 port ssh >> pass in proto tcp to 192.168.0.3 port ssh >> pass in proto tcp to 192.168.0.4 port ssh >> pass in proto tcp to 192.168.0.5 port ssh >> pass in proto tcp to 192.168.0.6 port ssh >> pass in proto tcp to 192.168.0.7 port ssh >> >> I think you should be able to reproduce this easily, if you need = >> anything else, please let me know. >> > Yeah, I see what=E2=80=99s happening here. The optimiser creates an = > automatic table, and the table name is longer than IFNAMSIZ. That=E2=80= =99s = > fine, because it=E2=80=99s stored in a union that has tblname, which I = > sufficiently long for that name. The problem is that the nvlist code = > unconditionally reads the ifname as well, and the automatic name is = > longer than IFNAMSIZ. > It=E2=80=99s a simple matter of (a) cursing the old pf data structures = for = > being awful and (b) only reading ifname (or tblname) for the = > appropriate addr type. > > I=E2=80=99m testing a patch now. > https://reviews.freebsd.org/D29962 Best regards, Kristof From owner-dev-commits-src-all@freebsd.org Sat Apr 24 19:02:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E1F562729E; Sat, 24 Apr 2021 19:02: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 4FSLC21nMvz3hdk; Sat, 24 Apr 2021 19:02: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 302AC25A6D; Sat, 24 Apr 2021 19:02: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 13OJ2stO048001; Sat, 24 Apr 2021 19:02:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OJ2sA2048000; Sat, 24 Apr 2021 19:02:54 GMT (envelope-from git) Date: Sat, 24 Apr 2021 19:02:54 GMT Message-Id: <202104241902.13OJ2sA2048000@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: e68d76c054d2 - main - hkbd: Fix typo which disables keyboard input in kdb 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: e68d76c054d25490195a99a25329ddca1467244b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 19:02:54 -0000 The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e68d76c054d25490195a99a25329ddca1467244b commit e68d76c054d25490195a99a25329ddca1467244b Author: Vladimir Kondratyev AuthorDate: 2021-04-24 18:49:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-04-24 19:01:14 +0000 hkbd: Fix typo which disables keyboard input in kdb Reported by: Greg V MFC after: 1 week --- sys/dev/hid/hkbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 775ad677f4de..55eba6d321ea 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -917,7 +917,7 @@ hkbd_attach(device_t dev) /* interrupt handler will be called with hkbd mutex taken */ hidbus_set_lock(dev, &sc->sc_mtx); /* interrupt handler can be called during panic */ - hidbus_set_flags(dev, hidbus_get_flags(dev) & HIDBUS_FLAG_CAN_POLL); + hidbus_set_flags(dev, hidbus_get_flags(dev) | HIDBUS_FLAG_CAN_POLL); /* setup default keyboard maps */ From owner-dev-commits-src-all@freebsd.org Sat Apr 24 19:05:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B7CB627312; Sat, 24 Apr 2021 19:05: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 4FSLFb0hQ8z3hfx; Sat, 24 Apr 2021 19:05: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 0646125A6E; Sat, 24 Apr 2021 19:05: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 13OJ56xO048259; Sat, 24 Apr 2021 19:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OJ56Pi048258; Sat, 24 Apr 2021 19:05:06 GMT (envelope-from git) Date: Sat, 24 Apr 2021 19:05:06 GMT Message-Id: <202104241905.13OJ56Pi048258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson Subject: git: af14713d49fd - main - Support run-time configuration of the PIPE_MINDIRECT threshold. PIPE_MINDIRECT determines at what (blocking) write size one-copy optimizations are applied in pipe(2) I/O. That threshold hasn't been tuned since the 1990s when this code was originally committed, and allowing run-time reconfiguration will make it easier to assess whether contemporary microarchitectures would prefer a different threshold. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af14713d49fdb30c84969588f6e5cb66d65dc4c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 19:05:07 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=af14713d49fdb30c84969588f6e5cb66d65dc4c4 commit af14713d49fdb30c84969588f6e5cb66d65dc4c4 Author: Robert Watson AuthorDate: 2021-01-02 16:42:28 +0000 Commit: Robert Watson CommitDate: 2021-04-24 19:04:28 +0000 Support run-time configuration of the PIPE_MINDIRECT threshold. PIPE_MINDIRECT determines at what (blocking) write size one-copy optimizations are applied in pipe(2) I/O. That threshold hasn't been tuned since the 1990s when this code was originally committed, and allowing run-time reconfiguration will make it easier to assess whether contemporary microarchitectures would prefer a different threshold. (On our local RPi4 baords, the 8k default would ideally be at least 32k, but it's not clear how generalizable that observation is.) MFC after: 3 weeks Reviewers: jrtc27, arichardson Differential Revision: https://reviews.freebsd.org/D29819 --- sys/kern/sys_pipe.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 558337794950..fee9d95e179c 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -209,6 +209,7 @@ static int pipefragretry; static int pipeallocfail; static int piperesizefail; static int piperesizeallowed = 1; +static long pipe_mindirect = PIPE_MINDIRECT; SYSCTL_LONG(_kern_ipc, OID_AUTO, maxpipekva, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &maxpipekva, 0, "Pipe KVA limit"); @@ -263,6 +264,29 @@ pipeinit(void *dummy __unused) KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } +static int +sysctl_handle_pipe_mindirect(SYSCTL_HANDLER_ARGS) +{ + int error = 0; + long tmp_pipe_mindirect = pipe_mindirect; + + error = sysctl_handle_long(oidp, &tmp_pipe_mindirect, arg2, req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* + * Don't allow pipe_mindirect to be set so low that we violate + * atomicity requirements. + */ + if (tmp_pipe_mindirect <= PIPE_BUF) + return (EINVAL); + pipe_mindirect = tmp_pipe_mindirect; + return (0); +} +SYSCTL_OID(_kern_ipc, OID_AUTO, pipe_mindirect, CTLTYPE_LONG | CTLFLAG_RW, + &pipe_mindirect, 0, sysctl_handle_pipe_mindirect, "L", + "Minimum write size triggering VM optimization"); + static int pipe_zone_ctor(void *mem, int size, void *arg, int flags) { @@ -1140,8 +1164,8 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, * away on us. */ if (uio->uio_segflg == UIO_USERSPACE && - uio->uio_iov->iov_len >= PIPE_MINDIRECT && - wpipe->pipe_buffer.size >= PIPE_MINDIRECT && + uio->uio_iov->iov_len >= pipe_mindirect && + wpipe->pipe_buffer.size >= pipe_mindirect && (fp->f_flag & FNONBLOCK) == 0) { error = pipe_direct_write(wpipe, uio); if (error != 0) From owner-dev-commits-src-all@freebsd.org Sat Apr 24 20:40:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D0005E066C; Sat, 24 Apr 2021 20:40: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 4FSNMz2FKwz3mLT; Sat, 24 Apr 2021 20:40: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 3FF6127014; Sat, 24 Apr 2021 20:40: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 13OKelHh076184; Sat, 24 Apr 2021 20:40:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OKel5J076183; Sat, 24 Apr 2021 20:40:47 GMT (envelope-from git) Date: Sat, 24 Apr 2021 20:40:47 GMT Message-Id: <202104242040.13OKel5J076183@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: 6096814d3134 - main - tcp: fix man page 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: 6096814d3134234d48936f557d431a793e35d8b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 20:40:47 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6096814d3134234d48936f557d431a793e35d8b3 commit 6096814d3134234d48936f557d431a793e35d8b3 Author: Michael Tuexen AuthorDate: 2021-04-24 20:31:36 +0000 Commit: Michael Tuexen CommitDate: 2021-04-24 20:40:34 +0000 tcp: fix man page Reviewed by: gbe, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D29963 --- share/man/man4/tcp.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 873cfe4b822a..d06630aa8d44 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 April 18, 2021 +.Dd April 24, 2021 .Dt TCP 4 .Os .Sh NAME @@ -690,6 +690,7 @@ for the connection for some defined period of time. Disable the host cache. .It 1 Enable the host cache. (default) +.El .It Va hostcache.purgenow Immediately purge all entries once set to any value. Setting this to 2 will also reseed the hash salt. @@ -704,6 +705,7 @@ Do not purge all entries when pruning the host cache. (default) Purge all entries when doing the next pruning. .It 2 Purge all entries, and also reseed the hash salt. +.El .It Va hostcache.prune Time in seconds between pruning expired host cache entries. Defaults to 300 (5 minutes). From owner-dev-commits-src-all@freebsd.org Sat Apr 24 22:31:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89DB05E2D3B; Sat, 24 Apr 2021 22:31: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 4FSQqM3Xvyz3qpK; Sat, 24 Apr 2021 22:31: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 6C5B37B9; Sat, 24 Apr 2021 22:31: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 13OMVBqG024796; Sat, 24 Apr 2021 22:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OMVBQ3024795; Sat, 24 Apr 2021 22:31:11 GMT (envelope-from git) Date: Sat, 24 Apr 2021 22:31:11 GMT Message-Id: <202104242231.13OMVBQ3024795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4543735a5f5c - stable/13 - nfsd: fix replies from session cache for multiple retries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4543735a5f5c4ecb0f73382fd3a84fb4b4af169f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 22:31:11 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4543735a5f5c4ecb0f73382fd3a84fb4b4af169f commit 4543735a5f5c4ecb0f73382fd3a84fb4b4af169f Author: Rick Macklem AuthorDate: 2021-04-10 22:50:25 +0000 Commit: Rick Macklem CommitDate: 2021-04-24 22:27:26 +0000 nfsd: fix replies from session cache for multiple retries Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. Commit 05a39c2c1c18 fixed replying with the cached reply in in the session slot if same session slot sequence#. However, the code uses the reply and, as such, will fail for a subsequent retry of the RPC. A subsequent retry would be an extremely rare event, but this patch fixes this, so long as m_copym(..M_NOWAIT) does not fail, which should also be a rare event. This fix affects the exceedingly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation, multiple times. Note that retries only occur after the client has needed to create a new TCP connection, with a new TCP connection for each retry. (cherry picked from commit 22cefe3d8378f58adcdbb2c7589b9f30c2a38315) --- sys/fs/nfs/nfs_commonsubs.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index e9b2af17d8b4..43bb396d9cfd 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4619,6 +4619,7 @@ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, struct nfsslot *slots, struct mbuf **reply, uint16_t maxslot) { + struct mbuf *m; int error; error = 0; @@ -4632,8 +4633,14 @@ nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, error = NFSERR_DELAY; else if (slots[slotid].nfssl_reply != NULL) { if (reply != NULL) { - *reply = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + m = m_copym(slots[slotid].nfssl_reply, 0, + M_COPYALL, M_NOWAIT); + if (m != NULL) + *reply = m; + else { + *reply = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } } slots[slotid].nfssl_inprog = 1; error = NFSERR_REPLYFROMCACHE; @@ -4660,10 +4667,29 @@ void nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat, struct mbuf **rep) { + struct mbuf *m; if (repstat == NFSERR_REPLYFROMCACHE) { - *rep = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + if (slots[slotid].nfssl_reply != NULL) { + /* + * We cannot sleep here, but copy will usually + * succeed. + */ + m = m_copym(slots[slotid].nfssl_reply, 0, M_COPYALL, + M_NOWAIT); + if (m != NULL) + *rep = m; + else { + /* + * Multiple retries would be extremely rare, + * so using the cached reply will likely + * be ok. + */ + *rep = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } + } else + *rep = NULL; } else { if (slots[slotid].nfssl_reply != NULL) m_freem(slots[slotid].nfssl_reply); From owner-dev-commits-src-all@freebsd.org Sat Apr 24 22:56:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DA6F5E3627; Sat, 24 Apr 2021 22:56: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 4FSRNt3qbnz3rrP; Sat, 24 Apr 2021 22:56: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 76319ACD; Sat, 24 Apr 2021 22:56: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 13OMukcL052530; Sat, 24 Apr 2021 22:56:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13OMuk6n052529; Sat, 24 Apr 2021 22:56:46 GMT (envelope-from git) Date: Sat, 24 Apr 2021 22:56:46 GMT Message-Id: <202104242256.13OMuk6n052529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 14fc640c2e97 - stable/12 - nfsd: fix replies from session cache for multiple retries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 14fc640c2e97885a82a7651b5ef912710e283d13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 22:56:46 -0000 The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=14fc640c2e97885a82a7651b5ef912710e283d13 commit 14fc640c2e97885a82a7651b5ef912710e283d13 Author: Rick Macklem AuthorDate: 2021-04-10 22:50:25 +0000 Commit: Rick Macklem CommitDate: 2021-04-24 22:52:21 +0000 nfsd: fix replies from session cache for multiple retries Recent testing of network partitioning a FreeBSD NFSv4.1 server from a Linux NFSv4.1 client identified problems with both the FreeBSD server and Linux client. Commit 05a39c2c1c18 fixed replying with the cached reply in in the session slot if same session slot sequence#. However, the code uses the reply and, as such, will fail for a subsequent retry of the RPC. A subsequent retry would be an extremely rare event, but this patch fixes this, so long as m_copym(..M_NOWAIT) does not fail, which should also be a rare event. This fix affects the exceedingly rare case where a NFSv4 client retries a non-idempotent RPC, such as a lock operation, multiple times. Note that retries only occur after the client has needed to create a new TCP connection, with a new TCP connection for each retry. PR: 254816 (cherry picked from commit 22cefe3d8378f58adcdbb2c7589b9f30c2a38315) --- sys/fs/nfs/nfs_commonsubs.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 9c6bee466272..d004fbb1bc51 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4561,6 +4561,7 @@ int nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, struct nfsslot *slots, struct mbuf **reply, uint16_t maxslot) { + struct mbuf *m; int error; error = 0; @@ -4574,8 +4575,14 @@ nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot, error = NFSERR_DELAY; else if (slots[slotid].nfssl_reply != NULL) { if (reply != NULL) { - *reply = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + m = m_copym(slots[slotid].nfssl_reply, 0, + M_COPYALL, M_NOWAIT); + if (m != NULL) + *reply = m; + else { + *reply = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } } slots[slotid].nfssl_inprog = 1; error = NFSERR_REPLYFROMCACHE; @@ -4602,10 +4609,29 @@ void nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat, struct mbuf **rep) { + struct mbuf *m; if (repstat == NFSERR_REPLYFROMCACHE) { - *rep = slots[slotid].nfssl_reply; - slots[slotid].nfssl_reply = NULL; + if (slots[slotid].nfssl_reply != NULL) { + /* + * We cannot sleep here, but copy will usually + * succeed. + */ + m = m_copym(slots[slotid].nfssl_reply, 0, M_COPYALL, + M_NOWAIT); + if (m != NULL) + *rep = m; + else { + /* + * Multiple retries would be extremely rare, + * so using the cached reply will likely + * be ok. + */ + *rep = slots[slotid].nfssl_reply; + slots[slotid].nfssl_reply = NULL; + } + } else + *rep = NULL; } else { if (slots[slotid].nfssl_reply != NULL) m_freem(slots[slotid].nfssl_reply); From owner-dev-commits-src-all@freebsd.org Sat Apr 24 23:03:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 186345E373B; Sat, 24 Apr 2021 23:03: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 4FSRY971wKz3sHf; Sat, 24 Apr 2021 23:03: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 E3AE4E32; Sat, 24 Apr 2021 23:03: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 13ON3vH1066287; Sat, 24 Apr 2021 23:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13ON3vJK066286; Sat, 24 Apr 2021 23:03:57 GMT (envelope-from git) Date: Sat, 24 Apr 2021 23:03:57 GMT Message-Id: <202104242303.13ON3vJK066286@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: bddae5c8a64d - main - Improve debugging output on routing tests failure. 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: bddae5c8a64dc6b292198945cbe676bb2158d438 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 23:03:58 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=bddae5c8a64dc6b292198945cbe676bb2158d438 commit bddae5c8a64dc6b292198945cbe676bb2158d438 Author: Alexander V. Chernikov AuthorDate: 2021-04-23 21:28:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-24 22:41:27 +0000 Improve debugging output on routing tests failure. Most of the routing tests create per-test VNET, making it harder to repeat the failure with CLI tools. Provide an additional route/nexthop data on failure. Differential Revision: https://reviews.freebsd.org/D29957 Reviewed by: kp MFC after: 2 weeks --- tests/sys/net/routing/rtsock_print.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/routing/rtsock_print.h b/tests/sys/net/routing/rtsock_print.h index b44fcca25053..20bb1c51bc33 100644 --- a/tests/sys/net/routing/rtsock_print.h +++ b/tests/sys/net/routing/rtsock_print.h @@ -40,7 +40,10 @@ #define RTSOCK_ATF_REQUIRE_MSG(_rtm, _cond, _fmt, ...) do { \ if (!(_cond)) { \ printf("-- CONDITION FAILED, rtm dump --\n\n");\ - rtsock_print_message(_rtm); \ + rtsock_print_message(_rtm); \ + rtsock_print_table(AF_INET); \ + rtsock_print_table(AF_INET6); \ + printf("===================================\n");\ } \ ATF_REQUIRE_MSG(_cond, _fmt, ##__VA_ARGS__); \ } while (0); @@ -381,4 +384,31 @@ rtsock_print_message(struct rt_msghdr *rtm) } } +static void +print_command(char *cmd) +{ + char line[1024]; + + FILE *fp = popen(cmd, "r"); + if (fp != NULL) { + while (fgets(line, sizeof(line), fp) != NULL) + printf("%s", line); + pclose(fp); + } +} + +void +rtsock_print_table(int family) +{ + char cmdbuf[128]; + char *key = (family == AF_INET) ? "4" : "6"; + + snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%srnW", key); + printf("==== %s ===\n", cmdbuf); + print_command(cmdbuf); + snprintf(cmdbuf, sizeof(cmdbuf), "/usr/bin/netstat -%sonW", key); + printf("==== %s ===\n", cmdbuf); + print_command(cmdbuf); +} + #endif From owner-dev-commits-src-all@freebsd.org Sat Apr 24 23:03:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B175E3C3A; Sat, 24 Apr 2021 23:03: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 4FSRYC1bDNz3sbh; Sat, 24 Apr 2021 23:03: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 1C0451105; Sat, 24 Apr 2021 23:03: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 13ON3xIU066308; Sat, 24 Apr 2021 23:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13ON3w5l066307; Sat, 24 Apr 2021 23:03:58 GMT (envelope-from git) Date: Sat, 24 Apr 2021 23:03:58 GMT Message-Id: <202104242303.13ON3w5l066307@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: 5d1403a79a3e - main - [rtsock] Enforce netmask/RTF_HOST consistency. 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: 5d1403a79a3e56403fb63c062252a23fce81e5f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 23:03:59 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5d1403a79a3e56403fb63c062252a23fce81e5f1 commit 5d1403a79a3e56403fb63c062252a23fce81e5f1 Author: Alexander V. Chernikov AuthorDate: 2021-04-23 21:53:47 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-24 22:41:27 +0000 [rtsock] Enforce netmask/RTF_HOST consistency. Traditionally we had 2 sources of information whether the added/delete route request targets network or a host route: netmask (RTA_NETMASK) and RTF_HOST flag. The former one is tricky: netmask can be empty or can explicitly specify the host netmask. Parsing netmask sockaddr requires per-family parsing and that's what rtsock code traditionally avoided. As a result, consistency was not enforced and it was possible to specify network with the RTF_HOST flag and vice versa. Continue normalization efforts from D29826 and D29826 and ensure that RTF_HOST flag always reflects host/network data from netmask field. Differential Revision: https://reviews.freebsd.org/D29958 MFC after: 2 days --- sys/net/rtsock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index b7a7e5170c74..fae15fdf4be6 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1503,6 +1503,7 @@ cleanup_xaddrs_inet(struct rt_addrinfo *info, struct linear_buffer *lb) return (ENOBUFS); fill_sockaddr_inet(mask_sa, mask); info->rti_info[RTAX_NETMASK] = (struct sockaddr *)mask_sa; + info->rti_flags &= ~RTF_HOST; } else remove_netmask(info); @@ -1563,6 +1564,7 @@ cleanup_xaddrs_inet6(struct rt_addrinfo *info, struct linear_buffer *lb) return (ENOBUFS); fill_sockaddr_inet6((struct sockaddr_in6 *)sa, &mask, 0); info->rti_info[RTAX_NETMASK] = sa; + info->rti_flags &= ~RTF_HOST; } else remove_netmask(info); From owner-dev-commits-src-all@freebsd.org Sat Apr 24 23:25:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43D385E402B; Sat, 24 Apr 2021 23:25: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 4FSS1x1ScJz3tGf; Sat, 24 Apr 2021 23:25:25 +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 24EF814CA; Sat, 24 Apr 2021 23:25: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 13ONPPZL092061; Sat, 24 Apr 2021 23:25:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13ONPPAn092060; Sat, 24 Apr 2021 23:25:25 GMT (envelope-from git) Date: Sat, 24 Apr 2021 23:25:25 GMT Message-Id: <202104242325.13ONPPAn092060@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: 6993187a8c30 - main - Add FIB_ALGO to GENERIC on amd64/arm64. 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: 6993187a8c30e83a408aad631a8d8629d8273c9d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2021 23:25:25 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6993187a8c30e83a408aad631a8d8629d8273c9d commit 6993187a8c30e83a408aad631a8d8629d8273c9d Author: Alexander V. Chernikov AuthorDate: 2021-04-24 23:05:04 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-24 23:22:58 +0000 Add FIB_ALGO to GENERIC on amd64/arm64. Option `FIB_ALGO` gates new modular fib lookup functionality, enabling more performant routing table lookups and improving control plane convergence under the load. Detailed feature description is available in D27401. Reviewed By: olivier, gnn Differential Revision: https://reviews.freebsd.org/D28434 --- sys/amd64/conf/GENERIC | 1 + sys/arm64/conf/GENERIC | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index f5f4bdf49c5f..bb7299a60382 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -32,6 +32,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support +options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging options TCP_HHOOK # hhook(9) framework for TCP diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index cf137417fbc5..430ba8a4a45f 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -32,6 +32,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support +options FIB_ALGO # Modular fib lookups options TCP_OFFLOAD # TCP offload options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open From owner-dev-commits-src-all@freebsd.org Sun Apr 25 06:41:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A81F5F6EFB for ; Sun, 25 Apr 2021 06:41: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 4FSdhv25hJz4mDt; Sun, 25 Apr 2021 06:41: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 312317169; Sun, 25 Apr 2021 06:41: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 13P6fJNb069649; Sun, 25 Apr 2021 06:41:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P6fJP1069648; Sun, 25 Apr 2021 06:41:19 GMT (envelope-from git) Date: Sun, 25 Apr 2021 06:41:19 GMT Message-Id: <202104250641.13P6fJP1069648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: bd136720030e - vendor/bc - Vendor import of Gavin D. Howards bc version 4.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: bd136720030ebb0b31e6d5a2236b9d0ddac71b94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 06:41:19 -0000 The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=bd136720030ebb0b31e6d5a2236b9d0ddac71b94 commit bd136720030ebb0b31e6d5a2236b9d0ddac71b94 Author: Stefan Eßer AuthorDate: 2021-04-25 06:36:50 +0000 Commit: Stefan Eßer CommitDate: 2021-04-25 06:36:50 +0000 Vendor import of Gavin D. Howards bc version 4.0.1 --- .gitattributes | 3 +++ .gitignore | 4 ++++ NEWS.md | 5 +++++ README.md | 4 ++++ include/version.h | 2 +- src/program.c | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..22d6e60bce68 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.vcxproj eol=crlf +*.vcxproj.filters eol=crlf +*.sln eol= crlf diff --git a/.gitignore b/.gitignore index 5c2bbae866c0..b131d5813764 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,7 @@ core.* cscope*.out tags + +*.vcxproj.user +Debug/* +Release/* diff --git a/NEWS.md b/NEWS.md index 011cb9138912..c66e7b164c8a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # News +## 4.0.1 + +This is a production release that only adds one thing: flushing output when it +is printed with a print statement. + ## 4.0.0 This is a production release with many fixes, a new command-line option, and a diff --git a/README.md b/README.md index 852c8956a73d..f0dcecf15bde 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ functionality is unnecessary. For more information, see the `dc`'s full manual. +This `bc` also provides `bc`'s math as a library with C bindings, called `bcl`. + +For more information, see the full manual for `bcl`. + This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD 2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. diff --git a/include/version.h b/include/version.h index 7f33df62312e..ab4823bd7c2a 100644 --- a/include/version.h +++ b/include/version.h @@ -36,6 +36,6 @@ #ifndef BC_VERSION_H #define BC_VERSION_H -#define VERSION 4.0.0 +#define VERSION 4.0.1 #endif // BC_VERSION_H diff --git a/src/program.c b/src/program.c index 82735083bd03..c1e61f729d2a 100644 --- a/src/program.c +++ b/src/program.c @@ -2034,6 +2034,7 @@ void bc_program_exec(BcProgram *p) { case BC_INST_PRINT_STR: { bc_program_print(p, inst, 0); + bc_file_flush(&vm.fout, bc_flush_save); break; } From owner-dev-commits-src-all@freebsd.org Sun Apr 25 06:41:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E9B35F6EB4 for ; Sun, 25 Apr 2021 06:41: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 4FSdhw3Wkhz4mN2; Sun, 25 Apr 2021 06:41: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 538D17545; Sun, 25 Apr 2021 06:41: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 13P6fKTX069678; Sun, 25 Apr 2021 06:41:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P6fKUB069677; Sun, 25 Apr 2021 06:41:20 GMT (envelope-from git) Date: Sun, 25 Apr 2021 06:41:20 GMT Message-Id: <202104250641.13P6fKUB069677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: a726c098c1bc - Create tag vendor/bc/4.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bc/4.0.1 X-Git-Reftype: annotated tag X-Git-Commit: a726c098c1bc733bdfff2c7f29b5ff62199ac789 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 06:41:20 -0000 The annotated tag vendor/bc/4.0.1 has been created by se: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bc/4.0.1 tag vendor/bc/4.0.1 Tagger: Stefan Eßer TaggerDate: 2021-04-25 06:38:42 +0000 vendor/bc: tag version 4.0.1 commit bd136720030ebb0b31e6d5a2236b9d0ddac71b94 Author: Stefan Eßer AuthorDate: 2021-04-25 06:36:50 +0000 Commit: Stefan Eßer CommitDate: 2021-04-25 06:36:50 +0000 Vendor import of Gavin D. Howards bc version 4.0.1 From owner-dev-commits-src-all@freebsd.org Sun Apr 25 06:45:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB36C5F7687; Sun, 25 Apr 2021 06:45: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 4FSdpF3Trhz4mJt; Sun, 25 Apr 2021 06:45: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 6A4B674F1; Sun, 25 Apr 2021 06:45: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 13P6jvQ7074300; Sun, 25 Apr 2021 06:45:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P6jvNG074299; Sun, 25 Apr 2021 06:45:57 GMT (envelope-from git) Date: Sun, 25 Apr 2021 06:45:57 GMT Message-Id: <202104250645.13P6jvNG074299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 8ea901351249 - main - Merge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ea9013512494c9f035afa1ffa1e199b44c7904f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 06:45:58 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=8ea9013512494c9f035afa1ffa1e199b44c7904f commit 8ea9013512494c9f035afa1ffa1e199b44c7904f Merge: 6993187a8c30 bd136720030e Author: Stefan Eßer AuthorDate: 2021-04-25 06:42:31 +0000 Commit: Stefan Eßer CommitDate: 2021-04-25 06:42:31 +0000 Merge commit 'bd136720030ebb0b31e6d5a2236b9d0ddac71b94' usr.bin/bc: update to version 4.0.1 This update adds a flush() of the output buffer to the bc print command. contrib/bc/.gitattributes | 3 +++ contrib/bc/.gitignore | 4 ++++ contrib/bc/NEWS.md | 5 +++++ contrib/bc/README.md | 4 ++++ contrib/bc/include/version.h | 2 +- contrib/bc/src/program.c | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) diff --cc contrib/bc/.gitattributes index 000000000000,000000000000..22d6e60bce68 new file mode 100644 --- /dev/null +++ b/contrib/bc/.gitattributes @@@ -1,0 -1,0 +1,3 @@@ ++*.vcxproj eol=crlf ++*.vcxproj.filters eol=crlf ++*.sln eol= crlf diff --cc contrib/bc/.gitignore index 5c2bbae866c0,000000000000..b131d5813764 mode 100644,000000..100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@@ -1,70 -1,0 +1,74 @@@ +*.config +*.creator +*.files +*.includes +*.creator.user* +*.cflags +*.cxxflags +bin/*bc +bin/*bc.exe +bin/*dc +bin/*dc.exe +bin/bcl +bc.old +*.o +*.a +.log_*.txt +.test.txt +.math.txt +.results.txt +.ops.txt +manuals/bc.1 +manuals/bc.1.ronn +manuals/bc.1.md +manuals/dc.1 +manuals/dc.1.ronn +manuals/dc.1.md +gen/strgen +lib.c +lib2.c +lib3.c +bc_help.c +dc_help.c +config.mak +timeconst.bc +Makefile + +tests/fuzzing/bc_outputs1/* +tests/fuzzing/bc_outputs2/* +tests/fuzzing/bc_outputs3/* +tests/fuzzing/dc_outputs/* +tests/bc_outputs/* +tests/dc_outputs/* + +.gdb_history + +# Ignore the generated test files +parse.txt +parse_results.txt +print.txt +print_results.txt +bessel.txt +bessel_results.txt +prime.txt +stream.txt +tests/bc/scripts/add.txt +tests/bc/scripts/divide.txt +tests/bc/scripts/multiply.txt +tests/bc/scripts/subtract.txt +perf.data +perf.data.old +*.gcda +*.gcno +*.gcov +*.html +*.profraw + +core.* + +cscope*.out +tags ++ ++*.vcxproj.user ++Debug/* ++Release/* diff --cc contrib/bc/README.md index 852c8956a73d,000000000000..f0dcecf15bde mode 100644,000000..100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@@ -1,407 -1,0 +1,411 @@@ +# `bc` + +[![Coverity Scan Build Status][17]][18] + +***WARNING: This project has moved to [https://git.yzena.com/][20] for [these +reasons][21], though GitHub will remain a mirror.*** + +This is an implementation of the [POSIX `bc` calculator][12] that implements +[GNU `bc`][1] extensions, as well as the period (`.`) extension for the BSD +flavor of `bc`. + +For more information, see this `bc`'s full manual. + +This `bc` also includes an implementation of `dc` in the same binary, accessible +via a symbolic link, which implements all FreeBSD and GNU extensions. (If a +standalone `dc` binary is desired, `bc` can be copied and renamed to `dc`.) The +`!` command is omitted; I believe this poses security concerns and that such +functionality is unnecessary. + +For more information, see the `dc`'s full manual. + ++This `bc` also provides `bc`'s math as a library with C bindings, called `bcl`. ++ ++For more information, see the full manual for `bcl`. ++ +This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD +2-clause License. Full license text may be found in the [`LICENSE.md`][4] file. + +## Prerequisites + +This `bc` only requires either: + +1. Windows 10 or later, or +2. A C99-compatible compiler and a (mostly) POSIX 2008-compatible system with + the XSI (X/Open System Interfaces) option group. + +Since POSIX 2008 with XSI requires the existence of a C99 compiler as `c99`, any +POSIX and XSI-compatible system will have everything needed. + +POSIX-compatible systems that are known to work: + +* Linux +* FreeBSD +* OpenBSD +* NetBSD +* Mac OSX +* Solaris* (as long as the Solaris version supports POSIX 2008) +* AIX +* HP-UX* (except for history) + +In addition, there is compatibility code to make this `bc` work on Windows. + +Please submit bug reports if this `bc` does not build out of the box on any +system. + +## Build + +### Windows + +There is no guarantee that this `bc` will work on any version of Windows earlier +than Windows 10 (I cannot test on earlier versions), but it is guaranteed to +work on Windows 10 at least. + +Also, if building with MSBuild, the MSBuild bundled with Visual Studio is +required. + +**Note**: Unlike the POSIX-compatible platforms, only one build configuration is +supported on Windows: extra math and prompt enabled, history and NLS (locale +support) disabled, with both calculators built. + +#### `bc` + +To build `bc`, you can open the `bc.sln` file in Visual Studio, select the +configuration, and build. + +You can also build using MSBuild with the following from the root directory: + +``` +msbuild -property:Configuration= bc.sln +``` + +where `` is either one of `Debug` or `Release`. + +#### `bcl` (Library) + +To build the library, you can open the `bcl.sln` file in Visual Studio, select +the configuration, and build. + +You can also build using MSBuild with the following from the root directory: + +``` +msbuild -property:Configuration= bcl.sln +``` + +where `` is either one of `Debug` or `Release`. + +### POSIX-Compatible Systems + +This `bc` should build unmodified on any POSIX-compliant system or on Windows +starting with Windows 10 (though earlier versions may work). + +For more complex build requirements than the ones below, see the +[build manual][5]. + +On POSIX-compatible systems, `bc` is built as `bin/bc` and `dc` is built as +`bin/dc` by default. On Windows, they are built as `Release/bc/bc.exe` and +`Release/bc/dc.exe`. + +**Note**: On Windows, `dc.exe` is just copied from `bc.exe`; it is not linked. +Patches are welcome for a way to do that. + +#### Default + +For the default build with optimization, use the following commands in the root +directory: + +``` +./configure.sh -O3 +make +``` + +#### One Calculator + +To only build `bc`, use the following commands: + +``` +./configure.sh --disable-dc +make +``` + +To only build `dc`, use the following commands: + +``` +./configure.sh --disable-bc +make +``` + +#### Debug + +For debug builds, use the following commands in the root directory: + +``` +./configure.sh -g +make +``` + +#### Install + +To install, use the following command: + +``` +make install +``` + +By default, `bc` and `dc` will be installed in `/usr/local`. For installing in +other locations, use the `PREFIX` environment variable when running +`configure.sh` or pass the `--prefix=` option to `configure.sh`. See the +[build manual][5], or run `./configure.sh --help`, for more details. + +#### Library + +This `bc` does provide a way to build a math library with C bindings. This is +done by the `-a` or `--library` options to `configure.sh`: + +``` +./configure.sh -a +``` + +When building the library, the executables are not built. For more information, +see the [build manual][5]. + +The library API can be found in [`manuals/bcl.3.md`][26] or `man bcl` once the +library is installed. + +The library is built as `bin/libbcl.a` on POSIX-compatible systems or as +`Release/bcl/bcl.lib` on Windows. + +#### Package and Distro Maintainers + +##### Recommended Compiler + +When I ran benchmarks with my `bc` compiled under `clang`, it performed much +better than when compiled under `gcc`. I recommend compiling this `bc` with +`clang`. + +I also recommend building this `bc` with C11 if you can because `bc` will detect +a C11 compiler and add `_Noreturn` to any relevant function(s). + +##### Recommended Optimizations + +I wrote this `bc` with Separation of Concerns, which means that there are many +small functions that could be inlined. However, they are often called across +file boundaries, and the default optimizer can only look at the current file, +which means that they are not inlined. + +Thus, because of the way this `bc` is built, it will automatically be slower +than other `bc` implementations when running scripts with no math. (My `bc`'s +math is *much* faster, so any non-trivial script should run faster in my `bc`.) + +Some, or all, of the difference can be made up with the right optimizations. The +optimizations I recommend are: + +1. `-O3` +2. `-flto` (link-time optimization) + +in that order. + +Link-time optimization, in particular, speeds up the `bc` a lot. This is because +when link-time optimization is turned on, the optimizer can look across files +and inline *much* more heavily. + +However, I recommend ***NOT*** using `-march=native`. Doing so will reduce this +`bc`'s performance, at least when building with link-time optimization. See the +[benchmarks][19] for more details. + +##### Stripping Binaries + +By default, non-debug binaries are stripped, but stripping can be disabled with +the `-T` option to `configure.sh`. + +##### Using This `bc` as an Alternative + +If this `bc` is packaged as an alternative to an already existing `bc` package, +it is possible to rename it in the build to prevent name collision. To prepend +to the name, just run the following: + +``` +EXECPREFIX= ./configure.sh +``` + +To append to the name, just run the following: + +``` +EXECSUFFIX= ./configure.sh +``` + +If a package maintainer wishes to add both a prefix and a suffix, that is +allowed. + +**Note**: The suggested name (and package name) when `bc` is not available is +`bc-gh`. + +##### Karatsuba Number + +Package and distro maintainers have one tool at their disposal to build this +`bc` in the optimal configuration: `karatsuba.py`. + +This script is not a compile-time or runtime prerequisite; it is for package and +distro maintainers to run once when a package is being created. It finds the +optimal Karatsuba number (see the [algorithms manual][7] for more information) +for the machine that it is running on. + +The easiest way to run this script is with `make karatsuba`. + +If desired, maintainers can also skip running this script because there is a +sane default for the Karatsuba number. + +## Status + +This `bc` is robust. + +It is well-tested, fuzzed, and fully standards-compliant (though not certified) +with POSIX `bc`. The math has been tested with 40+ million random problems, so +it is as correct as I can make it. + +This `bc` can be used as a drop-in replacement for any existing `bc`. This `bc` +is also compatible with MinGW toolchains, though history is not supported on +Windows. + +In addition, this `bc` is considered complete; i.e., there will be no more +releases with additional features. However, it *is* actively maintained, so if +any bugs are found, they will be fixed in new releases. Also, additional +translations will also be added as they are provided. + +## Comparison to GNU `bc` + +This `bc` compares favorably to GNU `bc`. + +* This `bc` builds natively on Windows. +* It has more extensions, which make this `bc` more useful for scripting. +* This `bc` is a bit more POSIX compliant. +* It has a much less buggy parser. The GNU `bc` will give parse errors for what + is actually valid `bc` code, or should be. For example, putting an `else` on + a new line after a brace can cause GNU `bc` to give a parse error. +* This `bc` has fewer crashes. +* GNU `bc` calculates the wrong number of significant digits for `length(x)`. +* GNU `bc` will sometimes print numbers incorrectly. For example, when running + it on the file `tests/bc/power.txt` in this repo, GNU `bc` gets all the right + answers, but it fails to wrap the numbers at the proper place when outputting + to a file. +* This `bc` is faster. (See [Performance](#performance).) + +### Performance + +Because this `bc` packs more than `1` decimal digit per hardware integer, this +`bc` is faster than GNU `bc` and can be *much* faster. Full benchmarks can be +found at [manuals/benchmarks.md][19]. + +There is one instance where this `bc` is slower: if scripts are light on math. +This is because this `bc`'s intepreter is slightly slower than GNU `bc`, but +that is because it is more robust. See the [benchmarks][19]. + +## Algorithms + +To see what algorithms this `bc` uses, see the [algorithms manual][7]. + +## Locales + +Currently, there is no locale support on Windows. + +Additionally, this `bc` only has support for English (and US English), French, +German, Portuguese, Dutch, Polish, Russian, Japanese, and Chinese locales. +Patches are welcome for translations; use the existing `*.msg` files in +`locales/` as a starting point. + +In addition, patches for improvements are welcome; the last two messages in +Portuguese were made with Google Translate, and the Dutch, Polish, Russian, +Japanese, and Chinese locales were all generated with [DeepL][22]. + +The message files provided assume that locales apply to all regions where a +language is used, but this might not be true for, e.g., `fr_CA` and `fr_CH`. +Any corrections or a confirmation that the current texts are acceptable for +those regions would be appreciated, too. + +## Other Projects + +Other projects based on this bc are: + +* [busybox `bc`][8]. The busybox maintainers have made their own changes, so any + bugs in the busybox `bc` should be reported to them. + +* [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the + toybox `bc` should be reported there. + +* [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better + to [report bugs there][24], as well as [submit patches][25], and the + maintainers of the package will contact me if necessary. + +## Language + +This `bc` is written in pure ISO C99, using POSIX 2008 APIs with custom Windows +compatibility code. + +## Commit Messages + +This `bc` uses the commit message guidelines laid out in [this blog post][10]. + +## Semantic Versioning + +This `bc` uses [semantic versioning][11]. + +## Contents + +Items labeled with `(maintainer use only)` are not included in release source +tarballs. + +Files: + + .gitignore The git ignore file (maintainer use only). + .gitattributes The git attributes file (maintainer use only). + bc.sln The Visual Studio solution file for bc. + bc.vcxproj The Visual Studio project file for bc. + bc.vcxproj.filters The Visual Studio filters file for bc. + bcl.sln The Visual Studio solution file for bcl. + bcl.vcxproj The Visual Studio project file for bcl. + bcl.vcxproj.filters The Visual Studio filters file for bcl. + configure A symlink to configure.sh to make packaging easier. + configure.sh The configure script. + functions.sh A script with functions used by other scripts. + install.sh Install script. + karatsuba.py Script to find the optimal Karatsuba number. + LICENSE.md A Markdown form of the BSD 2-clause License. + link.sh A script to link dc to bc. + locale_install.sh A script to install locales, if desired. + locale_uninstall.sh A script to uninstall locales. + Makefile.in The Makefile template. + manpage.sh Script to generate man pages from markdown files + (maintainer use only). + NOTICE.md List of contributors and copyright owners. + RELEASE.md A checklist for making a release (maintainer use only). + release.sh A script to test for release (maintainer use only). + safe-install.sh Safe install script from musl libc. + +Folders: + + gen The bc math library, help texts, and code to generate C source. + include All header files. + locales Locale files, in .msg format. Patches welcome for translations. + manuals Manuals for both programs. + src All source code. + tests All tests. + +[1]: https://www.gnu.org/software/bc/ +[4]: ./LICENSE.md +[5]: ./manuals/build.md +[7]: ./manuals/algorithms.md +[8]: https://git.busybox.net/busybox/tree/miscutils/bc.c +[9]: https://github.com/landley/toybox/blob/master/toys/pending/bc.c +[10]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +[11]: http://semver.org/ +[12]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html +[17]: https://img.shields.io/coverity/scan/16609.svg +[18]: https://scan.coverity.com/projects/gavinhoward-bc +[19]: ./manuals/benchmarks.md +[20]: https://git.yzena.com/gavin/bc +[21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ +[22]: https://www.deepl.com/translator +[23]: https://cgit.freebsd.org/src/tree/contrib/bc +[24]: https://bugs.freebsd.org/ +[25]: https://reviews.freebsd.org/ +[26]: ./manuals/bcl.3.md From owner-dev-commits-src-all@freebsd.org Sun Apr 25 07:44:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AFC75F8D84; Sun, 25 Apr 2021 07:44: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 4FSg5b2BFWz4ppF; Sun, 25 Apr 2021 07:44: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 3DA4A10883; Sun, 25 Apr 2021 07:44: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 13P7iJHU055517; Sun, 25 Apr 2021 07:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P7iJAY055516; Sun, 25 Apr 2021 07:44:19 GMT (envelope-from git) Date: Sun, 25 Apr 2021 07:44:19 GMT Message-Id: <202104250744.13P7iJAY055516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8209a085c701 - stable/13 - ixgbe: Clarify index name in ixgbe_mc_filter_apply MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8209a085c7016e62e97a9c756d656a41b4d9827e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 07:44:19 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8209a085c7016e62e97a9c756d656a41b4d9827e commit 8209a085c7016e62e97a9c756d656a41b4d9827e Author: Kevin Bowling AuthorDate: 2021-04-17 01:17:43 +0000 Commit: Kevin Bowling CommitDate: 2021-04-25 07:44:09 +0000 ixgbe: Clarify index name in ixgbe_mc_filter_apply "It looks like it would be less confusing to rename 'count' to something like 'idx', since that's what it's used for in this function." Reviewed by: erj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29798 (cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300) --- sys/dev/ixgbe/if_ix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 6e65f6bae55a..77ef118493a2 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -3262,15 +3262,15 @@ ixgbe_config_delay_values(struct adapter *adapter) * Called whenever multicast address list is updated. ************************************************************************/ static u_int -ixgbe_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count) +ixgbe_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int idx) { struct adapter *adapter = arg; struct ixgbe_mc_addr *mta = adapter->mta; - if (count == MAX_NUM_MULTICAST_ADDRESSES) + if (idx == MAX_NUM_MULTICAST_ADDRESSES) return (0); - bcopy(LLADDR(sdl), mta[count].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - mta[count].vmdq = adapter->pool; + bcopy(LLADDR(sdl), mta[idx].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[idx].vmdq = adapter->pool; return (1); } /* ixgbe_mc_filter_apply */ From owner-dev-commits-src-all@freebsd.org Sun Apr 25 07:47:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC81C5F8CFA; Sun, 25 Apr 2021 07:47: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 4FSg9H6NJkz4qH0; Sun, 25 Apr 2021 07:47: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 CDFA710885; Sun, 25 Apr 2021 07:47: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 13P7lVll055835; Sun, 25 Apr 2021 07:47:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P7lVPQ055834; Sun, 25 Apr 2021 07:47:31 GMT (envelope-from git) Date: Sun, 25 Apr 2021 07:47:31 GMT Message-Id: <202104250747.13P7lVPQ055834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2d8adf9cc000 - stable/12 - ixgbe: Clarify index name in ixgbe_mc_filter_apply MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2d8adf9cc0000d29d330d2ce06f659b207c0d11b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 07:47:32 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2d8adf9cc0000d29d330d2ce06f659b207c0d11b commit 2d8adf9cc0000d29d330d2ce06f659b207c0d11b Author: Kevin Bowling AuthorDate: 2021-04-17 01:17:43 +0000 Commit: Kevin Bowling CommitDate: 2021-04-25 07:47:06 +0000 ixgbe: Clarify index name in ixgbe_mc_filter_apply "It looks like it would be less confusing to rename 'count' to something like 'idx', since that's what it's used for in this function." Reviewed by: erj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29798 (cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300) --- sys/dev/ixgbe/if_ix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 80f812336d2c..b987369aefde 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -3239,18 +3239,18 @@ ixgbe_config_delay_values(struct adapter *adapter) * Called whenever multicast address list is updated. ************************************************************************/ static int -ixgbe_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int count) +ixgbe_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int idx) { struct adapter *adapter = arg; struct ixgbe_mc_addr *mta = adapter->mta; if (ifma->ifma_addr->sa_family != AF_LINK) return (0); - if (count == MAX_NUM_MULTICAST_ADDRESSES) + if (idx == MAX_NUM_MULTICAST_ADDRESSES) return (0); bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - mta[count].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - mta[count].vmdq = adapter->pool; + mta[idx].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[idx].vmdq = adapter->pool; return (1); } /* ixgbe_mc_filter_apply */ From owner-dev-commits-src-all@freebsd.org Sun Apr 25 08:19:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8416D5F9CC9; Sun, 25 Apr 2021 08:19: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 4FSgsf3KzMz4rBf; Sun, 25 Apr 2021 08:19: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 6525610DA1; Sun, 25 Apr 2021 08:19: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 13P8J2HG096165; Sun, 25 Apr 2021 08:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P8J2xU096164; Sun, 25 Apr 2021 08:19:02 GMT (envelope-from git) Date: Sun, 25 Apr 2021 08:19:02 GMT Message-Id: <202104250819.13P8J2xU096164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?B?U3RlZmFuIEXDn2Vy?= Subject: git: 6409e594272f - main - Fix build with gcc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6409e594272f66ce3896706ac705bbd465ce233e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 08:19:02 -0000 The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=6409e594272f66ce3896706ac705bbd465ce233e commit 6409e594272f66ce3896706ac705bbd465ce233e Author: Stefan Eßer AuthorDate: 2021-04-25 08:15:17 +0000 Commit: Stefan Eßer CommitDate: 2021-04-25 08:15:17 +0000 Fix build with gcc Correctly declare function without arguments as f(void) instead of f(). --- sys/net/route/fib_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 91565d727a9c..cd7abd282728 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -365,7 +365,7 @@ fib_error_clear_flm(struct fib_lookup_module *flm) * Clears all errors in current VNET. */ static void -fib_error_clear() +fib_error_clear(void) { struct fib_error *fe, *fe_tmp; From owner-dev-commits-src-all@freebsd.org Sun Apr 25 08:45:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C74325FA2FF; Sun, 25 Apr 2021 08:45: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 4FShSB5GzKz4sgv; Sun, 25 Apr 2021 08:45: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 A85A01115D; Sun, 25 Apr 2021 08:45: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 13P8jUgo035509; Sun, 25 Apr 2021 08:45:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P8jUtM035508; Sun, 25 Apr 2021 08:45:30 GMT (envelope-from git) Date: Sun, 25 Apr 2021 08:45:30 GMT Message-Id: <202104250845.13P8jUtM035508@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: a81e2e7890c2 - main - Make gcc happy by initializing error in rib_handle_ifaddr_info(). 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: a81e2e7890c2fce2a74dbb859e6855e0414a6ea1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 08:45:30 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=a81e2e7890c2fce2a74dbb859e6855e0414a6ea1 commit a81e2e7890c2fce2a74dbb859e6855e0414a6ea1 Author: Alexander V. Chernikov AuthorDate: 2021-04-25 08:44:20 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-25 08:44:59 +0000 Make gcc happy by initializing error in rib_handle_ifaddr_info(). --- sys/net/route/route_ifaddrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_ifaddrs.c b/sys/net/route/route_ifaddrs.c index e6d97f3c74f0..15ee13201059 100644 --- a/sys/net/route/route_ifaddrs.c +++ b/sys/net/route/route_ifaddrs.c @@ -100,7 +100,7 @@ rib_handle_ifaddr_one(uint32_t fibnum, int cmd, struct rt_addrinfo *info) int rib_handle_ifaddr_info(uint32_t fibnum, int cmd, struct rt_addrinfo *info) { - int error, last_error = 0; + int error = 0, last_error = 0; bool didwork = false; if (V_rt_add_addr_allfibs == 0) { From owner-dev-commits-src-all@freebsd.org Sun Apr 25 08:58:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5BCA5FAD5C; Sun, 25 Apr 2021 08:58: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 4FShl55cWgz4smf; Sun, 25 Apr 2021 08:58:25 +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 B38371144E; Sun, 25 Apr 2021 08:58: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 13P8wPZJ048659; Sun, 25 Apr 2021 08:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13P8wPl6048658; Sun, 25 Apr 2021 08:58:25 GMT (envelope-from git) Date: Sun, 25 Apr 2021 08:58:25 GMT Message-Id: <202104250858.13P8wPl6048658@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: c23385612da5 - main - [fib algo] Do not print algo attach/detach message on boot 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: c23385612da5dd3195a9b73bfb22bd969dbd26c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 08:58:25 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c23385612da5dd3195a9b73bfb22bd969dbd26c2 commit c23385612da5dd3195a9b73bfb22bd969dbd26c2 Author: Alexander V. Chernikov AuthorDate: 2021-04-25 08:51:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-25 08:58:06 +0000 [fib algo] Do not print algo attach/detach message on boot MFC after: 1 day --- sys/net/route/fib_algo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index cd7abd282728..43db482d73da 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -239,7 +239,9 @@ SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, CTLFLAG_RW | CTLFLAG_RWTUN, #endif #define _PASS_MSG(_l) (flm_debug_level >= (_l)) -#define ALGO_PRINTF(_fmt, ...) printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__) +#define ALGO_PRINTF(_l, _fmt, ...) if (_PASS_MSG(_l)) { \ + printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__); \ +} #define _ALGO_PRINTF(_fib, _fam, _aname, _gen, _func, _fmt, ...) \ printf("[fib_algo] %s.%u (%s#%u) %s: " _fmt "\n",\ print_family(_fam), _fib, _aname, _gen, _func, ## __VA_ARGS__) @@ -1971,7 +1973,7 @@ fib_module_register(struct fib_lookup_module *flm) { FIB_MOD_LOCK(); - ALGO_PRINTF("attaching %s to %s", flm->flm_name, + ALGO_PRINTF(LOG_INFO, "attaching %s to %s", flm->flm_name, print_family(flm->flm_family)); TAILQ_INSERT_TAIL(&all_algo_list, flm, entries); FIB_MOD_UNLOCK(); @@ -1995,7 +1997,7 @@ fib_module_unregister(struct fib_lookup_module *flm) return (EBUSY); } fib_error_clear_flm(flm); - ALGO_PRINTF("detaching %s from %s", flm->flm_name, + ALGO_PRINTF(LOG_INFO, "detaching %s from %s", flm->flm_name, print_family(flm->flm_family)); TAILQ_REMOVE(&all_algo_list, flm, entries); FIB_MOD_UNLOCK(); From owner-dev-commits-src-all@freebsd.org Sun Apr 25 11:29:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C03B5FE229; Sun, 25 Apr 2021 11:29: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 4FSm5f441Rz3GpK; Sun, 25 Apr 2021 11:29: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 7EB7F13786; Sun, 25 Apr 2021 11:29: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 13PBTgiS046712; Sun, 25 Apr 2021 11:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PBTgbx046711; Sun, 25 Apr 2021 11:29:42 GMT (envelope-from git) Date: Sun, 25 Apr 2021 11:29:42 GMT Message-Id: <202104251129.13PBTgbx046711@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: 67372fb3e06e - main - Fix NOINET[6] build after enabling FIB_ALGO in GENERIC. 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: 67372fb3e06ebaccfe7c093aa78009d161fa58e6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 11:29:42 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=67372fb3e06ebaccfe7c093aa78009d161fa58e6 commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6 Author: Alexander V. Chernikov AuthorDate: 2021-04-21 01:45:49 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-21 01:49:18 +0000 Fix NOINET[6] build after enabling FIB_ALGO in GENERIC. Submitted by: jbeich PR: 255389 --- sys/net/route/fib_algo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 43db482d73da..83fff1ec43e0 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -706,12 +706,16 @@ fill_change_entry(struct fib_data *fd, struct fib_change_entry *ce, struct rib_c int plen = 0; switch (fd->fd_family) { +#ifdef INET case AF_INET: rt_get_inet_prefix_plen(rc->rc_rt, &ce->addr4, &plen, &ce->scopeid); break; +#endif +#ifdef INET6 case AF_INET6: rt_get_inet6_prefix_plen(rc->rc_rt, &ce->addr6, &plen, &ce->scopeid); break; +#endif } ce->plen = plen; From owner-dev-commits-src-all@freebsd.org Sun Apr 25 12:43:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC7146216EC; Sun, 25 Apr 2021 12:43: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 4FSnkX4rYHz3LkG; Sun, 25 Apr 2021 12:43: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 9904C14817; Sun, 25 Apr 2021 12:43: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 13PChGrd052758; Sun, 25 Apr 2021 12:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PChGJm052757; Sun, 25 Apr 2021 12:43:16 GMT (envelope-from git) Date: Sun, 25 Apr 2021 12:43:16 GMT Message-Id: <202104251243.13PChGJm052757@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: b68e6569221e - main - rc: improve dependencies for growfs 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: b68e6569221ecade8899eaab8e1b088947ef2f8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 12:43:16 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=b68e6569221ecade8899eaab8e1b088947ef2f8a commit b68e6569221ecade8899eaab8e1b088947ef2f8a Author: Edward Tomasz Napierala AuthorDate: 2021-04-25 12:41:36 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-25 12:41:44 +0000 rc: improve dependencies for growfs Previously it depended on sysctl, which itself has no dependencies, so rcorder(8) had a bit too much flexibility when choosing when to run it. Make sure it runs just between 'fsck' and 'root'. Reviewed By: jmg, imp Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29748 --- libexec/rc/rc.d/growfs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.d/growfs b/libexec/rc/rc.d/growfs index 54bab2a60dfb..c2955c740d43 100755 --- a/libexec/rc/rc.d/growfs +++ b/libexec/rc/rc.d/growfs @@ -28,15 +28,17 @@ # # PROVIDE: growfs -# BEFORE: sysctl +# REQUIRE: fsck +# BEFORE: root # KEYWORD: firstboot # This allows us to distribute an image # and have it work on essentially any size drive. -# -# TODO: Figure out where this should really be ordered. -# I suspect it should go just after fsck but before mountcritlocal. -# + +# Note that this uses awk(1), and thus will not work if /usr is on a separate +# filesystem. We need to run early, because there might be not enough free +# space on rootfs for the boot to succeed, and on images we ship - which are +# the primary purpose of this script - there is no separate /usr anyway. . /etc/rc.subr From owner-dev-commits-src-all@freebsd.org Sun Apr 25 14:04:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51F33623F91; Sun, 25 Apr 2021 14:04:50 +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 4FSqXf1sdbz3QBy; Sun, 25 Apr 2021 14:04:50 +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 28A5915636; Sun, 25 Apr 2021 14:04:50 +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 13PE4ol4059511; Sun, 25 Apr 2021 14:04:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PE4o68059510; Sun, 25 Apr 2021 14:04:50 GMT (envelope-from git) Date: Sun, 25 Apr 2021 14:04:50 GMT Message-Id: <202104251404.13PE4o68059510@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: 5d1d844a7762 - main - kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOW 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: 5d1d844a77622878cd05478d4ab504f70e067248 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 14:04:50 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=5d1d844a77622878cd05478d4ab504f70e067248 commit 5d1d844a77622878cd05478d4ab504f70e067248 Author: Edward Tomasz Napierala AuthorDate: 2021-04-25 13:13:02 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-04-25 13:13:12 +0000 kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOW This makes this API match other kern_xxxat() functions. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29776 --- sys/compat/cloudabi/cloudabi_file.c | 2 +- sys/compat/linux/linux_file.c | 15 ++++++++------- sys/kern/vfs_syscalls.c | 12 ++++++------ sys/sys/syscallsubr.h | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/sys/compat/cloudabi/cloudabi_file.c b/sys/compat/cloudabi/cloudabi_file.c index f7d93bc85cad..83987b79aa0c 100644 --- a/sys/compat/cloudabi/cloudabi_file.c +++ b/sys/compat/cloudabi/cloudabi_file.c @@ -185,7 +185,7 @@ cloudabi_sys_file_link(struct thread *td, error = kern_linkat(td, uap->fd1.fd, uap->fd2, path1, path2, UIO_SYSSPACE, (uap->fd1.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) ? - FOLLOW : NOFOLLOW); + AT_SYMLINK_FOLLOW : 0); cloudabi_freestr(path1); cloudabi_freestr(path2); return (error); diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 6b02c2efb88e..1febb11b0131 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1111,7 +1111,7 @@ linux_link(struct thread *td, struct linux_link_args *args) if (!LUSECONVPATH(td)) { return (kern_linkat(td, AT_FDCWD, AT_FDCWD, args->path, args->to, - UIO_USERSPACE, FOLLOW)); + UIO_USERSPACE, AT_SYMLINK_FOLLOW)); } LCONVPATHEXIST(td, args->path, &path); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ @@ -1121,7 +1121,7 @@ linux_link(struct thread *td, struct linux_link_args *args) return (error); } error = kern_linkat(td, AT_FDCWD, AT_FDCWD, path, to, UIO_SYSSPACE, - FOLLOW); + AT_SYMLINK_FOLLOW); LFREEPATH(path); LFREEPATH(to); return (error); @@ -1132,18 +1132,19 @@ int linux_linkat(struct thread *td, struct linux_linkat_args *args) { char *path, *to; - int error, olddfd, newdfd, follow; + int error, olddfd, newdfd, flag; if (args->flag & ~LINUX_AT_SYMLINK_FOLLOW) return (EINVAL); + flag = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? AT_SYMLINK_FOLLOW : + 0; + olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd; newdfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd; - follow = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? NOFOLLOW : - FOLLOW; if (!LUSECONVPATH(td)) { return (kern_linkat(td, olddfd, newdfd, args->oldname, - args->newname, UIO_USERSPACE, follow)); + args->newname, UIO_USERSPACE, flag)); } LCONVPATHEXIST_AT(td, args->oldname, &path, olddfd); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ @@ -1152,7 +1153,7 @@ linux_linkat(struct thread *td, struct linux_linkat_args *args) LFREEPATH(path); return (error); } - error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, follow); + error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, flag); LFREEPATH(path); LFREEPATH(to); return (error); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 26a8d31e4456..32e4c8688762 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1495,7 +1495,7 @@ sys_link(struct thread *td, struct link_args *uap) { return (kern_linkat(td, AT_FDCWD, AT_FDCWD, uap->path, uap->link, - UIO_USERSPACE, FOLLOW)); + UIO_USERSPACE, AT_SYMLINK_FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -1518,8 +1518,7 @@ sys_linkat(struct thread *td, struct linkat_args *uap) return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW | - AT_RESOLVE_BENEATH | AT_EMPTY_PATH))); + UIO_USERSPACE, flag)); } int hardlink_check_uid = 0; @@ -1563,15 +1562,16 @@ can_hardlink(struct vnode *vp, struct ucred *cred) int kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, - const char *path2, enum uio_seg segflag, int follow) + const char *path2, enum uio_seg segflag, int flag) { struct nameidata nd; int error; do { bwillwrite(); - NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, segflag, - path1, fd1, &cap_linkat_source_rights, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, AUDITVNODE1 | at2cnpflags(flag, + AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH), + segflag, path1, fd1, &cap_linkat_source_rights, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 9e889e9d5465..471c38ab0e12 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -184,7 +184,7 @@ int kern_kldload(struct thread *td, const char *file, int *fileid); int kern_kldstat(struct thread *td, int fileid, struct kld_file_stat *stat); int kern_kldunload(struct thread *td, int fileid, int flags); int kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, - const char *path2, enum uio_seg segflg, int follow); + const char *path2, enum uio_seg segflg, int flag); int kern_listen(struct thread *td, int s, int backlog); int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, const char *path, enum uio_seg pathseg, From owner-dev-commits-src-all@freebsd.org Sun Apr 25 14:22:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5761F62444D; Sun, 25 Apr 2021 14:22: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 4FSqwh23dSz3R2c; Sun, 25 Apr 2021 14:22: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 39EC015A3E; Sun, 25 Apr 2021 14:22: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 13PEMCqK084981; Sun, 25 Apr 2021 14:22:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PEMCNX084980; Sun, 25 Apr 2021 14:22:12 GMT (envelope-from git) Date: Sun, 25 Apr 2021 14:22:12 GMT Message-Id: <202104251422.13PEMCNX084980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Watson Subject: git: 8e491aaeac6e - main - Add code examples to cpuset(2), and improve cross referencing. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rwatson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e491aaeac6eab92b1ba8f077f75cebac39adb1c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 14:22:12 -0000 The branch main has been updated by rwatson: URL: https://cgit.FreeBSD.org/src/commit/?id=8e491aaeac6eab92b1ba8f077f75cebac39adb1c commit 8e491aaeac6eab92b1ba8f077f75cebac39adb1c Author: Robert Watson AuthorDate: 2021-04-25 14:22:00 +0000 Commit: Robert Watson CommitDate: 2021-04-25 14:22:00 +0000 Add code examples to cpuset(2), and improve cross referencing. MFC after: 1 week Reviewed by: jeff, jrtc27, kevans, bcr (manpages) Differential revision: https://reviews.freebsd.org/D27803 --- lib/libc/sys/cpuset.2 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/lib/libc/sys/cpuset.2 b/lib/libc/sys/cpuset.2 index a2e5269ac042..8b17f537e7fa 100644 --- a/lib/libc/sys/cpuset.2 +++ b/lib/libc/sys/cpuset.2 @@ -1,5 +1,6 @@ .\" Copyright (c) 2008 Christian Brueffer .\" Copyright (c) 2008 Jeffrey Roberson +.\" Copyright (c) 2021 Robert N. M. Watson .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -180,9 +181,72 @@ The actual contents of the sets may be retrieved or manipulated using .Xr cpuset_setaffinity 2 , .Xr cpuset_getdomain 2 , and .Xr cpuset_setdomain 2 . +The +.Xr cpuset 9 +macros may be used to manipulate masks of type +.Ft cpuset_t +get and set using those APIs. See those manual pages for more detail. .Sh RETURN VALUES .Rv -std +.Sh EXAMPLES +In this example, a CPU set mask is configured to limit execution to the first +CPU using +.Xr CPU_ZERO 9 +and +.Xr CPU_SET 9 , +members of the +.Xr cpuset 9 +programming interface. +Then, the mask is applied to a new anonymous CPU set associated with the +current process using +.Xr cpuset_setaffinity 2 . +This mask will be used by the current process, and inherited by any new +child processes. +.Bd -literal -offset indent +#include +#include + +#include + +cpuset_t cpuset_mask; + +/* Initialize a CPU mask and enable CPU 0. */ +CPU_ZERO(&cpuset_mask); +CPU_SET(0, &cpuset_mask); + +/* Set affinity for the CPU set for the current process. */ +if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, + sizeof(cpuset_mask), &cpuset_mask) < 0) + err(EX_OSERR, "cpuset_setaffinity"); +.Ed +.Pp +In the next example, a named CPU set is created containing the current +process, and its affinity similarly configured. +The resulting CPU set ID can then be used for further external management of +the affinity of the set. +.Bd -literal -offset indent +#include +#include + +#include + +cpusetid_t cpuset_id; +cpuset_t cpuset_mask; + +/* Create new cpuset for the current process. */ +if (cpuset(&cpuset_id) < 0) + err(EX_OSERR, "cpuset"); + +/* Initialize a CPU mask and enable CPU 0. */ +CPU_ZERO(&cpuset_mask); +CPU_SET(0, &cpuset_mask); + +/* Set affinity for the CPU set for the current process. */ +if (cpuset_setaffinity(CPU_LEVEL_SET, CPU_WHICH_CPUSET, cpuset_id, + sizeof(cpuset_mask), &cpuset_mask) < 0) + err(EX_OSERR, "cpuset_setaffinity"); +.Ed .Sh ERRORS The following error codes may be set in .Va errno : @@ -226,6 +290,8 @@ for allocation. .Xr cpuset_setdomain 2 , .Xr pthread_affinity_np 3 , .Xr pthread_attr_affinity_np 3 , +.Xr CPU_SET 9 , +.Xr CPU_ZERO 9 , .Xr cpuset 9 .Sh HISTORY The From owner-dev-commits-src-all@freebsd.org Sun Apr 25 19:53:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E5C35E5199; Sun, 25 Apr 2021 19: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 4FSzH641l9z4SG0; Sun, 25 Apr 2021 19:53:38 +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 7C38519FA9; Sun, 25 Apr 2021 19:53:38 +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 13PJrcxN022341; Sun, 25 Apr 2021 19:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PJrcdE022340; Sun, 25 Apr 2021 19:53:38 GMT (envelope-from git) Date: Sun, 25 Apr 2021 19:53:38 GMT Message-Id: <202104251953.13PJrcdE022340@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: 7d222ce3c10b - main - Fix NOINET[6], !VIMAGE builds after FIB_ALGO addition to GENERIC 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: 7d222ce3c10bdc23c8dc92d6b13e376ede5840d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 19:53:38 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7d222ce3c10bdc23c8dc92d6b13e376ede5840d5 commit 7d222ce3c10bdc23c8dc92d6b13e376ede5840d5 Author: Alexander V. Chernikov AuthorDate: 2021-04-21 04:52:38 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-04-21 04:53:42 +0000 Fix NOINET[6],!VIMAGE builds after FIB_ALGO addition to GENERIC Reported by: jbeich PR: 255390 --- sys/net/route/fib_algo.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c index 83fff1ec43e0..5dff2690454d 100644 --- a/sys/net/route/fib_algo.c +++ b/sys/net/route/fib_algo.c @@ -108,19 +108,19 @@ SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, /* Algorithm sync policy */ /* Time interval to bucket updates */ -VNET_DEFINE(unsigned int, bucket_time_ms) = 50; -#define V_bucket_time_ms VNET(bucket_time_ms) +VNET_DEFINE_STATIC(unsigned int, update_bucket_time_ms) = 50; +#define V_update_bucket_time_ms VNET(update_bucket_time_ms) SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_time_ms, CTLFLAG_RW | CTLFLAG_VNET, - &VNET_NAME(bucket_time_ms), 0, "Time interval to calculate update rate"); + &VNET_NAME(update_bucket_time_ms), 0, "Time interval to calculate update rate"); /* Minimum update rate to delay sync */ -VNET_DEFINE(unsigned int, bucket_change_threshold_rate) = 500; +VNET_DEFINE_STATIC(unsigned int, bucket_change_threshold_rate) = 500; #define V_bucket_change_threshold_rate VNET(bucket_change_threshold_rate) SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_change_threshold_rate, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(bucket_change_threshold_rate), 0, "Minimum update rate to delay sync"); /* Max allowed delay to sync */ -VNET_DEFINE(unsigned int, fib_max_sync_delay_ms) = 1000; +VNET_DEFINE_STATIC(unsigned int, fib_max_sync_delay_ms) = 1000; #define V_fib_max_sync_delay_ms VNET(fib_max_sync_delay_ms) SYSCTL_UINT(_net_route_algo, OID_AUTO, fib_max_sync_delay_ms, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(fib_max_sync_delay_ms), 0, "Maximum time to delay sync (ms)"); @@ -589,7 +589,7 @@ update_rebuild_delay(struct fib_data *fd, enum fib_callout_action action) struct timeval tv; /* Fetch all variables at once to ensure consistent reads */ - uint32_t bucket_time_ms = V_bucket_time_ms; + uint32_t bucket_time_ms = V_update_bucket_time_ms; uint32_t threshold_rate = V_bucket_change_threshold_rate; uint32_t max_delay_ms = V_fib_max_sync_delay_ms; @@ -1618,10 +1618,14 @@ static struct fib_dp ** get_family_dp_ptr(int family) { switch (family) { +#ifdef INET case AF_INET: return (&V_inet_dp); +#endif +#ifdef INET6 case AF_INET6: return (&V_inet6_dp); +#endif } return (NULL); } From owner-dev-commits-src-all@freebsd.org Sun Apr 25 19:58:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FB625E52D5; Sun, 25 Apr 2021 19:58: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 4FSzNb72bcz4SVY; Sun, 25 Apr 2021 19:58: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 E449919EB9; Sun, 25 Apr 2021 19:58: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 13PJwNnb022855; Sun, 25 Apr 2021 19:58:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PJwNro022854; Sun, 25 Apr 2021 19:58:23 GMT (envelope-from git) Date: Sun, 25 Apr 2021 19:58:23 GMT Message-Id: <202104251958.13PJwNro022854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 02695ea8909d - main - nfscl: fix delegation recall when the file is not open MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02695ea8909d818ceaa726f90f889889dfd39fac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 19:58:24 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=02695ea8909d818ceaa726f90f889889dfd39fac commit 02695ea8909d818ceaa726f90f889889dfd39fac Author: Rick Macklem AuthorDate: 2021-04-25 19:52:48 +0000 Commit: Rick Macklem CommitDate: 2021-04-25 19:55:00 +0000 nfscl: fix delegation recall when the file is not open Without this patch, if a NFSv4 server recalled a delegation when the file is not open, the renew thread would block in the NFS VOP_INACTIVE() trying to acquire the client state lock that it already holds. This patch fixes the problem by delaying the vrele() call until after the client state lock is released. This bug has been in the NFSv4 client for a long time, but since it only affects delegation when recalled due to another client opening the file, it got missed during previous testing. Until you have this patch in your client, you should avoid the use of delegations. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 53 ++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index e310deff6cf9..6cff58331c97 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -156,7 +156,8 @@ static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *); static int nfscl_errmap(struct nfsrv_descript *, u_int32_t); static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *); static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *, - struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int); + struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int, + vnode_t *); static void nfscl_freeopenowner(struct nfsclowner *, int); static void nfscl_cleandeleg(struct nfscldeleg *); static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, @@ -2562,6 +2563,7 @@ nfscl_renewthread(struct nfsclclient *clp, NFSPROC_T *p) struct nfsclds *dsp; bool retok; struct mount *mp; + vnode_t vp; cred = newnfs_getcred(); NFSLOCKCLSTATE(); @@ -2683,7 +2685,7 @@ tryagain: NFSUNLOCKCLSTATE(); newnfs_copycred(&dp->nfsdl_cred, cred); ret = nfscl_recalldeleg(clp, clp->nfsc_nmp, dp, - NULL, cred, p, 1); + NULL, cred, p, 1, &vp); if (!ret) { nfscl_cleandeleg(dp); TAILQ_REMOVE(&clp->nfsc_deleg, dp, @@ -2694,6 +2696,22 @@ tryagain: nfsstatsv1.cldelegates--; } NFSLOCKCLSTATE(); + /* + * The nfsc_lock must be released before doing + * vrele(), since it might call nfs_inactive(). + * For the unlikely case where the vnode failed + * to be acquired by nfscl_recalldeleg(), a + * VOP_RECLAIM() should be in progress and it + * will return the delegation. + */ + nfsv4_unlock(&clp->nfsc_lock, 0); + igotlock = 0; + if (vp != NULL) { + NFSUNLOCKCLSTATE(); + vrele(vp); + NFSLOCKCLSTATE(); + } + goto tryagain; } dp = ndp; } @@ -3943,16 +3961,18 @@ nfscl_lockt(vnode_t vp, struct nfsclclient *clp, u_int64_t off, static int nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p, - int called_from_renewthread) + int called_from_renewthread, vnode_t *vpp) { struct nfsclowner *owp, *lowp, *nowp; struct nfsclopen *op, *lop; struct nfscllockowner *lp; struct nfscllock *lckp; struct nfsnode *np; - int error = 0, ret, gotvp = 0; + int error = 0, ret; if (vp == NULL) { + KASSERT(vpp != NULL, ("nfscl_recalldeleg: vpp NULL")); + *vpp = NULL; /* * First, get a vnode for the file. This is needed to do RPCs. */ @@ -3966,7 +3986,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, return (0); } vp = NFSTOV(np); - gotvp = 1; + *vpp = vp; } else { np = VTONFS(vp); } @@ -3993,8 +4013,6 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, * return now, so that the dirty buffer will be flushed * later. */ - if (gotvp != 0) - vrele(vp); return (ret); } @@ -4018,11 +4036,8 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, owp, dp, cred, p); if (ret == NFSERR_STALECLIENTID || ret == NFSERR_STALEDONTRECOVER || - ret == NFSERR_BADSESSION) { - if (gotvp) - vrele(vp); + ret == NFSERR_BADSESSION) return (ret); - } if (ret) { nfscl_freeopen(lop, 1); if (!error) @@ -4050,11 +4065,8 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, nfscl_freeopenowner(owp, 0); if (ret == NFSERR_STALECLIENTID || ret == NFSERR_STALEDONTRECOVER || - ret == NFSERR_BADSESSION) { - if (gotvp) - vrele(vp); + ret == NFSERR_BADSESSION) return (ret); - } if (ret) { nfscl_freeopen(lop, 1); if (!error) @@ -4075,17 +4087,12 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp, if (ret == NFSERR_STALESTATEID || ret == NFSERR_STALEDONTRECOVER || ret == NFSERR_STALECLIENTID || - ret == NFSERR_BADSESSION) { - if (gotvp) - vrele(vp); + ret == NFSERR_BADSESSION) return (ret); - } if (ret && !error) error = ret; } } - if (gotvp) - vrele(vp); return (error); } @@ -4497,7 +4504,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp) NFSUNLOCKCLSTATE(); cred = newnfs_getcred(); newnfs_copycred(&dp->nfsdl_cred, cred); - (void) nfscl_recalldeleg(clp, nmp, dp, vp, cred, p, 0); + nfscl_recalldeleg(clp, nmp, dp, vp, cred, p, 0, NULL); NFSFREECRED(cred); triedrecall = 1; NFSLOCKCLSTATE(); @@ -4596,7 +4603,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp, NFSUNLOCKCLSTATE(); cred = newnfs_getcred(); newnfs_copycred(&dp->nfsdl_cred, cred); - (void) nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p, 0); + nfscl_recalldeleg(clp, nmp, dp, fvp, cred, p, 0, NULL); NFSFREECRED(cred); triedrecall = 1; NFSLOCKCLSTATE(); From owner-dev-commits-src-all@freebsd.org Sun Apr 25 21:19:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 370A45ED06A; Sun, 25 Apr 2021 21:19: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 4FT19c15KLz4f4Y; Sun, 25 Apr 2021 21:19: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 17EB51B0EC; Sun, 25 Apr 2021 21:19: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 13PLJ0T6038648; Sun, 25 Apr 2021 21:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13PLJ0UD038647; Sun, 25 Apr 2021 21:19:00 GMT (envelope-from git) Date: Sun, 25 Apr 2021 21:19:00 GMT Message-Id: <202104252119.13PLJ0UD038647@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: d55bf492f8f5 - main - Revert "Add workaround for a QoS-related bug in VMWare Workstation." 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: d55bf492f8f587e4a99f4dcb39a96159b4431782 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Apr 2021 21:19:00 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d55bf492f8f587e4a99f4dcb39a96159b4431782 commit d55bf492f8f587e4a99f4dcb39a96159b4431782 Author: Ed Maste AuthorDate: 2021-04-25 21:14:23 +0000 Commit: Ed Maste CommitDate: 2021-04-25 21:17:22 +0000 Revert "Add workaround for a QoS-related bug in VMWare Workstation." This reverts commit 77c2fe20df6a9a7c1a353e1a4ab2ba80fefab881. The VMware Workstation issue was fixed in 2019[1], and we'd rather not carry unnecessary local changes in OpenSSH. [1] https://communities.vmware.com/t5/VMware-Workstation-Pro/Regression-ssh-results-in-broken-pipe-upon-connecting-in-Vmware/m-p/486105/highlight/true#M25470 PR: 234426 Discussed with: yuripv Approved by: des MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- crypto/openssh/readconf.c | 22 ---------------------- secure/usr.bin/ssh/Makefile | 3 --- 2 files changed, 25 deletions(-) diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index 75fbd4ca222f..c1147a9e2e5f 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -16,9 +16,6 @@ __RCSID("$FreeBSD$"); #include -#ifdef VMWARE_GUEST_WORKAROUND -#include -#endif #include #include #include @@ -1983,15 +1980,6 @@ fill_default_options(Options * options) { char *all_cipher, *all_mac, *all_kex, *all_key, *all_sig; int r; -#ifdef VMWARE_GUEST_WORKAROUND - char scval[7]; /* "vmware\0" */ - size_t scsiz = sizeof(scval); - int vmwguest = 0; - - if (sysctlbyname("kern.vm_guest", scval, &scsiz, NULL, 0) == 0 && - strcmp(scval, "vmware") == 0) - vmwguest = 1; -#endif if (options->forward_agent == -1) options->forward_agent = 0; @@ -2126,18 +2114,8 @@ fill_default_options(Options * options) if (options->visual_host_key == -1) options->visual_host_key = 0; if (options->ip_qos_interactive == -1) -#ifdef VMWARE_GUEST_WORKAROUND - if (vmwguest) - options->ip_qos_interactive = IPTOS_LOWDELAY; - else -#endif options->ip_qos_interactive = IPTOS_DSCP_AF21; if (options->ip_qos_bulk == -1) -#ifdef VMWARE_GUEST_WORKAROUND - if (vmwguest) - options->ip_qos_bulk = IPTOS_THROUGHPUT; - else -#endif options->ip_qos_bulk = IPTOS_DSCP_CS1; if (options->request_tty == -1) options->request_tty = REQUEST_TTY_AUTO; diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile index 023fa4a55be9..614cc7627fc5 100644 --- a/secure/usr.bin/ssh/Makefile +++ b/secure/usr.bin/ssh/Makefile @@ -37,9 +37,6 @@ LIBADD+= crypto CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif -# Workaround VMware Workstation NAT bug -CFLAGS+=-DVMWARE_GUEST_WORKAROUND - .include .PATH: ${SSHDIR}