From nobody Mon Jan 20 00:01:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybr8t6N6Zz5ltt6; Mon, 20 Jan 2025 00:01: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybr8t5crSz3bRp; Mon, 20 Jan 2025 00:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/wUkgvEu197+KUMXQfIY4/c6wyQVxbgBk8gywqV/H4=; b=yW6kBq+Yp07mDsNC2WoEDCm4bFx5chOzUc3GvSrABK+qf2Z2nGm5K9Z1aNCJEcT/A2j4vb Xf2/s/5VqVz5mBwZ85fyf7UMa8zg9MNNPY28ivYZCnO7K5IOuEN3K131GZ4CP+bwvv5KpI FOMh0VsuvOkxEjf8iNdeYIx5TM8v6iI1rZRKbeWf0rVXL523plHtkFIyXgWWu6zJ3m/EVX 2+v0Ge46fJ9uCRy/Do17+z7wU7hOQokatWgNFGHZ64R7SIqBSFy3YCSmmYxrXj72kGLz6S QXUvI17T2VC9+lm3cCSBoKEnubVL1soFSdl7hHOzCrgHaJ2XQ6NKVYHuMXZBtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q/wUkgvEu197+KUMXQfIY4/c6wyQVxbgBk8gywqV/H4=; b=H5psnzO5Ooka9waa4TcT3UDELZYAIXQVu30J9vD64IGO2OPfnmweypKl9PlJeROMdqp4tt CvLV3FDNECCVD1rNStgAvq0RBlcTmxVOCi53xbdpyn/2YAXwLEX5ZQFDm5de3Nn0Pwqa9L oBFtQ1Zz7l79U+/yk9stxvqLQTOSzNG//g6IyzamXHLydeXzvuT3lWv78pMovQ3vW4k/rp YIfv02RbZUXKDrOA9dKRzQi2uNhqxCTEptxzUQJPwHQ2wtbv8E/eZLPCfHcpbMG5qklJrA o+E3uOzalw8SA1ua66tDECNOES6NXm7U5uo9mKuhQ9sX+74A9J8aSQzllz+sVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737331278; a=rsa-sha256; cv=none; b=e9YD69AezeLfFvQSYpMFkdLzUsocpFJxeWIzDDRYtdlUHy4JmULAkEBD8Nkg6R2S22MiMO kkVewqxM2YwMbXtQlL41i2Zwz8uaSaPTiuFOUmottKrHXoNYG7p27RSK78YWpOAGdsk1FU QkzC9O/+Sl3YGrKZYuEDwxi6vEYETveXI17AwVijT4y/w/p8l0ASMVqfJbFf/UHio2fSuN mflLNDvYBO6IvRxNAOgh1QthA4RzPI0IouoFV7WMulF0nbWPUCz/vnX9ttEGnYmHqz2zXA A6dkGYaQzAHtNfXB/64CRjJEJGaBQ5giizRqLxAyr7hJ0VXzdubZDImUl90ekQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybr8t57tCz19nN; Mon, 20 Jan 2025 00:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K01IJw075772; Mon, 20 Jan 2025 00:01:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K01IZn075769; Mon, 20 Jan 2025 00:01:18 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:01:18 GMT Message-Id: <202501200001.50K01IZn075769@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: 2cd9a4f0c229 - stable/14 - exports.5: Document the current behavior of -alldirs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 2cd9a4f0c229626f7422187b30723772336e8896 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd9a4f0c229626f7422187b30723772336e8896 commit 2cd9a4f0c229626f7422187b30723772336e8896 Author: Rick Macklem AuthorDate: 2024-12-28 21:51:08 +0000 Commit: Rick Macklem CommitDate: 2025-01-20 00:00:35 +0000 exports.5: Document the current behavior of -alldirs Commit 07cd69e272da adds a new "-a" mountd option, which changes the behavior of mountd when file systems are exported via -alldirs. This patch updates the man page to reflect the actual behavior when -alldirs is used when mountd is started with/without -a. Prior to the above commit, exports(5) documented that, when -alldirs was specified, the exports line would fail unless the directory was a server file system mount point. This behavior was only documented in the Examples section and has not been implemented since a change between FreeBSD 1 and FreeBSD 2 was done. This is a contents change. PR: 282995 (cherry picked from commit 295934eaa92cd917ae42a446899c0d527ad9c0c9) --- usr.sbin/mountd/exports.5 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index 6c18e910c116..b8f0e93aec8a 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd October 08, 2024 +.Dd December 16, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -86,6 +86,15 @@ to limit exported directories to server local file system mount points. When exporting ZFS datasets with the .Sy sharenfs property, this is auomatically the case. +If the +.Fl alldirs +flag is specified and +the +.Fl a +command line option is specified for +.Xr mountd 8 , +the export will fail if the directory path is not a local file system +mount point. .Pp There are three forms of the directory path specification. The first is to list all mount points as absolute @@ -552,12 +561,18 @@ will be exported read-only to the entire network 192.168.33.0/24, including all its subdirectories. Since .Pa /cdrom -is the conventional mountpoint for a CD-ROM device, this export will -fail if no CD-ROM medium is currently mounted there since that line +is the conventional mountpoint for a CD-ROM device, +for the case where the +.Fl a +option has been specified for +.Xr mountd 8 , +this export will +fail if no CD-ROM medium is currently mounted there +since that line would then attempt to export a subdirectory of the root file system with the .Fl alldirs -option which is not allowed. +option. The .Fl quiet option will then suppress the error message for this condition that From nobody Mon Jan 20 00:11:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbrP96JMrz5lvRR; Mon, 20 Jan 2025 00:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbrP95SPHz3cLp; Mon, 20 Jan 2025 00:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH9wpVDyW5/xUzlFZf3SoenLYLfGq/eldATm74mjroc=; b=su8jfQwHeYZhToL/H34S4yNqPA1hiADS7GRbeWbLbdS9LD6Px77irb6n2An+t+dCUVAGjJ MO0i9MLU44mR0MBabeQ2bhrkaCE0CXk05aDUHnFD98JO2Lndo1X8l2xU3xPbsV5PSQ480d zU6RN3UtWfVDPfhaY8AZUQtm8574wyBV7LF3uIx4H2Pux1U/iiauEVxnHkWkfio+WVkBU/ 5wm1a2TdKuXZjbAukHzI2S9d9g7qsF7n4qatsRwkLy8v4GrV29dCjrilUwvLVkMiTGd1pS Q038UjKuTFA3wt2TB7snpZVhpm/nJ35mapFbl3LTvJAuAATYHRx0YDSACmNNLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH9wpVDyW5/xUzlFZf3SoenLYLfGq/eldATm74mjroc=; b=yndRd5hgS+J1vd5iC0QJbmAyqGJ1fMIF/e+czcgVHlAAnCl15B/WBbol/rgwLTa4TMy4/z jdFnLLshy/59b6ZabGb/Q45mjYlPKwcxAhpl47TavJvp/MX5z49IObt5/Dl2pfahNqZuxV CYPvdSuY6EXkcw56O/vzZmCjfRre+mzgmXg07OS7p4lBqBJ7o2Ooz8AB9tMCj5ZQnO0KBN y8GRLp2iwODxtgbhd2CHbO8ymcBX5v2d8nopzYUDNQPRIYeWDW0xnkfwnQ2HvYORChLpAd tXxnn/Gz+8YfmdFZV7sfIsE6UuwFtCvgY6uo60fRxC4Z+Mz6mIa3xhsOBp7BdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737331917; a=rsa-sha256; cv=none; b=n3fPHWtUWGBUDM0HEAMUriVlF7kTMSKPnFa1j+SGpY98o9FEIf+ztsxpmspqnJvSKkbFWU DLSRbidv41I3KvHnB1xeaHxl0f6J5htnOeIYDnBav6YIRKqrCVdwVJ3gwMslUOQTakQFew tcrE8ifxCXY+fenVFYNuZTSSztWLkrfzXf4PcOhnSUMreHoLiyr9zYddxSvdRHnILwgt13 zyAgj/05Jja1uKtpcXvGQkQo/AkSMZYXIWeuD4z6lQtBvGgNo6ZEsfbORM1E7QmaxKJ9Ae XI6CAFAFGcUycSG8b0Hqbs2aUZ/Xz1hHT7YTgEB/jobg/jCxdQqqdC1f9/dngQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbrP954CSz1Bx0; Mon, 20 Jan 2025 00:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0Bv6i093078; Mon, 20 Jan 2025 00:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0BvFW093075; Mon, 20 Jan 2025 00:11:57 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:11:57 GMT Message-Id: <202501200011.50K0BvFW093075@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: 22d2336252c9 - stable/14 - RELNOTES: Add entry for commit ead3cd3ef628 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 22d2336252c9af8e58b19444e2308a98946f3246 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=22d2336252c9af8e58b19444e2308a98946f3246 commit 22d2336252c9af8e58b19444e2308a98946f3246 Author: Rick Macklem AuthorDate: 2025-01-20 00:10:06 +0000 Commit: Rick Macklem CommitDate: 2025-01-20 00:10:06 +0000 RELNOTES: Add entry for commit ead3cd3ef628 --- RELNOTES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELNOTES b/RELNOTES index 515ba162b440..812dc613957b 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +ead3cd3ef628: + Add a new -a command line option to mountd(8). + If this command line option is specified, when + a line in exports(5) has the -alldirs export option, + the directory must be a server file system mount point. + 54974e731f27, 155987e20190, 4634282f8908, 7a3a0402aeb6, 6b1a5d3535d9: The layout of NFS file handles for the tarfs, cd9660, and ext2fs file systems has changed. An NFS server that exports any of these file From nobody Mon Jan 20 00:25:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybrhw0LFBz5lwC0; Mon, 20 Jan 2025 00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrhv6ZVCz3dLJ; Mon, 20 Jan 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLQsh2C31AuJCgFRHwjsQ/XDlBgQo5bez2IdUL4Jz2U=; b=dDUJCbcSrhS7VDtvRYQ/WJSdlCJXzte11+3XtQfWTWhKYr3RWW+H6esfRhpgRTOjCf7O5C MBKWY157A/Rtv1duRtax4pQ4tcXBBXJg6eMNhIdyQJoCEMjtt9RKYCLAGrmSMm4rs/92/D 2AFgvoQf4I3VwQBe2o/aNKodo/GVVwbhbDCjpJ9cVkg87YNg9p74kFeso/xHkWltkFyXKT KKl/o/jWfx2JpgyPCJUw9mav4I4F3wbSKUaKOuhFyvP1thgcLBpwCQAzvml399XDyUqR3N ++hCp7MWW8030vpdBa0pe+ng+uLppn8j4ufua8tySk0B58jkJz8E0sPE/CIV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLQsh2C31AuJCgFRHwjsQ/XDlBgQo5bez2IdUL4Jz2U=; b=Y3aXP7008P9YhJv3zRSrurqkx5DWlQq7NVSBAladz4TQB03XK4P14vkyV6UU+fu1BBe7VW cXU6f6npamSjj610bdZ0pdduRvE1HkH4poRurKdLccx27JMxJOOu3Qz61YtLooGkZfV7tr 1ovchgcn2yfp4fqG/q9KZNvMVdKgNmOA4nwbNElGgfUTECXfjb8eHKG9hAhyPy2b9P0DMH GlbksI1qksnyzkipj96TqMEzL7O/bk9AIaa40JUKM1D3G+srgyH1P7Uufw2aY+H1PkCtRN qzezE8HSKEFUDgA/F27cJvbJBhtmyKI7JXQ8BSS+hDZgMFBDmBCng7gID5CZKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332735; a=rsa-sha256; cv=none; b=hpIFIIh0tddvaxpV8oItlMMwP/pA65lzHf2ZBvfKAl66631/2frd9SU2UFq0taUBhnrQyV TU3KdrbVY+jVuXWSrlZnTDsQgBUBfM6Ti63fgw1uWMX0i1mmn42Sy5ZvbEiKiU+b0CGpgx 36iFpAzOTvlP8DY+s0XXOVomae+nGBxvpCT+XBWTLUoyU3UwMigYyAysa2p9lInIfy+OBr 0ZTohwhoRrObdlJKt5BqaEr3N3VJU7HpS0EkuswWOICBo+ABTAreWcBMKjjtW+dkoediMb Qnl0sGXZkMI3NRsN5YydE72bM5GO/iX3jMY55a1najEgkaxBolsZNk14Ab7jBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrhv5zd7z1Bpx; Mon, 20 Jan 2025 00:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0PZ2I018076; Mon, 20 Jan 2025 00:25:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0PZYg018073; Mon, 20 Jan 2025 00:25:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:25:35 GMT Message-Id: <202501200025.50K0PZYg018073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: a158d26e89f2 - stable/14 - contrib/tzdata: import tzdata 2025a List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a158d26e89f2e3274ba1064e3fd6b341c6fcb07c Auto-Submitted: auto-generated The branch stable/14 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=a158d26e89f2e3274ba1064e3fd6b341c6fcb07c commit a158d26e89f2e3274ba1064e3fd6b341c6fcb07c Author: Philip Paeps AuthorDate: 2025-01-17 01:33:46 +0000 Commit: Philip Paeps CommitDate: 2025-01-20 00:23:58 +0000 contrib/tzdata: import tzdata 2025a Changes: https://github.com/eggert/tz/blob/2025a/NEWS (cherry picked from commit 46226b0162ba03986b1de2c790804b37dd8e64d6) --- contrib/tzdata/Makefile | 32 +++++------ contrib/tzdata/NEWS | 84 +++++++++++++++++++++++++++-- contrib/tzdata/antarctica | 2 + contrib/tzdata/asia | 113 ++++++++++++++++++++++++++++----------- contrib/tzdata/australasia | 113 +++++++++++++++++++++------------------ contrib/tzdata/checknow.awk | 2 +- contrib/tzdata/checktab.awk | 39 +++++++++++++- contrib/tzdata/etcetera | 4 ++ contrib/tzdata/europe | 2 +- contrib/tzdata/factory | 10 ++++ contrib/tzdata/leap-seconds.list | 8 +-- contrib/tzdata/leapseconds | 8 +-- contrib/tzdata/northamerica | 9 ++-- contrib/tzdata/southamerica | 27 ++++++++-- contrib/tzdata/theory.html | 40 +++++++++----- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 2 +- contrib/tzdata/zone1970.tab | 6 +-- contrib/tzdata/zonenow.tab | 9 ++-- 19 files changed, 369 insertions(+), 143 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 0087b4596515..2130582c2deb 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -137,7 +137,7 @@ TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ uint_least64_t.ck # What kind of TZif data files to generate. (TZif is the binary time -# zone data format that zic generates; see Internet RFC 8536.) +# zone data format that zic generates; see Internet RFC 9636.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -255,6 +255,7 @@ LDLIBS= # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DMKTIME_MIGHT_OVERFLOW if mktime might fail due to time_t overflow # -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ # Typically it is better to use a later standard. For example, # with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. @@ -262,7 +263,7 @@ LDLIBS= # feature (integers at least 64 bits wide) and maybe more. # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. -# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -Dssize_t=int on hosts like MS-Windows that lack ssize_t # -DSUPPORT_C89=0 if the tzcode library should not support C89 callers # Although -DSUPPORT_C89=0 might work around latent bugs in callers, # it does not conform to POSIX. @@ -285,7 +286,7 @@ LDLIBS= # This mishandles some past timestamps, as US DST rules have changed. # It also mishandles settings like TZ='EET-2EEST' for eastern Europe, # as Europe and US DST rules differ. -# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 254) # -DUNINIT_TRAP if reading uninitialized storage can cause problems # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library @@ -319,7 +320,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ $(GCC_INSTRUMENT) \ -Wall -Wextra \ -Walloc-size-larger-than=100000 -Warray-bounds=2 \ - -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ + -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wcast-qual \ + -Wdate-time \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ @@ -336,7 +338,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-format-nonliteral -Wno-sign-compare + -Wno-format-nonliteral -Wno-sign-compare -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -614,8 +616,8 @@ TZS_YEAR= 2050 TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs -TZS_DEPS= $(YDATA) asctime.c localtime.c \ - private.h tzfile.h zdump.c zic.c +TZS_DEPS= $(YDATA) localtime.c private.h \ + strftime.c tzfile.h zdump.c zic.c TZDATA_DIST = $(COMMON) $(DATA) $(MISC) # EIGHT_YARDS is just a yard short of the whole ENCHILADA. EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi @@ -855,10 +857,10 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_mild back.ck +check: check_mild back.ck now.ck check_mild: check_web check_zishrink \ character-set.ck white-space.ck links.ck mainguard.ck \ - name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ + name-lengths.ck slashed-abbrs.ck sorted.ck \ tables.ck ziguard.ck tzs.ck # True if UTF8_LOCALE does not work; @@ -1103,7 +1105,7 @@ set-timestamps.out: $(EIGHT_YARDS) touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ - if git diff --quiet $$file; then \ + if git diff --quiet HEAD $$file; then \ time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ --date='format:%Y-%m-%dT%H:%M:%SZ' \ @@ -1354,13 +1356,13 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi -asctime.o: private.h tzfile.h +asctime.o: private.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.h tzdir.h -strftime.o: private.h tzfile.h -zdump.o: version.h -zic.o: private.h tzfile.h tzdir.h version.h +localtime.o: private.h tzdir.h tzfile.h +strftime.o: localtime.c private.h tzdir.h tzfile.h +zdump.o: private.h version.h +zic.o: private.h tzdir.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 83b8b8c8d39c..a5d7ea89204e 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,83 @@ News for the tz database +Release 2025a - 2025-01-15 10:47:24 -0800 + + Briefly: + Paraguay adopts permanent -03 starting spring 2024. + Improve pre-1991 data for the Philippines. + Etc/Unknown is now reserved. + + Changes to future timestamps + + Paraguay will stop changing its clocks after the spring-forward + transition on 2024-10-06, so it is now permanently at -03. + (Thanks to Heitor David Pinto and Even Scharning.) + This affects timestamps starting 2025-03-22, as well as the + obsolescent tm_isdst flags starting 2024-10-15. + + Changes to past timestamps + + Correct timestamps for the Philippines before 1900, and from 1937 + through 1990. (Thanks to P Chan for the heads-up and citations.) + This includes adjusting local mean time before 1899; fixing + transitions in September 1899, January 1937, and June 1954; adding + transitions in December 1941, November 1945, March and September + 1977, and May and July 1990; and removing incorrect transitions in + March and September 1978. + + Changes to data + + Add zone1970.tab lines for the Concordia and Eyre Bird Observatory + research stations. (Thanks to Derick Rethans and Jule Dabars.) + + Changes to code + + strftime %s now generates the correct numeric string even when the + represented number does not fit into time_t. This is better than + generating the numeric equivalent of (time_t) -1, as strftime did + in TZDB releases 96a (when %s was introduced) through 2020a and in + releases 2022b through 2024b. It is also better than failing and + returning 0, as strftime did in releases 2020b through 2022a. + + strftime now outputs an invalid conversion specifier as-is, + instead of eliding the leading '%', which confused debugging. + + An invalid TZ now generates the time zone abbreviation "-00", not + "UTC", to help the user see that an error has occurred. (Thanks + to Arthur David Olson for suggesting a "wrong result".) + + mktime and timeoff no longer incorrectly fail merely because a + struct tm component near INT_MIN or INT_MAX overflows when a + lower-order component carries into it. + + TZNAME_MAXIMUM, the maximum number of bytes in a proleptic TZ + string's time zone abbreviation, now defaults to 254 not 255. + This helps reduce the size of internal state from 25480 to 21384 + on common platforms. This change should not be a problem, as + nobody uses such long "abbreviations" and the longstanding tzcode + maximum was 16 until release 2023a. For those who prefer no + arbitrary limits, you can now specify TZNAME_MAXIMUM values up to + PTRDIFF_MAX, a limit forced by C anyway; formerly tzcode silently + misbehaved unless TZNAME_MAXIMUM was less than INT_MAX. + + tzset and related functions no longer leak a file descriptor if + another thread forks or execs at about the same time and if the + platform has O_CLOFORK and O_CLOEXEC respectively. Also, the + functions no longer let a TZif file become a controlling terminal. + + 'zdump -' now reads TZif data from /dev/stdin. + (From a question by Arthur David Olson.) + + Changes to documentation + + The name Etc/Unknown is now reserved: it will not be used by TZDB. + This is for compatibility with CLDR, which uses the string + "Etc/Unknown" for an unknown or invalid timezone. (Thanks to + Justin Grant, Mark Davis, and Guy Harris.) + + Cite Internet RFC 9636, which obsoletes RFC 8536 for TZif format. + + Release 2024b - 2024-09-04 12:27:47 -0700 Briefly: @@ -116,7 +194,7 @@ Release 2024b - 2024-09-04 12:27:47 -0700 Changes to commentary Commentary about historical transitions in Portugal and her former - colonies has been expanded with links to many relevant legislation. + colonies has been expanded with links to relevant legislation. (Thanks to Tim Parenti.) @@ -204,10 +282,10 @@ Release 2023d - 2023-12-21 20:02:24 -0800 changing its time zone from -01/+00 to -02/-01 at the same moment as the spring-forward transition. Its clocks will therefore not spring forward as previously scheduled. The time zone change - reverts to its common practice before 1981. + reverts to its common practice before 1981. (Thanks to Jule Dabars.) Fix predictions for DST transitions in Palestine in 2072-2075, - correcting a typo introduced in 2023a. + correcting a typo introduced in 2023a. (Thanks to Jule Dabars.) Changes to past and future timestamps diff --git a/contrib/tzdata/antarctica b/contrib/tzdata/antarctica index 8d5d6cd1cdd0..2e90a5e09d17 100644 --- a/contrib/tzdata/antarctica +++ b/contrib/tzdata/antarctica @@ -174,6 +174,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # France & Italy - year-round base # Concordia, -750600+1232000, since 2005 +# https://en.wikipedia.org/wiki/Concordia_Station +# Can use Asia/Singapore, which it has agreed with since inception. # Germany - year-round base # Neumayer III, -704080-0081602, since 2009 diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index a2480b021225..d4eb058053ed 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3665,21 +3665,70 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line # https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm -# The rest of the data entries are from Shanks & Pottenger. - -# From Jesper Nørgaard Welen (2006-04-26): -# ... claims that Philippines had DST last time in 1990: -# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/ -# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires, -# but no details] - -# From Paul Eggert (2014-08-14): -# The following source says DST may be instituted November-January and again -# March-June, but this is not definite. It also says DST was last proclaimed -# during the Ramos administration (1992-1998); but again, no details. -# Carcamo D. PNoy urged to declare use of daylight saving time. -# Philippine Star 2014-08-05 -# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time + +# From P Chan (2021-05-10): +# Here's a fairly comprehensive article in Japanese: +# https://wiki.suikawiki.org/n/Philippine%20Time +# (2021-05-16): +# According to the references listed in the article, +# the periods that the Philippines (Manila) observed DST or used +9 are: +# +# 1936-10-31 24:00 to 1937-01-15 24:00 +# (Proclamation No. 104, Proclamation No. 126) +# 1941-12-15 24:00 to 1945-11-30 24:00 +# (Proclamation No. 789, Proclamation No. 20) +# 1954-04-11 24:00 to 1954-06-04 24:00 +# (Proclamation No. 13, Proclamation No. 33) +# 1977-03-27 24:00 to 1977-09-21 24:00 +# (Proclamation No. 1629, Proclamation No. 1641) +# 1990-05-21 00:00 to 1990-07-28 24:00 +# (National Emergency Memorandum Order No. 17, Executive Order No. 415) +# +# Proclamation No. 104 ... October 30, 1936 +# https://www.officialgazette.gov.ph/1936/10/30/proclamation-no-104-s-1936/ +# Proclamation No. 126 ... January 15, 1937 +# https://www.officialgazette.gov.ph/1937/01/15/proclamation-no-126-s-1937/ +# Proclamation No. 789 ... December 13, 1941 +# https://www.officialgazette.gov.ph/1941/12/13/proclamation-no-789-s-1941/ +# Proclamation No. 20 ... November 11, 1945 +# https://www.officialgazette.gov.ph/1945/11/11/proclamation-no-20-s-1945/ +# Proclamation No. 13 ... April 6, 1954 +# https://www.officialgazette.gov.ph/1954/04/06/proclamation-no-13-s-1954/ +# Proclamation No. 33 ... June 3, 1954 +# https://www.officialgazette.gov.ph/1954/06/03/proclamation-no-33-s-1954/ +# Proclamation No. 1629 ... March 25, 1977 +# https://www.officialgazette.gov.ph/1977/03/25/proclamation-no-1629-s-1977/ +# Proclamation No. 1641 ...May 26, 1977 +# https://www.officialgazette.gov.ph/1977/05/26/proclamation-no-1641-s-1977/ +# National Emergency Memorandum Order No. 17 ... May 2, 1990 +# https://www.officialgazette.gov.ph/1990/05/02/national-emergency-memorandum-order-no-17-s-1990/ +# Executive Order No. 415 ... July 20, 1990 +# https://www.officialgazette.gov.ph/1990/07/20/executive-order-no-415-s-1990/ +# +# During WWII, Proclamation No. 789 fixed two periods of DST. The first period +# was set to continue only until January 31, 1942. But Manila was occupied by +# the Japanese earlier in the month.... +# +# For the date of the adoption of standard time, Shank[s] gives 1899-05-11. +# The article is not able to state the basis of that. I guess it was based on +# a US War Department Circular issued on that date. +# https://books.google.com/books?id=JZ1PAAAAYAAJ&pg=RA3-PA8 +# +# However, according to other sources, standard time was adopted on +# 1899-09-06. Also, the LMT was GMT+8:03:52 +# https://books.google.com/books?id=MOYIAQAAIAAJ&pg=PA521 +# https://books.google.com/books?id=lSnqqatpYikC&pg=PA21 +# +# From Paul Eggert (2024-09-05): +# The penultimate URL in P Chan's email refers to page 521 of +# Selga M, The Time Service in the Philippines. +# Proc Pan-Pacific Science Congress. Vol. 1 (1923), 519-532. +# It says, "The change from the meridian 120° 58' 04" to the 120th implied a +# change of 3 min. 52s.26 in time; consequently on 6th September, 1899, +# Manila Observatory gave the noon signal 3 min. 52s.26 later than before". +# +# Wikipedia says the US declared Manila liberated on March 4, 1945; +# this doesn't affect clocks, just our time zone abbreviation and DST flag. # From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 @@ -3697,24 +3746,26 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# From P Chan (2021-05-10): -# Here's a fairly comprehensive article in Japanese: -# https://wiki.suikawiki.org/n/Philippine%20Time -# From Paul Eggert (2021-05-10): -# The info in the Japanese table has not been absorbed (yet) below. - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 D -Rule Phil 1937 only - Feb 1 0:00 0 S -Rule Phil 1954 only - Apr 12 0:00 1:00 D -Rule Phil 1954 only - Jul 1 0:00 0 S -Rule Phil 1978 only - Mar 22 0:00 1:00 D -Rule Phil 1978 only - Sep 21 0:00 0 S +Rule Phil 1936 only - Oct 31 24:00 1:00 D +Rule Phil 1937 only - Jan 15 24:00 0 S +Rule Phil 1941 only - Dec 15 24:00 1:00 D +# The following three rules were canceled by Japan: +#Rule Phil 1942 only - Jan 31 24:00 0 S +#Rule Phil 1942 only - Mar 1 0:00 1:00 D +#Rule Phil 1942 only - Jun 30 24:00 0 S +Rule Phil 1945 only - Nov 30 24:00 0 S +Rule Phil 1954 only - Apr 11 24:00 1:00 D +Rule Phil 1954 only - Jun 4 24:00 0 S +Rule Phil 1977 only - Mar 27 24:00 1:00 D +Rule Phil 1977 only - Sep 21 24:00 0 S +Rule Phil 1990 only - May 21 0:00 1:00 D +Rule Phil 1990 only - Jul 28 24:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 - 8:04:00 - LMT 1899 May 11 - 8:00 Phil P%sT 1942 May - 9:00 - JST 1944 Nov +Zone Asia/Manila -15:56:08 - LMT 1844 Dec 31 + 8:03:52 - LMT 1899 Sep 6 4:00u + 8:00 Phil P%sT 1942 Feb 11 24:00 + 9:00 - JST 1945 Mar 4 8:00 Phil P%sT # Bahrain diff --git a/contrib/tzdata/australasia b/contrib/tzdata/australasia index 359f9c1f1e10..405944536cd3 100644 --- a/contrib/tzdata/australasia +++ b/contrib/tzdata/australasia @@ -1239,10 +1239,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # The 1992 ending date used in the rules is a best guess; # it matches what was used in the past. -# The Australian Bureau of Meteorology FAQ -# http://www.bom.gov.au/faq/faqgen.htm -# (1999-09-27) writes that Giles Meteorological Station uses -# South Australian time even though it's located in Western Australia. +# From Christopher Hunt (2006-11-21), after an advance warning +# from Jesper Nørgaard Welen (2006-11-01): +# WA are trialing DST for three years. +# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf # From Paul Eggert (2018-04-01): # The Guardian Express of Perth, Australia reported today that the @@ -1254,54 +1254,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/ # [The article ends with "Today's date is April 1."] -# Queensland - -# From Paul Eggert (2018-02-26): -# I lack access to the following source for Queensland DST: -# Pearce C. History of daylight saving time in Queensland. -# Queensland Hist J. 2017 Aug;23(6):389-403 -# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS - -# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): -# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] -# # [ Dec 1990 ] -# ... -# Zone Australia/Queensland 10:00 AQ %sST -# ... -# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D -# Rule AQ 1972 only - Feb lastSun 3:00 0 E -# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D -# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E - -# From Bradley White (1989-12-24): -# "Australia/Queensland" now observes daylight time (i.e. from -# October 1989). - -# From Bradley White (1991-03-04): -# A recent excerpt from an Australian newspaper... -# ...Queensland...[has] agreed to end daylight saving -# at 3am tomorrow (March 3)... - -# From John Mackin (1991-03-06): -# I can certainly confirm for my part that Daylight Saving in NSW did in fact -# end on Sunday, 3 March. I don't know at what hour, though. (It surprised -# me.) - -# From Bradley White (1992-03-08): -# ...there was recently a referendum in Queensland which resulted -# in the experimental daylight saving system being abandoned. So, ... -# ... -# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D -# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S -# ... - -# From Arthur David Olson (1992-03-08): -# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. - -# From Christopher Hunt (2006-11-21), after an advance warning -# from Jesper Nørgaard Welen (2006-11-01): -# WA are trialing DST for three years. -# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf +# The Australian Bureau of Meteorology FAQ +# http://www.bom.gov.au/faq/faqgen.htm +# (1999-09-27) writes that Giles Meteorological Station uses +# South Australian time even though it's located in Western Australia. # From Rives McDow (2002-04-09): # The most interesting region I have found consists of three towns on the @@ -1359,6 +1315,59 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # For lack of better info, assume the tradition dates back to the # introduction of standard time in 1895. +# From Stuart Bishop (2024-11-12): +# An article discussing the in-use but technically unofficial timezones +# in the Western Australian portion of the Nullarbor Plain. +# https://www.abc.net.au/news/2024-11-22/outback-wa-properties-strange-time-zones/104542494 +# From Paul Eggert (2024-11-12): +# As the article says, the Eyre Bird Observatory and nearby sheep stations +# can use Tokyo time. Other possibilities include Asia/Chita, Asia/Seoul, +# and Asia/Jayapura. + +# Queensland + +# From Paul Eggert (2018-02-26): +# I lack access to the following source for Queensland DST: +# Pearce C. History of daylight saving time in Queensland. +# Queensland Hist J. 2017 Aug;23(6):389-403 +# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS + +# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (1989-12-24): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (1991-03-04): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (1991-03-06): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (1992-03-08): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (1992-03-08): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + # southeast Australia # diff --git a/contrib/tzdata/checknow.awk b/contrib/tzdata/checknow.awk index 8b7881d2e27f..450490ee3768 100644 --- a/contrib/tzdata/checknow.awk +++ b/contrib/tzdata/checknow.awk @@ -44,7 +44,7 @@ BEGIN { END { for (zone in zone_data) { data = zone_data[zone] - if (!zonenow[data]) { + if (data && !zonenow[data]) { printf "Zone table should have one of:%s\n", zones[data] zonenow[data] = zone # This suppresses duplicate diagnostics. status = 1 diff --git a/contrib/tzdata/checktab.awk b/contrib/tzdata/checktab.awk index 9a26e4655ddb..5fa60556be13 100644 --- a/contrib/tzdata/checktab.awk +++ b/contrib/tzdata/checktab.awk @@ -9,6 +9,19 @@ BEGIN { if (!zone_table) zone_table = "zone1970.tab" if (!want_warnings) want_warnings = -1 + monthabbr["Jan"] = 1 + monthabbr["Feb"] = 1 + monthabbr["Mar"] = 1 + monthabbr["Apr"] = 1 + monthabbr["May"] = 1 + monthabbr["Jun"] = 1 + monthabbr["Jul"] = 1 + monthabbr["Aug"] = 1 + monthabbr["Sep"] = 1 + monthabbr["Oct"] = 1 + monthabbr["Nov"] = 1 + monthabbr["Dec"] = 1 + while (getline >"/dev/stderr" + status = 1 + } } else { + stdoff = $1 ruleUsed[$2] = 1 if ($3 ~ /%/) rulePercentUsed[$2] = 1 } + + if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) { + printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \ + >>"/dev/stderr" + status = 1 + } + if (tz && tz ~ /\// && tz !~ /^Etc\//) { if (!tztab[tz] && FILENAME != "backward" \ && zone_table != "zonenow.tab") { diff --git a/contrib/tzdata/etcetera b/contrib/tzdata/etcetera index a5ecd6de1f6e..948531c8d862 100644 --- a/contrib/tzdata/etcetera +++ b/contrib/tzdata/etcetera @@ -51,6 +51,10 @@ Link Etc/GMT GMT # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. +# There is no "Etc/Unknown" entry, as CLDR says that "Etc/Unknown" +# corresponds to an unknown or invalid time zone, and things would get +# confusing if Etc/Unknown were made valid here. + Zone Etc/GMT-14 14 - %z Zone Etc/GMT-13 13 - %z Zone Etc/GMT-12 12 - %z diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index f9063949eb83..df334fc27c1d 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1147,7 +1147,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # However, Greenland will change to Daylight Saving Time again in 2024 # and onwards. -# From a contributor who wishes to remain anonymous for now (2023-10-29): +# From Jule Dabars (2023-10-29): # https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland # with a link to that page: # https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid diff --git a/contrib/tzdata/factory b/contrib/tzdata/factory index d116a115990e..14faf52a792e 100644 --- a/contrib/tzdata/factory +++ b/contrib/tzdata/factory @@ -8,5 +8,15 @@ # time zone abbreviation "-00", indicating that the actual time zone # is unknown. +# TZ="Factory" was added to TZDB in 1989, and in 2016 its abbreviation +# was changed to "-00" from a longish English-language error message. +# Around 2010, CLDR added "Etc/Unknown" for use with TZDB, to stand +# for an unknown or invalid time zone. These two notions differ: +# TZ="Factory" is a valid timezone, so tzalloc("Factory") succeeds, whereas +# TZ="Etc/Unknown" is invalid and tzalloc("Etc/Unknown") fails. +# Also, a downstream distributor could modify Factory to be a +# default timezone suitable for the devices it manufactures, +# whereas that cannot happen for Etc/Unknown. + # Zone NAME STDOFF RULES FORMAT Zone Factory 0 - "Local time zone must be set--use tzsetup" diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index da0efc8c8566..6f861c888d75 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -60,15 +60,15 @@ # # The following line shows the last update of this file in NTP timestamp: # -#$ 3929093563 +#$ 3945196800 # # 2) Expiration date of the file given on a semi-annual basis: last June or last December # -# File expires on 28 June 2025 +# File expires on 28 December 2025 # # Expire date in NTP timestamp: # -#@ 3960057600 +#@ 3975868800 # # # LIST OF LEAP SECONDS @@ -117,4 +117,4 @@ # please see the readme file in the 'source' directory : # https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README # -#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 +#h 848434d5 570f7ea8 d79ba227 a00fc821 f608e2d4 diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index 6c715cb20b01..76f771427f25 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -69,11 +69,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2025 Jun 28 00:00:00 +#Expires 2025 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1720104763 (2024-07-04 14:52:43 UTC) -#expires 1751068800 (2025-06-28 00:00:00 UTC) +#updated 1736208000 (2025-01-07 00:00:00 UTC) +#expires 1766880000 (2025-12-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 June 2025 +# File expires on 28 December 2025 diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index 01f392e0e6a4..8d356aa0069d 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -27,9 +27,12 @@ # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# From Paul Eggert (2018-03-20): +# From Paul Eggert (2024-11-18): # Dowd's proposal left many details unresolved, such as where to draw -# lines between time zones. The key individual who made time zones +# lines between time zones. Sandford Fleming of the Canadian Pacific Railway +# argued for Dowd's proposal in 1876, and Cleveland Abbe of the American +# Meteorology Society published a report in 1879 recommending four US time +# zones based on GMT. However, the key individual who made time zones # work in the US was William Frederick Allen - railway engineer, # managing editor of the Travelers' Guide, and secretary of the # General Time Convention, a railway standardization group. Allen @@ -2631,7 +2634,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - April 30 0:00 1:00 D +Rule Mexico 1931 only - Apr 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index c8d9097aeb14..1fcf65146785 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1687,7 +1687,7 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - # and that on the first Sunday of the month of October, it is to be set # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... -Rule Para 2010 max - Oct Sun>=1 0:00 1:00 - +Rule Para 2010 2024 - Oct Sun>=1 0:00 1:00 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): @@ -1706,14 +1706,35 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ # From Carlos Raúl Perasso (2023-07-27): # http://silpy.congreso.gov.py/descarga/ley-144138 -Rule Para 2013 max - Mar Sun>=22 0:00 0 - +Rule Para 2013 2024 - Mar Sun>=22 0:00 0 - +# +# From Heitor David Pinto (2024-09-24): +# Today the Congress of Paraguay passed a bill to observe UTC-3 permanently.... +# The text of the bill says that it would enter into force on the first +# Sunday in October 2024, the same date currently scheduled to start DST.... +# https://silpy.congreso.gov.py/web/expediente/132531 +# (2024-10-14): +# The president approved the law on 11 October 2024, +# and it was officially published on 14 October 2024. +# https://www.gacetaoficial.gov.py/index/detalle_publicacion/89723 +# The text of the law says that it enters into force on the first +# Sunday in October 2024 (6 October 2024). But the constitution +# prohibits retroactive effect, and the civil code says that laws +# enter into force on the day after their publication or on the day +# that they specify, and it also says that they don't have retroactive +# effect. So I think that the time change on 6 October 2024 should +# still be considered as DST according to the previous law, and +# permanently UTC-3 from 15 October 2024 according to the new law.... +# https://www.constituteproject.org/constitution/Paraguay_2011 +# https://www.oas.org/dil/esp/codigo_civil_paraguay.pdf # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time -4:00 - %z 1972 Oct -3:00 - %z 1974 Apr - -4:00 Para %z + -4:00 Para %z 2024 Oct 15 + -3:00 - %z # Peru # diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index d3573ede0dfb..352a3d87078f 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -123,8 +123,9 @@ If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see the tzselect program in the tz code. -The Unicode Common Locale Data -Repository contains data that may be useful for other selection +Unicode's Common Locale Data +Repository (CLDR) +contains data that may be useful for other selection interfaces; it maps timezone names like Europe/Prague to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".

@@ -200,6 +201,8 @@ in decreasing order of importance:
  • A name must not be empty, or contain '//', or start or end with '/'. + Also, a name must not be 'Etc/Unknown', as + CLDR uses that string for an unknown or invalid timezone.
  • Do not use names that differ only in case. @@ -220,10 +223,18 @@ in decreasing order of importance: do not need locations, since local time is not defined there.
  • - If all the clocks in a timezone have agreed since 1970, - do not bother to include more than one timezone - even if some of the clocks disagreed before 1970. + If all clocks in a region have agreed since 1970, + give them just one name even if some of the clocks disagreed before 1970, + or reside in different countries or in notable or faraway locations. Otherwise these tables would become annoyingly large. + For example, do not create a name Indian/Crozet + as a near-duplicate or alias of Asia/Dubai + merely because they are different countries or territories, + or their clocks disagreed before 1970, or the + Crozet Islands + are notable in their own right, + or the Crozet Islands are not adjacent to other locations + that use Asia/Dubai.
  • If boundaries between regions are fluid, such as during a war or @@ -579,10 +590,10 @@ in decreasing order of importance: locations while uninhabited. The leading '-' is a flag that the UT offset is in some sense undefined; this notation is derived - from Internet + from Internet RFC 3339. (The abbreviation 'Z' that - Internet + Internet RFC 9557 uses for this concept would violate the POSIX requirement of at least three characters in an abbreviation.) @@ -1115,8 +1126,8 @@ However POSIX.1-2024, like earlier POSIX editions, has some limitations: the name of a file from which time-related information is read. The file's format is TZif, a timezone information format that contains binary data; see - Internet - RFC 8536. + Internet + RFC 9636. The daylight saving time rules to be used for a particular timezone are encoded in the TZif file; the format of the file allows US, @@ -1201,12 +1212,15 @@ The vestigial APIs are: The tm_isdst member is almost never needed and most of its uses should be discouraged in favor of the abovementioned APIs. + It was intended as an index into the tzname variable, + but as mentioned previously that usage is obsolete. Although it can still be used in arguments to mktime to disambiguate timestamps near a DST transition when the clock jumps back on platforms lacking tm_gmtoff, this - disambiguation does not work when standard time itself jumps back, - which can occur when a location changes to a time zone with a + disambiguation works only for proleptic TZ strings; + it does not work in general for geographical timezones, + such as when a location changes to a time zone with a lesser UT offset.
  • @@ -1223,8 +1237,8 @@ The vestigial APIs are: Programs that in the past used the timezone function may now examine localtime(&clock)->tm_zone (if TM_ZONE is defined) or - tzname[localtime(&clock)->tm_isdst] - (if HAVE_TZNAME is nonzero) to learn the correct time + use strftime with a %Z conversion specification + to learn the correct time zone abbreviation to use.
  • diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 699e50d4d38e..0846b7f265fa 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2024b +2025a diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index bfc0b5933044..d2be66359f3b 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -310,7 +310,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG -0930+14710 Pacific/Port_Moresby most of Papua New Guinea PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index 764215888efa..3a5a71c508d4 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -184,7 +184,7 @@ IR +3540+05126 Asia/Tehran IT,SM,VA +4154+01229 Europe/Rome JM +175805-0764736 America/Jamaica JO +3157+03556 Asia/Amman -JP +353916+1394441 Asia/Tokyo +JP,AU +353916+1394441 Asia/Tokyo Eyre Bird Observatory KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi KG +4254+07436 Asia/Bishkek KI,MH,TV,UM,WF +0125+17300 Pacific/Tarawa Gilberts, Marshalls, Wake @@ -247,7 +247,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG,AQ,FM -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas), Chuuk, Yap, Dumont d'Urville PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon @@ -294,7 +294,7 @@ RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea SA,AQ,KW,YE +2438+04643 Asia/Riyadh Syowa SB,FM -0932+16012 Pacific/Guadalcanal Pohnpei SD +1536+03232 Africa/Khartoum -SG,MY +0117+10351 Asia/Singapore peninsular Malaysia +SG,AQ,MY +0117+10351 Asia/Singapore peninsular Malaysia, Concordia SR +0550-05510 America/Paramaribo SS +0451+03137 Africa/Juba ST +0020+00644 Africa/Sao_Tome diff --git a/contrib/tzdata/zonenow.tab b/contrib/tzdata/zonenow.tab index 01f536b3ba38..d2c1e48584f8 100644 --- a/contrib/tzdata/zonenow.tab +++ b/contrib/tzdata/zonenow.tab @@ -97,9 +97,6 @@ XX +1828-06954 America/Santo_Domingo Atlantic Standard ("AST") - eastern Caribbe # -04/-03 (Chile DST) XX -3327-07040 America/Santiago most of Chile # -# -04/-03 (Paraguay DST) -XX -2516-05740 America/Asuncion Paraguay -# # -04/-03 - AST/ADT (North America DST) XX +4439-06336 America/Halifax Atlantic ("AST/ADT") - Canada; Bermuda # @@ -224,7 +221,7 @@ XX +1345+10031 Asia/Bangkok Russia; Indochina; Christmas Island XX -0610+10648 Asia/Jakarta Indonesia ("WIB") # # +08 -XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore +XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore; Concordia # # +08 - AWST XX -3157+11551 Australia/Perth Western Australia ("AWST") *** 18 LINES SKIPPED *** From nobody Mon Jan 20 00:26:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbrkD3mdtz5lvyX; Mon, 20 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbrkD2rJSz3dNB; Mon, 20 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6tqkhbKoSAj7/uJCtDyMudSuAVvg/8mDUHT+q0jbfE=; b=RS4YMwvymyholJkWYAV9ZEJQiDd/kiUXSb7Nm9PMQIs2dDQPcZevmD5b5JymigYivUvEwe nV/79zVSLEaw2zJEpNs+viW8yKMNuRmdk7Yy5nNPztWPjN37OrXiEXepbjAhm1sy88PuZh 0JdU7DokLtqZZGpolqze88fwIlOUJ0tzikfRxNieqL2OtZlK0NYICzNVfZOskx4uIAqkPL uLd7ijpZ/jTVa0Nza5mNBM3DrKyJ2P+lwtG6l4eMYvLk8tBo/UBtdIbtLEWLLT5+vtoaq4 V9kGcP6Y3CzOiiO8ra7OOGbTLGG5hf1P+BQIHF785mB3ZPXkV4ifqbQnS34Pxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6tqkhbKoSAj7/uJCtDyMudSuAVvg/8mDUHT+q0jbfE=; b=IbewTKrqsWeRrllB+NG+Zv3kPIO66ASptwhcXBTJtrdFIOnzj2Orr9M+0lIpUDns9ohwir vlmBsXqiWRIZb+qXnP181gqDGdDFtNxLelmPsxOceyd+6RBXkUBr3H3Lf/JArY50/3RaNb dnuKoAq1bOQunbFiE28PTPjg7X2mwPr664bj/xmzMt6O3InbkywPcWfifBWa6FI4XNcEzt jxQWM/MqyQS9XHfjI79suNUuiPgyjNW/wwylnVGUAhP2Ncl36k2ngvyDSQUThpAJSEg68M Dthe0UJq8/8lyddLh6FIbIzyig2ppffQc2a8gEz3MeGmu1MJFEGk8kaklDPDBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332804; a=rsa-sha256; cv=none; b=rG3YLek953EhAQzTtxo069rKEGh5mwVj545L1wm9M+Pi5f2Y/l7bpptyYSbY3/zJP3ts2N Ad59/ZPs6un8hMzwc3czwH8/SjsPeaNFmsMKQDt6uTZV80aQxE4AprDDG9rl4ckgvGM8Nm GW2+gykNPIfq75iUyPFbTObOOjogfURAmTkDBnS1+Yt9Ef8S0y/oemeGSGSPj6tMh6Rcam GYXYMBY2pALwmLg7EfxH459GNbXHoDubRK4N6Oc6GToSx2e437nWLeoz4Y68i5z+CtEse4 1taAxT6eH3ExzxlMlwMPRj9TbTmiVXy+pp33LF2EmpxJ/Gj0luvjEZV3IVIdEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbrkD2NMfz1Bcw; Mon, 20 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0QiUN018524; Mon, 20 Jan 2025 00:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0Qi4a018520; Mon, 20 Jan 2025 00:26:44 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:26:44 GMT Message-Id: <202501200026.50K0Qi4a018520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 2d6dcb4f97f8 - stable/13 - contrib/tzdata: import tzdata 2025a List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d6dcb4f97f89376189f39b700459c72fe7a2678 Auto-Submitted: auto-generated The branch stable/13 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6dcb4f97f89376189f39b700459c72fe7a2678 commit 2d6dcb4f97f89376189f39b700459c72fe7a2678 Author: Philip Paeps AuthorDate: 2025-01-17 01:33:46 +0000 Commit: Philip Paeps CommitDate: 2025-01-20 00:26:07 +0000 contrib/tzdata: import tzdata 2025a Changes: https://github.com/eggert/tz/blob/2025a/NEWS (cherry picked from commit 46226b0162ba03986b1de2c790804b37dd8e64d6) --- contrib/tzdata/Makefile | 32 +++++------ contrib/tzdata/NEWS | 84 +++++++++++++++++++++++++++-- contrib/tzdata/antarctica | 2 + contrib/tzdata/asia | 113 ++++++++++++++++++++++++++++----------- contrib/tzdata/australasia | 113 +++++++++++++++++++++------------------ contrib/tzdata/checknow.awk | 2 +- contrib/tzdata/checktab.awk | 39 +++++++++++++- contrib/tzdata/etcetera | 4 ++ contrib/tzdata/europe | 2 +- contrib/tzdata/factory | 10 ++++ contrib/tzdata/leap-seconds.list | 8 +-- contrib/tzdata/leapseconds | 8 +-- contrib/tzdata/northamerica | 9 ++-- contrib/tzdata/southamerica | 27 ++++++++-- contrib/tzdata/theory.html | 40 +++++++++----- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 2 +- contrib/tzdata/zone1970.tab | 6 +-- contrib/tzdata/zonenow.tab | 9 ++-- 19 files changed, 369 insertions(+), 143 deletions(-) diff --git a/contrib/tzdata/Makefile b/contrib/tzdata/Makefile index 0087b4596515..2130582c2deb 100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@ -137,7 +137,7 @@ TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ uint_least64_t.ck # What kind of TZif data files to generate. (TZif is the binary time -# zone data format that zic generates; see Internet RFC 8536.) +# zone data format that zic generates; see Internet RFC 9636.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -255,6 +255,7 @@ LDLIBS= # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DMKTIME_MIGHT_OVERFLOW if mktime might fail due to time_t overflow # -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ # Typically it is better to use a later standard. For example, # with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. @@ -262,7 +263,7 @@ LDLIBS= # feature (integers at least 64 bits wide) and maybe more. # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. -# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -Dssize_t=int on hosts like MS-Windows that lack ssize_t # -DSUPPORT_C89=0 if the tzcode library should not support C89 callers # Although -DSUPPORT_C89=0 might work around latent bugs in callers, # it does not conform to POSIX. @@ -285,7 +286,7 @@ LDLIBS= # This mishandles some past timestamps, as US DST rules have changed. # It also mishandles settings like TZ='EET-2EEST' for eastern Europe, # as Europe and US DST rules differ. -# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 254) # -DUNINIT_TRAP if reading uninitialized storage can cause problems # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library @@ -319,7 +320,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ $(GCC_INSTRUMENT) \ -Wall -Wextra \ -Walloc-size-larger-than=100000 -Warray-bounds=2 \ - -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ + -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wcast-qual \ + -Wdate-time \ -Wdeclaration-after-statement -Wdouble-promotion \ -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ @@ -336,7 +338,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-format-nonliteral -Wno-sign-compare + -Wno-format-nonliteral -Wno-sign-compare -Wno-type-limits # # If your system has a "GMT offset" field in its "struct tm"s # (or if you decide to add such a field in your system's "time.h" file), @@ -614,8 +616,8 @@ TZS_YEAR= 2050 TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs -TZS_DEPS= $(YDATA) asctime.c localtime.c \ - private.h tzfile.h zdump.c zic.c +TZS_DEPS= $(YDATA) localtime.c private.h \ + strftime.c tzfile.h zdump.c zic.c TZDATA_DIST = $(COMMON) $(DATA) $(MISC) # EIGHT_YARDS is just a yard short of the whole ENCHILADA. EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi @@ -855,10 +857,10 @@ tzselect: tzselect.ksh version chmod +x $@.out mv $@.out $@ -check: check_mild back.ck +check: check_mild back.ck now.ck check_mild: check_web check_zishrink \ character-set.ck white-space.ck links.ck mainguard.ck \ - name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ + name-lengths.ck slashed-abbrs.ck sorted.ck \ tables.ck ziguard.ck tzs.ck # True if UTF8_LOCALE does not work; @@ -1103,7 +1105,7 @@ set-timestamps.out: $(EIGHT_YARDS) touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ - if git diff --quiet $$file; then \ + if git diff --quiet HEAD $$file; then \ time=$$(TZ=UTC0 git log -1 \ --format='tformat:%cd' \ --date='format:%Y-%m-%dT%H:%M:%SZ' \ @@ -1354,13 +1356,13 @@ long-long.ck unsigned.ck: $(VERSION_DEPS) zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi -asctime.o: private.h tzfile.h +asctime.o: private.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.h tzdir.h -strftime.o: private.h tzfile.h -zdump.o: version.h -zic.o: private.h tzfile.h tzdir.h version.h +localtime.o: private.h tzdir.h tzfile.h +strftime.o: localtime.c private.h tzdir.h tzfile.h +zdump.o: private.h version.h +zic.o: private.h tzdir.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 83b8b8c8d39c..a5d7ea89204e 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,83 @@ News for the tz database +Release 2025a - 2025-01-15 10:47:24 -0800 + + Briefly: + Paraguay adopts permanent -03 starting spring 2024. + Improve pre-1991 data for the Philippines. + Etc/Unknown is now reserved. + + Changes to future timestamps + + Paraguay will stop changing its clocks after the spring-forward + transition on 2024-10-06, so it is now permanently at -03. + (Thanks to Heitor David Pinto and Even Scharning.) + This affects timestamps starting 2025-03-22, as well as the + obsolescent tm_isdst flags starting 2024-10-15. + + Changes to past timestamps + + Correct timestamps for the Philippines before 1900, and from 1937 + through 1990. (Thanks to P Chan for the heads-up and citations.) + This includes adjusting local mean time before 1899; fixing + transitions in September 1899, January 1937, and June 1954; adding + transitions in December 1941, November 1945, March and September + 1977, and May and July 1990; and removing incorrect transitions in + March and September 1978. + + Changes to data + + Add zone1970.tab lines for the Concordia and Eyre Bird Observatory + research stations. (Thanks to Derick Rethans and Jule Dabars.) + + Changes to code + + strftime %s now generates the correct numeric string even when the + represented number does not fit into time_t. This is better than + generating the numeric equivalent of (time_t) -1, as strftime did + in TZDB releases 96a (when %s was introduced) through 2020a and in + releases 2022b through 2024b. It is also better than failing and + returning 0, as strftime did in releases 2020b through 2022a. + + strftime now outputs an invalid conversion specifier as-is, + instead of eliding the leading '%', which confused debugging. + + An invalid TZ now generates the time zone abbreviation "-00", not + "UTC", to help the user see that an error has occurred. (Thanks + to Arthur David Olson for suggesting a "wrong result".) + + mktime and timeoff no longer incorrectly fail merely because a + struct tm component near INT_MIN or INT_MAX overflows when a + lower-order component carries into it. + + TZNAME_MAXIMUM, the maximum number of bytes in a proleptic TZ + string's time zone abbreviation, now defaults to 254 not 255. + This helps reduce the size of internal state from 25480 to 21384 + on common platforms. This change should not be a problem, as + nobody uses such long "abbreviations" and the longstanding tzcode + maximum was 16 until release 2023a. For those who prefer no + arbitrary limits, you can now specify TZNAME_MAXIMUM values up to + PTRDIFF_MAX, a limit forced by C anyway; formerly tzcode silently + misbehaved unless TZNAME_MAXIMUM was less than INT_MAX. + + tzset and related functions no longer leak a file descriptor if + another thread forks or execs at about the same time and if the + platform has O_CLOFORK and O_CLOEXEC respectively. Also, the + functions no longer let a TZif file become a controlling terminal. + + 'zdump -' now reads TZif data from /dev/stdin. + (From a question by Arthur David Olson.) + + Changes to documentation + + The name Etc/Unknown is now reserved: it will not be used by TZDB. + This is for compatibility with CLDR, which uses the string + "Etc/Unknown" for an unknown or invalid timezone. (Thanks to + Justin Grant, Mark Davis, and Guy Harris.) + + Cite Internet RFC 9636, which obsoletes RFC 8536 for TZif format. + + Release 2024b - 2024-09-04 12:27:47 -0700 Briefly: @@ -116,7 +194,7 @@ Release 2024b - 2024-09-04 12:27:47 -0700 Changes to commentary Commentary about historical transitions in Portugal and her former - colonies has been expanded with links to many relevant legislation. + colonies has been expanded with links to relevant legislation. (Thanks to Tim Parenti.) @@ -204,10 +282,10 @@ Release 2023d - 2023-12-21 20:02:24 -0800 changing its time zone from -01/+00 to -02/-01 at the same moment as the spring-forward transition. Its clocks will therefore not spring forward as previously scheduled. The time zone change - reverts to its common practice before 1981. + reverts to its common practice before 1981. (Thanks to Jule Dabars.) Fix predictions for DST transitions in Palestine in 2072-2075, - correcting a typo introduced in 2023a. + correcting a typo introduced in 2023a. (Thanks to Jule Dabars.) Changes to past and future timestamps diff --git a/contrib/tzdata/antarctica b/contrib/tzdata/antarctica index 8d5d6cd1cdd0..2e90a5e09d17 100644 --- a/contrib/tzdata/antarctica +++ b/contrib/tzdata/antarctica @@ -174,6 +174,8 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # France & Italy - year-round base # Concordia, -750600+1232000, since 2005 +# https://en.wikipedia.org/wiki/Concordia_Station +# Can use Asia/Singapore, which it has agreed with since inception. # Germany - year-round base # Neumayer III, -704080-0081602, since 2009 diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia index a2480b021225..d4eb058053ed 100644 --- a/contrib/tzdata/asia +++ b/contrib/tzdata/asia @@ -3665,21 +3665,70 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # be immediately followed by 1845-01-01; see R.H. van Gent's # History of the International Date Line # https://webspace.science.uu.nl/~gent0113/idl/idl_philippines.htm -# The rest of the data entries are from Shanks & Pottenger. - -# From Jesper Nørgaard Welen (2006-04-26): -# ... claims that Philippines had DST last time in 1990: -# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/ -# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires, -# but no details] - -# From Paul Eggert (2014-08-14): -# The following source says DST may be instituted November-January and again -# March-June, but this is not definite. It also says DST was last proclaimed -# during the Ramos administration (1992-1998); but again, no details. -# Carcamo D. PNoy urged to declare use of daylight saving time. -# Philippine Star 2014-08-05 -# http://www.philstar.com/headlines/2014/08/05/1354152/pnoy-urged-declare-use-daylight-saving-time + +# From P Chan (2021-05-10): +# Here's a fairly comprehensive article in Japanese: +# https://wiki.suikawiki.org/n/Philippine%20Time +# (2021-05-16): +# According to the references listed in the article, +# the periods that the Philippines (Manila) observed DST or used +9 are: +# +# 1936-10-31 24:00 to 1937-01-15 24:00 +# (Proclamation No. 104, Proclamation No. 126) +# 1941-12-15 24:00 to 1945-11-30 24:00 +# (Proclamation No. 789, Proclamation No. 20) +# 1954-04-11 24:00 to 1954-06-04 24:00 +# (Proclamation No. 13, Proclamation No. 33) +# 1977-03-27 24:00 to 1977-09-21 24:00 +# (Proclamation No. 1629, Proclamation No. 1641) +# 1990-05-21 00:00 to 1990-07-28 24:00 +# (National Emergency Memorandum Order No. 17, Executive Order No. 415) +# +# Proclamation No. 104 ... October 30, 1936 +# https://www.officialgazette.gov.ph/1936/10/30/proclamation-no-104-s-1936/ +# Proclamation No. 126 ... January 15, 1937 +# https://www.officialgazette.gov.ph/1937/01/15/proclamation-no-126-s-1937/ +# Proclamation No. 789 ... December 13, 1941 +# https://www.officialgazette.gov.ph/1941/12/13/proclamation-no-789-s-1941/ +# Proclamation No. 20 ... November 11, 1945 +# https://www.officialgazette.gov.ph/1945/11/11/proclamation-no-20-s-1945/ +# Proclamation No. 13 ... April 6, 1954 +# https://www.officialgazette.gov.ph/1954/04/06/proclamation-no-13-s-1954/ +# Proclamation No. 33 ... June 3, 1954 +# https://www.officialgazette.gov.ph/1954/06/03/proclamation-no-33-s-1954/ +# Proclamation No. 1629 ... March 25, 1977 +# https://www.officialgazette.gov.ph/1977/03/25/proclamation-no-1629-s-1977/ +# Proclamation No. 1641 ...May 26, 1977 +# https://www.officialgazette.gov.ph/1977/05/26/proclamation-no-1641-s-1977/ +# National Emergency Memorandum Order No. 17 ... May 2, 1990 +# https://www.officialgazette.gov.ph/1990/05/02/national-emergency-memorandum-order-no-17-s-1990/ +# Executive Order No. 415 ... July 20, 1990 +# https://www.officialgazette.gov.ph/1990/07/20/executive-order-no-415-s-1990/ +# +# During WWII, Proclamation No. 789 fixed two periods of DST. The first period +# was set to continue only until January 31, 1942. But Manila was occupied by +# the Japanese earlier in the month.... +# +# For the date of the adoption of standard time, Shank[s] gives 1899-05-11. +# The article is not able to state the basis of that. I guess it was based on +# a US War Department Circular issued on that date. +# https://books.google.com/books?id=JZ1PAAAAYAAJ&pg=RA3-PA8 +# +# However, according to other sources, standard time was adopted on +# 1899-09-06. Also, the LMT was GMT+8:03:52 +# https://books.google.com/books?id=MOYIAQAAIAAJ&pg=PA521 +# https://books.google.com/books?id=lSnqqatpYikC&pg=PA21 +# +# From Paul Eggert (2024-09-05): +# The penultimate URL in P Chan's email refers to page 521 of +# Selga M, The Time Service in the Philippines. +# Proc Pan-Pacific Science Congress. Vol. 1 (1923), 519-532. +# It says, "The change from the meridian 120° 58' 04" to the 120th implied a +# change of 3 min. 52s.26 in time; consequently on 6th September, 1899, +# Manila Observatory gave the noon signal 3 min. 52s.26 later than before". +# +# Wikipedia says the US declared Manila liberated on March 4, 1945; +# this doesn't affect clocks, just our time zone abbreviation and DST flag. # From Paul Goyette (2018-06-15) with URLs updated by Guy Harris (2024-02-15): # In the Philippines, there is a national law, Republic Act No. 10535 @@ -3697,24 +3746,26 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# From P Chan (2021-05-10): -# Here's a fairly comprehensive article in Japanese: -# https://wiki.suikawiki.org/n/Philippine%20Time -# From Paul Eggert (2021-05-10): -# The info in the Japanese table has not been absorbed (yet) below. - # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Phil 1936 only - Nov 1 0:00 1:00 D -Rule Phil 1937 only - Feb 1 0:00 0 S -Rule Phil 1954 only - Apr 12 0:00 1:00 D -Rule Phil 1954 only - Jul 1 0:00 0 S -Rule Phil 1978 only - Mar 22 0:00 1:00 D -Rule Phil 1978 only - Sep 21 0:00 0 S +Rule Phil 1936 only - Oct 31 24:00 1:00 D +Rule Phil 1937 only - Jan 15 24:00 0 S +Rule Phil 1941 only - Dec 15 24:00 1:00 D +# The following three rules were canceled by Japan: +#Rule Phil 1942 only - Jan 31 24:00 0 S +#Rule Phil 1942 only - Mar 1 0:00 1:00 D +#Rule Phil 1942 only - Jun 30 24:00 0 S +Rule Phil 1945 only - Nov 30 24:00 0 S +Rule Phil 1954 only - Apr 11 24:00 1:00 D +Rule Phil 1954 only - Jun 4 24:00 0 S +Rule Phil 1977 only - Mar 27 24:00 1:00 D +Rule Phil 1977 only - Sep 21 24:00 0 S +Rule Phil 1990 only - May 21 0:00 1:00 D +Rule Phil 1990 only - Jul 28 24:00 0 S # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31 - 8:04:00 - LMT 1899 May 11 - 8:00 Phil P%sT 1942 May - 9:00 - JST 1944 Nov +Zone Asia/Manila -15:56:08 - LMT 1844 Dec 31 + 8:03:52 - LMT 1899 Sep 6 4:00u + 8:00 Phil P%sT 1942 Feb 11 24:00 + 9:00 - JST 1945 Mar 4 8:00 Phil P%sT # Bahrain diff --git a/contrib/tzdata/australasia b/contrib/tzdata/australasia index 359f9c1f1e10..405944536cd3 100644 --- a/contrib/tzdata/australasia +++ b/contrib/tzdata/australasia @@ -1239,10 +1239,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # The 1992 ending date used in the rules is a best guess; # it matches what was used in the past. -# The Australian Bureau of Meteorology FAQ -# http://www.bom.gov.au/faq/faqgen.htm -# (1999-09-27) writes that Giles Meteorological Station uses -# South Australian time even though it's located in Western Australia. +# From Christopher Hunt (2006-11-21), after an advance warning +# from Jesper Nørgaard Welen (2006-11-01): +# WA are trialing DST for three years. +# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf # From Paul Eggert (2018-04-01): # The Guardian Express of Perth, Australia reported today that the @@ -1254,54 +1254,10 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # https://www.communitynews.com.au/guardian-express/news/exclusive-daylight-savings-coming-wa-summer-2018/ # [The article ends with "Today's date is April 1."] -# Queensland - -# From Paul Eggert (2018-02-26): -# I lack access to the following source for Queensland DST: -# Pearce C. History of daylight saving time in Queensland. -# Queensland Hist J. 2017 Aug;23(6):389-403 -# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS - -# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): -# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] -# # [ Dec 1990 ] -# ... -# Zone Australia/Queensland 10:00 AQ %sST -# ... -# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D -# Rule AQ 1972 only - Feb lastSun 3:00 0 E -# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D -# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E - -# From Bradley White (1989-12-24): -# "Australia/Queensland" now observes daylight time (i.e. from -# October 1989). - -# From Bradley White (1991-03-04): -# A recent excerpt from an Australian newspaper... -# ...Queensland...[has] agreed to end daylight saving -# at 3am tomorrow (March 3)... - -# From John Mackin (1991-03-06): -# I can certainly confirm for my part that Daylight Saving in NSW did in fact -# end on Sunday, 3 March. I don't know at what hour, though. (It surprised -# me.) - -# From Bradley White (1992-03-08): -# ...there was recently a referendum in Queensland which resulted -# in the experimental daylight saving system being abandoned. So, ... -# ... -# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D -# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S -# ... - -# From Arthur David Olson (1992-03-08): -# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. - -# From Christopher Hunt (2006-11-21), after an advance warning -# from Jesper Nørgaard Welen (2006-11-01): -# WA are trialing DST for three years. -# http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf +# The Australian Bureau of Meteorology FAQ +# http://www.bom.gov.au/faq/faqgen.htm +# (1999-09-27) writes that Giles Meteorological Station uses +# South Australian time even though it's located in Western Australia. # From Rives McDow (2002-04-09): # The most interesting region I have found consists of three towns on the @@ -1359,6 +1315,59 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila # For lack of better info, assume the tradition dates back to the # introduction of standard time in 1895. +# From Stuart Bishop (2024-11-12): +# An article discussing the in-use but technically unofficial timezones +# in the Western Australian portion of the Nullarbor Plain. +# https://www.abc.net.au/news/2024-11-22/outback-wa-properties-strange-time-zones/104542494 +# From Paul Eggert (2024-11-12): +# As the article says, the Eyre Bird Observatory and nearby sheep stations +# can use Tokyo time. Other possibilities include Asia/Chita, Asia/Seoul, +# and Asia/Jayapura. + +# Queensland + +# From Paul Eggert (2018-02-26): +# I lack access to the following source for Queensland DST: +# Pearce C. History of daylight saving time in Queensland. +# Queensland Hist J. 2017 Aug;23(6):389-403 +# https://search.informit.com.au/documentSummary;dn=994682348436426;res=IELHSS + +# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06): +# # The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ] +# # [ Dec 1990 ] +# ... +# Zone Australia/Queensland 10:00 AQ %sST +# ... +# Rule AQ 1971 only - Oct lastSun 2:00 1:00 D +# Rule AQ 1972 only - Feb lastSun 3:00 0 E +# Rule AQ 1989 max - Oct lastSun 2:00 1:00 D +# Rule AQ 1990 max - Mar Sun>=1 3:00 0 E + +# From Bradley White (1989-12-24): +# "Australia/Queensland" now observes daylight time (i.e. from +# October 1989). + +# From Bradley White (1991-03-04): +# A recent excerpt from an Australian newspaper... +# ...Queensland...[has] agreed to end daylight saving +# at 3am tomorrow (March 3)... + +# From John Mackin (1991-03-06): +# I can certainly confirm for my part that Daylight Saving in NSW did in fact +# end on Sunday, 3 March. I don't know at what hour, though. (It surprised +# me.) + +# From Bradley White (1992-03-08): +# ...there was recently a referendum in Queensland which resulted +# in the experimental daylight saving system being abandoned. So, ... +# ... +# Rule QLD 1989 1991 - Oct lastSun 2:00 1:00 D +# Rule QLD 1990 1992 - Mar Sun>=1 3:00 0 S +# ... + +# From Arthur David Olson (1992-03-08): +# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes. + # southeast Australia # diff --git a/contrib/tzdata/checknow.awk b/contrib/tzdata/checknow.awk index 8b7881d2e27f..450490ee3768 100644 --- a/contrib/tzdata/checknow.awk +++ b/contrib/tzdata/checknow.awk @@ -44,7 +44,7 @@ BEGIN { END { for (zone in zone_data) { data = zone_data[zone] - if (!zonenow[data]) { + if (data && !zonenow[data]) { printf "Zone table should have one of:%s\n", zones[data] zonenow[data] = zone # This suppresses duplicate diagnostics. status = 1 diff --git a/contrib/tzdata/checktab.awk b/contrib/tzdata/checktab.awk index 9a26e4655ddb..5fa60556be13 100644 --- a/contrib/tzdata/checktab.awk +++ b/contrib/tzdata/checktab.awk @@ -9,6 +9,19 @@ BEGIN { if (!zone_table) zone_table = "zone1970.tab" if (!want_warnings) want_warnings = -1 + monthabbr["Jan"] = 1 + monthabbr["Feb"] = 1 + monthabbr["Mar"] = 1 + monthabbr["Apr"] = 1 + monthabbr["May"] = 1 + monthabbr["Jun"] = 1 + monthabbr["Jul"] = 1 + monthabbr["Aug"] = 1 + monthabbr["Sep"] = 1 + monthabbr["Oct"] = 1 + monthabbr["Nov"] = 1 + monthabbr["Dec"] = 1 + while (getline >"/dev/stderr" + status = 1 + } } else { + stdoff = $1 ruleUsed[$2] = 1 if ($3 ~ /%/) rulePercentUsed[$2] = 1 } + + if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) { + printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \ + >>"/dev/stderr" + status = 1 + } + if (tz && tz ~ /\// && tz !~ /^Etc\//) { if (!tztab[tz] && FILENAME != "backward" \ && zone_table != "zonenow.tab") { diff --git a/contrib/tzdata/etcetera b/contrib/tzdata/etcetera index a5ecd6de1f6e..948531c8d862 100644 --- a/contrib/tzdata/etcetera +++ b/contrib/tzdata/etcetera @@ -51,6 +51,10 @@ Link Etc/GMT GMT # so we moved the names into the Etc subdirectory. # Also, the time zone abbreviations are now compatible with %z. +# There is no "Etc/Unknown" entry, as CLDR says that "Etc/Unknown" +# corresponds to an unknown or invalid time zone, and things would get +# confusing if Etc/Unknown were made valid here. + Zone Etc/GMT-14 14 - %z Zone Etc/GMT-13 13 - %z Zone Etc/GMT-12 12 - %z diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe index f9063949eb83..df334fc27c1d 100644 --- a/contrib/tzdata/europe +++ b/contrib/tzdata/europe @@ -1147,7 +1147,7 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn # However, Greenland will change to Daylight Saving Time again in 2024 # and onwards. -# From a contributor who wishes to remain anonymous for now (2023-10-29): +# From Jule Dabars (2023-10-29): # https://www.dr.dk/nyheder/seneste/i-nat-skal-uret-stilles-en-time-tilbage-men-foerste-gang-sker-det-ikke-i-groenland # with a link to that page: # https://naalakkersuisut.gl/Nyheder/2023/10/2710_sommertid diff --git a/contrib/tzdata/factory b/contrib/tzdata/factory index d116a115990e..14faf52a792e 100644 --- a/contrib/tzdata/factory +++ b/contrib/tzdata/factory @@ -8,5 +8,15 @@ # time zone abbreviation "-00", indicating that the actual time zone # is unknown. +# TZ="Factory" was added to TZDB in 1989, and in 2016 its abbreviation +# was changed to "-00" from a longish English-language error message. +# Around 2010, CLDR added "Etc/Unknown" for use with TZDB, to stand +# for an unknown or invalid time zone. These two notions differ: +# TZ="Factory" is a valid timezone, so tzalloc("Factory") succeeds, whereas +# TZ="Etc/Unknown" is invalid and tzalloc("Etc/Unknown") fails. +# Also, a downstream distributor could modify Factory to be a +# default timezone suitable for the devices it manufactures, +# whereas that cannot happen for Etc/Unknown. + # Zone NAME STDOFF RULES FORMAT Zone Factory 0 - "Local time zone must be set--use tzsetup" diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index da0efc8c8566..6f861c888d75 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -60,15 +60,15 @@ # # The following line shows the last update of this file in NTP timestamp: # -#$ 3929093563 +#$ 3945196800 # # 2) Expiration date of the file given on a semi-annual basis: last June or last December # -# File expires on 28 June 2025 +# File expires on 28 December 2025 # # Expire date in NTP timestamp: # -#@ 3960057600 +#@ 3975868800 # # # LIST OF LEAP SECONDS @@ -117,4 +117,4 @@ # please see the readme file in the 'source' directory : # https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README # -#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 +#h 848434d5 570f7ea8 d79ba227 a00fc821 f608e2d4 diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index 6c715cb20b01..76f771427f25 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -69,11 +69,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2025 Jun 28 00:00:00 +#Expires 2025 Dec 28 00:00:00 # POSIX timestamps for the data in this file: -#updated 1720104763 (2024-07-04 14:52:43 UTC) -#expires 1751068800 (2025-06-28 00:00:00 UTC) +#updated 1736208000 (2025-01-07 00:00:00 UTC) +#expires 1766880000 (2025-12-28 00:00:00 UTC) # Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) -# File expires on 28 June 2025 +# File expires on 28 December 2025 diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica index 01f392e0e6a4..8d356aa0069d 100644 --- a/contrib/tzdata/northamerica +++ b/contrib/tzdata/northamerica @@ -27,9 +27,12 @@ # in New York City (1869-10). His 1870 proposal was based on Washington, DC, # but in 1872-05 he moved the proposed origin to Greenwich. -# From Paul Eggert (2018-03-20): +# From Paul Eggert (2024-11-18): # Dowd's proposal left many details unresolved, such as where to draw -# lines between time zones. The key individual who made time zones +# lines between time zones. Sandford Fleming of the Canadian Pacific Railway +# argued for Dowd's proposal in 1876, and Cleveland Abbe of the American +# Meteorology Society published a report in 1879 recommending four US time +# zones based on GMT. However, the key individual who made time zones # work in the US was William Frederick Allen - railway engineer, # managing editor of the Travelers' Guide, and secretary of the # General Time Convention, a railway standardization group. Allen @@ -2631,7 +2634,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/ # Rule NAME FROM TO - IN ON AT SAVE LETTER/S -Rule Mexico 1931 only - April 30 0:00 1:00 D +Rule Mexico 1931 only - Apr 30 0:00 1:00 D Rule Mexico 1931 only - Oct 1 0:00 0 S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica index c8d9097aeb14..1fcf65146785 100644 --- a/contrib/tzdata/southamerica +++ b/contrib/tzdata/southamerica @@ -1687,7 +1687,7 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 - # and that on the first Sunday of the month of October, it is to be set # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... -Rule Para 2010 max - Oct Sun>=1 0:00 1:00 - +Rule Para 2010 2024 - Oct Sun>=1 0:00 1:00 - Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): @@ -1706,14 +1706,35 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # https://www.abc.com.py/politica/2023/07/12/promulgacion-el-cambio-de-hora-sera-por-ley/ # From Carlos Raúl Perasso (2023-07-27): # http://silpy.congreso.gov.py/descarga/ley-144138 -Rule Para 2013 max - Mar Sun>=22 0:00 0 - +Rule Para 2013 2024 - Mar Sun>=22 0:00 0 - +# +# From Heitor David Pinto (2024-09-24): +# Today the Congress of Paraguay passed a bill to observe UTC-3 permanently.... +# The text of the bill says that it would enter into force on the first +# Sunday in October 2024, the same date currently scheduled to start DST.... +# https://silpy.congreso.gov.py/web/expediente/132531 +# (2024-10-14): +# The president approved the law on 11 October 2024, +# and it was officially published on 14 October 2024. +# https://www.gacetaoficial.gov.py/index/detalle_publicacion/89723 +# The text of the law says that it enters into force on the first +# Sunday in October 2024 (6 October 2024). But the constitution +# prohibits retroactive effect, and the civil code says that laws +# enter into force on the day after their publication or on the day +# that they specify, and it also says that they don't have retroactive +# effect. So I think that the time change on 6 October 2024 should +# still be considered as DST according to the previous law, and +# permanently UTC-3 from 15 October 2024 according to the new law.... +# https://www.constituteproject.org/constitution/Paraguay_2011 +# https://www.oas.org/dil/esp/codigo_civil_paraguay.pdf # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 -3:50:40 - AMT 1931 Oct 10 # Asunción Mean Time -4:00 - %z 1972 Oct -3:00 - %z 1974 Apr - -4:00 Para %z + -4:00 Para %z 2024 Oct 15 + -3:00 - %z # Peru # diff --git a/contrib/tzdata/theory.html b/contrib/tzdata/theory.html index d3573ede0dfb..352a3d87078f 100644 --- a/contrib/tzdata/theory.html +++ b/contrib/tzdata/theory.html @@ -123,8 +123,9 @@ If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see the tzselect program in the tz code. -The Unicode Common Locale Data -Repository contains data that may be useful for other selection +Unicode's Common Locale Data +Repository (CLDR) +contains data that may be useful for other selection interfaces; it maps timezone names like Europe/Prague to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".

    @@ -200,6 +201,8 @@ in decreasing order of importance:
  • A name must not be empty, or contain '//', or start or end with '/'. + Also, a name must not be 'Etc/Unknown', as + CLDR uses that string for an unknown or invalid timezone.
  • Do not use names that differ only in case. @@ -220,10 +223,18 @@ in decreasing order of importance: do not need locations, since local time is not defined there.
  • - If all the clocks in a timezone have agreed since 1970, - do not bother to include more than one timezone - even if some of the clocks disagreed before 1970. + If all clocks in a region have agreed since 1970, + give them just one name even if some of the clocks disagreed before 1970, + or reside in different countries or in notable or faraway locations. Otherwise these tables would become annoyingly large. + For example, do not create a name Indian/Crozet + as a near-duplicate or alias of Asia/Dubai + merely because they are different countries or territories, + or their clocks disagreed before 1970, or the + Crozet Islands + are notable in their own right, + or the Crozet Islands are not adjacent to other locations + that use Asia/Dubai.
  • If boundaries between regions are fluid, such as during a war or @@ -579,10 +590,10 @@ in decreasing order of importance: locations while uninhabited. The leading '-' is a flag that the UT offset is in some sense undefined; this notation is derived - from Internet + from Internet RFC 3339. (The abbreviation 'Z' that - Internet + Internet RFC 9557 uses for this concept would violate the POSIX requirement of at least three characters in an abbreviation.) @@ -1115,8 +1126,8 @@ However POSIX.1-2024, like earlier POSIX editions, has some limitations: the name of a file from which time-related information is read. The file's format is TZif, a timezone information format that contains binary data; see - Internet - RFC 8536. + Internet + RFC 9636. The daylight saving time rules to be used for a particular timezone are encoded in the TZif file; the format of the file allows US, @@ -1201,12 +1212,15 @@ The vestigial APIs are: The tm_isdst member is almost never needed and most of its uses should be discouraged in favor of the abovementioned APIs. + It was intended as an index into the tzname variable, + but as mentioned previously that usage is obsolete. Although it can still be used in arguments to mktime to disambiguate timestamps near a DST transition when the clock jumps back on platforms lacking tm_gmtoff, this - disambiguation does not work when standard time itself jumps back, - which can occur when a location changes to a time zone with a + disambiguation works only for proleptic TZ strings; + it does not work in general for geographical timezones, + such as when a location changes to a time zone with a lesser UT offset.
  • @@ -1223,8 +1237,8 @@ The vestigial APIs are: Programs that in the past used the timezone function may now examine localtime(&clock)->tm_zone (if TM_ZONE is defined) or - tzname[localtime(&clock)->tm_isdst] - (if HAVE_TZNAME is nonzero) to learn the correct time + use strftime with a %Z conversion specification + to learn the correct time zone abbreviation to use.
  • diff --git a/contrib/tzdata/version b/contrib/tzdata/version index 699e50d4d38e..0846b7f265fa 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2024b +2025a diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab index bfc0b5933044..d2be66359f3b 100644 --- a/contrib/tzdata/zone.tab +++ b/contrib/tzdata/zone.tab @@ -310,7 +310,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG -0930+14710 Pacific/Port_Moresby most of Papua New Guinea PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon diff --git a/contrib/tzdata/zone1970.tab b/contrib/tzdata/zone1970.tab index 764215888efa..3a5a71c508d4 100644 --- a/contrib/tzdata/zone1970.tab +++ b/contrib/tzdata/zone1970.tab @@ -184,7 +184,7 @@ IR +3540+05126 Asia/Tehran IT,SM,VA +4154+01229 Europe/Rome JM +175805-0764736 America/Jamaica JO +3157+03556 Asia/Amman -JP +353916+1394441 Asia/Tokyo +JP,AU +353916+1394441 Asia/Tokyo Eyre Bird Observatory KE,DJ,ER,ET,KM,MG,SO,TZ,UG,YT -0117+03649 Africa/Nairobi KG +4254+07436 Asia/Bishkek KI,MH,TV,UM,WF +0125+17300 Pacific/Tarawa Gilberts, Marshalls, Wake @@ -247,7 +247,7 @@ PF -0900-13930 Pacific/Marquesas Marquesas Islands PF -2308-13457 Pacific/Gambier Gambier Islands PG,AQ,FM -0930+14710 Pacific/Port_Moresby Papua New Guinea (most areas), Chuuk, Yap, Dumont d'Urville PG -0613+15534 Pacific/Bougainville Bougainville -PH +1435+12100 Asia/Manila +PH +143512+1205804 Asia/Manila PK +2452+06703 Asia/Karachi PL +5215+02100 Europe/Warsaw PM +4703-05620 America/Miquelon @@ -294,7 +294,7 @@ RU +6445+17729 Asia/Anadyr MSK+09 - Bering Sea SA,AQ,KW,YE +2438+04643 Asia/Riyadh Syowa SB,FM -0932+16012 Pacific/Guadalcanal Pohnpei SD +1536+03232 Africa/Khartoum -SG,MY +0117+10351 Asia/Singapore peninsular Malaysia +SG,AQ,MY +0117+10351 Asia/Singapore peninsular Malaysia, Concordia SR +0550-05510 America/Paramaribo SS +0451+03137 Africa/Juba ST +0020+00644 Africa/Sao_Tome diff --git a/contrib/tzdata/zonenow.tab b/contrib/tzdata/zonenow.tab index 01f536b3ba38..d2c1e48584f8 100644 --- a/contrib/tzdata/zonenow.tab +++ b/contrib/tzdata/zonenow.tab @@ -97,9 +97,6 @@ XX +1828-06954 America/Santo_Domingo Atlantic Standard ("AST") - eastern Caribbe # -04/-03 (Chile DST) XX -3327-07040 America/Santiago most of Chile # -# -04/-03 (Paraguay DST) -XX -2516-05740 America/Asuncion Paraguay -# # -04/-03 - AST/ADT (North America DST) XX +4439-06336 America/Halifax Atlantic ("AST/ADT") - Canada; Bermuda # @@ -224,7 +221,7 @@ XX +1345+10031 Asia/Bangkok Russia; Indochina; Christmas Island XX -0610+10648 Asia/Jakarta Indonesia ("WIB") # # +08 -XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore +XX +0117+10351 Asia/Singapore Russia; Brunei; Malaysia; Singapore; Concordia # # +08 - AWST XX -3157+11551 Australia/Perth Western Australia ("AWST") *** 18 LINES SKIPPED *** From nobody Mon Jan 20 00:27:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybrlf3wYwz5lw9V; Mon, 20 Jan 2025 00:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlf3GRzz3djM; Mon, 20 Jan 2025 00:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoyQEvpCyRxopGiTiXBfaho2IpAhqFWiWZEcCKgD2YY=; b=YdvW+tEAxvpnBpYT/Y2Ou2xpldCchun34R9pfSk3xLTPBPNWnD+L1iTEd/xzC761QZTtn/ CTNkYa86fWIkJ4TNX9nU7HV1mED4IngC+3QhCsG340fKwUYCMJ8JEOs82TESEoDaw4NKvN zZFr+cxZikV5QSJPvWcS1wkAjUWX1MTAIaqLTqqxEKlufYfmEHjkqXWT8SWuKiTj2IHL6n 66ziEQAV/urnBJwfOhhbFpJIXJcxAK52fEorGkGAX0YMUX6CE6BKc4UNKOu7QJgXuSvnaO 8wu4GR59Dd+WT/3A6DdC0+6jyQfOYHnhETZpCO7Ii04Na3a2u4H3SJ2EWsak3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoyQEvpCyRxopGiTiXBfaho2IpAhqFWiWZEcCKgD2YY=; b=JnbhOAiW8NjwTM+D5McXqLk7jgOMAT+IoBG5CiAwqWShgdryVVSdwVhzEWvGjBVUzMhXJB lmFuQCpaOxS5sdn3wrp5lT2/CRqm6wHPwoWytk5mvAVbYxRBd9MYPG4q/Sb00+HI7f5Vb9 9KXwzI2jPW6VNvg62C+UByYXNC81MJAAdQl2d2xpRCBxMn8KJx4oz81TaYu5lqOpHHxh1F UJxObjTdFuPbqNtQtY+uY9wOGr7CRkpzkXigJOe1wD2g3dttx51+f3LC4TH9arf1aJ2OTO 66NAtpBf/RbDOifboOdur/cw26J5pPXosAA7fTV9FbaW2jyODHDM2V6nQzKzIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332878; a=rsa-sha256; cv=none; b=MrW/FgoHmjmnIydq7QYS/0rLHpv+4LvKns33cIElCtXF+zf8BEa1dCyRhp4L7Rv4aRUniA RCHrHFshagHAJHuQjJviD4UWbW0T3BHXRFMySa/bxr9gmomndpW/N/PGGCZSWBvqL5CTO1 LyVXsOsn3zCG+2QNitfDcUY9wihZ20m7sRdek4JKBO7nPBTlCV0wdbov+DcV4jRcojD/5G 61RfbWfirYTKiqaJ9SolCldgZCphErpjFN44RcXfJwRgRdH5e81F0tASNFvtI9sHM4K4Tx ypD9QMN6QIokckerx6hWapYPpbfdRbjarzY+jYEfPl6ubpiF6Ln3Dbn3UZa5uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlf2qMTz1Bpy; Mon, 20 Jan 2025 00:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0Rwot019006; Mon, 20 Jan 2025 00:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0RwdY019003; Mon, 20 Jan 2025 00:27:58 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:27:58 GMT Message-Id: <202501200027.50K0RwdY019003@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: 8373644ee2c8 - stable/14 - unix: Be consistent about error handling for unconnected sockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 8373644ee2c848bab47d87d24b31d673e6515bce Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8373644ee2c848bab47d87d24b31d673e6515bce commit 8373644ee2c848bab47d87d24b31d673e6515bce Author: Mark Johnston AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:27 +0000 unix: Be consistent about error handling for unconnected sockets SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment here. PR: 176420 MFC after: 2 weeks (cherry picked from commit 1c933f464fdbb630f9663751f04c29cdcda38902) --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 78469adcd84d..80ac5cc0b775 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1779,7 +1779,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt) if (unp->unp_flags & UNP_HAVEPC) xu = unp->unp_peercred; else { - if (so->so_type == SOCK_STREAM) + if (so->so_proto->pr_flags & PR_CONNREQUIRED) error = ENOTCONN; else error = EINVAL; From nobody Mon Jan 20 00:27:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybrlg6mXJz5jxYW; Mon, 20 Jan 2025 00:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlg4NNMz3dlQ; Mon, 20 Jan 2025 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+S/BGzCn3b2P9TPqXu3bx9KGJ7xFKZRAOV2DXZJIv4s=; b=W9V7AC3M7485aQc9w6j22c/MljLGupXUOXjNo3CuqxuI0qmuour9X2y614X+ohToUtONxm 7h7oAq8dEa8+QiNK2a++McQO9DguCAg55L4rwLsG/NIy9ZZX4YIC8d4ksfv1Ah1z24VClV dpukCsZW3MWzBYsbiT22A/mkyurs7jujW1H76N3UcFUQlVx8NU3r/oR13j3lDNvrEAT623 cKUhvDh6tjGzLlqFcWCkrhB6dMvbGgSUOZWOdvg44PH/d7VFXAO7H2jiujQUmGqdfz/rZ3 j9ZlbI79LkD0wvQ1nLlKlwc1we+WGpj+hBNWmyUGeg/hly6FFSYqfekX+ir7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+S/BGzCn3b2P9TPqXu3bx9KGJ7xFKZRAOV2DXZJIv4s=; b=O/ziKlV3VfE3dsSh3S0zj9hlcrR6Ib6pUKjlJFPypQFxTYrPiqFdTuDzQaU6BV3DfuKCyq vgJ5wuL6GRd3LLkpNRSAMe9X1HL3uBg7BvA4bQWZ/XicchXLvIL91AR0NkdDU8UZ0IqtXw 9DZywxn/3+2xrrNyJy8q4g/NkiYKAzTqNY28F38UGU6rQl80k3zc/iPyKjo95GSZY451js fdqgSQB78arpHrsIAhQVvO58GRSitSF+X3uLNFvaBDHe1d64a225KxqkicBaEIf/tv6zTs tmchbm7Ay/8LDHe1t0W4QCx1b0GgyXpzAIqpir5V8TwJ0gfoWeKFQaOeWfqcGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332879; a=rsa-sha256; cv=none; b=PGAARJEHJVcUgntmByt/30tqqma8OERiYNQ27m+IBzn+oxsizfYEYAyzfuCJIIUpQjY3oR BJY1c+5jjbKIiyMm17fy7dx2qhZhdxAn6OYHi1FxwlUfD1BNfyIRFCKYtLhhZpjzTFUVU7 dw+KIplvElntQ77y6o6VToVx6cH/5FcHEMs11HRVRs0UjKgyT0iH854ujduPEph76xWKdi DjtKHyEZYVQP//HKQVq5/U2uPgQTTACNYwxnEGGrpm4VP/ifQzVjnakAE5T1f+aaoE5Vz3 mcG3BifOZjcJGrxlLj0mguKJBm89dSNOsEkaz9oH63aH2Hd/KSeNYxDaTnBzUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlg3kcYz1Bq0; Mon, 20 Jan 2025 00:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0RxdJ019043; Mon, 20 Jan 2025 00:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0Rxjb019040; Mon, 20 Jan 2025 00:27:59 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:27:59 GMT Message-Id: <202501200027.50K0Rxjb019040@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: 65da23709d20 - stable/14 - netipsec: Pass the right mbuf up List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 65da23709d2047c996fb9434e68c2ce90ecdc1bb Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=65da23709d2047c996fb9434e68c2ce90ecdc1bb commit 65da23709d2047c996fb9434e68c2ce90ecdc1bb Author: Mark Johnston AuthorDate: 2025-01-06 23:20:08 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:35 +0000 netipsec: Pass the right mbuf up Note that key_spdacquire() is dead code, as the SADB_X_SPDACQUIRE message handler is not set. PR: 243057 MFC after: 2 weeks (cherry picked from commit 378a2b155aaf853933df5b53e174b3880826488c) --- sys/netipsec/key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 772602eeea90..5458d189c7bf 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2519,7 +2519,7 @@ key_spdacquire(struct secpolicy *sp) mtod(result, struct sadb_msg *)->sadb_msg_len = PFKEY_UNIT64(result->m_pkthdr.len); - return key_sendup_mbuf(NULL, m, KEY_SENDUP_REGISTERED); + return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED); } /* From nobody Mon Jan 20 00:28:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybrlj1tQRz5jxZt; Mon, 20 Jan 2025 00:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybrlh55Ftz3dpC; Mon, 20 Jan 2025 00:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YQBNE3EkhmuUpH/M6Qv/7lbiAfQ9jn5zPkTMDF3jD5o=; b=OxiShi0M83nnlxclcIc7Jxo+UMbq3+970pa0ndRSOQ8UkN00/sSoZG+BVVOsLu9fbr68F1 ahODvLiFo/b0WFTj3YWISGYtrnGoNc9h6QTqnjV0D1b3yP5jbw99wndFZVgw9JWyyAuXr3 JjihczWNlXOAqCS6TfzPqLaR+zQUwpS0VV1JkJl7YDdg+nPMu5fq61cfTaRx4ECaUftvcy 9Wr6R+lFRZGxK2T4KwCntWnwquojxQ4if7YB943R+XOsKl0DY3lbWSODhQ5JgRrG6IsNTM 2C9DM10dLJYRLJ7cLsmkMSkHgcFUQqDtIuNoO1oV/R60vQ0baY/RHN3f0W+Dmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737332880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YQBNE3EkhmuUpH/M6Qv/7lbiAfQ9jn5zPkTMDF3jD5o=; b=iOygzJcE4zk9Ksx4+wpN38p2FVQFWyNqKg2koeooh4gzGgj9vrS2H/9BjIUWfXj58tdxHI gQ61lDuLNL/ebUyjtlxGjjdBQlvM4vgMNffNhJOicBThObXcHs0BMM7a9Y+Zno2INrq3xZ B4ywGd+ferqWOACSf2mUI+PGqFHr5lfHKVgFzWwZd3m9R7nGbav5O/x8e2Q3ks3CkyURml wHV06BRosSqrRUa7jnORTy9aZkfAYAUakROZhaDxiYy/oR2ChHxs9PeVP9dtA4V61RKmc6 ri/H0GpGUcSsyvsG32O9CbCHaFff7aL8NYNtC4YHhN6L/6M9BTmNbPD+HPVJ/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737332880; a=rsa-sha256; cv=none; b=A7/QETDrXi7MQMjA0GHYtcGH7E5tvPw1K/F8PgLwoVsEninTh7TVMZxb2d5PQ/hDJ8Yli7 JOtCclee3H1KPSJDdE+wwpsw8uiwOrn1JqCER3Qp5QwVc2j+6rATMpJ1Zsa2tk/crXffg6 +PzGoZfG9kGfwI1wSfp+nr69XJmJ813qtpRn4zKG40Xk3mHsvomZ5VXyS888ugS6lUYfFf NJFll4oDFDsE67Ln+8BWytnz3mjiED4ks41faquAx4yyXY9uLR3cGOoWuYPvjoFGX87NXf 60ZQAQfnkEoZHck1FTc1CXVAFXRB5EzRubgHu/HrkfDm9l7434nKBfsKO0/Z+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybrlh4gT8z1Bjm; Mon, 20 Jan 2025 00:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K0S0LU019083; Mon, 20 Jan 2025 00:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K0S0YU019080; Mon, 20 Jan 2025 00:28:00 GMT (envelope-from git) Date: Mon, 20 Jan 2025 00:28:00 GMT Message-Id: <202501200028.50K0S0YU019080@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: bd40a5abb1f8 - stable/14 - jail: Avoid a potential use-after-free when destroying jails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: bd40a5abb1f8810310a8841c34e469019002993f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd40a5abb1f8810310a8841c34e469019002993f commit bd40a5abb1f8810310a8841c34e469019002993f Author: Mark Johnston AuthorDate: 2025-01-06 22:53:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 00:26:43 +0000 jail: Avoid a potential use-after-free when destroying jails prison_deref() and prison_deref_kill() have to handle the case where destruction of a jail will release the final reference on the jail's parent, resulting in destruction of the parent jail. They thus maintain a list of jails whose references have gone away; the loop at the end of prison_deref() then goes through the list and deallocates resources associated with each jail. In particular, if a jail's VNET is not the same as that of its parent, this loop destroys the VNET. Suppose prison_deref() removes the last reference on a jail, releasing a reference to its parent and causing the jail to be placed in the "freeprison" list. Suppose then that the parent jail is destroyed before the "freeprison" list is processed. When destroying the now-orphaned child jail, prison_deref() derefences its parent to see whether the child jail's VNET needs to be freed, but if this race occurs, this is a use-after-free. Fix the problem by using PR_VNET to decide whether the jail's VNET is to be destroyed, rather than dereferencing the parent jail pointer. Set it earlier so that a subsequent failure in kern_jail_set() cleans up the nascent VNET. Reviewed by: zlei (previous version), jamie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47992 (cherry picked from commit 8c75c15d43e4123bc51f24f5bf99319289c45a6c) --- sys/kern/kern_jail.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 6f2b4f7fc336..103b44cc00b9 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1701,9 +1701,18 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) sizeof(pr->pr_osrelease)); #ifdef VIMAGE - /* Allocate a new vnet if specified. */ - pr->pr_vnet = (pr_flags & PR_VNET) - ? vnet_alloc() : ppr->pr_vnet; + /* + * Allocate a new vnet if specified. + * + * Set PR_VNET now if so, so that the vnet is disposed of + * properly when the jail is destroyed. + */ + if (pr_flags & PR_VNET) { + pr->pr_flags |= PR_VNET; + pr->pr_vnet = vnet_alloc(); + } else { + pr->pr_vnet = ppr->pr_vnet; + } #endif /* * Allocate a dedicated cpuset for each jail. @@ -3173,9 +3182,12 @@ prison_deref(struct prison *pr, int flags) * Removing a prison frees references * from its parent. */ + ppr = pr->pr_parent; + pr->pr_parent = NULL; mtx_unlock(&pr->pr_mtx); + + pr = ppr; flags &= ~PD_LOCKED; - pr = pr->pr_parent; flags |= PD_DEREF | PD_DEUREF; continue; } @@ -3202,7 +3214,7 @@ prison_deref(struct prison *pr, int flags) */ TAILQ_FOREACH_SAFE(rpr, &freeprison, pr_list, tpr) { #ifdef VIMAGE - if (rpr->pr_vnet != rpr->pr_parent->pr_vnet) + if (rpr->pr_flags & PR_VNET) vnet_destroy(rpr->pr_vnet); #endif if (rpr->pr_root != NULL) From nobody Mon Jan 20 01:41:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbtNZ4BNKz5k2rb; Mon, 20 Jan 2025 01:41:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbtNZ3T8sz3kD7; Mon, 20 Jan 2025 01:41:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737337294; 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=XZbKYL0dMtbw3XBXPhFP7lP7WXAH3CIEjfLjM/h/EXM=; b=xCVrv4Ah4o9b94N/3Q83Br2ZO/q7n3dFN5/lFpWVATjs9xx3L8NTQ8W19UaXONc1VCm0K1 lBDW7XIYTTmWJwX/z/4sp59IQlrOfmjQ03wZ2SSQy9tsvV7tS1QVxtDQe+v6/4eTgAbSIe 4phl+uabOXhiER3coHenVmkpNzfZf2V9eWpQEEVB768rAKNCZqAulw8eSEkWSS28zSzlzA smB4klS/8ygtxFu90xVdobVnxLWosAZrI/cllIkLQ2X0awOWZ+rm3PLxW/bnNPa42MoVwA Utsp55sUKhIHmYOOm1mnCSzZVQUyLrseWdZm453fs7Q9zokTT5hc4PrjLEAHdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737337294; 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=XZbKYL0dMtbw3XBXPhFP7lP7WXAH3CIEjfLjM/h/EXM=; b=wcP0vWNW/OgKkZBH6LL5NOyERe5kXNMtDC2Pqr49mV8y2C5/SenozrURuca72XjPZe3G62 +JopzVD7pbadv2qI/v8xtzuJqSwBzczNgm0LCUmUBHHLNq5k2w3087ojqNsKL1tlSeGfeD 87vTj8ddtKpoMMLO7EFwOBc0tDqPsTVfKJEep2rIXpKJkPsu78IO9TivU6Wzefwuzgq4ao KcO5raPY/QhC8tBImbX9YgKa2oZQfxh+P26SXMdsb4qS61Y15BEkJ5JRiCs2Sbp9ZvfEia y904Rpzt8lTEMvuZdZi1NjMmwPkvhHacCet1qyUvpRTehm1vM/XjJ6S6Mt6fNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737337294; a=rsa-sha256; cv=none; b=qCxktLhCrlSuDSrFBgGa7q98HbQNizhGDVui1/R2+kNDx5+q8QAN157l3EDLn9x5AtnCy7 6OLcUURndQIbNebEku+eKAxM2YiXppUNN6IQj3kxVRlprcYAXHG5ZTfI/n35t2v36KcOTb Iuvfww+pI8Stg7etLjR2wfMop2llNt/fLEpchYdaVhrmIPCHgalV+xq56tWW7t40K2LYrw RgR/7Utz05vV6sBNFtdj1GGgaBHAFloi3rTtu8mArjRZSS674AdbJsXeMa6kxQpfqSfR0n qViNcGVQUSTnJsdVkHAqqY5wDK+O8VM65s5EFT5mxutwkiOd18atP6H2cjoCRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (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 did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YbtNZ04myzQ6f; Mon, 20 Jan 2025 01:41:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <7371f49b-125a-47af-b36b-38f3a8ebfef1@FreeBSD.org> Date: Sun, 19 Jan 2025 19:41:32 -0600 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Warner Losh References: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/17/25 12:35, Brooks Davis wrote: > On Thu, Jan 16, 2025 at 08:53:07PM -0600, Kyle Evans wrote: >> On 1/16/25 16:43, Brooks Davis wrote: >>> On Thu, Jan 16, 2025 at 03:52:22PM -0600, Kyle Evans wrote: >>>> On 10/30/24 16:08, Brooks Davis wrote: >>>>> The branch main has been updated by brooks: >>>>> >>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 >>>>> >>>>> commit 9ded074e875c29cb92d5f643801990d7bb23cca4 >>>>> Author: agge3 >>>>> AuthorDate: 2024-10-21 21:42:13 +0000 >>>>> Commit: Brooks Davis >>>>> CommitDate: 2024-10-30 21:04:30 +0000 >>>>> >>>>> Refactor makesyscalls.lua into a library >>>>> * main.lua replicates the functionality of makesyscalls.lua >>>>> * Individual files are generated by their associated module >>>>> * Modules can be called as standalone scripts to generate a specific >>>>> file >>>>> * Data and procedures are performed by objects instead of procedual code >>>>> * Bitmasks are replaced by declarative types >>>>> * Temporary files are no longer produced, writing is stored in memory >>>>> * Comments provide explanation to functions and semantics >>>>> Google Summer of Code 2024 Final Work Product >>>>> Co-authored-by: Warner Losh >>>>> Co-authored-by: Kyle Evans >>>>> Co-authored-by: Brooks Davis >>>>> Sponsored by: Google (GSoC 24) >>>>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 >>>>> Signed-off-by: agge3 >>>>> --- >>>>> sys/tools/syscalls/README.md | 49 +++ >>>>> sys/tools/syscalls/config.lua | 312 +++++++++++++++++ >>>>> sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ >>>>> sys/tools/syscalls/core/scarg.lua | 163 +++++++++ >>>>> sys/tools/syscalls/core/scret.lua | 45 +++ >>>>> sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ >>>>> sys/tools/syscalls/main.lua | 64 ++++ >>>>> sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ >>>>> sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ >>>>> sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ >>>>> sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ >>>>> sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ >>>>> sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ >>>>> sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ >>>>> sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ >>>>> sys/tools/syscalls/tools/generator.lua | 113 ++++++ >>>>> sys/tools/syscalls/tools/util.lua | 194 +++++++++++ >>>>> 17 files changed, 2768 insertions(+) >>>>> >>>>> [...] >>>>> diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua >>>>> new file mode 100644 >>>>> index 000000000000..193b1e43563c >>>>> --- /dev/null >>>>> +++ b/sys/tools/syscalls/core/freebsd-syscall.lua >>>>> @@ -0,0 +1,147 @@ >>>>> [...] >>>>> +function FreeBSDSyscall:parseSysfile() >>>>> + local file = self.sysfile >>>>> + local config = self.config >>>>> + local commentExpr = "^%s*;.*" >>>>> + >>>>> + if file == nil then >>>>> + return nil, "No file given" >>>>> + end >>>>> + >>>>> + self.syscalls = {} >>>>> + >>>>> + local fh, msg = io.open(file) >>>>> + if fh == nil then >>>>> + return nil, msg >>>>> + end >>>>> + >>>>> + local incs = "" >>>>> + local defs = "" >>>>> + local s >>>>> + for line in fh:lines() do >>>>> + line = line:gsub(commentExpr, "") -- Strip any comments. >>>>> + -- NOTE: Can't use pure pattern matching here because of >>>>> + -- the 's' test and this is shorter than a generic pattern >>>>> + -- matching pattern. >>>>> + if line == nil or line == "" then >>>>> + goto skip -- Blank line, skip this line. >>>>> + elseif s ~= nil then >>>>> + -- If we have a partial system call object s, >>>>> + -- then feed it one more line. >>>>> + if s:add(line) then >>>>> + -- Append to system call list. >>>>> + for t in s:iter() do >>>>> + if t:validate(t.num - 1) then >>>>> + table.insert(self.syscalls, t) >>>>> + else >>>>> + util.abort(1, >>>>> + "Skipped system call " .. >>>>> + "at number " .. t.num) >>>>> + end >>>>> + end >>>>> + s = nil >>>>> + end >>>>> + elseif line:match("^#%s*include") then >>>>> + incs = incs .. line .. "\n" >>>>> + elseif line:match("%%ABI_HEADERS%%") then >>>>> + local h = self.config.abi_headers >>>>> + if h ~= nil and h ~= "" then >>>>> + incs = incs .. h .. "\n" >>>>> + end >>>>> + elseif line:match("^#%s*define") then >>>>> + defs = defs .. line.. "\n" >>>>> + elseif line:match("^#") then >>>>> + util.abort(1, "Unsupported cpp op " .. line) >>>> >>>> This specifically is kind of a huge regression, and I don't really know how to >>>> cope with it. We've guaranteed for years that we'll copy preprocessor >>>> directives through to all output files. We don't use that upstream in >>>> FreeBSD, but we work with downstreams/vendors that make extensive use of it in >>>> their syscall definitions. >>>> >>>> I don't really know what the answer is to this, but we probably shouldn't have >>>> dropped it without some discussion first. This is going to be a bit of a >>>> headache... >>> >>> This response seems rather hyperbolic. This change was up for review >>> for months and the feature is unused in tree so there was no way to know >>> it was important. >>> >> >> Re-reading, yes, this was a bit dramatic; my apologies. There's plenty of >> frustration here, mostly amplified by the fact that I was on the review just >> as much as you folks and have worked in environments that use it- it certainly >> should have stuck out to me, but I just didn't have the time into it that I'd >> hoped I would. >> >> I would've also really liked to see an "XXX" comment at a minimum drawing >> attention to it or a call-out in the commit message, given that the syscall >> definition documentation isn't that lengthy and this is one of the few >> guarantees we make it. I think there's some compromise to be had, but... >> >>> It would be helpful to work through some examples understand what people >>> need here and if it really has to be a refactor to pass things through >>> or if adding some new tags and config values could do the job. >>> >> >> ... I'll respond to this this weekend, hopefully. I'd like to condense what >> I'm aware of into some formal test cases in sys/tools that I can point to so >> that we have something less abstract to debate the merits of, and also so that >> we have something we can verify the functionality against. > > I've implemented simple support for ifdef's syscall variants in > https://github.com/freebsd/freebsd-src/pull/1575. It's not robust at all > and may be missing some bits in newly generated files, but it's probably > not much worse than what's in 14. > I'll take a look when I get a chance, thanks. > I agree some tests would be good. I think I'd deviate from the norm and > run them as part of the top level `make sysent` for ease of develoment. I took a stab at this here: https://github.com/kevans91/freebsd/commit/083215d48541eb2be5e7725031c319f50f3881c8 Most of the uses are fairly trivial but, IMO, pretty reasonable (and generally of the same pattern). Even just a subset of CPP parsing to cover trivial #ifdef / #else / #endif sequences and tagging syscalls with a `condition`` that propagates to generated files would be sufficient, even if we aren't blindly propagating preprocessor conditions anymore. Thanks, Kyle Evans From nobody Mon Jan 20 01:59:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybtn933JLz5k46x; Mon, 20 Jan 2025 01:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybtn90V0pz3l8H; Mon, 20 Jan 2025 01:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737338365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3H5C+wIKHbpqpJkkOGRgetIXkz+Ks7bS94vEMbGTs6c=; b=vPQoufBM1PjcZ/6Kf2+Q2uNBvstNCsHHeZUH9fZNlGkx0E/b4wELAAzkdmZZII8EVZD/dj aT5nvDSunqN/9l2EQFIUrMNt747BndUuBde3VKUsB5taZZywRmNWaR+6IXexh7+BFkhShz rPLUdunHYbgc+oWjJcAyeegAFFqA/7+ci1C2Bt0ME5iub/Tn7/R8g+ytpvi8/l69qLWpSB mg3/nU6DBtgzbpN/tZLgffMiBh89Lb/XGta8vEsElbkUgOdtteeQRkqXQBqpPmtOv9rCcn ZL/RgLJt8f1g3RH41v9Fjmn2Iyo9Doy5ual5V4AhLPYyHJs3A+UEF/ArOm4JtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737338365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3H5C+wIKHbpqpJkkOGRgetIXkz+Ks7bS94vEMbGTs6c=; b=d6vnMxMIArI1BlBqNkJyzahKcRdhLhR8xTqDpysJvubABzPGv31UQf5GrXJHUp7hGSS7C/ ulP6wUJe6maz5nKB2mGywCSfVbcPXJVnnkDZsqBZAJmN33ZmRoB776qNAV5x6cpxBE7Onb C0IE5X85VoV/vyv8oC5BmN/+UrYES/w2rLUBDp5pfwEvfoBHf+zB6BpW4jcPZxR6oVxy+e gLkrjyQIDhUqWKZiXxyHuDj2hfm5phodVH1DCt2iZxWzZQeJnOz9VSrAFQhhVScgBRwkrG vq37a/vRKJSf5x/jNX1l9eQzIqGdfX+CRtJhouJ7Vv3bgSfALhS2ZYybiZI3iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737338365; a=rsa-sha256; cv=none; b=qcm0hY1G9RS6vUoD0AwX9GP6U2LgGv/2WsmdO31yEaBUNcAQDYScdgSUqLfS9ZHGrYwLbF eooOV3nupYd0b7BeZVSnSsWGcjedxuI2OAPcxItOtwDAvw8JBY45mkFPrdh/0LidBsjE8t v5HRyEJ5+LbSc3xBZtHKVfNsfBHDnFqQaxuTyaJHP/0aCYPSzm+cGWluGnOQWksOOS8QXt SuPjijaeLylUSxYdYR8BzendoBCPO+hOwmW9QqCqmJ7pEnbCHIs1wm/qBq4/1W8U/SJrE2 ZRumqI5VUP6kCgmLuMxpTt+bQJgbqk2nvUsXMf+ag9lmadHLdAWX1Isv8MpnMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybtn904zhz1FPf; Mon, 20 Jan 2025 01:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K1xOtc085864; Mon, 20 Jan 2025 01:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K1xOHO085861; Mon, 20 Jan 2025 01:59:24 GMT (envelope-from git) Date: Mon, 20 Jan 2025 01:59:24 GMT Message-Id: <202501200159.50K1xOHO085861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6404a5a7fe13 - stable/14 - genl.1: Improve grammar List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6404a5a7fe1341c641c29299bdf7bf43e9d7094e Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6404a5a7fe1341c641c29299bdf7bf43e9d7094e commit 6404a5a7fe1341c641c29299bdf7bf43e9d7094e Author: Cy Schubert AuthorDate: 2025-01-17 04:18:24 +0000 Commit: Cy Schubert CommitDate: 2025-01-20 01:59:16 +0000 genl.1: Improve grammar Make the first sentence read more smoothly. (cherry picked from commit 13d81ef632ec6ca5e6936ab77e8ac67a8c430033) --- usr.bin/genl/genl.1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/genl/genl.1 b/usr.bin/genl/genl.1 index af0c6360ad83..5a32d69dd482 100644 --- a/usr.bin/genl/genl.1 +++ b/usr.bin/genl/genl.1 @@ -40,8 +40,7 @@ .Sh DESCRIPTION The .Nm -utility is design to provide access to the user to generic netlink -protocols. +utility provides user access to generic netlink protocols. .Pp The following commands are available: .Bl -tag -width indent From nobody Mon Jan 20 02:40:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybvhh2DVXz5k6Y8; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhh1XNNz3pMG; Mon, 20 Jan 2025 02:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=671cz/R2LJnV1lPdzrfNGoP2GQe1KQDsu6S8KCuukN4=; b=A3tViV00eiuVWk5eMtHB+zoKUrfDnQ6ktd1dtxRyFHYbBNQj63If3zYAuxOkPHZ89MLnt3 zEeRGtd1UC1alt2GktKb/O4Co48NbX9WNWbGIrcgl75kd0CwEmPJLTW5xN+OVD3iX35fFf SPiU7oRREwpVSV4gsAxFHaMlzpYdMBUQHZ5sONTwNmx0nlzosageV6NfqYdjiQULxkPREA kMfsu9uGy/vh+53v9ECFOMQ3FaRNFS7lhTacwOzfbPSR97F4PMU3UBf5QPsNLVleOrG43W HusLLtUU/nyJqa3QV+j0kaju0NjJgRNDSw+j0r4khQ4+ggx9S/J7pvKAgbi+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=671cz/R2LJnV1lPdzrfNGoP2GQe1KQDsu6S8KCuukN4=; b=xzJQZ3F/0Zh6omP0TlwEB1nkc9y+YOssExSsNa0/bWNPWuBjc956VjIF0knTk7iecgqMWo QQlxzny7nzUhncxz8CsVhOo+Gphz8viQFlGcb0gysBTfDQBnmPW5jMQloCIRFPA1bYMAqr MEWuFctl68ODbc48rtma2teFTkAmS+UCHT0PaCR2S5MlHxaXLp1ycUwVMSA2sJ0zY6ayws p6oQvpygR95zNrtVNxayeQYIKMjbtAXPSfuZsSe5F7Q8wOYWjrZnwvGo4N2sJH4ce2gBZV YV0990JKU0+9CkGUaTc4KB/x0jSj4F49/qWJDVZW0Igy2pdCHcgoY+Ti77A8mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340836; a=rsa-sha256; cv=none; b=Y8OYvbZpiHVBStXoRfDwaCT9m/1YePkZz8+J7Uqn1x6YX2lbrMjK4hihawv4bZvI3CX3CF NRu/KuWPb/ETPWrPxbRKJyNhAPaatV/VyGarhIUAv8gtfsXzp0YQviMQ6EUMrA1WfjuqvZ prL9eZn3Hlf8AyIh6p8jWUbkTWVj8i9KkcrnLSTC57Y99bqUMN2BoceGNEY8D6z9bWkmwz XwWPsHYTVpaMyk9peWRgxuICNqkWBc4QmRvXJP8OpaPkJFBsLO3imaatf7gdcpuHa6Nn8F 9bHy0yCcH9yERGG6NEwq5fpGSt35mVYomAxTYai5XhbuIY8kGRJ1FcQvDHRfeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhh0sW8z1GJC; Mon, 20 Jan 2025 02:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2eaDq069485; Mon, 20 Jan 2025 02:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2eanF069482; Mon, 20 Jan 2025 02:40:36 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:36 GMT Message-Id: <202501200240.50K2eanF069482@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: 97eaa1218f77 - stable/14 - ffs_blkpref_ufsX(): do not iterate over startcg twice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 97eaa1218f7752556801105899620954a8f98bc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=97eaa1218f7752556801105899620954a8f98bc3 commit 97eaa1218f7752556801105899620954a8f98bc3 Author: Konstantin Belousov AuthorDate: 2025-01-05 23:00:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ffs_blkpref_ufsX(): do not iterate over startcg twice (cherry picked from commit a57a2c01aacc5e2a29fa33d50aecc516e37cecd0) --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 690df0c12793..d08a51264fdb 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1498,7 +1498,7 @@ ffs_blkpref_ufs1(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); @@ -1610,7 +1610,7 @@ ffs_blkpref_ufs2(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); From nobody Mon Jan 20 02:40:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybvhj3JVbz5k6pb; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhj28qNz3p13; Mon, 20 Jan 2025 02:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLLwKh+1QMyrDSwPpftDcmXMUVKloqqAjK6KQvDh31A=; b=aPHrlF4fGS17XsgoXTeh8q/GuHIsek5Z+kZ1RjQ/Ke0oLiEwTz9LgnFEh03MeKeK+VBsV0 39H0NmYYFxa/b9eCdXIUcapm9L5yI+TMYhcsmBnFBuUI+rOleTeM2kNnyLM8UsnBcwUmZn nTVlmoTsKO0hfkl+vQ3GW98vSN3GeB8TYND8tj26MGlpx8WeY6N6Amt2HmOxgO89ZR92F3 ueagsJEjbidbkgZZjbsdX20v6u4fKVMyY23WJg1ifBFUyQ7CWhXQjF4rWiA6Hlma6WY4qK Bm+bYc/aEV13TvlmXCff3yNMBa/hTS0eLfyG/YsmHmocM5s03U4JV1Jrl/pQ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xLLwKh+1QMyrDSwPpftDcmXMUVKloqqAjK6KQvDh31A=; b=UsVE45LVMV464hGXE1J0eqNw9fxUnkbDpBBKYcGnBf2If0ypyprF/Qo26+0fUMkp1RL8G0 QVWgqnyUZMm3NOGoql0nRFsezYNGCJaBD6jwyXa4vEafB/60+QuJBKGP2zOkX2O6d5YTgk RTitUH5QROI7vx0/H5jSdWlZzm9KA33ymlXBxmDt9ZcWyHEyswxhPCRnpfxWsYDlJ7agVO 4TqKDwwrAXByKdRG6jpKhI8iWZDR4Ip69suy+J0hIdQlx++E3nvdI3iev6LvS61DVNayaX dH9Il/vnPESYTdTDNw7XgR/Go0ttH5UcvZuAKv+oTftLXxHieiwJcmyqsXy+MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340837; a=rsa-sha256; cv=none; b=WDCPvndWq3BxuR53LaGh5VcIkjGswo/BHIKbtcsOeGND5BjP8Fn5h7DNB6+lWEBIKkDE2A aomdZse5AImtDczDnx0hkJR+kngZHoobfm4NurSUpxTnfJGW96BCgRCi3TsAubXeMybkDD W0yvBpLahlFC21tjWx1bv6PAokrieEJDCCR2PUK6GOFnyGjeLiFscGm06POnAkepi5pIoM 3DZK02kQRoJzD3eBI+oowC+Qw2C98WOs7CKpOrPkCArsjIS1AE9i52C/ef20Fklnkn7hSz U+hoSZD8EzsIKoDA0qr0ea9zlYBeRJGJdWuL8fljBYbAl+12NBMO5AI5DRIVXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhj1Prmz1Fxj; Mon, 20 Jan 2025 02:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ebFv069541; Mon, 20 Jan 2025 02:40:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2eb44069534; Mon, 20 Jan 2025 02:40:37 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:37 GMT Message-Id: <202501200240.50K2eb44069534@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: 6149261d549b - stable/14 - ffs_reallocblks(): ensure that pref cg is valid List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 6149261d549b3b5072fe69b498f26e8172de1623 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6149261d549b3b5072fe69b498f26e8172de1623 commit 6149261d549b3b5072fe69b498f26e8172de1623 Author: Konstantin Belousov AuthorDate: 2025-01-05 22:51:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ffs_reallocblks(): ensure that pref cg is valid (cherry picked from commit dc37121d3210d08c96a883ebfed780660e7e2b39) --- sys/ufs/ffs/ffs_alloc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index d08a51264fdb..b586ab8e126a 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -683,6 +683,7 @@ ffs_reallocblks_ufs1( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -949,6 +950,7 @@ ffs_reallocblks_ufs2( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -1440,8 +1442,11 @@ ffs_blkpref_ufs1(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din1->di_db[UFS_NDADDR - 1] != 0) + ip->i_din1->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din1->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1452,8 +1457,11 @@ ffs_blkpref_ufs1(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din1->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1508,6 +1516,8 @@ ffs_blkpref_ufs1(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1552,8 +1562,11 @@ ffs_blkpref_ufs2(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din2->di_db[UFS_NDADDR - 1] != 0) + ip->i_din2->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din2->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1564,8 +1577,11 @@ ffs_blkpref_ufs2(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din2->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1620,6 +1636,8 @@ ffs_blkpref_ufs2(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1970,6 +1988,7 @@ ffs_clusteralloc(struct inode *ip, ump = ITOUMP(ip); fs = ump->um_fs; + MPASS(cg < fs->fs_ncg); if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); From nobody Mon Jan 20 02:40:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybvhm0q6jz5k6gp; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhl2xq4z3nxl; Mon, 20 Jan 2025 02:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYy2IYqzEJmmUcaxePEGUMZGo2aAvnfIyUfXE15uLvg=; b=PywFhIpwf7Wjv0ogQ92wHULMRLoqRlT4vrCqODPTkmy+E/8sopPahBFnAQHk2hJziMwst4 yWdM3kuijsMh1NPo53wKIMmMQLQ+WoGHljZsYCPD/M+iMbk5vDvnqAFsNtW789xWQUW1b/ 5N6A8fyCdvq320eVHDFa/EKhC+KgzWmgRy5tFq6JJvxuNIu18JusgKgLxea3/72nDOYz/Z kWwtjmd9gMKjFuzhJEUKCVpI8X8qtgkvsqLsXmcrXVv1UhWkzvz6tOTI5Bh1+mpDoOQogD qbebsX7+NPakrUtWYDP8PZ6yKq0HgjjKHgZxP9toKN2IfbpUDGdLlthhHFIdOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYy2IYqzEJmmUcaxePEGUMZGo2aAvnfIyUfXE15uLvg=; b=jh0VgToyy70rkvOpFCWl9/w4hyt8k6qz+vaQ2SRpftszYPDQdGlQAsPJAmTZBsPO6lazGX f3TApZFunSnK9S7Fx9/1SUYs42ItnwH4248wcEnc6FyeZIlR/yppo2uO3dKCOqZKMGOsas +WtDSwNcixqDbSv5tUxEwXbyM0AgGCviA4NnP9ec8OSSXPSJY7LotWPF1nIzlhNu0Fq3HT eoFI5RFiLo+tPUq8vQlABtgJ5nXsLha+5F2LiyD+AbE3UA7jKi2Z33WeNPhWW541cBJnxu I6XnJKnw7jat8TpyHiuBUn1dmDKo7+Z7dAs4VAO9cWLPb3D/WBnyhK/pFtzJTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340839; a=rsa-sha256; cv=none; b=UuDecUMZal3ZJw6CjyNRVAE2/iCQmMLTzIhbXdSmaoABbgS+flL3HpYd1VUY/TfRf13Scz zq+Qddfr5gPIhfzQ0EOTM88y/rCPglM0ICk5mx6Sg9apxE8gov1Ss3b1TMUI7zwU1akLvb NOFHBybEiOcinnGWz/3iROlempAML3kAvcZjniQQ2+wBNGZlqYb2xjg1G+kysyhKM4DJZt 4nv4DZJBc/j3nqpxaDkZgNArKE6Lhuwf5EmzeMUgl+VvaFmKO+vRMaA+qMi0EVDywjMKiT j0AAVF76CPZEQIecA8WQ+0c2dwCfmXGamWWeQ06pWBohXoLZSmbgxWcCmXElsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhl2XYPz1Fxm; Mon, 20 Jan 2025 02:40:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ediF072343; Mon, 20 Jan 2025 02:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2ed1v072328; Mon, 20 Jan 2025 02:40:39 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:39 GMT Message-Id: <202501200240.50K2ed1v072328@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: c968d55123fa - stable/14 - ipsec + ktls: cannot coexists List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: c968d55123faf55a26d769847b603330eb51f67c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c968d55123faf55a26d769847b603330eb51f67c commit c968d55123faf55a26d769847b603330eb51f67c Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 ipsec + ktls: cannot coexists (cherry picked from commit b0e020764aae970545357b0f146dcba7b4b55864) --- sys/netinet/ip_output.c | 33 +++++++++++++++++++++++++-------- sys/netinet6/ip6_output.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index bcd4ed4c94c9..892a54eb628d 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -669,17 +669,25 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IPSTAT_INC(ips_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv4, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } /* * Check if there was a route for this packet; return error if not. @@ -733,11 +741,20 @@ sendit: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IPSTAT_INC(ips_odropped); - error = ENOBUFS; goto bad; + } else { + m = m1; } } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 3c0e7f37b74f..d98d7c5aa928 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -459,17 +459,25 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IP6STAT_INC(ip6s_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv6, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } #endif /* IPSEC */ @@ -1102,10 +1110,20 @@ passout: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IP6STAT_INC(ip6s_odropped); - return (ENOBUFS); + return (error); + } else { + m = m1; } } From nobody Mon Jan 20 02:40:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybvhm0c5sz5k6dB; Mon, 20 Jan 2025 02:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybvhk5Fx4z3pPr; Mon, 20 Jan 2025 02:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbDCCV8ICSUrdrvLxgX7T2pZLZlIYxVPyygrlSc8O7c=; b=wTRXMN7U4PIpLkvmkc51wv3l6jP/ELxKdg6ylw9HcU1Ro5zKqksRNpBE4kjxH2ocdMUaBB W0+OUQaE0ipIlUMLMEmJZDN6uBEmiZE7mqXcoFi8fMZzpzLp0Rfsny3GzNDan5yBFw53lZ QYSNwcAiap8hFshobfT7zP17sSjG918tznPK9eKJxbXt22e2zXTtatgbm4dUFLSOGOL3Ky EE1c4uVWYgpNAb1JIFafx79roFO3Gy9AGnJ2j3sJ6XN4+JVa8CqmDD/a2ycT5FJzW6pMNA JjcfTaH22QjYNoWV4AuPyJfQmxptgwFXkskduFNhuUxpMH2mDW4PM2IHi9/3fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737340838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbDCCV8ICSUrdrvLxgX7T2pZLZlIYxVPyygrlSc8O7c=; b=a7GYXsIzwIrgx/TsmSEpF5lKpH9TTRcjunS+bkrDi1uNDnMmJ91m2cbQ6hBXIIFvIXlOE8 s/vWLmU/HUBcb19nl9ZSXwMye0uRtQCo6wmEUj++md/OWWYr+BByTN6aGmE4on8ioMNgQe Gzq/4yus/CXmPQ7q6Tka9+DDQb57Ff8yRIgDv5UT6+7aUrDiwP+s0iepv4RdCf0LV+ZyCG LQcQ561R5okInhaELOL8A4A2UzJT1kcoFvTM+K4x7Z87Pl6G+r+ES4FIhrG2JIMTtRFQw0 azWZQ8elfHFuHCtgj2hzuDPmeUt0wKoZLk0O5dSoa+/XkINIMudnmU/m7Usbzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737340838; a=rsa-sha256; cv=none; b=XC1c3ieUH4CA7PKML8E8Db9ZQFPgWMWNnfvyvGZb2/S12XJyiEmnAo1dV8IlbFjemka6Cs E/NTxNke3n4FKSeUierJL0CXKy2UA3jYkqE+Ry0LY6fFsm7kBj+flXwxoiJWirhzjrb2LY 7aU78O9Fk8ZSnU8KD3u120A9J3Cbt0OtI4LB6ZsPDtZ7Y8+hN3xib3gyV1qJm8VyqO0J4y tgoxF9aH51Bvlq5v16dqXPrIxaPtQx4NEn3RdjkNvch/kpMh1+07u+Ne0T8Mm8mu9norWR r4RRq2OushDPevWlUA63OlUHZfXBXpEKrHmV2llO0g+1r5F2sdqWZMWkbUylUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybvhk1mlBz1Fxk; Mon, 20 Jan 2025 02:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50K2ecAV071038; Mon, 20 Jan 2025 02:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50K2ecB3071024; Mon, 20 Jan 2025 02:40:38 GMT (envelope-from git) Date: Mon, 20 Jan 2025 02:40:38 GMT Message-Id: <202501200240.50K2ecB3071024@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: 6e9b6e5dbb84 - stable/14 - mb_unmapped_to_ext(): return error code on error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 6e9b6e5dbb84c0c44930448b7da169a6a351d670 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6e9b6e5dbb84c0c44930448b7da169a6a351d670 commit 6e9b6e5dbb84c0c44930448b7da169a6a351d670 Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-20 02:40:09 +0000 mb_unmapped_to_ext(): return error code on error (cherry picked from commit cf322978d73a3ed4958cb64cc4f1b47ceb53a03e) --- sys/kern/kern_mbuf.c | 41 +++++++++++++++++++++++++++-------------- sys/sys/mbuf.h | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 002e508e91cc..0a9cb72222c2 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -936,8 +936,8 @@ mb_unmapped_free_mext(struct mbuf *m) mb_free_extpg(old_m); } -static struct mbuf * -_mb_unmapped_to_ext(struct mbuf *m) +static int +_mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres) { struct mbuf *m_new, *top, *prev, *mref; struct sf_buf *sf; @@ -947,9 +947,15 @@ _mb_unmapped_to_ext(struct mbuf *m) u_int ref_inc = 0; M_ASSERTEXTPG(m); + + if (m->m_epg_tls != NULL) { + /* can't convert TLS mbuf */ + m_freem(m); + *mres = NULL; + return (EINVAL); + } + len = m->m_len; - KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", - __func__, m)); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -1047,7 +1053,8 @@ _mb_unmapped_to_ext(struct mbuf *m) atomic_add_int(refcnt, ref_inc); } m_free(m); - return (top); + *mres = top; + return (0); fail: if (ref_inc != 0) { @@ -1064,13 +1071,15 @@ fail: } m_free(m); m_freem(top); - return (NULL); + *mres = NULL; + return (ENOMEM); } -struct mbuf * -mb_unmapped_to_ext(struct mbuf *top) +int +mb_unmapped_to_ext(struct mbuf *top, struct mbuf **mres) { - struct mbuf *m, *next, *prev = NULL; + struct mbuf *m, *m1, *next, *prev = NULL; + int error; prev = NULL; for (m = top; m != NULL; m = next) { @@ -1086,12 +1095,15 @@ mb_unmapped_to_ext(struct mbuf *top) */ prev->m_next = NULL; } - m = _mb_unmapped_to_ext(m); - if (m == NULL) { - m_freem(top); + error = _mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (top != m) + m_free(top); m_freem(next); - return (NULL); + *mres = NULL; + return (error); } + m = m1; if (prev == NULL) { top = m; } else { @@ -1110,7 +1122,8 @@ mb_unmapped_to_ext(struct mbuf *top) prev = m; } } - return (top); + *mres = top; + return (0); } /* diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index f7925da795cd..941c907e903b 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -814,7 +814,7 @@ struct mbuf *mb_alloc_ext_plus_pages(int, int); struct mbuf *mb_mapped_to_unmapped(struct mbuf *, int, int, int, struct mbuf **); int mb_unmapped_compress(struct mbuf *m); -struct mbuf *mb_unmapped_to_ext(struct mbuf *m); +int mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres); void mb_free_notready(struct mbuf *m, int count); void m_adj(struct mbuf *, int); void m_adj_decap(struct mbuf *, int); From nobody Mon Jan 20 10:15:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc5ng3C0Nz5l7n8; Mon, 20 Jan 2025 10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc5ng2Nynz3kMk; Mon, 20 Jan 2025 10:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737368135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyP3Rw8szAR7AfRy1I0y0ISgbZ1uGo5X9Smbjbocj84=; b=m8Ikmy5otqWd+a8bC5dxJ6azvuUEx3NNa8YKuLT1wQGWxhWFTJIa9ybu5uDwaKeu+h/fgy zuvWhOimc+H4S+ghSdVo1Ko4cewPtg4iABtPzoOBnMJ3W++BnVRUJA006Jswjdutf6jic9 2jl4vFShOYN7aEoFsrY4PHvqdvNHY1ylqBjY/FSyTdiGCAEfQlppkQnF4tifczaQBulpZm Sm+b7tpm9mUhqCneizHT2+4Jug35WzSlPJnRTvkbb0r+Mk2TRD4FY3qP8WZyVtt6OLLhGf LsH78eyItMLu2dcluIrT9rwA2Z3EvzTMcLFXu1r2oujRYHzJ7wxHc5czwDdEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737368135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyP3Rw8szAR7AfRy1I0y0ISgbZ1uGo5X9Smbjbocj84=; b=r9uWDZsiOCTTQceV/0Ic4pVc19+CuMnildLmB60RidiGmBqomycgHsoDWd4ot8uigLCH0J Kh2WKjb37Othsy06qH5mMLq/N5/mh2uKZoRKMXvtqVoVAnSGNlu+EmJpDf/bEXyWyvjQHo 8J/n98TsCd3jSeo0+Dl1laYvfW6CN6aKrfmCHC7gasnrmhCg5hx8ANRthQ7T2lhakO2e+s 6Hq4bm2gaP28FL8N/cMDfwqZvZOyvdfvpxK/bhQ3tOR5EEKuVwSDIqur7xyo2b1Pq9fo54 Czs5r2XnUoOUM8B4VkREpdY6ZUgkZ3bLZkVNaFAaMBmCcjG77dkRqZdFvztr+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737368135; a=rsa-sha256; cv=none; b=BJnTwS3WqFVbMn2HpEzcFCIozAB7wiJ8iYbEoQZBIgQtNveLzhqZcw+JLfpopZuveehUN7 c6Jgpi0DT+/zR40IFtI+7eSaSiKkUh3XyLPRFuybUmsfq3B0QoibprxnuKgSQ2r3S4iE8a 3x5m6oPmLT9bfglLH/wVEgsx/MT/mZ6jL2vWAECw0a6beN0DdpJ7R34Tn8D7pefRrspxQE mUIVX/QkwIDL94vZo7nluYoGCV+BDyTTj0gGFtem/Up6U5qXfso2VhNIPLCDFR2Aa4kJEp O8bWsMK3FNUqSCWKoFK1I097wYRxGx9+7+RodUBzsV7yyHA0jqPzSlKuTzjShQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc5ng1z6Dz1TB; Mon, 20 Jan 2025 10:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KAFZRB019356; Mon, 20 Jan 2025 10:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KAFZot019353; Mon, 20 Jan 2025 10:15:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 10:15:35 GMT Message-Id: <202501201015.50KAFZot019353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 5094faf5dfa8 - stable/14 - pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5094faf5dfa860f238f636457563bc0d89013c7a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5094faf5dfa860f238f636457563bc0d89013c7a commit 5094faf5dfa860f238f636457563bc0d89013c7a Author: Zhenlei Huang AuthorDate: 2025-01-15 04:32:31 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 10:14:43 +0000 pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit This driver prefers connection speed over sas port speed. On stable/13 branch the stack-allocated CCB is not cleared thus the cam layer may report weird speed on boot. ``` da0: Fixed Direct Access SPC-4 SCSI device da0: 4294967.295MB/s transfers ``` -current and stable/14 have the change [1] which clears stack-allocated CCB thus are not affected, but I want -current and stable/14 to have this fix in to reduce drift between branches. 1. ec5325dbca62 cam: make sure to clear even more CCBs allocated on the stack Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48438 (cherry picked from commit 7befd68335a0b34405b6293f30cc47cabc46ab06) --- sys/dev/vmware/pvscsi/pvscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index 74c515c9fca0..c8b79485efc7 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1445,6 +1445,10 @@ finish_ccb: cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; + /* Prefer connection speed over sas port speed */ + cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED; + cts->xport_specific.sas.bitrate = 0; + ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); } break; From nobody Mon Jan 20 12:42:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc92r2FsYz5lJ9q; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92r11VPz3v7G; Mon, 20 Jan 2025 12:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWCf11Jw/Pdnu4fDwho2PclPPZlM2qSfZkagDMLUMHE=; b=sq3tRJH/vkyw2XonOh6CZeirAuZkd3rj590VjPygVe5nzhs8e9mRZu62C/+b3Tmvtk4TM1 QLMxP2y6sEZGjYgNm4cPBZphaYGplqjBiK1RsRYBd/ZE2AGPu+AizhUj28ypdZwA4zpzRA kPPJIZjxlGxDzufWm9DF44I3xjZh9qhaGKrnOuQPoyByZVT1oPHMgIGXRAf88iXCfV3wLY 7KUWypD4zkMXJh5CWWgobLPjbFfUycfOthG1sR/RmfOVgM6CMk1Ce0cdSwJZw1Sn9+iint wcePejAKAWAM0OghSArOloYEYMPm1mTKkhMiVK2jcvQkNQ1dxk/DOydOGToSEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWCf11Jw/Pdnu4fDwho2PclPPZlM2qSfZkagDMLUMHE=; b=bWAFrUb2TtaQpX94xd+RTVBWq3K1ImhFY177n9FidK3Wiuf2E8Uy3lLuLbkWA4JZU7/8Ij BRkAfDY0sbCB2zpr2ZLTnNIQKPNLxmP1M/9wkuckMn450uYIKZaHQvP0wDKXfpd0Qsi8v0 uH+TfWw1oVdStjYZMLLmEMAecI0MivOCgDqO0alTPTGPxQaI17LQWrSrRBx02jGUtBD9Hr 3hHFrNXPp2KIoYaPw2H/RiXQvztLFKznTuFGTGuv8w7Db7NWlaJbLJL4Giref5GSy79Hol fsWVjSzITJY6OhktAmqtRyp6hFGC88ZVeyOYzfv7e2jOU3tQQVBys4S2DwShOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376932; a=rsa-sha256; cv=none; b=mVuwP6daaq28/zCA4PABnW+ALETd1zSZzGBOoFruI0e4H4e00tWSVtYLuvIfPtfXC1ICYX 1z5B9KVCpIHBLEGPk+HjRd1/T0mVJlq3NGpl94Y7r17fK7HDlL0ErEKrlxGxn1e1fGn5Vr FD8sg116dy5doh7FViUJnvvLG5fdrCzuzvX1gF4DlYZ0ncK6YHUZQkBPB2CySSTvdrLLA6 LS7XmLto/0gmd1cNyoCZ8fseFA21Q/bPkIKcQDx5BfbcVvsyFzkBfC/t1XV8cYNBHlrhht EoUhNjB+BHycgjb+hkKuGbkUFk5exQ1PK7PVHzN7YWJUh5DSyDQVjJu9WcIcjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92r0Z7rz5kr; Mon, 20 Jan 2025 12:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgC1j098381; Mon, 20 Jan 2025 12:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgCtq098378; Mon, 20 Jan 2025 12:42:12 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:12 GMT Message-Id: <202501201242.50KCgCtq098378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 25695358d03b - stable/13 - pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25695358d03b4c60344df5b7dead04085350448d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=25695358d03b4c60344df5b7dead04085350448d commit 25695358d03b4c60344df5b7dead04085350448d Author: Zhenlei Huang AuthorDate: 2025-01-15 04:32:31 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit This driver prefers connection speed over sas port speed. On stable/13 branch the stack-allocated CCB is not cleared thus the cam layer may report weird speed on boot. ``` da0: Fixed Direct Access SPC-4 SCSI device da0: 4294967.295MB/s transfers ``` -current and stable/14 have the change [1] which clears stack-allocated CCB thus are not affected, but I want -current and stable/14 to have this fix in to reduce drift between branches. 1. ec5325dbca62 cam: make sure to clear even more CCBs allocated on the stack Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48438 (cherry picked from commit 7befd68335a0b34405b6293f30cc47cabc46ab06) (cherry picked from commit 5094faf5dfa860f238f636457563bc0d89013c7a) --- sys/dev/vmware/pvscsi/pvscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index b3be2280eb5e..e850f6d8dae3 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1445,6 +1445,10 @@ finish_ccb: cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; + /* Prefer connection speed over sas port speed */ + cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED; + cts->xport_specific.sas.bitrate = 0; + ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); } break; From nobody Mon Jan 20 12:42:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc92s2dfGz5lHyV; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92s1kb5z3v9G; Mon, 20 Jan 2025 12:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7iNAy7GZpDHyRKUQcnXHNTljW3UCbAasIVxnTIgcaP4=; b=B4w3sQ71s97uhxKrdTfhZw9Cus2a/axGMKEwfkYtt5ES23UtHIYEqSWFn3UiTYTeb6Zkd+ 4seFGnhVJ2fcncFEG926Z/jS2MDgj8miP0it+VvkHsLLihfPGPT30NzpX5+Jhb1OYOmyVA lz+R5lANNdfsyW7mr4FVPcAlXEuY6AqAsEA4itRjvP6ZNIwsYsHzRMJhgW04kRp0tqAEuP H7oTbn1rZi5fnhoPLy+UnL+WA8V/BtjS/Zs0ESqI8/5jJ3ngUNJIFmrDa17ZqE3AjoftyR fFiYCvuZrDaabKJWLNpVWFsJ/KLqTzCXAjpTaHFOVuK/xmClxym7D/35rSkkzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7iNAy7GZpDHyRKUQcnXHNTljW3UCbAasIVxnTIgcaP4=; b=fcx/21EnrF5JMomv2btI6WzQ6YR2LluC+hUePgFs7Y+8ivZDwIFZxVuXkAUryv9K1c3fba CLofx34r9xN2uFhtndRXhb/E4TcmrMd2lGi1YEkEHj/m9rO0hPdyJULZhSGvlHbFYiTnO2 Rp6VJbGDN7Bihxv8kbhH4P5EOdFuADqbkRx/VhRQmIBCVRE4+vtk6vdjrtdwL71145PSRF irUKTobNzWk5L28oDahYrwInOjsXg3DmVygQN8mWNSMgvQ7FfHcf96OcTCllq4n795UqS6 uwSemXl8kU5Be6Be6tlqAi0jS36jD7Fhh1xKsdyYoz2usrCeErGXRPalHMghCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376933; a=rsa-sha256; cv=none; b=Ph0k1/LwJPGqWsLEZntF+fjgZ4VCQgGbVbwSgRjwkz5bRjO34VVaN96VBFH3R9GwXKTpHj RQWSJH/vyMLoL/FOwM+/nbAUH4PGSldiuSAkmq539WVhp+RWQES9KGnRpAVlmxIgnkSq+W worqSwdXaEaocWYGI45eueovDxTO60eLzjU2ugDhywRckILQ15Rm3YuxHRxLe64koVsiP1 2Hfc3KNhknEEGZOn7bY+Le/yUFziKoUBMu8pHDuuiFDwOFcTgf6TQ1tBxgS0qLOrlWkeAJ Im0uAkO75C0qd+v9rV9m3w4NYo5QkRr9fAy3QL9uJ1fiLDQefIJyP4AolmYv/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92s1GW8z5dl; Mon, 20 Jan 2025 12:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgDre098413; Mon, 20 Jan 2025 12:42:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgDFm098410; Mon, 20 Jan 2025 12:42:13 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:13 GMT Message-Id: <202501201242.50KCgDFm098410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 23b90ad00a2a - stable/13 - cam: make sure to clear CCBs allocated on the stack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23b90ad00a2a00e4c4fa25b996de79266ae152a6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=23b90ad00a2a00e4c4fa25b996de79266ae152a6 commit 23b90ad00a2a00e4c4fa25b996de79266ae152a6 Author: Edward Tomasz Napierala AuthorDate: 2021-03-30 18:15:11 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 cam: make sure to clear CCBs allocated on the stack This is required for small CCBs support, where we need to track whether the CCB was allocated from an UMA zone or not. There are no (intended) functional changes with the current source. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29484 (cherry picked from commit 076686fe0703b906a05c9869609dd550bd4ed7ac) --- sys/cam/cam_periph.c | 6 ++++++ sys/cam/cam_xpt.c | 5 +++++ sys/cam/scsi/scsi_da.c | 3 +++ sys/cam/scsi/scsi_xpt.c | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 21abebc416ae..f609e198921a 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -760,6 +760,7 @@ camperiphfree(struct cam_periph *periph) union ccb ccb; void *arg; + memset(&ccb, 0, sizeof(ccb)); switch (periph->deferred_ac) { case AC_FOUND_DEVICE: ccb.ccb_h.func_code = XPT_GDEV_TYPE; @@ -1333,6 +1334,7 @@ cam_freeze_devq(struct cam_path *path) struct ccb_hdr ccb_h; CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_freeze_devq\n")); + memset(&ccb_h, 0, sizeof(ccb_h)); xpt_setup_ccb(&ccb_h, path, /*priority*/1); ccb_h.func_code = XPT_NOOP; ccb_h.flags = CAM_DEV_QFREEZE; @@ -1348,6 +1350,7 @@ cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("cam_release_devq(%u, %u, %u, %d)\n", relsim_flags, openings, arg, getcount_only)); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0; @@ -1472,6 +1475,7 @@ cam_periph_bus_settle(struct cam_periph *periph, u_int bus_settle) { struct ccb_getdevstats cgds; + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgds.ccb_h.func_code = XPT_GDEV_STATS; xpt_action((union ccb *)&cgds); @@ -1543,6 +1547,7 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, * First off, find out what the current * transaction counts are. */ + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); @@ -1661,6 +1666,7 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **orig, /* * Grab the inquiry data for this device. */ + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 391a5b8ae2a2..25679c705741 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -495,6 +495,7 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * * This is an immediate CCB, so it's okay to * allocate it on the stack. */ + memset(&ccb, 0, sizeof(ccb)); /* * Create a path using the bus, target, and lun the @@ -2546,6 +2547,7 @@ xptsetasyncfunc(struct cam_ed *device, void *arg) if ((device->flags & CAM_DEV_UNCONFIGURED) != 0) return (1); + memset(&cgd, 0, sizeof(cgd)); xpt_compile_path(&path, NULL, device->target->bus->path_id, @@ -5024,6 +5026,7 @@ xpt_start_tags(struct cam_path *path) sim->max_tagged_dev_openings); xpt_dev_ccbq_resize(path, newopenings); xpt_async(AC_GETDEV_CHANGED, path, NULL); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -5049,6 +5052,7 @@ xpt_stop_tags(struct cam_path *path) device->inq_flags &= ~SID_CmdQue; xpt_dev_ccbq_resize(path, sim->max_dev_openings); xpt_async(AC_GETDEV_CHANGED, path, NULL); + memset(&crs, 0, sizeof(crs)); xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL); crs.ccb_h.func_code = XPT_REL_SIMQ; crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY; @@ -5206,6 +5210,7 @@ xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, xptpath = 1; } + memset(&csa, 0, sizeof(csa)); xpt_setup_ccb(&csa.ccb_h, path, CAM_PRIORITY_NORMAL); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = event; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 5782d414bd42..2161e3340ff6 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4888,6 +4888,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) /*timeout*/0, /*getcount_only*/0); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; @@ -6133,6 +6134,7 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, * up with something that will make this a bootable * device. */ + memset(&ccg, 0, sizeof(ccg)); xpt_setup_ccb(&ccg.ccb_h, periph->path, CAM_PRIORITY_NORMAL); ccg.ccb_h.func_code = XPT_CALC_GEOMETRY; ccg.block_size = dp->secsize; @@ -6170,6 +6172,7 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, min(sizeof(softc->rcaplong), rcap_len)) != 0)) { struct ccb_dev_advinfo cdai; + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_RCAPLONG; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 512d4ad6823a..37d8333e21a8 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1046,6 +1046,7 @@ proberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; @@ -2299,6 +2300,7 @@ scsi_scan_lun(struct cam_periph *periph, struct cam_path *path, CAM_DEBUG(path, CAM_DEBUG_TRACE, ("scsi_scan_lun\n")); + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -2425,6 +2427,7 @@ scsi_devise_transport(struct cam_path *path) struct scsi_inquiry_data *inq_buf; /* Get transport information from the SIM */ + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -2485,6 +2488,7 @@ scsi_devise_transport(struct cam_path *path) */ /* Tell the controller what we think */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -2747,6 +2751,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path * Perform sanity checking against what the * controller and device can do. */ + memset(&cur_cts, 0, sizeof(cur_cts)); xpt_setup_ccb(&cur_cts.ccb_h, path, CAM_PRIORITY_NONE); cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cur_cts.type = cts->type; @@ -2930,6 +2935,7 @@ scsi_toggle_tags(struct cam_path *path) && (dev->inq_flags & (SID_Sync|SID_WBus16|SID_WBus32)) != 0)) { struct ccb_trans_settings cts; + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.protocol = PROTO_SCSI; cts.protocol_version = PROTO_VERSION_UNSPECIFIED; @@ -3037,6 +3043,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int *speed, u_int *freq, stru return; /* Ask the SIM for its base transfer speed */ + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); From nobody Mon Jan 20 12:42:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc92v1mZqz5lHyY; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92t3Zyxz3vZB; Mon, 20 Jan 2025 12:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8BwJys7RU9qyHqxlWN3v/xISBFRKRzj1MhCf/AIXf8=; b=LVaSBN5YvxQNKXCy+gfpF35p4uFOq4FPGObAfGtHRp1k4HgcNZ93HDksT0pWkQ0Bv+xWnX YZamHTwa3S6xChKzBcG3ZJ0oiZ4FDImHc6gXJ39NWmRh28f8ZXhWvdGuQYSPVSB4trzx4A hDSvekBCIkHPP0uGiCItY8py2pgv7zRo7emlciFWTVbBvKqL6QdNvKmP2DmlLx5+xLh4f8 7r8romgik1xwCpT57M1Kw+MmO889pc47Uav6YfNyeGrwwSb514QoebkY29kOy4SI384n6v Ku4NZAKXLZUxNFUtIHu8KkPBh77wN9MHgO/xuLtNvwR2xHpJ6I0JLIOVYhrY6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o8BwJys7RU9qyHqxlWN3v/xISBFRKRzj1MhCf/AIXf8=; b=bVhVUpTPPzC37jgZ/Kim4bg/SQrg5WmrPkLbt+VF4QvedZnZYSyLY53MvkzvglWkDYLe+w cyy92JHXbaJx/9Rqk5BHffiPynyFdGQwrlUEjuFTCH7Q7uren8sjFE1qOtOSurMvDqOmc8 QaeCfFDt6osn4YsZYNbohXmwq0fMCL60v97Xc2r9mYqCrpCHgiy5ViPArNksiHJHfkaYqh CicB6LEyccFAg2R1gg2dGoKUZYkIkBHho9UW3i8Y/GNDFYgFRLRK4b8KoQYUlOuag7iCRv k6nwnsk/vTcI4a3nQcPwgRF5H0S5s19rSIRWtKIttyhHc0I9Y6PU6o+XJNzInw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376934; a=rsa-sha256; cv=none; b=gs/wsll+Ef2og++Nzwe3pJMGVp7YCK6myOGy9j2XQ3gcP/hlilSGELjVk+h1jO/yovobDK sZb1uowQBw3W8mu89eW5hbva7+XOE2OHeSfULaVp94/Oljvn1n6FKqAqVuK4U3dYMvnULh nwXXVPQDbT6NJMUWA6zJ6BO4MLy4pTF+KEVfNfVBZ/cmIoAbC578ITRO2eJzIUrWcMx9dM pcBJc6HneUSMj1aoWfbrGf8Cdmak2MVtpuMhhAkbqCL+HCIoFGf5VFuKXMLivnGU23SLSJ wUn05bbvcnQ5vuIWVRkP8Csj5BgzPcCvYy4E8h9KPf1xCaq18XAX/3mBHzD66w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92t2JPGz4yK; Mon, 20 Jan 2025 12:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgE5k098445; Mon, 20 Jan 2025 12:42:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgEvt098442; Mon, 20 Jan 2025 12:42:14 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:14 GMT Message-Id: <202501201242.50KCgEvt098442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ee2a1bc81a17 - stable/13 - cam: make sure to clear even more CCBs allocated on the stack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee2a1bc81a1782f197053c53cf84b4933e545e47 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ee2a1bc81a1782f197053c53cf84b4933e545e47 commit ee2a1bc81a1782f197053c53cf84b4933e545e47 Author: Edward Tomasz Napierala AuthorDate: 2021-04-10 10:25:22 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:26 +0000 cam: make sure to clear even more CCBs allocated on the stack This is my second pass, this time over all of CAM except for the SCSI target bits. There should be no functional changes. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29549 (cherry picked from commit ec5325dbca629d65179f14f68bbcdb9c014f1523) --- sys/cam/ata/ata_da.c | 2 ++ sys/cam/ata/ata_xpt.c | 3 +++ sys/cam/mmc/mmc_da.c | 1 + sys/cam/mmc/mmc_xpt.c | 1 + sys/cam/nvme/nvme_xpt.c | 2 ++ sys/cam/scsi/scsi_cd.c | 1 + sys/cam/scsi/scsi_enc_ses.c | 3 +++ sys/cam/scsi/scsi_sa.c | 2 ++ sys/cam/scsi/scsi_xpt.c | 2 ++ 9 files changed, 17 insertions(+) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 4ad82e8e1fc0..38d8b45243bc 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1346,6 +1346,7 @@ adaasync(void *callback_arg, u_int32_t code, case AC_GETDEV_CHANGED: { softc = (struct ada_softc *)periph->softc; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); @@ -1381,6 +1382,7 @@ adaasync(void *callback_arg, u_int32_t code, cam_periph_async(periph, code, path, arg); if (softc->state != ADA_STATE_NORMAL) break; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 5c8f07dd5e9e..81e6269dfa0d 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -724,6 +724,7 @@ aproberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; + bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; @@ -1691,6 +1692,7 @@ ata_device_transport(struct cam_path *path) ata_version(ident_buf->version_major) : cpi.transport_version; /* Tell the controller what we think */ + bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -2126,6 +2128,7 @@ ata_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; u_int speed, mb; + bzero(&cts, sizeof(cts)); _ata_announce_periph(periph, &cts, &speed); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 18d686735082..81cbccb62693 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -693,6 +693,7 @@ sddaasync(void *callback_arg, u_int32_t code, case AC_GETDEV_CHANGED: { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_GETDEV_CHANGED\n")); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 127c24e31bf4..c957a1ef5e41 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -386,6 +386,7 @@ mmc_announce_periph(struct cam_periph *periph) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmc_announce_periph")); + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index ec4ffd4b33e7..e55bc09cf35d 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -631,6 +631,7 @@ nvme_device_transport(struct cam_path *path) path->device->protocol_version = cpi.protocol_version; /* Tell the controller what we think */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; @@ -792,6 +793,7 @@ nvme_announce_periph(struct cam_periph *periph) cam_periph_assert(periph, MA_OWNED); /* Ask the SIM for connection details */ + memset(&cts, 0, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index d5406dc76f6f..b964c59906d3 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1257,6 +1257,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) status = done_ccb->ccb_h.status; + bzero(&cgd, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, CAM_PRIORITY_NORMAL); diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index df06a8a4c22e..ef71cfb1f0b4 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -980,6 +980,7 @@ ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, != CAM_REQ_CMP) return; + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); @@ -1041,6 +1042,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element_t *elm, args = (ses_setphyspath_callback_args_t *)arg; old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); xpt_path_lock(path); + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; @@ -1101,6 +1103,7 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, * Assemble the components of the physical path starting with * the device ID of the enclosure itself. */ + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.flags = CDAI_FLAG_NONE; diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 2ac4edb48de2..9c596f5523d0 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -2552,6 +2552,7 @@ saregister(struct cam_periph *periph, void *arg) bzero(&ext_inq, sizeof(ext_inq)); + memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; @@ -4728,6 +4729,7 @@ saextget(struct cdev *dev, struct cam_periph *periph, struct sbuf *sb, SASBADDVARSTR(sb, indent, periph->periph_name, %s, periph_name, strlen(periph->periph_name) + 1); SASBADDUINT(sb, indent, periph->unit_number, %u, unit_number); + memset(&cgd, 0, sizeof(cgd)); xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 37d8333e21a8..28d6445afac5 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2730,6 +2730,7 @@ scsi_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_path *path inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; + memset(&cpi, 0, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -3086,6 +3087,7 @@ scsi_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) struct ccb_trans_settings cts; u_int speed, freq, mb; + memset(&cts, 0, sizeof(cts)); _scsi_announce_periph(periph, &speed, &freq, &cts); if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) return; From nobody Mon Jan 20 12:42:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc92w6FR8z5lJ9v; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92w4ZZdz3vd7; Mon, 20 Jan 2025 12:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnhsoaDeTzCjpwTU0M1eSlclO57vS3Hz5B0BGDLG3LY=; b=pxDjdrua1nsfRJOJHvO1QkvUdIS5JtjVCVTxkG7TvWJ+C7M1tna/hMom7OTShFkfgXKQyo oX3TvcNdxzjEJjwLk3nbpaWlWfIHRMld5nTRgidNAo06456AZmNVU0M6I6T28rrw8lAChj Gj25Zzw71GVL7meQ3F8R0jv6qRVjq/r7SH6Ufz4JZGOYlju6mPWZmDH2cb3rwC3S98uWnK Shx903cv2Nt7a92CuZXtVs5Wo+s/E/rGXMbuqF7Rmy5W/sicQntpo1AxNVA6p+u//6+/Vc hyZVFthobzBBHDUtLTCNKnrWVSf/iikPV/MgSR8gg+T3I1lkhJwn8JRvpjd7PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnhsoaDeTzCjpwTU0M1eSlclO57vS3Hz5B0BGDLG3LY=; b=yVaIVM27fNT7bn05gFws/Lu5fPsPZ0RIiIF6G/W6UOopteTF27QWBtPcFnYjoAIelS/8D8 vl1xjE0+0PTR0uGJYut4oTQkIY/LN183QUaG7OX9BiKaGWGFqgjJ0OXsmBsZwPbHZ6hf2Y 3dsTZCIQ9KFjb4KsNgrD9LRUGLK1DQQQTixy+fkHm05iQ4METN4BpyBt1OwcYfdnsSopf7 4GK1VIhDPyqPs2w24tgM819KRmhrRyw3GyOIG7iTemWgDQv9erxNPIWSb66yFGT60rU4YZ LQLn4zKz0Aq73Hq7yANayLplMbaqUdPuZrlldGZZ15sU1wAaiGn2e1IQhgJdXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376936; a=rsa-sha256; cv=none; b=BUAOxaf05oaBDuLsE7J22vzm6BjTtbHAYcKH+fQIyBIuh9jAJoGc7mEyDID9f7N4toOLnO qo9cUXqUqPHtjXlpC+GJDwksKY785h9m4uGmMfG9cmGFq3n0ES++1quw7L5ADubXvwE+7q 7WsaN+YDhf4jz6vV2OQGhrlQSeGlb0truqf8DEKqyCR2hoa26RXZV5XHQ+fykIE9EgR+sb Hsu3cDO+WkWzdvXL25HH70QzTqYtvdbVWhIRd7xPwcCy1O2eC10uJlnhn6hB3S5ZQLFXDw eDLgUKTPQ0oDd6wEE3DL798EEsqpXVREkpTCMCZ1MN6VP7ild0/RXl9fJCuDog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92w4BBdz5hH; Mon, 20 Jan 2025 12:42:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgG5Z098810; Mon, 20 Jan 2025 12:42:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgGT2098794; Mon, 20 Jan 2025 12:42:16 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:16 GMT Message-Id: <202501201242.50KCgGT2098794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: eeecaa064c8d - stable/13 - cam: clear stack-allocated CCB in the target layer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eeecaa064c8d4ba0f4a17739527ef285ee56fd36 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=eeecaa064c8d4ba0f4a17739527ef285ee56fd36 commit eeecaa064c8d4ba0f4a17739527ef285ee56fd36 Author: Edward Tomasz Napierala AuthorDate: 2021-07-21 09:18:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:27 +0000 cam: clear stack-allocated CCB in the target layer Note that, as pointed out by scottl@, this code should really look a bit different, in that the stack allocations should be replaced with dynamic allocation, and the periph creation should be moved to a context where one can use M_WAITOK. See the review for more details. For now let's go with a minimal fix until we're done with UMA CCBs. Reviewed By: mav, imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30298 (cherry picked from commit 616a676a0535eca78ce6b02a6226d0bcb69d7d4e) --- sys/cam/ctl/scsi_ctl.c | 3 +++ sys/cam/scsi/scsi_targ_bh.c | 7 +++++-- sys/cam/scsi/scsi_target.c | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c index 4bc7091337ca..d3a3e299a213 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -477,6 +477,7 @@ ctlferegister(struct cam_periph *periph, void *arg) /*getcount_only*/1); } + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_EN_LUN; ccb.cel.grp6_len = 0; @@ -611,6 +612,7 @@ ctlfeoninvalidate(struct cam_periph *periph) cam_status status; /* Abort all ATIOs and INOTs queued to SIM. */ + memset(&ccb, 0, sizeof(ccb)); xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); ccb.ccb_h.func_code = XPT_ABORT; LIST_FOREACH(hdr, &softc->atio_list, periph_links.le) { @@ -1850,6 +1852,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc *softc) struct ccb_getdevstats cgds; int num_items; + memset(&cgds, 0, sizeof(cgds)); xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgds.ccb_h.func_code = XPT_GDEV_STATS; xpt_action((union ccb *)&cgds); diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c index ae105ea03356..7b543763c521 100644 --- a/sys/cam/scsi/scsi_targ_bh.c +++ b/sys/cam/scsi/scsi_targ_bh.c @@ -239,6 +239,7 @@ targbhenlun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) != 0) return (CAM_REQ_CMP); + memset(&immed_ccb, 0, sizeof(immed_ccb)); xpt_setup_ccb(&immed_ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); immed_ccb.ccb_h.func_code = XPT_EN_LUN; @@ -265,7 +266,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_accept_tio *atio; atio = (struct ccb_accept_tio*)malloc(sizeof(*atio), M_SCSIBH, - M_NOWAIT); + M_ZERO | M_NOWAIT); if (atio == NULL) { status = CAM_RESRC_UNAVAIL; break; @@ -307,7 +308,7 @@ targbhenlun(struct cam_periph *periph) struct ccb_immediate_notify *inot; inot = (struct ccb_immediate_notify*)malloc(sizeof(*inot), - M_SCSIBH, M_NOWAIT); + M_SCSIBH, M_ZERO | M_NOWAIT); if (inot == NULL) { status = CAM_RESRC_UNAVAIL; @@ -348,6 +349,8 @@ targbhdislun(struct cam_periph *periph) if ((softc->flags & TARGBH_FLAG_LUN_ENABLED) == 0) return CAM_REQ_CMP; + memset(&ccb, 0, sizeof(ccb)); + /* XXX Block for Continue I/O completion */ /* Kill off all ACCECPT and IMMEDIATE CCBs */ diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 4cb8024545e1..dcec777d1604 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -360,6 +360,7 @@ targendislun(struct cam_path *path, int enable, int grp6_len, int grp7_len) cam_status status; /* Tell the lun to begin answering selects */ + memset(&en_ccb, 0, sizeof(en_ccb)); xpt_setup_ccb(&en_ccb.ccb_h, path, CAM_PRIORITY_NORMAL); en_ccb.ccb_h.func_code = XPT_EN_LUN; /* Don't need support for any vendor specific commands */ @@ -933,7 +934,7 @@ targgetccb(struct targ_softc *softc, xpt_opcode type, int priority) int ccb_len; ccb_len = targccblen(type); - ccb = malloc(ccb_len, M_TARG, M_NOWAIT); + ccb = malloc(ccb_len, M_TARG, M_NOWAIT | M_ZERO); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); if (ccb == NULL) { return (ccb); @@ -1030,6 +1031,7 @@ abort_all_pending(struct targ_softc *softc) * Then abort all pending CCBs. * targdone() will return the aborted CCB via user_ccb_queue */ + memset(&cab, 0, sizeof(cab)); xpt_setup_ccb(&cab.ccb_h, softc->path, CAM_PRIORITY_NORMAL); cab.ccb_h.func_code = XPT_ABORT; cab.ccb_h.status = CAM_REQ_CMP_ERR; From nobody Mon Jan 20 12:42:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc92v6cvJz5lHyZ; Mon, 20 Jan 2025 12:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc92v45h8z3vg2; Mon, 20 Jan 2025 12:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0UdfaMQQAZSLqSIXrPKfcIEa/p07ZY+pkXhVPoENJc=; b=OvTTPrEb2KbWaNBHBOIGFzHXFKLK6sawNBaDIiwZBkvBk+0OH56WFKwetB4FDZbU1RBbms LRDX4mXfztNcZcZhSo9RMv8vvtQJYcpv0iQcP5CLtWEtpr7tRnwIxofztfI+0CVMWwG5Vq VGwmdMvIpGu5GkA83pNsomx3MtVITr1MuBguUJ2x13D0ldDCZuAfDDd9uBnAcNj4Dt5+AI Iy3QGwq5Az3IiD5OElXVYz8JBPaUQ4jioIgieWZYk05PABa70t/uK3KV1CbCDBZT3eoT/d Xowx5EDrPwJQPRLS50AOBVgjnx/aXOLgZTtE69qXk3znAIu4kAC0X9+t3NcInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737376935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0UdfaMQQAZSLqSIXrPKfcIEa/p07ZY+pkXhVPoENJc=; b=fRO5y+OaYABRrRIzwL+T2Sp9ioLjCfnHznkKIDdu/wUJpQbWTRyCsH8L6h7JVHGcaPfxpV 1Ko+aHzNmQDyUOcZhn+VaieB64ItNbwDHX9ZbNtNTTnnl5BQrAy1m57sm2zz2/LVUfL2hq e6SMTqZw37bnbg4efBAYuVy+BECszHWs2N0dAyxaTU5CbPRBBsmYMOmcXjBTDllf3g1mWf 8kzZvLi9eOzVQtPsdyvQan/yk3ncyCIeoyeutHa4ylHYBsJoXoFUvuOTu1z6/cbYiuOpk5 jIIxighzDfnWV2j6zkUZ92apR5CC+Aycspu8Ip+sfeUBeGThxsTOTumQFam1Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737376935; a=rsa-sha256; cv=none; b=FWhpP5kuoh0pI8hFF0d+zo4by5jZe4eYSeSwjteEHMASgtmIaTZwMfE1phaQ6SnkYbEjjm IdDk7lvrJJ1H8VVLHZ8r5ngCvEI4sSqThqCKvexcK2E/JH09kL+giQ1s8SJ5tyQf7STCXC aQZdtEjSBswa51NOwMeu7au93DicBe7DCBgqC7153Fs5lVmMVAeAZxKscMEhtQy0E4pHTK 5jSnHq+h95FpkM1reP9v/IdUBqWfLaUOu0IcIXAVbWW343BbPQez5BJF8SbZ+uvk5jWqp1 l/4SUQH0knVtMRt6SlJyaCOLwGIxxNQ0hnEaqik2qIvyvGMM0WAY5rlRovaIyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc92v3cv1z5dm; Mon, 20 Jan 2025 12:42:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KCgFC7098477; Mon, 20 Jan 2025 12:42:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KCgFBW098474; Mon, 20 Jan 2025 12:42:15 GMT (envelope-from git) Date: Mon, 20 Jan 2025 12:42:15 GMT Message-Id: <202501201242.50KCgFBW098474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: cdd9dd5ac768 - stable/13 - cam: add missing zeroing of a stack-allocated CCB. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a commit cdd9dd5ac768675c1e67b6aa33f8f1c0ae56534a Author: Edward Tomasz Napierala AuthorDate: 2021-05-16 09:28:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-20 12:39:27 +0000 cam: add missing zeroing of a stack-allocated CCB. This could cause a panic at boot. Reported By: Shawn Webb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit 0f206cc91279e630ad9e733eb6e330b7dbe6c70e) --- sys/cam/ata/ata_xpt.c | 1 + sys/cam/scsi/scsi_xpt.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 81e6269dfa0d..c20c8626e395 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -2181,6 +2181,7 @@ ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) struct ccb_trans_settings cts; u_int speed, mb; + bzero(&cts, sizeof(cts)); _ata_announce_periph(periph, &cts, &speed); if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 28d6445afac5..3b3aaabf2968 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -3144,6 +3144,7 @@ scsi_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; u_int speed, freq, mb; + memset(&cts, 0, sizeof(cts)); _scsi_announce_periph(periph, &speed, &freq, &cts); if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP) return; From nobody Mon Jan 20 13:23:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yc9yF3xNRz5lLSg; Mon, 20 Jan 2025 13:23: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yc9yF3D7Tz41pQ; Mon, 20 Jan 2025 13:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737379397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qd+E9lp1aY0SANtat480bLc2EBSCcGaPKYYz9k9lxQ4=; b=yWCj7MqoCS90BASgjezvAXWtL7hL3PaW6p3nMGQXvCpGxUBp3QQ40wdxLH7xWU0h2hwwWp PO8GK1n7+KNbBly6VQx6hwkW0fwR2OZPFlOo7AGKo9qVLU+HXvNZnQ8xgtWVkxSFrHNFD1 +OKxizIw5z5qgFczgN2YM2NJ9gBvnVl7vS5SjxXQ06hh+g8GnWus4SiFUGGbHfG9IST/ZM f3cw3H0T6ltWMiN7ogytvlrn3zVnLRaAaxga76EO97AMwub5djf1azO4oxXvABY9YdGQs6 R8NM4XucPPq/+fxi+1W/xTF2IUaKzC0JII78USqNY2zSdmkBuQMPmnxEq5NvNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737379397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qd+E9lp1aY0SANtat480bLc2EBSCcGaPKYYz9k9lxQ4=; b=uv1KMCGqPP97Vj/acYYwFqpT/833nnwS/9bd24Z9W27+OLpnzd8BOlr3hNJ+uyFhjNu4Eq YO8WUldBoNxDen0IPjTpz3ahzK2EIF7ufR/mvHUcLIyATtbuSLMaDlS28QKK5CDWbDGMBT YrhzBppa/0A8d23lhvhpa/PIhvKUsxNBm58J92pax76mNRmTBH1d+C1EITuF1yKb0/KNBx jVyrjkqcTd3EAsxHK8wQhzuy5sb9Ilecbyal2COTHfbmn1EEX9Quz6XekngNihKCUC9gAg 1uZlHuwARxuHnCZyBeuYTzA83i2as4BNCuQJBN68cywCDVD4xrLE6RdZGR/8Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737379397; a=rsa-sha256; cv=none; b=TQmG2kV6gfa4wDpVYltcC/g5h3ifdwOaoecOSp91ZkQPPkvKEe7UBHvg5rhlepdzBU8Jhb 68WBzLUOp/5vi00hSaqeuihhbxlRD98CIWon2wh3xw6OhCMWyFNpUz8nsD/IR8ORBwfaDx XQuTnANbEvyC44MA+1Cu6XzupRvmP72SS6aJeXrLIxJc6S1iom7UOjTv54ffxqKdXlm1fv Wv7+wf9iANoYMdnUpVEivijoBqh48rPIHVECgBCGolsXSY5eYYmHLixFxKgDCVggE3B7fb 65rz3e2yZpbHUpOPFc1x32l496jVpJnaKFOmYR72xX7xIk+XhUBo6rwwR3NU/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yc9yF2pHPz62H; Mon, 20 Jan 2025 13:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KDNHu1074468; Mon, 20 Jan 2025 13:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KDNHsf074465; Mon, 20 Jan 2025 13:23:17 GMT (envelope-from git) Date: Mon, 20 Jan 2025 13:23:17 GMT Message-Id: <202501201323.50KDNHsf074465@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: 90670e0e275c - main - jls.8: Reference correct manpage for libxo options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 90670e0e275c6e36fc7e14368fc4e3e7f1d3671d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=90670e0e275c6e36fc7e14368fc4e3e7f1d3671d commit 90670e0e275c6e36fc7e14368fc4e3e7f1d3671d Author: Ed Maste AuthorDate: 2025-01-20 13:21:51 +0000 Commit: Ed Maste CommitDate: 2025-01-20 13:22:44 +0000 jls.8: Reference correct manpage for libxo options PR: 284135 Sponsored by: The FreeBSD Foundation --- usr.sbin/jls/jls.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jls/jls.8 b/usr.sbin/jls/jls.8 index 1361d70b654b..ce148da0d138 100644 --- a/usr.sbin/jls/jls.8 +++ b/usr.sbin/jls/jls.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 20, 2012 +.Dd January 20, 2025 .Dt JLS 8 .Os .Sh NAME @@ -66,7 +66,7 @@ Generate output via .Xr libxo 3 in a selection of different human and machine readable formats. See -.Xr xo_parse_args 3 +.Xr xo_options 7 for details on command line arguments. .It Fl d List @@ -112,7 +112,7 @@ Without this option, all active jails will be listed. .Sh SEE ALSO .Xr jail_get 2 , .Xr libxo 3 , -.Xr xo_parse_args 3 , +.Xr xo_options 7 , .Xr jail 8 , .Xr jexec 8 .Sh HISTORY From nobody Mon Jan 20 13:55:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcBg50wCyz5lN5m; Mon, 20 Jan 2025 13:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcBg475XQz458N; Mon, 20 Jan 2025 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737381313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPaRw3Bj1RE3Ph/4UdqEQBAHCkhxfJQSOUQbf+EawMo=; b=OU84vyd3dYrubuV1rjbs/Lxd9PZswe6bafkKo9J7igT0JxXXSD4YKM9rXE0OocWsy63VBy RNwHIMIfin61qm2/6lBdoNPyK4sc5OdJaKSEkKSjPJ1wyCYEVzRJ27oJxQfSHbIbi3vILY jhTo+i/YDe9p4++tY1wqkiP40rr0ehbxaAAM0qBP0lE3UKSTAulMk57oTlOmr8qU+BUbii 3PNpIaOC2qLW5iJD+fL5A5RoGoFMjeMFVC15KhxHO0953v63+6lQ0heYUYm5Vxc2ofyAiR p2zGtV8VaxB8aMeFz3/V3Ftwglf+5ckl840bK58nbUzgXJZ3hSKWwSo3xtZBkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737381313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPaRw3Bj1RE3Ph/4UdqEQBAHCkhxfJQSOUQbf+EawMo=; b=ZeFrAYWogbruBNfw4gFUzapLAdYx8R2Dv9guZOFTVSFXBRu7t1jondbPNrCBjZ6ONwIQea 8PjyLTbvNV2Ku1fby5MrUAbxsKGOkjYczeCtg02MZLfgmrAEvK5ksXYWpFwUjKJ8go2h7L yNS2Nn3e0IHrekTpgI7xVJ5xJVlr/vw1HLkMxJU7COVJTr3fJ3aWKklCPl7vSM1V2Xnlsa dTM2uSjBKVniItueRuQle25xmMVxDXTQLC60Mi09uPRpg8pyjzA5cazuhqNDuKw8rzCm1A Ya8Hz0F14WkDx7AaOTPftWiz6IwngzvC6eV7WuCIc/BJ3Kr6vGeDmDpmEJDWMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737381313; a=rsa-sha256; cv=none; b=B5dPRhOX2dyl2tsoj0FqBI6tx6E3eIwLpmITqwNknlGbDrBqrEwc2ErUxnvG/WdWv0fC1s V/vi8yVMi9NwU0leG4ub+WiO0+uQyL/p5wE96yO1uvpyo6AGi003c/4ZK0NeLJyzI3FVZB owpfmRi3FokZVIg71BWIJN/01TaP6K0BLlmCUjucx5twdpdZyYbaldAYEktzWJ/FLOHdm/ WZWdJvfRpc9/ltJhM2DYEjIegsQcRBf6oyO28aXKI9J48PPPG09hdfmlgxB+iN2k/Jd1oI ALqx18g20k7+lIJ3BLpkmyaRCrkAdb4bVe0mncF2Gzm62JE8FQkkOfXMWF0sfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcBg46Qbkz6pF; Mon, 20 Jan 2025 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KDtCOZ030759; Mon, 20 Jan 2025 13:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KDtCjV030756; Mon, 20 Jan 2025 13:55:12 GMT (envelope-from git) Date: Mon, 20 Jan 2025 13:55:12 GMT Message-Id: <202501201355.50KDtCjV030756@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: f9097705fb1c - main - pkgbase: Fix OSVERSION specification when creating a repo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: f9097705fb1c8d9c1f8946d1c1897d606bdbd517 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f9097705fb1c8d9c1f8946d1c1897d606bdbd517 commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517 Author: Mark Johnston AuthorDate: 2025-01-19 23:25:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 13:54:49 +0000 pkgbase: Fix OSVERSION specification when creating a repo -o OSVERSION= needs to appear before the "repo" verb, otherwise it has no effect. In this case, recent pkg-devel fails to create the repo, saying that ABI cannot be specified without OSVERSION. Reviewed by: kevans, manu MFC after: 2 weeks Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") Differential Revision: https://reviews.freebsd.org/D48518 --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c8e6e63d2e39..efa1299b76a7 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2362,7 +2362,7 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ + @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ From nobody Mon Jan 20 13:55:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcBg61G4Fz5lN5n; Mon, 20 Jan 2025 13:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcBg60dKTz45FC; Mon, 20 Jan 2025 13:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737381314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6g/RPq5UfLmjqyLdM8vcccCm0tPfhRuoZ4boM/aLVLY=; b=N1QA2EREDCnEUapiWEcd635dhdR7BDrcuc2K6tjIbuApohl/nokdpBBXn6a1P+Ix4Y+BMm jIrFn5XjtFehXLsDu8WMPA60RUUUQGN3WWwiEvPbvPaBxN4exKPBgYMtGBUsau609+UNAn JANZ1lI9r2+Adx5NqmYNklSp+ADg+K4oAF6av3trEebklNewBvWXW7qZQ78mL0HAFwIQwf R/s5Tu+qc+7/IIt+EBnftPYqXo9JCQCGee1+96n/qXBWl28TxwCQSRRoILRcwAkIATGbu5 HX2KAQ9peekC2fvekjH46iMrNcsGfCjCEr/IDPIcb9Yc/WlCiIZexrYZqE4f4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737381314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6g/RPq5UfLmjqyLdM8vcccCm0tPfhRuoZ4boM/aLVLY=; b=WzuZ+7uO60SMeG4R3Q75YPH3l4/XdVAO1k3suSzi22gfkMA02c8Vq+n0GpAG90MdAbYHyD I3mA2HKgKDgV9lGA9mdeyWx0wxLeCbtJ/YN8bIT26G1zKvg4+c3khFIwITI8FYs7D2DaxT z2nFVEn5nxC3tfzAHJLHgkFZjQsqQg7BkOm7fR0TF0BV0p2Tw9JEBJ8GJ0cEtNWYMZxbw4 KammH2HHENPKL9OPwq4mwlprBfg4SS8L3kFKrmNgddO+1MtUi/gnYfARNodmwIBcAqVb/0 Eho2/iCrcN+IhIP7ru7Ih1fTUrn3iJShvhd8vpB0doGBjcNiA2Rmr19anRFkvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737381314; a=rsa-sha256; cv=none; b=FHQaTjkrhjtvjHi9CyBpvPM9UrYOgzbtmVaejeXqQzjuItCVDNpRNmo10CfALtAsgjyMy+ jmWC9Zmm7LAAAG3WDR3uFHZJb6JXxjZDYtEEAfQvDSBNue2H0Xn4kPDqU7wapHGMGOn+Pw drFM6Mgd1nF+UWOsSh4GuOnWUADbPMiz2+MMWeRckbNm+FySAwhl98mTB71ysLQ+dDPTx5 MV7FBYDr4jAZ1XzQ+I2MmXzRhXrcAkUtEMfOC/BnYxLFvRbI+l+/MmALkjVQ2pHVBfJY/b XXlv3+OQe7nrsRWGdURh1w52Q9Ibbntj8Vwa0QIo4IrtUuy+ckxdaTXuiuty3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcBg60Dxfz6Qh; Mon, 20 Jan 2025 13:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KDtDIC030793; Mon, 20 Jan 2025 13:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KDtDJh030790; Mon, 20 Jan 2025 13:55:13 GMT (envelope-from git) Date: Mon, 20 Jan 2025 13:55:13 GMT Message-Id: <202501201355.50KDtDJh030790@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: 5b86888bae65 - main - ktrace: Fix uninitialized memory disclosure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5b86888bae651e54ccc0adde0ed897ec1c1e0d45 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5b86888bae651e54ccc0adde0ed897ec1c1e0d45 commit 5b86888bae651e54ccc0adde0ed897ec1c1e0d45 Author: Mark Johnston AuthorDate: 2025-01-20 13:50:04 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 13:54:49 +0000 ktrace: Fix uninitialized memory disclosure The sockaddr passed to ktrcapfail() may be smaller than sizeof(struct sockaddr), and the trailing bytes in the sockaddr structure will be uninitialized, whereupon they get copied out to userspace. PR: 283673 Reviewed by: jfree, emaste Reported by: Yichen Chai Reported by: Zhuo Ying Jiang Li Fixes: 9bec84131215 ("ktrace: Record detailed ECAPMODE violations") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48499 --- sys/kern/kern_ktrace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 7a31fe234cb5..a67b773a154c 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -973,9 +973,16 @@ ktrcapfail(enum ktr_cap_violation type, const void *data) case CAPFAIL_PROTO: kcd->cap_int = *(const int *)data; break; - case CAPFAIL_SOCKADDR: - kcd->cap_sockaddr = *(const struct sockaddr *)data; + case CAPFAIL_SOCKADDR: { + size_t len; + + len = MIN(((const struct sockaddr *)data)->sa_len, + sizeof(kcd->cap_sockaddr)); + memset(&kcd->cap_sockaddr, 0, + sizeof(kcd->cap_sockaddr)); + memcpy(&kcd->cap_sockaddr, data, len); break; + } case CAPFAIL_NAMEI: strlcpy(kcd->cap_path, data, MAXPATHLEN); break; From nobody Mon Jan 20 14:21:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCF32nbTz5lPHZ; Mon, 20 Jan 2025 14:21:11 +0000 (UTC) (envelope-from bapt@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCF26NKFz47Qx; Mon, 20 Jan 2025 14:21:10 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737382870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLgtl7JmaOu7BykleyseIyEWVi8uk61k7cZZQ5aqzXs=; b=jef9BSLihZjIqVT4UhXq8lODne0tfgv1vpLAI9UNyTsDf5L4pa7Jl5bxjH2WNtWwjEj+/V mpK1HDbDktb8FcQUqbyss1fsnhSnrNzpgPOXf8qNmHc4q64gTgtG1Do86KX5v7Kt5fytsb Bj5dL+nrrMSkNGQQxtQEFPRJ4vYFA4ijzq6wu8UwfExFTGSmacngoJyWjHdBAPzpMAZrBp rCsUHBmBFv24Hi3TUszS9VA7itKpbClzzNAH7WgttoA0U45aYt/M3ebnXMxtKLtFNULOEH AGx/unq1CRmBvh/tUhHxet85bTQ7/6E3Z0YcGa/EVF8W3ePhYlnD6/OQOjXX6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737382870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RLgtl7JmaOu7BykleyseIyEWVi8uk61k7cZZQ5aqzXs=; b=hCnom3EWRbxjcduH5tXxujzjb4kt19L1VQPU+OdyKsUW/rJgnLV7up3SXtC2KDutpKUMtD vonDm9Qm82rjXjfUknKnF0WygHsBgYn4LG2srUJEdqtaOg2XEbXiLnoCPHWwk0Lne6ZIl5 +mZipZhcr//nmbMJSVf50NKV5jxRyCRmFUYNxFlpKvj15fDm+u2TAKEpl2F4bZNIH1/oWy E+Bzh5L1am4FAszgwOdu7GgLqDPJX75n9NLlRgb6FVIU+rxfzza8VHlsgdPDIPa0hoZFED 4rW9az9ZNEAidKenMROG3+x8baYIe95XQXQDPH494X5NGQ5OBalAbQ+Yw2xE2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737382870; a=rsa-sha256; cv=none; b=mN7leVcSXXDtqmIZFHzGrlK5MquOu5EifI5m+eenx1ZgInXOK2K/2PIwQvtmlicy1Inic6 lOIx9mgwBlq2E3M5Yq9brZ5g3TU4NPFVj7h15cOFfvGY0VVcfs66ji7fASWRv7c0aRuDA7 vLG0YelwGQxDwfw+5auV8+7MlNFgcMcmEknfpeCWlEe6CmOQPg/YSt4I667DzUHvpwDeZ0 ONoRU4SPbL+tBIYsvf3T3QVImu+koPt8yIJbf8W+c/9kRkHwAvr9du1ElqWplHmjE06JVv dkHqDqCMZV5vPu+tPjkKHGSJz8irqeaUOenm2h6aecFezEAH+03U6UBzl7vp5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::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) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YcCF255QTzw3w; Mon, 20 Jan 2025 14:21:10 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 980F3DFCBD; Mon, 20 Jan 2025 15:21:03 +0100 (CET) Date: Mon, 20 Jan 2025 15:21:03 +0100 From: Baptiste Daroussin To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f9097705fb1c - main - pkgbase: Fix OSVERSION specification when creating a repo Message-ID: References: <202501201355.50KDtCjV030756@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501201355.50KDtCjV030756@gitrepo.freebsd.org> On Mon 20 Jan 13:55, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f9097705fb1c8d9c1f8946d1c1897d606bdbd517 > > commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517 > Author: Mark Johnston > AuthorDate: 2025-01-19 23:25:09 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-20 13:54:49 +0000 > > pkgbase: Fix OSVERSION specification when creating a repo > > -o OSVERSION= needs to appear before the "repo" verb, otherwise it has > no effect. In this case, recent pkg-devel fails to create the repo, > saying that ABI cannot be specified without OSVERSION. > > Reviewed by: kevans, manu > MFC after: 2 weeks > Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") > Differential Revision: https://reviews.freebsd.org/D48518 Good catch! Thanks! Best regards, Bapt From nobody Mon Jan 20 14:26:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCM53ztDz5lPKp; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCM53FpWz4869; Mon, 20 Jan 2025 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKW1DVsD3v5fnfy+XI1uscpY5akLQb/ME/jlLYRleC0=; b=lZensxFlzWSEXz+WaxTvG9911XKOiRMjkoUwk5f5L8/KIqLqFZAann3wsaP08EA8P13B6B cY8yQpIHgULsPl4TAlEtXHRhEroJvGJtEZtF0GtUpDbBRdUZ7bc/9AG9sJ0jT1jLXvDJaK HXD1mqeKn+UqtmuFO7nwxBKq2w+WPjK/fYz3YmQsfz5IWFym8O0jy/vGlBhaY1dtUG4X2r RqY/COU4y0pi91I9FLVNRwrO0VeKrjdIXN5Vr1Feye0kz8qPZ3qxtPZuq2oIRePd33KI4y VoGT0GlZUpMD0iSZAbyAZc2d9+6LAW/bBjvCRDVzmNrtItHKoxTgHYfdQ0Eo5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKW1DVsD3v5fnfy+XI1uscpY5akLQb/ME/jlLYRleC0=; b=U76BU/0joCJsxxLVMg2HnnPBEy9B9UohK12H4hCAbka7K2jxh8337e0cNAwAhUE43QP/w6 JSKJ7h1x6AnO9PXrpdBEw/4yKyst+NBlFKUynF/zve4f7fmrB8dXWZzSmLs3/pBiVsvcp6 2rWqSDvVn+OFGUaomee65SY1AlJNfHKo22z3w6DU48CLXX7oclUJAInQDrreJhHQMwbePT 3EvZ287S43kjvfj8090on1hNDiFAVrUKGLKro6YtJBk/1ONzq2hg3d0GhQKy6SbXxregNV KH1qjBk0nKIImM2TbQxJUKnG+2/hv4ro+dpFcPJdzimPeRR6vPpknabiqEoU2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383185; a=rsa-sha256; cv=none; b=Secavvy7aCv82ZJE2Wfx63BJU6nCNWABfvjEH9lDVn1+vYi69nty7mC13K80+tdNrmHPRC pgKr0GirdhHVrgesp2jxi84/XVOZMSANvmcpH+YEDYKiWclyLeb6aAx95j/qSJnWhXnFHm Qta/deOOrAEllmj8UTRnBPpW7peyS3Wb3TLuLp80eN9lcfe3NqWShrxbNK7P22a1QqCvVi TfCy0laXXo7KZsatCyt5jfcxtzVC3ZkmIbD1+VpytmZqPIP+sCYHnEuSBjzod3hHsqEDfd Orx0nQ4L5YbWjmZU4YZx+D29ue4VChNQC4NTCreuNngSSYgM95HOB5KfpTUW/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCM52VH5z7Jw; Mon, 20 Jan 2025 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQPAi086989; Mon, 20 Jan 2025 14:26:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQPHj086986; Mon, 20 Jan 2025 14:26:25 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:25 GMT Message-Id: <202501201426.50KEQPHj086986@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: c4cae8cbc337 - stable/14 - libbsnmp: avoid division by zero with empty password List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: c4cae8cbc337eaf824774fcba88018e42fa31efa Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c4cae8cbc337eaf824774fcba88018e42fa31efa commit c4cae8cbc337eaf824774fcba88018e42fa31efa Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 (cherry picked from commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146) --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index ab3ac2d18e64..b312a37ed3ed 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) From nobody Mon Jan 20 14:26:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCM642Gjz5lPKq; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCM63CXYz48jP; Mon, 20 Jan 2025 14:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qnb+3m0uB0w968B1ENQBB5saPPYqASIAeYlnQvWXZ98=; b=bLQV0lo9CS4zlnIqK+7xYyNS27Ztbtw2ahtREt6s9YaiUQ7jGH0AfRFpHA0Siqe5fdk0Kd c17COTk4x7XA02ftXrI97LNBRJL3FtLJtKgvXzfxouA6KBq4Oe0NriPIVGjowU14WD9KND sSZtru+Eb6Xxy1JVgUaxTQlySPRrdo/ATaiXxZbKObTKMsyj7/Bnc25dvpxOHevr5UFUEj yJMSASuenVTfearSZO3y1Re8SsQkugW/heRgNGkludJcAsLGW1zxkCiy8szKWH1bUZ0CfH GcEjxnz7nFQ6KGXS+Fw/3x/MZB3Og/90FDr8tLPhT14848hoAlrozBzgTNDoow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qnb+3m0uB0w968B1ENQBB5saPPYqASIAeYlnQvWXZ98=; b=BK+XW0ARaGn4o45R9OqOpsVrn7R0bZYMMeLKdrpsXVpzqu2RyUmMYDnsb94zdjsMZQ47B5 Ma4KRdrxEl5x4P8C7EzJqdXAuzKGbLKZ1CvKbsYDpdFasGSK069QBBLOoxg2e2QW7OCFaD U6Nm2ocPKkAwQAd0yU3yag8ew1ZYf7v8Z3g/P1Y2yufNjgZhxNBa2Oi5PqQQbGfUi+/m3O 0q7RHGJcOo0imM3czJOAA+rLy2VapvXNFa/T2xjH4jRB4KDy7mSjH/3CxGkPTp+MopFX/P UgJt1PDw8i7bKRk1knUZLm6NIpvjjjxHurNDELnhLB6Oyiey4bTouPbM6Psjag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383186; a=rsa-sha256; cv=none; b=AV3W/7v+IQuC1jzG+BraAwwSeesy3Cwq5QfKHkdbyc1IxY7IM2hzQWvFrhnaLSN/mAWz+6 PojzVop1SOAOTznty/u6RTtnkZaGXLL1gZTDYlT469xQT3sX9/MxN5bQONZlPcGaOjLnBl sNNFLJ0yrefEM8EMKW9pVuXuylE5Hgyi7A02bqcjTRsLMiB4oWwZ86JY83eIodyXjgGw0p jIs5yr0iKB7yFVtyXlKJwKFBPxJlssswwEsWoFPP3hYbeQmGjYlzrwkNQmhhQs3wykIpkp vk7RHhv5nGLhU/r0BUkRvLRXeJX1mDKKT0G/Vu2znqXqu0k5HdWh5XmMeK5j1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCM62dlTz7sv; Mon, 20 Jan 2025 14:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQQfV087032; Mon, 20 Jan 2025 14:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQQbb087029; Mon, 20 Jan 2025 14:26:26 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:26 GMT Message-Id: <202501201426.50KEQQbb087029@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: 0bfbd30663b6 - stable/14 - libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 0bfbd30663b68a851ebf24667d121c6891c86827 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0bfbd30663b68a851ebf24667d121c6891c86827 commit 0bfbd30663b68a851ebf24667d121c6891c86827 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909 (cherry picked from commit 3999a860d6e899de98b1025317d2d0ef1f83255f) --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index a9d44cee4364..fb09e1ac785e 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -178,8 +178,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) warn("malloc() failed"); return (-1); } - if (slen > 0) - strlcpy(snmptoolctx->passwd, str, slen + 1); + strlcpy(snmptoolctx->passwd, str, slen + 1); } return (0); From nobody Mon Jan 20 14:26:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCMd5vJvz5lPTM; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCMd5PlTz49g3; Mon, 20 Jan 2025 14:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsFhbBtDxAy97mjIw2FhdHhVgp02lrEurO9NqlwnXY0=; b=o/evr0ZueMWdOrkaZHy4QCTGvfRJL5rjGwAkS0D7h+mAWzvXqcSnRCZamYBemi1KBL5NQC yNo0gqp/1scuGyYGFspJBWK8WTnDDtvKmU9lRFuDppSyei27xD2Lr2VXH8q9iw79RwcnUZ yUXhTj+BOZAHyVW8bLQI6lgUlvEgdS3VtB4ggbqPwmwQKmRfCnJuvCjFVjiFLID7ra3HRD PZA4QBVquOO1blsTsDw91gdGjkKGLsNfMlUdhDZbX+YTV2ZsoSDvB6gjtzQxZhVkZqvR4N 18EdGwSVm/4wjmG5tZ6/Zly2gtbR6CRYjcrEOWhDcMOmZinosYLaIoyyNENp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsFhbBtDxAy97mjIw2FhdHhVgp02lrEurO9NqlwnXY0=; b=bzMassnbruv2V6eOmzU6wXuIQszpWO9DU9wLkLwtMnIm7G9KuQd9d6lvKvVStaulJZL1jX EBP3cG4jiRXP5dNPDwX7sUt6HmKBunmsscPAsoufJhThl3nL/r0jtdu8naTNmdmNu6vwv5 cLZcvwETK1c7LIiGSnxdNe5dXfwL6/0chBgVObVnPz/CPF5Fwkq+mKRFmygNf+5bBKRjbo eceea5oavZFLEDuAtAtRotLQH7q57pBW/5TNS0eDJIgVeXu1+PH8beXSkMOHYdPP2mazus WyUbaqq9fds1HzQyiDurKkCWiThAXaMOTFuPI4Z1nsLbLnv7t+SXA2zfWU+xlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383213; a=rsa-sha256; cv=none; b=w39ApYWHKK4sL9CfForw8jkm3beUYK5feTfYbtkTWCpzf9b66kaFPkDYE8klYwgsZpD/gC VRNA2j3nJsbJvNm2N9KtCUn8SKZLiCzDMPmp7UW3Ag5+mxel1BdN6EI6iWGxyNYhk+CUPN j5rXGfc9cmOyqxiUIyQYtaVrh9d4Eyf4Dlk/IEcoBxvbWreZ8JuZ4kDHeMPisQJL/IyIrs jrqZlk8qC5R3ZD9jUOiWQ/OmTqxZrl18tRjUu9Nvvdib0qzZ0AMyApoVaqo6ja07NfIKh1 E+AAi1onUGmGbSu093ehCwWxzHBB2NjscurZffSS3GiOF17PDvwdfxJVWPaUdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCMd4jCnz8Hr; Mon, 20 Jan 2025 14:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQrdU087299; Mon, 20 Jan 2025 14:26:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQrab087296; Mon, 20 Jan 2025 14:26:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:53 GMT Message-Id: <202501201426.50KEQrab087296@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: 61c50909354a - stable/14 - munmap.2: Unaligned addresses do not return error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 61c50909354ace6f07d0b2113f10965f4546e0ed Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=61c50909354ace6f07d0b2113f10965f4546e0ed commit 61c50909354ace6f07d0b2113f10965f4546e0ed Author: Ed Maste AuthorDate: 2025-01-15 16:52:58 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 munmap.2: Unaligned addresses do not return error We previously claimed that non-page-aligned addresses would return EINVAL, but the address is in fact rounded down to the page boundary. Reported by: Harald Eilertsen Reviewed by: brooks Sponsored by: The FreeBSD Foundation Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()") Differential Revision: https://reviews.freebsd.org/D48465 (cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3) --- lib/libc/sys/munmap.2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index 8f5cb0c02e2b..cf8d9ec22b1c 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -25,9 +25,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 +.Dd January 15, 2025 .\" -.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -56,8 +55,6 @@ will fail if: .Bl -tag -width Er .It Bq Er EINVAL The -.Fa addr -argument was not page aligned, the .Fa len argument was zero or negative, or some part of the region being unmapped is outside the From nobody Mon Jan 20 14:26:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCMf74ZCz5lPZY; Mon, 20 Jan 2025 14:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCMf64f6z49jG; Mon, 20 Jan 2025 14:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW7TgAty811m8Zgrk0CwPcNwbNp8647qmbC+CpNgO7s=; b=id96PcKFkUPs+H4RIY38lM2e9/ewASzFsRIPJQ9ImO0Q2MxM0pdO67uQY49wV8H1R76wzV DMomoUeMAkQknq8cJTlcawI6mQO+mzerR1gmRaNU3rt4Jz1NS+PNC7aDxPCtontH2/hOdW SSvu97PfGO52RBQi47kq7C6dv1aYAont4BGKdOwpxySX+DklM9NrNH2XVpLjuYBpVJev+x R6WBebaTxVrSPh8TToNnSvOksynX16n5YUCm8H73xaTRfDdmrRIaknHq/e5x0XHAmTwmx+ 0YzcA7iuRfPyq57okdV2mp33n3dfpNd7ODifvT7k+bVooKceVDeOYmMBNWMnIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tW7TgAty811m8Zgrk0CwPcNwbNp8647qmbC+CpNgO7s=; b=J6hFTw//No3lKPkMUKogaJVJwOPIpUkzZhZ6j2+BoTpfIxYO6xzjWvI3TKVPvUY8z06pc9 TIKW7sBdcEEMO3+EMQ5//2x5ZuiHbk+JuptzxbY97EIGhUPbWO4ufWEnV0WpYZAXEYMaRi /MfgnVhSObRUVA0IksKZtuyxdTnNq3VH5ZNx8wzvv2isQ7KCGeboqhqx0RysPiiU4ElWQp /3gUCB4zxthUwcNa4egParT/c3exkX29o8IU6beOJ3rCMoRSwPPwNntOuTxdm0SHCiJOY8 YPASDoMDXW+uCi+zadGGRQuBjevQ7rDmpNcOQ/D5Cf+GPeQpwa8ORU/ImKyMyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383214; a=rsa-sha256; cv=none; b=YFg6LDACTbVcNAe4hyNFHhhpTb9ME23y5/a9HTdFRFsJm6zk3TQr7JhPB/I648aiH2PWNd xZvOl6y3MIERp08vJSZ3yVs7cC2U6oCM2XLx2P0vbwCJCRnCqUuED7Ne9+xktvI4HcmR/k lmE70B2peUKZF4KBu0p88uOATptdQe7O5GSoYsR3UFaCow8CfM09vrGF7bpkUfVY717IBz M3Zchr4jvCEtJ01ZYDu15k7ntwtwtaZYgbIdhfDHtiSg2rKmFW0+lla0pRVgbB8h+wN+Xv UuICgRUmVLdQZhynNvZyAMQHQkpNeJeuVQwqmg+VBwwOlo9RUY8AIo1yKFNSHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCMf5dJtz8Hs; Mon, 20 Jan 2025 14:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEQsH0087344; Mon, 20 Jan 2025 14:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEQs1q087340; Mon, 20 Jan 2025 14:26:54 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:26:54 GMT Message-Id: <202501201426.50KEQs1q087340@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: e2cbfa1f5045 - stable/14 - munmap.2: Remove EINVAL for negative len List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: e2cbfa1f5045019d34eb0091db7755c151ea06d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e2cbfa1f5045019d34eb0091db7755c151ea06d5 commit e2cbfa1f5045019d34eb0091db7755c151ea06d5 Author: Ed Maste AuthorDate: 2025-01-15 21:44:31 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:25:14 +0000 munmap.2: Remove EINVAL for negative len len is unsigned (it is size_t), so cannot be negative. Sponsored by: The FreeBSD Foundation (cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1) --- lib/libc/sys/munmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index cf8d9ec22b1c..2411ccb3b0db 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -56,7 +56,7 @@ will fail if: .It Bq Er EINVAL The .Fa len -argument was zero or negative, or +argument was zero, or some part of the region being unmapped is outside the valid address range for a process. .El From nobody Mon Jan 20 14:29:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCQF2C7zz5lQ0s; Mon, 20 Jan 2025 14:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCQF1k9Fz4B7k; Mon, 20 Jan 2025 14:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOaT/dUWZo1h66DLcHsjMQqmlmv3cVUXLjiw6U4XBZs=; b=ONE1BkJKKZnCzyr692ZEWcDiXC5TAX/8ATmuBh1Xe9i5LzMt6r19wafH0rN1zQiqIL+37e r2mVf1j/6gwJY8E5Y46sO9ETqnF+t6s3rdYxPTFMx4QIk3uxR20PwyQAhDRa5a8J/liTSo /sWCKqRvL+zDsjI6dWao/seSVyI4QzSWXCWg48X7r67zX6b7ZYVX7GJKUCUv/5XGMSZ+f2 96DDRdIkDf9laQHePKgjjB4JxqFs7OzwfwEzk+/F/hd4iT31VgP5X5ragN9aoVueNJSEAD QYiD2Nw/F/w5iXUOt55t1EnRVTG/XG44zoRgkfOs+LwsLq0LKWaYQ7jOwb63+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOaT/dUWZo1h66DLcHsjMQqmlmv3cVUXLjiw6U4XBZs=; b=JcnzdmfKaeUJkrOSVQtZnX83cXor4ByUC/AE/MqEyNkulg1sr2AWZ/3k4kYWHLputjZvbP MZ1zIpPw4qHTbNerbesImyLVkgwN9bfKj+ejrhOH1iXO5l5p6flAnNjAyGTLh7ZrnTH8oq FkxFB0CT6qJFmxSbFF0dA6EI77MPc78Wqkh/Nob3fE2osN1g2vUT6KNAoShZiOr4Feh8cj +Y4oJkUzhHzm21o65E9jUhMholGxgYyf2OeVe4mcWyySAiYDEKVa5w8LxDjHmzI0LfA1qM 9KIpJfqa2XYHDvx6MG2VpK/alnHklYhzE/u1QD4KBAZ28TtiI27NQ9p5j6vO7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383349; a=rsa-sha256; cv=none; b=ToypiurD0Q4EqQFOSCdLGf/f2tInGdzkt4XoBykiA4gk4E7dshauIyeI/QQ14cF2l96Qmo T6oA1DSOoLNQSeUtrgywfJXD9mTnBroNHu6WWHcZSffl+j7IJimyf/aibKc4JEntFss81c hR35hwEs3xX53X15OXeFcXjzH4/6rB26DLgbUbvYEsLOpdmehsy3mrYkhcfsHlK4ef3/Q3 4pZkM8jXrZE3ZYCadI2SDPipK6B7QRmAs5QLqghFe4FqyaepNBvuPsSFEtGCr6BtybXJuS 5ISC6egH4NjfDn5l2T0vMFFghoBK6c2DU12krFLMkrMDg2woVWEcWHEGtkvScg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCQF1Bfgz7sy; Mon, 20 Jan 2025 14:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KET9tW088113; Mon, 20 Jan 2025 14:29:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KET92p088110; Mon, 20 Jan 2025 14:29:09 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:29:09 GMT Message-Id: <202501201429.50KET92p088110@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: d6fbd34acbbc - stable/13 - libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 commit d6fbd34acbbc90ae106fc1fa08d83d5f25d59039 Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:28:54 +0000 libbsnmptools: avoid uninitialized snmptoolctx->passwd with empty password The removed check left snmptoolctx->passwd pointer to uninitialized memory. Always calling strlcpy(3) would guarantee that with empty password it will point to empty string. Submitted by: markj PR: 283909 (cherry picked from commit 3999a860d6e899de98b1025317d2d0ef1f83255f) (cherry picked from commit 0bfbd30663b68a851ebf24667d121c6891c86827) --- usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index 373e91de06d3..e1339877e945 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -178,8 +178,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) warn("malloc() failed"); return (-1); } - if (slen > 0) - strlcpy(snmptoolctx->passwd, str, slen + 1); + strlcpy(snmptoolctx->passwd, str, slen + 1); } return (0); From nobody Mon Jan 20 14:29:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCQG3bMVz5lPLh; Mon, 20 Jan 2025 14:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCQG2S5Wz3Bmm; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=Ml1Su8JZd49IgzL7sQtdTska+Fwhi2rlrh1Gv+yO3HUurm3ABM20Jmu7ieJPne2RhCX6rA 5Enq+k93yR750S6UKSwI2Fu5BPH4vyiw0nLCIUth8j49QhEq5BLr/yMrCpQotk2PLOHxFA Ck3FrM15Y6APy4mWzvgAVvzbwIeutVxMwtNjKHN2uvEREGl2OSE+sh1t18b3tEvqEYqLHd lUbFNHs1DqsaKIAOeZ998BeW676FYdTh+wUOYanfD94cM6ky/ecoHh95BcKuRN8jtpBSVx XgtrGVXypOhksEBwOcYKOJNYnIsSl7EZUY2eV/cUX7KlUziG5L7H7AX9LgM7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZaxG+AOy3FgFYojRR2Icu2dvVGUA6g1+Hsb2YgnKm4=; b=tIQUWdVLowF4/3j2sm20ZPbLVo84YV/BvHhlg6S8D13xSZQ3Uu2SZXw51NZhYFrYNIuKIo hFxxklrNnr3g9uSZlamoF4of4bMJVWj65Mr4zlywukFWoowiDxW0QFJX/tPH4IXtS/dKLa 23Hv4jDGnt/PUfr1JVzQqyh7mzeA/6jWnQ8QIn1FYqw2Lkq4uBZvXnSGFOR58nRyZWr4hI Q+t1JizV1DSasThP8zu8xDBkfSAxBpNyxSLs60IhT3nHZd5goqe3qfb44Bq4G3xYDjA7lk 1zZBHCU3XXiIL7txtODc7QdwVIfRPFpBEEf9SD4EDfRCMpKXgl5E1rOkouVxWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383350; a=rsa-sha256; cv=none; b=lmAZi7FGIyrduDHN0xPfYxeg2ralCTqaTd07Z525o1SOzi/dl/NrXMXxUOOvWl/I+gsXUC QdanFjf7TcAP+Iudq7Kgx2N6G4YbNlFFhr5V/ang1Et2LGYjU8qVQhDx5m0oYgQ7VVztVI Di7mYVlxVv6t50oJtajkHsoMQoejGKMBL5TZULRRWBwNpULtxCiIp9IgPXZ5YfXe2h9RQ/ cVm5um7+siNwVYvxKD2oAchthgarfH/I2zZvOAx51iCedSy0nthide2ivrIwt8VEslOczs sAXRNFsuf9KCy0iIDiz/wyqI3A7SAU4w+koYXp+HqnMYxF/YyBN7orCebYE7HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCQG1zNFz8Ls; Mon, 20 Jan 2025 14:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KETAHu088145; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KETAD3088142; Mon, 20 Jan 2025 14:29:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:29:10 GMT Message-Id: <202501201429.50KETAD3088142@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: 8ed2e663712c - stable/13 - libbsnmp: avoid division by zero with empty password List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8ed2e663712c3749b10af7968a646b9e81b6bcea Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed2e663712c3749b10af7968a646b9e81b6bcea commit 8ed2e663712c3749b10af7968a646b9e81b6bcea Author: Gleb Smirnoff AuthorDate: 2025-01-11 05:08:02 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:28:54 +0000 libbsnmp: avoid division by zero with empty password PR: 283909 (cherry picked from commit 4dc1820a16b9b6108e0ff8a0265c08c67fa34146) (cherry picked from commit c4cae8cbc337eaf824774fcba88018e42fa31efa) --- contrib/bsnmp/lib/snmpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index 05711e341fd7..a7556527ad51 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -1792,7 +1792,7 @@ snmp_discover_engine(char *passwd) if (snmp_client.user.auth_proto == SNMP_AUTH_NOAUTH) return (0); - if (passwd == NULL || + if (passwd == NULL || strlen(passwd) == 0 || snmp_passwd_to_keys(&snmp_client.user, passwd) != SNMP_CODE_OK || snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) From nobody Mon Jan 20 14:30:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCSJ1qrgz5lPsD; Mon, 20 Jan 2025 14:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCSJ19Fkz3CNM; Mon, 20 Jan 2025 14:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YUpPC8TUDOBbQ9TrAr3Tty3EilHY1wzpTtCTs84L5v0=; b=TlRLm2Iw8f3SZ4ad+8YiRJarVW/13gBs34zGTpBrYG+cdoRNRJdspJQwwJRH6Vbp7zlO+v He0id7ev/nlTLtTJVNSQs1UzNUWQG3w+jtaqJFjSaYOGhJ2IyRZYXxMH1EzFmS1ZxHnPbi 7k6olKZEa0yifGVjXzxAdrQgy8ZWHnoB9WfuumnVYVFIXDNAXIwkyXfnneD441gbyLZwY3 WIBMjt95CvQlxLyVX0ooH9C6Sr28pizwH13Kcb2HF8eARhVqTgCltVLl2YXV7XfswCrfAh eMFnb84K/xZ0GwRH4XdEMVLk2zKc9s6/vMJ3AEbmjqpbv7a5cKLDMIeED9NoJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YUpPC8TUDOBbQ9TrAr3Tty3EilHY1wzpTtCTs84L5v0=; b=vFz5+Bh9PPlD0aWkNfpIZR+wxGNjxvqC0VvwbtMmQLSrqNWrx5Rsu8SKxfg15NpSE2SFJf MZFzQ76H46FkoCXL9yBPrTKV8x+KMDLVJbIyHoSqV/q4T2uIK3xAHwtcdahzI2gsipZbyJ /A0DBRmqU3g1bsAZhvUF5r4mXmkTLb9gvPVIC4RRCTR33m0Cfvk7mS22S+U473w7xK4j+m gL8jwKEA/GD9kWL2mVJLmoSO62dEFZYO5M3M6Ni3mlUP+iZS+drZUqIuYz9ZrguERpMLIF nZCidl+zWbKpRGe8MLJjvuqa5WhyWrGQiGaT4suhpCOFRZBlddwE4xFqGnl4Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383456; a=rsa-sha256; cv=none; b=b6KfGkWfGISSbtUtbkrDiXo9qB04gGUpg4937aW808ztnSajA+ofERNTaPuexYgmlwfUCO IBIwHQiaTPubOjJ71zHgUAZt6TgUIEeogbWVMNansxcVszCtqtQBKxp4mLBOoVA25Ceh4S 18E+xlvku9g9QF/RbOxe+/eDuQmyc+Qggvphgv8W8+UJzWwzlgEYGvwpP8jlV9ul5W+tXJ G0ol9DNRekb52ABYjxB6iBhl/mxcJ8AkuDURwnW6aEC/+OvM0xCHB8ojTdfZh7O72OfPUy CmFukJ0w3TGIqPUk96fQNCWzQJpnjiNJoTV/3zBFiQK7fTgzXZKIWXaz84gTZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCSJ0lP1z8Rl; Mon, 20 Jan 2025 14:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEUuXG002476; Mon, 20 Jan 2025 14:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEUuUP002473; Mon, 20 Jan 2025 14:30:56 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:30:56 GMT Message-Id: <202501201430.50KEUuUP002473@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: a52b922c05a4 - stable/13 - munmap.2: Unaligned addresses do not return error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: a52b922c05a46f594fa604e1af3f17f046aba955 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a52b922c05a46f594fa604e1af3f17f046aba955 commit a52b922c05a46f594fa604e1af3f17f046aba955 Author: Ed Maste AuthorDate: 2025-01-15 16:52:58 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:30:43 +0000 munmap.2: Unaligned addresses do not return error We previously claimed that non-page-aligned addresses would return EINVAL, but the address is in fact rounded down to the page boundary. Reported by: Harald Eilertsen Reviewed by: brooks Sponsored by: The FreeBSD Foundation Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()") Differential Revision: https://reviews.freebsd.org/D48465 (cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3) (cherry picked from commit 61c50909354ace6f07d0b2113f10965f4546e0ed) --- lib/libc/sys/munmap.2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index 8f5cb0c02e2b..cf8d9ec22b1c 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -25,9 +25,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 +.Dd January 15, 2025 .\" -.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -56,8 +55,6 @@ will fail if: .Bl -tag -width Er .It Bq Er EINVAL The -.Fa addr -argument was not page aligned, the .Fa len argument was zero or negative, or some part of the region being unmapped is outside the From nobody Mon Jan 20 14:30:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcCSK2p5Jz5lPsF; Mon, 20 Jan 2025 14:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcCSK23wbz3CSs; Mon, 20 Jan 2025 14:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qi2OaVI3TtfTlCIgqgo1PJ/h4cfWhyu6cc/mpp7CMc=; b=aWoqDeSGTLBCHptv0HnYnGHF+rFVHh+SK0cmTxqKUOMtLlchTgCEyWUyD6VbgBCqns05Rz HBbWyPy35nioY2YcIwU0DltbkXUzANwC0ZQDgvmck2ouPKN83ACAVvDP5RifDsY8Qs6OPF ija8PHR66UdONPz/C6uOj96FUQrxVcYI2y8yloTqOE3+ndmRWJu2GIjnXYujVR+cYu63PF MarrEbeXIUMaxVcMDt9tC6gP+Pn7YFePz+o/kRwqG1KmRXRC+9UaMarTBgi7Q/a5krPzik xNdvPwsx686uVl0cgDxsN0+VVdMzuTpGZMX5lnuCwYzWHUIG/pb377yQNFDBgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737383457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8qi2OaVI3TtfTlCIgqgo1PJ/h4cfWhyu6cc/mpp7CMc=; b=FWUGDuJLWVUl4hy2Nw8+ckXgE7jAqeOLqcJzzH54H5hobu7AKcP/UneOwtPlFBt74QKliR 3CfKzHBD1rOVpo3x5cYUECtMdvo0QoXAgSahAMF2vGOEcOjGQ9TXPQ04cwVmx9z2sh+JkO H+nrnbhw/Xj8l50r4gvAwRBJmm5IkxXLg7q37eCoJ6tiM8jXpj/tgRwYJyoeYKcOf72SVW orgIfKORjrfLXFf7lffVgJRrWG25qbwyIIVucYasKBj4pCq47//DS8UkS6fHwrvKkadrMe da0jLxjJJfx9yeGEuD4OLQmmJL0wI3KHItiKylvA8c3fsJbuUwqufXwcFwl9Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737383457; a=rsa-sha256; cv=none; b=FNr//JgkVR6Zi1bC2AzOA/JeLZQvAt+daE9g05T/9GVnUyB4qPrfFGPIB3ZzWxCJ+qIQhj maw0M7wLY8LK/W3sipvzSSeQaFL1eFo0T8N9UQ9kPCL/NxOHjfLCjWSuSAKFYYRkUml1OO hDcDcdrd5EetrpmEXkLfoHTBTqrnWAs8F3XR98eh10x+tY/rVG79VZKlLEB4sClNhMs9iN u0gwMGSoSZFHpoKJ3Y+i6w3QxQMTIbuvPvLvV/bKPotqWasUj6+KKMmYGyUGSr/qo/ERSN zR6C/XcxpDfvVYRaVri5Ep3+Pmqch9xj9zYgvCZIVUloplsAhavr0IpRao0oJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcCSK1gy6z8PM; Mon, 20 Jan 2025 14:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KEUvkr002513; Mon, 20 Jan 2025 14:30:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KEUvh7002510; Mon, 20 Jan 2025 14:30:57 GMT (envelope-from git) Date: Mon, 20 Jan 2025 14:30:57 GMT Message-Id: <202501201430.50KEUvh7002510@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: 8883e8de0559 - stable/13 - munmap.2: Remove EINVAL for negative len List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8883e8de05598e475d2ac129dfefd734e06908ab Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8883e8de05598e475d2ac129dfefd734e06908ab commit 8883e8de05598e475d2ac129dfefd734e06908ab Author: Ed Maste AuthorDate: 2025-01-15 21:44:31 +0000 Commit: Ed Maste CommitDate: 2025-01-20 14:30:43 +0000 munmap.2: Remove EINVAL for negative len len is unsigned (it is size_t), so cannot be negative. Sponsored by: The FreeBSD Foundation (cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1) (cherry picked from commit e2cbfa1f5045019d34eb0091db7755c151ea06d5) --- lib/libc/sys/munmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/munmap.2 b/lib/libc/sys/munmap.2 index cf8d9ec22b1c..2411ccb3b0db 100644 --- a/lib/libc/sys/munmap.2 +++ b/lib/libc/sys/munmap.2 @@ -56,7 +56,7 @@ will fail if: .It Bq Er EINVAL The .Fa len -argument was zero or negative, or +argument was zero, or some part of the region being unmapped is outside the valid address range for a process. .El From nobody Mon Jan 20 15:10:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcDLM4fM6z5kDJW; Mon, 20 Jan 2025 15:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcDLM2J7wz3Fnf; Mon, 20 Jan 2025 15:10:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFPuyR+W2aMdXRpkzc+PfXLoC2NHEogoryOuK69WkTM=; b=nZYFhUVniAekv5iJsBjkhj5sZIiB2yybpDB7WE+LbIcUkgCpDbz25mqkgTJoK5daiyrZH5 TLWeWjeVJMXgjO5wlNGrRvmYNc+p+GBZI4s1ce1XG6gidDefXPqDjyhlWbn3X+LnXA0siW qFyeA6jDpr+nLiOs48yhKSm3H9JmyL3d15yZb1KjGxFE1IXN1WDygZzAhr51GhgidQw4r0 p297Lexr9Lm/bIxXLUWsHCr8ydxoV3jYRWN35gr9hnLo1YSTJWr6rnhqEMF5zotkP9KPWC SljE7Q7m4xPPFrH0iEw5pxIV7HyZT9w5uBpWSDxBx7/gOWlwqtaJVvdFU7X2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dFPuyR+W2aMdXRpkzc+PfXLoC2NHEogoryOuK69WkTM=; b=fYL75yvIGgyJoDIwnT7pb1sxQUzzNva7ntSf/0biEwh0YW8lXL+sBED4aqmLPfnFAUzxrm PyUKwDlfWn41pEUVNZstbC30mIX98LFsSZbWHtFPL6Vrh2FCLg6Qx8Vq/uFvFyhZYNpDMD k9HzeAJvjODKad45oH/7JcVgnXv76SzeiFVVkECAnbQN3OwujTDG5WaCWccCT3X6NVeXvR tF/t1Hmhsz0y8jX4/42YCCdxGG2MeMVpbyD8Em8HOngCp5R6ddCS2c11/a7t1vfq+fsi8G u6WPs94WJyDZyJT/6fvmq4S6EVuClSKPEetU8GIkoKIoilFdcWbZWvelOROnBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737385851; a=rsa-sha256; cv=none; b=ETeImRDBCVsRVvAuDe9ITQlkSolnU+vdUk70CNUa5xU39TXaCc9BaiR8dNjkon7uHhdxO1 wutU3s7hAOm4lrZfdvsglP+D6jznWY3lWMxghXqPVyPf4S17u1Y0XB4frw/2vHX4vdGK9Q wWV5MshHPf+33nK3sGEawSVhfsBuFwlf95g/oAM/4H8oG4eMc6c5StzVHL7q8f2fVPrBeF y5Th8KakSNWE3w8lbu/Ok+aNKBLixmcKy3bhJkw+qjrSL3KQjP3xTChfaj9eBOdOg/XRc6 ekDwdFoaqFpLAcBvGEclnxWPrSGdM5yvktbKs4gpqNQCbZhGnJmXiycKHw532A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcDLM1lHdz9Jw; Mon, 20 Jan 2025 15:10:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFApZX073396; Mon, 20 Jan 2025 15:10:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFAp9H073393; Mon, 20 Jan 2025 15:10:51 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:10:51 GMT Message-Id: <202501201510.50KFAp9H073393@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: 013784c967f9 - main - netinet: virtualize net.link.ether.inet.garp_rexmit_count List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 013784c967f994058f701c1fd2a82a2cc0bd90b0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=013784c967f994058f701c1fd2a82a2cc0bd90b0 commit 013784c967f994058f701c1fd2a82a2cc0bd90b0 Author: Kristof Provost AuthorDate: 2025-01-20 13:19:20 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 13:28:38 +0000 netinet: virtualize net.link.ether.inet.garp_rexmit_count Turn garp_rexmit_count into a per-vnet variable. This immediate use case is to enable easier testing. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/if_ether.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 81f4b901f21b..502261f5f2d9 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -155,11 +155,12 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_log_per_second, */ #define MAX_GARP_RETRANSMITS 16 static int sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS); -static int garp_rexmit_count = 0; /* GARP retransmission setting. */ +VNET_DEFINE_STATIC(int, garp_rexmit_count) = 0; /* GARP retransmission setting. */ +#define V_garp_rexmit_count VNET(garp_rexmit_count) SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, - CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, - &garp_rexmit_count, 0, sysctl_garp_rexmit, "I", + CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE|CTLFLAG_VNET, + &VNET_NAME(garp_rexmit_count), 0, sysctl_garp_rexmit, "I", "Number of times to retransmit GARP packets;" " 0 to disable, maximum of 16"); @@ -1377,7 +1378,7 @@ garp_rexmit(void *arg) * the callout to retransmit another GARP packet. */ ++ia->ia_garp_count; - if (ia->ia_garp_count >= garp_rexmit_count) { + if (ia->ia_garp_count >= V_garp_rexmit_count) { ifa_free(&ia->ia_ifa); } else { int rescheduled; @@ -1444,7 +1445,7 @@ arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) NET_EPOCH_ENTER(et); arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); NET_EPOCH_EXIT(et); - if (garp_rexmit_count > 0) { + if (V_garp_rexmit_count > 0) { garp_timer_start(ifa); } From nobody Mon Jan 20 15:10:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcDLN4KCSz5kDMm; Mon, 20 Jan 2025 15:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcDLN3Crrz3G37; Mon, 20 Jan 2025 15:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R6sjyqjZfFIryK/CeJVjob8fB1CgiPWtRZG1t9JTNG8=; b=Bp5gZtlJqmtvvL6pZjy0Z4DeCfZxDzLu+/Ytn/AFCLkopio/Zritozfkbg/dDnxKJDpfzl Ng0FOUPtwT5VEeiXCOqGMp5+eSWHqQQH8a7FqinBj+YjwHrryk6miZpw9oZWtSTM4F6H7y YrOaGNzvCROmBaMNfiNhXwpicngzAh0bHeve7sXV3dDKGMSfHCalaxoBAtVGnfkhQDr/cp WMwhEDSHv7AueXntg4iKbqRnNVnh+3wEtjbbXSVT9vb6hIp27pKysJQkuzPjOqYrPjZk1i TT0BA7UcRieSx/ZFmdr4fEBUvm4BbuNK1/y4bk6iE5PmtwN7Y+P+4ltaa8tx3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R6sjyqjZfFIryK/CeJVjob8fB1CgiPWtRZG1t9JTNG8=; b=oJ07PpLpNxxTrNrLv3sK0jttkIRD7bgC6lwlSKoNiFvUO9tYn5wgAHG8D6L8zeK9toW/dj Ubr8kusUdrhLWUBkfJneJVFbbU5tpIvnfNV6YSYGQVOotY6X9YO4rT56D740oWyz/BgQRN Ob5sIbIds/3idwRrZI0KuX71CZGpHYoQdlOkGQNV+t1IO/iig/r15w3ZnSB0/ATvayywBQ 026S2YQCExtTte6nUUnX7qhSL5UpSCXNsz+N6YNzHQxQuJ9UVc7IQyj57m9/y/v2NMskcz yDdxhIvZ7o2HKCEhfSGRjZDrLeyVF720DilOz4EJIgyq7oIJwyc+TMST5rnu+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737385852; a=rsa-sha256; cv=none; b=uNZxwN6qzZUxmqyT7RqY9QCJ2QRpm2GA3glE1yrbdoRsNFonVxpNP9wtBKBTSqIIIsL0Pr /7ID7jhmPELeO4MMj52OvyKa8P9f578nBh86pJ3b1ErifFd9bS1MR0Qq4mU5I7hEMdWvJT G8WHL4yWiF4OJ95PMNzm1NNnsa1oap4y+IIkxFRoBvzY2eSU1CXndyhbHznbqHZdxuz9ne ZWMUFOTKIAa+IDDccX22UBZmp/hk3JIZbRYS7xmym9sogkNMy3nlvGnVqj3xKc0RVu7tMp 5Y6DTrXxl19TZwjZw0DxO5cszxjaZWESHGnltOTLdi6Se0olnC8OgMfK67jRhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcDLN2hFSz8vp; Mon, 20 Jan 2025 15:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFAqkr073431; Mon, 20 Jan 2025 15:10:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFAqfU073428; Mon, 20 Jan 2025 15:10:52 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:10:52 GMT Message-Id: <202501201510.50KFAqfU073428@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: 38fdcca05d09 - main - netinet: enter epoch in garp_rexmit() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 38fdcca05d09b4d5426a253d3c484f9481a73ac2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38fdcca05d09b4d5426a253d3c484f9481a73ac2 commit 38fdcca05d09b4d5426a253d3c484f9481a73ac2 Author: Kristof Provost AuthorDate: 2025-01-20 13:24:48 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 13:28:39 +0000 netinet: enter epoch in garp_rexmit() garp_rexmit() is a callback, so is not in net_epoch, which arprequest_internal() expects. Enter and exit the net_epoch. PR: 284073 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netinet/if_ether.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 502261f5f2d9..88da1b139b1f 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1353,6 +1353,7 @@ sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS) static void garp_rexmit(void *arg) { + struct epoch_tracker et; struct in_ifaddr *ia = arg; if (callout_pending(&ia->ia_garp_timer) || @@ -1362,6 +1363,7 @@ garp_rexmit(void *arg) return; } + NET_EPOCH_ENTER(et); CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet); /* @@ -1393,6 +1395,7 @@ garp_rexmit(void *arg) } CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } /* From nobody Mon Jan 20 15:10:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcDLQ0Bj7z5kD6d; Mon, 20 Jan 2025 15:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcDLP4C9yz3G3C; Mon, 20 Jan 2025 15:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e2F2FkxtasF2/KfByqSHHoLssFcboqnjVB+zJ46yohM=; b=EhnLq2Wy9yZ5mwJcPqGeTYyUtehXNI13nSIEqNAV2PaQLsK8RmSF3WLarSMrB4J9SFglNj ++pvP9sUp3Mfc6V9oRpR5AgQQGY4H6/gvJhyFMohTqYIODdZHGu0T7V/1w7mAJWNLNwsYE cOFVe4SA9aRpzQ2qJ3LHWUVkh/B9GoxqudWHY7zOMa8eNcncRCp9j6UaASelq6zpYNyyon tCBOzChsHbPI3XbnCfae01tu0ZUH5GetLyHvxOaNK7NBgp9seAdKlYPR9ov5rMcpmVtbj5 NwcK1WDbx2F40GbTqFhfhlW944KSqD9Mkhp2+wQseEPpy0Q/v0norrWEKrWYwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737385853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e2F2FkxtasF2/KfByqSHHoLssFcboqnjVB+zJ46yohM=; b=Mk9f5Va85JMZ34MbtI/g/f9QFCL/eMCKpu2zfBNztrWuKr/R/5w4PrARSuvioL+3dRjd40 6abREiettsDhc2dzs+yiYG0BVnoax2CQ9L+mG9/Kx79hfWeoPuWaVUbR2hihhp9lgi++3r bd7gOV7BrEAm+roIDmXf5dWDOpELH7Vfr1CVsOrYQwQr+E1hqTTbj8XiQBDgfedcwwLr9Q s2CM3ArX+x/yymJ4nkO7ULOqD4dL/eF+HlAXUMkIGH5NDS2RXwY1rIVIMuq8/Hss3n7hOy JpBY7ZnfZr2W41WMNlFNAA2mU2ZepockAvU7F38Wk/TFzEujpRl8WT3ESM7pQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737385853; a=rsa-sha256; cv=none; b=smoL1Fd5T5wJx5EwJhJ7dE/SOGfQlLWZ7wdtPWaOlCWEEdXgep7OfmC7Ij6z8OL0uDRi/4 WCTgOYrkHFXmpiR1JM0TosIj/NnITxMy+52SPu2PNZyNwuXXN2MX0aTnc6bTBWXLZaP4oe ZfsKanUvxwCQ55p7nF7HdS8nnwWLgNrV+is1vl1e/3HbTR8uEHxfth7xyrAsHNCeB0KYsZ T3VprDucfhSgxz8K5Ffm3sTEnVERL6dlPKtmlKXM1Q64rV8CPnxqKl432oYe2tKhUl5O6K +pC4aDYcVFQCyS18ONTT2ibSakk0BgjPf30Ai2dwWssBTUFZ2DqiIvbcsb+ZtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcDLP3bZHz8vr; Mon, 20 Jan 2025 15:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFArRi073466; Mon, 20 Jan 2025 15:10:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFArq4073463; Mon, 20 Jan 2025 15:10:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:10:53 GMT Message-Id: <202501201510.50KFArq4073463@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: b4bd97ec168e - main - netinet tests: basic garp test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: b4bd97ec168e97360cf9511b975a20f677864661 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4bd97ec168e97360cf9511b975a20f677864661 commit b4bd97ec168e97360cf9511b975a20f677864661 Author: Kristof Provost AuthorDate: 2025-01-20 13:27:05 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 13:28:39 +0000 netinet tests: basic garp test Excercise the garp code. This doesn't actively verify anything, but is sufficient to trigger the panic reported in PR 284073, so it's a useful test case to keep. PR: 284073 Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netinet/arp.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/sys/netinet/arp.sh b/tests/sys/netinet/arp.sh index 34946d42f250..c7744d5de938 100755 --- a/tests/sys/netinet/arp.sh +++ b/tests/sys/netinet/arp.sh @@ -229,6 +229,32 @@ static_cleanup() { vnet_cleanup } +atf_test_case "garp" "cleanup" +garp_head() { + atf_set descr 'Basic gratuitous arp test' + atf_set require.user root +} + +garp_body() { + vnet_init + + j="v4t-garp" + + epair=$(vnet_mkepair) + + vnet_mkjail ${j} ${epair}a + atf_check -s exit:0 -o ignore \ + jexec ${j} sysctl net.link.ether.inet.garp_rexmit_count=3 + jexec ${j} ifconfig ${epair}a inet 192.0.2.1/24 up + + # Allow some time for the timer to actually fire + sleep 5 +} + +garp_cleanup() { + vnet_cleanup +} + atf_init_test_cases() { @@ -238,6 +264,7 @@ atf_init_test_cases() atf_add_test_case "pending_delete_if" atf_add_test_case "arp_lookup_host" atf_add_test_case "static" + atf_add_test_case "garp" } # end From nobody Mon Jan 20 15:50:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFDM4W2Pz5kGr7; Mon, 20 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFDM3xtfz3NYK; Mon, 20 Jan 2025 15:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRFkgexaSgPNWAlYVs0tSLJ0OAwWGNDS+u86Z+ua+hg=; b=ekNbr6GCeLSGlBhqrbwetOtmHitCQTqG8JBLgap3g6R4exiun2tdgWeTVziWrfV+WM+viz 5/Fmf5EVRt6cA2u+TRdBLR0nDpsL21cqQFGDq16PwY63Xawb7C/V672/2VAijAZadHgCKN qlKChoXKddSwKVoJ3jtbnukfMfwWYFx8bsDA46JButCHxdryKcqKFlxVLYfgYsFiS51ddB 6qyw9q225AT9A2WNjcgIgsT6XyVULl507drWvFSggBtFRWV0ZadKOBKg78RQ/7cxiJRkVQ 6edT0QWBpCTyZJvb4WjszXP9JmdbjLAd8dsWHU/rZDelLEEO8OVcsIqZbqdDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WRFkgexaSgPNWAlYVs0tSLJ0OAwWGNDS+u86Z+ua+hg=; b=etXOYjyfbJF34i+5wOPwxZOW2cB4ABmxKLojmvX4pzia+3iobQ216q1OLmnXAEoOxXNCGr qzTOUob4FyWQetJfrONVlQbsSqtmei5djnMKmTbSLOu04VCqqF2U60GeaVeGy5KN9ifP3b z3pJwDzp7Pm7eRB6tk2abyzWIzWljPFYerU4sib3cLBVGdXrrj7GiKidwJDoOKX55l0csm Cqc6mmnX+7VjJLHDch+aNBj/W7iqFZgDX/dg/vhxhpLavz+ruHRFW/WS7PpmvSeisYC2vx UX2splN2PANCwcVxv8SJU4CiEn4RVat1/KuT0k5TLpuHpvPdxW9d14hWm1Inkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737388243; a=rsa-sha256; cv=none; b=YuNHv8ILW83x+tsVUEiWhb9HYIaDiX3cp7angPtUhSF81wW1x10sbvpBT8EKSp/JpuXU8w B5g8cSV+od3Nq7fGPYiCRG5Sabt151yyacI6bD/1b5mvDCxCV//FB0tZ5v/jSVobXwkUxh LqYqTNqJv+3ftrf5Lx8Nhc00MsUM+pFXd51vzSDfoBtoFeaFVHW0iLdSKdlpX/xVFKaqAb vpPPwoYDjhUXSxBAyjIFgtbFzfSaqHCvXCFVTJ6fG3zJnfRWkxfQag3V79uHSo6O2+jHw3 ZLHK4N1qY3VE92dPxvr18dVkjnwRDtgkebgOWtvxHip4wtBzfTiQjHkBYXsasA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFDM3NCVzBP5; Mon, 20 Jan 2025 15:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFohFc047237; Mon, 20 Jan 2025 15:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFohIa047221; Mon, 20 Jan 2025 15:50:43 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:50:43 GMT Message-Id: <202501201550.50KFohIa047221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ac2156c139f8 - main - atomics: Constify loads: riscv: Convert missed atomic_load_acq_64() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac2156c139f8f685b84a71a7f0f164d6cccc7656 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2156c139f8f685b84a71a7f0f164d6cccc7656 commit ac2156c139f8f685b84a71a7f0f164d6cccc7656 Author: Olivier Certner AuthorDate: 2025-01-20 12:53:13 +0000 Commit: Olivier Certner CommitDate: 2025-01-20 15:49:45 +0000 atomics: Constify loads: riscv: Convert missed atomic_load_acq_64() Reviewed by: kib Fixes: 5e9a82e898d5 ("atomics: Constify loads") MFC after: 4 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48497 --- sys/riscv/include/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index bf9c42453d8b..74ffc171b028 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -569,7 +569,7 @@ ATOMIC_CMPSET_ACQ_REL(64); ATOMIC_FCMPSET_ACQ_REL(64); static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +atomic_load_acq_64(const volatile uint64_t *p) { uint64_t ret; From nobody Mon Jan 20 15:50:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFDN6Nb8z5kGcW; Mon, 20 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFDN4lgCz3NVn; Mon, 20 Jan 2025 15:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJCWwyQuHx67SBB3eAXsN78pQuNHQbbmIwuO3wjGgAs=; b=eb30PZonn0dKGydKVRSSUcdGZmXtEET6ocycvloGJA4c+405NlpevW78QARxDXBWxiam+s TZhQhhLCISR/KWd6QAESt/h3JL2dpVSIwbqqnovlHPNp4+IjGm/PpfaPO9EcK989gOvDOc xYOWT08FvsFJ4VKWLtUlvXYvM6VXYbarKKuEiX1trSRNl3oGAQImAZndB3vflEzjgbKIQe 6wS+3J3BW8Nbda5ZfUk/13rUQSdVOEaJjyyMQjysRzKlD3VN+c4g69ZFcM1DPPopHB6jmr h+4OJZW1XvgY84aAG2FwO2IeHKD6cWrrnIcLiCBd99zJ5h0v2nZvo3eInX7bTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lJCWwyQuHx67SBB3eAXsN78pQuNHQbbmIwuO3wjGgAs=; b=rI4MeSsgOvccikEFNx++THt96atXFOtvdkDLDZ1vOUhkf/02/fNMbEQpMBP0yD3hTEsDs1 I3UG1PIGBW3Aoq6HTajzJva5tqdycu+NyzDiDD1k2MhT3V0oK4s+k02ADO1llKF6PIwVqQ ezELhSJ8CqAPaKgPJqED22R2cOZUluScxZGAyAMJLNKoPk7JMOD53m2qM2Hz/qV0UOP+tW HxaRfDv8ilk36iNx9XDK1Sy56mWjaow5KeEIms8p9TrkEc+M92LRFCnjrmKkTdU158Z46K vuROVytzTyCV1kSVBmrrAdzMDqvjeqEinHeUrPNAusa3EPmYnyhIS0NmO+u/EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737388244; a=rsa-sha256; cv=none; b=Bckb1yqZrdYSOkZ6dPit02WSF/zatdFYpVWcGtdj1WlfpDNNxNWn6FvbGpMgo8woMfsUkr wALOdhhiO4JgHFx2Z8CT+eZ2NBfnjNvy6l6LfEA0WSBHeSzCnKtGDajmsAh1wbpsDM2Wa+ 9UMct8tnnZB0cmKMDYJzVQcXs0fcmz3JMNmTu/8k7uLEYR++ghDG8i3tGrh3e6C3G1jgdr g+DXgqQmERBAifCTptWD6XWfRZTYXyDkoVMIkoQwBoNnK7hsX8mKZgIuiZNpYyAnUOY6YF jiE7PIZnBDvqd5RuyMBzVNMcMJ3TYn7gt5h/fWVOnv9W9Um19wPVY3XkLe0nFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFDN4HxYzBcn; Mon, 20 Jan 2025 15:50:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFoie6047868; Mon, 20 Jan 2025 15:50:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFoiO1047865; Mon, 20 Jan 2025 15:50:44 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:50:44 GMT Message-Id: <202501201550.50KFoiO1047865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: d0cbb1930e82 - main - atomics: atomic_load_consume_ptr(): Accept pointers to const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0cbb1930e82a53b07b1091402ff14cdfe7a4898 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d0cbb1930e82a53b07b1091402ff14cdfe7a4898 commit d0cbb1930e82a53b07b1091402ff14cdfe7a4898 Author: Olivier Certner AuthorDate: 2025-01-20 13:53:35 +0000 Commit: Olivier Certner CommitDate: 2025-01-20 15:49:52 +0000 atomics: atomic_load_consume_ptr(): Accept pointers to const Now that all directly-implemented loads (with acquire semantics or not) accept pointers to const, ensure that atomic_load_consume_ptr(), built on atomic_load_acq_ptr(), does so too, in the common atomics header as well as *SAN interceptors. Reviewed by: kib Fixes: 5e9a82e898d5 ("atomics: Constify loads") MFC after: 4 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48497 --- sys/sys/atomic_common.h | 2 +- sys/sys/atomic_san.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index e03cd93c2d4a..e802b2a99630 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -133,7 +133,7 @@ * openly resorting to the stronger acquire fence, to be sorted out. */ #define atomic_load_consume_ptr(p) \ - ((__typeof(*p)) atomic_load_acq_ptr((uintptr_t *)p)) + ((__typeof(*p)) atomic_load_acq_ptr((const volatile uintptr_t *)p)) #define atomic_interrupt_fence() __compiler_membar() diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index 93a9bfcbf593..06c6c98ec8a8 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -270,7 +270,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ - ((__typeof(*x))atomic_load_acq_ptr((volatile uintptr_t *)(x))) + ((__typeof(*x))atomic_load_acq_ptr((const volatile uintptr_t *)(x))) #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr) #define atomic_set_ptr ATOMIC_SAN(set_ptr) #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr) From nobody Mon Jan 20 15:50:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFDQ0053z5kGgq; Mon, 20 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFDP5jgGz3NYS; Mon, 20 Jan 2025 15:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32pe9Pf499pgiN9nnnVTwCFK8Sm61u3H/JR7JDixdH0=; b=YvBh23BKJ9c2n+DxNfwJjZ9FcXCnfS63Mq61vcBcv2NVYZvv2h+IICX/SwMRyolQbopLum hzsTdsRY5bDaadJ5JnMmnRkD/RY88nOAJ1iiV+JrtoIoNKIZ1aNGq038OhJwsPmc7y91fV ojlZvlmmyqwkc51cWDjA1gn3nA9O7zf6VcLLJ9EijWe6UmJrkdbIrtFs663wmZkggiViNd DnDk6dFEZYWA1Bf5NiBijSSfHt+9I47em9YT287J7VZKnlQ74e/pkA+c6RlinRXoKJIHBt UaPZqDEXTiI2ZEYnBNuhqonL0gwoECXMBhiea0oMV7tnfClRazuf/bVNt1bCaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32pe9Pf499pgiN9nnnVTwCFK8Sm61u3H/JR7JDixdH0=; b=aO3FMjDGKOu5tmvoH5zTN6PAFZaR5OUpin6LSWFYLAdfsA6iPRYn1GLLcLYaWmNJlGiH55 YitFaoSJ1a7pFhfmhTOSsazpQ6CQPzN0tlSJHhGQqsqyK5G6qsTKTw616VdOOJS8w4qmek KYC4Q7Fn/0klr+xEMq1geM0/dEBTr7pbuex6Flt9SlhYlcA98+fErKhn/A8PkDZKrNN11K Gx7SzNQZqqIBw9X2Vn8Zrzylm4VRt8TcZvbJnajZPKo/ZlHG75VB0z2bGNixCILBCTOYOd K3fDfKC3qc9z2YFLSp6Q5GHpjoYhYGAoBXjj/IbIUUdPiTgo4lD04yR6eFrcWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737388245; a=rsa-sha256; cv=none; b=QMf4lGpaauWxjcEQELTFsA/jvMikz3k0fgCZHA6fig4h/1bld+yuDUams9m8pVIkA8+QHx vaH4jak2I/t35pcn19Fd66vUkmCVa9jinX8btAoZDWlASseIIAtv3kil3tMcBtH4b43SfZ REfChumm2cilnzqUCiXuLJx5Qm4yKt2J+8gYZCqzNskKpA996bxjrqJ87McBGs7bpxOTAV fpz2qH3mj78nmJH4enq63+vI+kh7YaTt417+60fI72Gnn54dyi5gm6DXeENlTvRn7t2Zwy zhAycAqSXFpksR0fnwu3pdYPgHvuApiKWuL8I76mppjBXfyKoIEA1yt1QAFDPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFDP5DdQzBDh; Mon, 20 Jan 2025 15:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFojHX047902; Mon, 20 Jan 2025 15:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFojnA047899; Mon, 20 Jan 2025 15:50:45 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:50:45 GMT Message-Id: <202501201550.50KFojnA047899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 62af5b9dc620 - main - atomics: Constify loads: Remove now superfluous uses of DECONST() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62af5b9dc6205289a0ace964d060fba64e71ef28 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=62af5b9dc6205289a0ace964d060fba64e71ef28 commit 62af5b9dc6205289a0ace964d060fba64e71ef28 Author: Olivier Certner AuthorDate: 2025-01-20 14:28:37 +0000 Commit: Olivier Certner CommitDate: 2025-01-20 15:49:52 +0000 atomics: Constify loads: Remove now superfluous uses of DECONST() No functional change (intended). Reviewed by: kib MFC after: 4 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48497 --- sys/compat/linuxkpi/common/include/linux/seqlock.h | 2 +- sys/sys/atomic_san.h | 3 +-- sys/sys/seqc.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/seqlock.h b/sys/compat/linuxkpi/common/include/linux/seqlock.h index 48e42efc10fe..554fdfd6e202 100644 --- a/sys/compat/linuxkpi/common/include/linux/seqlock.h +++ b/sys/compat/linuxkpi/common/include/linux/seqlock.h @@ -99,7 +99,7 @@ lkpi_write_seqcount_invalidate(seqc_t *seqcp) static inline seqc_t lkpi_seqprop_sequence(const seqc_t *seqcp) { - return (atomic_load_int(__DECONST(seqc_t *, seqcp))); + return (atomic_load_int(seqcp)); } #define seqprop_sequence(s) lkpi_seqprop_sequence(&(s)->seqc) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index 06c6c98ec8a8..9a82ff6762c6 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -266,8 +266,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); #define atomic_fcmpset_rel_ptr ATOMIC_SAN(fcmpset_rel_ptr) #define atomic_fetchadd_ptr ATOMIC_SAN(fetchadd_ptr) #define atomic_load_ptr(x) \ - ((__typeof(*x))ATOMIC_SAN(load_ptr)( \ - __DECONST(volatile uintptr_t *, (x)))) + ((__typeof(*x))ATOMIC_SAN(load_ptr)((const volatile uintptr_t *)(x))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ ((__typeof(*x))atomic_load_acq_ptr((const volatile uintptr_t *)(x))) diff --git a/sys/sys/seqc.h b/sys/sys/seqc.h index 6472c2e3cfd7..17854b6f4adb 100644 --- a/sys/sys/seqc.h +++ b/sys/sys/seqc.h @@ -78,14 +78,14 @@ static __inline seqc_t seqc_read_any(const seqc_t *seqcp) { - return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp))); + return (atomic_load_acq_int(seqcp)); } static __inline seqc_t seqc_read_notmodify(const seqc_t *seqcp) { - return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp)) & ~SEQC_MOD); + return (atomic_load_acq_int(seqcp) & ~SEQC_MOD); } static __inline seqc_t From nobody Mon Jan 20 15:50:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFDR10J6z5kGcf; Mon, 20 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFDQ6jNgz3NW8; Mon, 20 Jan 2025 15:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nxG5hRFQsvSqSnmfTAeADzBGLAsaegY/v/WgD3fApfI=; b=xiZPQ5kSiBKO89J95zWifvw2sUv/8Yh3R+ArTjBmwxoUX1dMcSa28+O+V/mOcta0PYCT+O xK5DP3y/ZTF/VBSxIwZKFsLGcgHkSOYVztqB1VOhpos69P+lQf3tL0A1tfSS0r7PiQ50m/ AFJT7X9hr8Jxqk7lB2VzwX11X+ecZz767OWUx0IuYdXBkkKZHOZtYNsBcQifjCR+H3EI9K XXig8qDrcXj/rOhRucy2NSLzqdPtoTBFXqL9whzhGoyy04LK0/wgb9hFACVDHwmhHEGqqu p0h+wQmB0duikTtZGABpFdQZGGk2O5FmS4ufux2VN37RCJZDzIeCZzXSTGw+Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737388247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nxG5hRFQsvSqSnmfTAeADzBGLAsaegY/v/WgD3fApfI=; b=LGrw+0z0zPKDP00YuPyCsbM+2xsJJrOG0rtH3sw1qqNpR4dRRe3mZeMeboEzrPSTcFJTRv iHKHSupQnCUz5PryeQLAC4OtCunqmpCDhtz+Rm+AjVhJyQFubIIqKD/eeB4b0KezdkStCG Uv7Ar5RjqKzdeoWeSO/rAWyG4ycvmBScIXXXsNBcXtOUol6LDOCcC8SVo4c1z99KezmT9c pcMwaAnVurh2o4hscLegy0vA9EeITXaYa0PrpNoyPQ/I+Rl+yIIs3YRl7ju6e/BVDyWSP4 ONub6EfvYRm8xMQVl+eZLZP4IGE/P8jycdR09pLj9vylsEfGwk3RhAwWWBlqhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737388247; a=rsa-sha256; cv=none; b=A/Fa5tPP7T+5NCzA8bI39M7cAr7bgfm3sR+HX4ARGdi4gXk6QmMVOE/OxeJWybaz/laKf3 k91nhBARnGWYbU3QXAMXUO7I+/xdFdGcTEazkPiQJpMAvRQCWeTjr6tjy8YhQ3UDl3i3Eh o024mufGEMi6nrHPprvyoJhBqrI1Tz7bvhYWmcRakI6AhM/ComyLEOKf6JanRC4eGvR95Q vnc//l6KgRl3gJ++1FNClYjs1qVmH8oln/QIBJS7W24NUBN4S2c06gCvyic1vL2tjwbwZ0 dqJL5dL83P4Wn5EpdATruL2exfXEBtdMsunT0Erp5g6ps/nqRf+y01CEY1A4Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFDQ6C2QzBQY; Mon, 20 Jan 2025 15:50:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KFokI0047935; Mon, 20 Jan 2025 15:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KFokt2047932; Mon, 20 Jan 2025 15:50:46 GMT (envelope-from git) Date: Mon, 20 Jan 2025 15:50:46 GMT Message-Id: <202501201550.50KFokt2047932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: c57c02ebf7bc - main - smr: Load to accept pointers to const pointers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c57c02ebf7bcc9b02a0dc11711e8d8a6960ad34b Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c57c02ebf7bcc9b02a0dc11711e8d8a6960ad34b commit c57c02ebf7bcc9b02a0dc11711e8d8a6960ad34b Author: Olivier Certner AuthorDate: 2025-01-20 14:38:42 +0000 Commit: Olivier Certner CommitDate: 2025-01-20 15:49:52 +0000 smr: Load to accept pointers to const pointers Pointers passed to the smr_entered_load() and smr_serialized_load() macros are in the end used as arguments to atomic_load_*ptr(), so convert them to the now acceptable 'const uintptr_t *' ones (instead of 'uintptr_tr *'), making these macros accept pointers to constant pointers. Reviewed by: kib MFC after: 4 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48497 --- sys/sys/smr_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/smr_types.h b/sys/sys/smr_types.h index 9da4a73c568c..0257236f7314 100644 --- a/sys/sys/smr_types.h +++ b/sys/sys/smr_types.h @@ -60,7 +60,8 @@ struct { \ */ #define smr_entered_load(p, smr) ({ \ SMR_ASSERT(SMR_ENTERED((smr)), "smr_entered_load"); \ - (__typeof((p)->__ptr))atomic_load_acq_ptr((uintptr_t *)&(p)->__ptr); \ + (__typeof((p)->__ptr))atomic_load_acq_ptr( \ + (const uintptr_t *)&(p)->__ptr); \ }) /* @@ -70,7 +71,8 @@ struct { \ */ #define smr_serialized_load(p, ex) ({ \ SMR_ASSERT(ex, "smr_serialized_load"); \ - (__typeof((p)->__ptr))atomic_load_ptr(&(p)->__ptr); \ + (__typeof((p)->__ptr))atomic_load_ptr( \ + (const uintptr_t *)&(p)->__ptr); \ }) /* From nobody Mon Jan 20 16:20:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFtx0zGbz5kK4c; Mon, 20 Jan 2025 16:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFtx0DF1z3RRv; Mon, 20 Jan 2025 16:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhUoAeVj0tuBXalptBZU9X2jFfcQmwEo/J4FJ6mG0so=; b=J7x9hXCoN8TYspCfwu5obrQU7m6eh5K/6NfEJOLdxjU6tkCVvDDqkQUOrIguYxUJN2+nr9 hpKA9XmZ5rRHSijF4LCV+UAZzfqbpoGEh6sjiADm28MBORW+bQjpnFh6xHzZjCtyOdrUnW /ZYb9CJ+cggjuj222SvBb7IVffQbnNDnpGMBjJfa/VxpAYR5IsGI450CU9AQ78VGiU5rtd uFGj4OR/U7g9gIAl4Ih6wZVvP9OnvnNUTavRJfO3PPgWwjOYJcBvOrcCm2slBSmYpEuEvA BsCCcCOktCOwBP/0FYW2e/Pmr3QTpf+ksSqB/XL90kdj96pbt0X/+aHG5Ts4cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AhUoAeVj0tuBXalptBZU9X2jFfcQmwEo/J4FJ6mG0so=; b=iglXSmGHGgWC+rTODnsQ+JMM8fXl5EDKjRIR2BmbSXtaoe2KogZmxbYOqhWkLhrB+2EEhE RhmSuyEm2DCLVDcfN3m7v21zx0kwLKl1vtYWjeAfeFRc1gOlyGkL7E3S6EqfnX5rEYYwP5 ED0lBhyIakSyMc0OJquVPd++QDZPivroq3HxvP7s+jKwtindyYHFbTEWrvx6W/gSR5vko9 NwNuRWGZYWQGIS7fOfiwA/UI1YVRME8RYR+Q3gbksO5RMjRDW9ShO0ehIqPJISE4IBPsI6 S0EUU4SuiYmX52IdPKkWrX/IBFB9F2ELfUTi8phqX2C4D25XwgUde1pe8VmoDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390041; a=rsa-sha256; cv=none; b=aUkATB2j8koUIPWY0SFX3B7X6XcpVmg7jBr+qqTed3kYpTOglnoyBhKGguXnY1YQA/jOr3 O7Ke6GyHU32xlpDJU7Bn1fkTUXS/WJJSNRo013TT+g6zO+BsQREGPQFyZupogHDfCJsNNP 8Lu9dPDFMEytOL4y7jmAW+JXlaxk38hAc5MzjGMLgdwv4aJrkvOY1HL19nofoC7Fd80MPz lCl9rKetBL5NiY6kJTT8moUziatRVN2hNPPD7WXMXQ4SaMGx6lAyxf2zMMrD0SS1ejjfT1 zr5vZsglurz22reGJ8LwGFj4tMxwrdu2CJdy8DMTnNYNadAlDQ6tdfbVBRpGKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFtw6xcXzC4M; Mon, 20 Jan 2025 16:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGKeNE003691; Mon, 20 Jan 2025 16:20:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGKeiC003686; Mon, 20 Jan 2025 16:20:40 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:20:40 GMT Message-Id: <202501201620.50KGKeiC003686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4ea15740a873 - stable/14 - tmpfs: remove duplicate flags check in tmpfs_rmdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ea15740a87314302dcb79d48b9280be199b0173 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea15740a87314302dcb79d48b9280be199b0173 commit 4ea15740a87314302dcb79d48b9280be199b0173 Author: Claudiu AuthorDate: 2024-10-13 20:00:42 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:20:20 +0000 tmpfs: remove duplicate flags check in tmpfs_rmdir Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D47100 (cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 729feb0329a4..a42ada6a5469 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1327,6 +1327,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Check flags to see if we are allowed to remove the directory. */ if ((dnode->tn_flags & APPEND) || (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; @@ -1344,13 +1345,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); - /* Check flags to see if we are allowed to remove the directory. */ - if ((dnode->tn_flags & APPEND) != 0 || - (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { - error = EPERM; - goto out; - } - /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) From nobody Mon Jan 20 16:22:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFxR2NGKz5kKX2; Mon, 20 Jan 2025 16:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFxR1cFJz3RnZ; Mon, 20 Jan 2025 16:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QNViSTRw19HDifaYvLn0Fcb7UnjG7RTGfdCCCwVUPU=; b=PEJgIN++gE7N7Zj/cJ3kqo48qMRftPa4DCgopUheZgO5d2Tzr4vKBweRnpqmF5g2Usfmv/ bSxtcZ1DWvPA5LPypVzokJ55UTBanWpXCYlRV03xv8mhzZH8++oTFd9QLh1xRlWDBvR7TG 4AX9oaVuhXsfug8MOsvur1jA2X/2oIaH1jQsq6HzoQpq0AZ7R3BUJHoWmei3QugSkw7rjj iHC5ofKPEn1CU5ENOe+u24rPCFNqEYdWIRR+zWW2r6MR3Uw0DxlnpQBNosV7AvdFFGeo9m BC0hWO5rV+34g2tZbm5SHdozjgeTQqUFiQDsF8Rfy8uyFQukDDoUCivNR7ndgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QNViSTRw19HDifaYvLn0Fcb7UnjG7RTGfdCCCwVUPU=; b=kG1MT75pgjrZfAn2gIbckjO/BAGZHcfH2xA/T2+RioVDHIZwQtwHB5G75wSyYQrcL/CZ9r 7yYJrFAtjL39Fuh6nPWzr7oHc90aPwV7tfzrmJbVgKDOYAwCIHi3Tw8MGZ2lZRkFKl6rI6 obOz+CQ/rpSc1QcHXfeqNq3gvZgy3sh7Y8z1gPDD78+I1gsKo/JosO818alxRYMKBNJ7VV omdMx8PFpt466527/1fdGsyM0AaB+LXp36kjBFgC3EAnwGk/DssmUy8umkynx4O+nwjqjq 27W73zaz6AcqnJCx/pdkJuMuoyvKfri70z+UicvIaxwoC2WvjgQtjlCg6uMqiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390171; a=rsa-sha256; cv=none; b=AV7uKsg7Iotagrskql/hROHI1qkqG1Kw9VuGVkwnQrAMjOKb6mRzbQCG+iQNdgpGULK2Jg vGurQdADzpgYzf7ikdUn6vQcwOvPQLzmrQOjzW8rcTLNZoVpizC1WxC8L1Kfes0vumD/ob +pnmWZrq5FZ7Qzms/1bx4RHPcJdnKg6R5pz4pZ91XlVAdBYKiaCAPNPuLamieGNG3Jt72B MXnDF1/nr3oe9rs2ArmcAXzE2tSEWVabfx+yJCE2uh/mdT95Qx4icCXJrpJSQpuQaPOdpR 2KwsOfU9BujqtOUjiYCtJnTfCc+WGY5sZHNbF5RGC7CPESLY/k1IQMCNxQA57Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFxR15XjzCG9; Mon, 20 Jan 2025 16:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGMpiq010887; Mon, 20 Jan 2025 16:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGMpG8010884; Mon, 20 Jan 2025 16:22:51 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:22:51 GMT Message-Id: <202501201622.50KGMpG8010884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 6203d08e7a3a - stable/14 - ktls.4: note that security/gnutls now supports ktls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d commit 6203d08e7a3aaaa1e8e4c1e78b26065ec2902d8d Author: Alan Somers AuthorDate: 2024-10-28 15:14:06 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:22:21 +0000 ktls.4: note that security/gnutls now supports ktls [skip ci] PR: 278083 Sponsored by: ConnectWise Reviewed by: diizzy Differential Revision: https://reviews.freebsd.org/D47310 (cherry picked from commit 7200d90644ba61d63e6fec33855bba5d3b7eb7bd) ktls.4: note that there are multiple openssl ports with KTLS knobs [skip ci] Reported by: "Herbert J. Skuhra" Sponsored by: ConnectWise (cherry picked from commit 1e4da42a36d5cf44bacf0e261626b69a4761f0cc) --- share/man/man4/ktls.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index 46a37d5dd636..56b03d45faf7 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd December 14, 2021 +.Dd October 31, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -220,8 +220,10 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa security/openssl-devel -port may also be built with support for +.Fa security/openssl* +and +.Fa security/gnutls +ports may also be built with support for .Nm by enabling the .Dv KTLS From nobody Mon Jan 20 16:24:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcFyv6f3lz5kKgp; Mon, 20 Jan 2025 16:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcFyv5rPxz3S82; Mon, 20 Jan 2025 16:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1NqUjmH0fZ9RkN+R7jmcAYegzES9vbVRy7I5a775C3U=; b=lCWHk7eRBHcF1Kb4bCh8ZRaONf2HjnZCXPHdz55CNJoNwmqHWSyQx6eFBCF939gA++Rb7D tOQJ10re1Wov8f/vTWJSxsTz+S3HkyQKJ6wRScsR5lVZdla/HW9e1sOQO9S/RG/j8r9kWz xRk5REMVFpflsiH4BT5vttidE9bqqKf5DBsXvD/6EVwRmykZ1xDeVEJtnXlGsMT0VTNp6a ZJO3kmpyqDi3bAym3Mg0VHrdrNUrx1mCxTqbPMb3IslzViwQCZFpQps30d+cQQzQdd6DBc Ncpz6LqcwjraXp0EASp2uTeNE61zAzlV0R2U8Rq5AaXOKhnlDb0C7Z74dnBNFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1NqUjmH0fZ9RkN+R7jmcAYegzES9vbVRy7I5a775C3U=; b=JyIO4OULJAp+bNwCL+zFySwoZT3rF3TUSou8Z3YBHdJmtiCyzlqj0I3h03yInmUbmbjSFM kxcAsG0Ry90HuqOGdRdbLGpP7E80GNO32EFHFNH2idE6VT5yws58uZQxOHgQGggFKR1dmp VXSKlF6CQFVXTnqiOxQolZc62AfPAF49gyeyxPP/hRD8E7SfuHnlrhFD7tlXJz1305kvwY h4TVNuK0L27q9FnSFwL+tyuc5ORQJEPy+fKRpTFxjYNgluwvhPOBiFX5nw/6fPKf5UV0YY uaPEghxVFRg9V4YSzrgnbS421bHu0zenbh6GGAreI/1l3tP+mAkNOKwZR8z0EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390247; a=rsa-sha256; cv=none; b=Ms4tnLffzbXe8e+gKD2zPlLEJx9wCSmdPdMPWRue2txrFu6tIABX+46M1EA8aZHV0KBfgK dRQMeiJHt1A8ToPrlyILAeN9BZFVg7ZERzapBM6XQecqjraf1MNgx18Q9PPMO/i6p8ZVnw 3y3cH4iYp3yVXUkzwUpgUdQlV7Ne58ewfMNhWKxT+cDPjlH8agP+uQH5BW4h4BSmv+LaJW hRuaasc6ieoNSJyWkdh78WIzfQGhJ1148zdZHyXqTpvJW39YgRzzjqyViJYXqyhFYlCY+L KjMzeqd/EePxKlAKXSaiQXQn4z3xEvoFRE8+O/d+NFDEC7EZcfJP1ZA6Zbx1mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcFyv5RXXzCD1; Mon, 20 Jan 2025 16:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGO7tn011388; Mon, 20 Jan 2025 16:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGO7ha011385; Mon, 20 Jan 2025 16:24:07 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:24:07 GMT Message-Id: <202501201624.50KGO7ha011385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 23b270405951 - stable/14 - Make the CTL tests more resilient List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 23b2704059512b985bb14b220d92102bc4569b3e Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=23b2704059512b985bb14b220d92102bc4569b3e commit 23b2704059512b985bb14b220d92102bc4569b3e Author: Alan Somers AuthorDate: 2024-11-05 00:26:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:23:08 +0000 Make the CTL tests more resilient Fix the find_device function to work regardless of whether "camcontrol devlist" lists the da device first and the pass device second or vice versa. On FreeBSD 14 and 15 it apparently always lists da first. But on 13 it can do it in either order. Sponsored by: ConnectWise Reviewed by: emaste, markj, #cam Differential Revision: https://reviews.freebsd.org/D47446 (cherry picked from commit b032be711c740d2f25b27c92069537edcfac221c) --- tests/sys/cam/ctl/ctl.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr index 18991e0fa144..868b1c809571 100644 --- a/tests/sys/cam/ctl/ctl.subr +++ b/tests/sys/cam/ctl/ctl.subr @@ -47,7 +47,14 @@ find_device() { ctladm port -o on -p 0 >/dev/null HEXLUN=`printf %x $LUN` while true; do - dev=`camcontrol devlist | awk -v lun=$HEXLUN '/FREEBSD CTL/ && $9==lun {split($10, fields, /[,]/); print fields[1];}' | sed 's:[()]::'` + dev=`camcontrol devlist | awk -v lun=$HEXLUN ' + /FREEBSD CTL.*,pass/ && $9==lun { + split($10, fields, /[,]/); print fields[1]; + } + /FREEBSD CTL.*\(pass/ && $9==lun { + split($10, fields, /[,]/); print fields[2]; + } + ' | sed 's:[()]::'` if [ -z "$dev" -o ! -c /dev/$dev ]; then retries=$(( $retries - 1 )) if [ $retries -eq 0 ]; then From nobody Mon Jan 20 16:27:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcG3D2L86z5kKmq; Mon, 20 Jan 2025 16:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcG3D1p1tz3StN; Mon, 20 Jan 2025 16:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puheg5tWKDriOHlHV8I++IR49mvsmAdcBmrzHKAt66s=; b=EJk9BLNy4StThiRh1IGnyLR+KjEzotz5xrtggb1c3eTYEJSzonha7PzVAcecllfhDnagbd 1Hjl5Izyb46BSmA98hV9ISVr64zYF69BbSuFT0aNm+Hm1qbIHQ7r3ERur3oUM3LAUVoAoK uk9wqjcZSWmYbcvt43Z2izec4FDNEIgN/XroIT3tkj1DpWLcd5DvM0F9++db1Y3of1hCuD FfdM+orzqnd1LRa+eSH/EB4+s1Oc16J8GZALwTRTSoRyv/X7T8v5gXQ0v58v9tHIG36u4k B3vtPVaE0Ss2bHdf3MX0mMPQmVxzykPB61nXes2Lnm2OXT4U7veSUnHsuLEfPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puheg5tWKDriOHlHV8I++IR49mvsmAdcBmrzHKAt66s=; b=XeOCfHP/ZjrUrxYCclr9xUHbZW/3P3jE6/qaZH7JYKHKwtSxE2KyMlJ+rqeXnxPwCv8b53 yYLs1zyrhGr0TDYbk5c8EBHRsCXSzm1uDE71I5UJrI/WyhwmziKCDhmzr3TGjAa0LduYgo UwW+8rambzVOgrDN7hrJ21dd2X3Q8xh2B3Wms91TisWZgSlogAUkNLQfbKomlegRddeqH6 S/jKM+Tmb5zjcpwL2G6ypnpCwEz88ZfuTSdWAHZ4nUFG/lglbBRWHO3dCE6CnDiR7qqlvN xHJzWG3vCSBtRj0GkA1TUBAsdScJZChbKsjhHewrhq4L5xH9b/MgQu0sSYdKOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390472; a=rsa-sha256; cv=none; b=npPbxuD4pKjNQewM1bhXCpr5yxgK/VJ0fWeNjWX9M6cS7xQ3kMK34hdd/sHSmTOpSBB34c qc7R55deYGPZxW7+0TPMDZ+J5uJt0Q51wqWDE/AHvWhgJnFSkcEzLelW0c/Cb7B7pB8M+6 sae3/l9wxk/Tb0C6gqEoZHF5cTgl0fuSJHchAyhsSvH+YDPjInroCThGEioeYfe/sNn5X1 1kt7wX1Jnk7oROEg35B9IoWQzdHyorqBmP9dk7klpKeEMxBgpjRLg8yhrqj1ZZN3X7v4LP nrb3xQvnSP/r17dRdMRhXe8bU2iCUdDUXOXl88gSf5zD3mHfONb0iXvpMLSINg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcG3D0xCwzCD3; Mon, 20 Jan 2025 16:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGRqVj012577; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGRqYc012574; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:27:52 GMT Message-Id: <202501201627.50KGRqYc012574@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: 980eedb0cad6 - stable/14 - pf: avoid use-after-free on reassembly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 980eedb0cad684c1e4a64d063df2ee7d28fa693d Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=980eedb0cad684c1e4a64d063df2ee7d28fa693d commit 980eedb0cad684c1e4a64d063df2ee7d28fa693d Author: Kristof Provost AuthorDate: 2025-01-06 20:08:04 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 16:26:49 +0000 pf: avoid use-after-free on reassembly Ensure we update the mbuf pointer returned by pf_normalize_ip() or pf_normalize_ip6() even if they fail. Otherwise we'd risk using a freed mbuf. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5d28f4cab8d5919aba1365e885a91a96c0655b59) --- sys/netpfil/pf/pf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 18b907c45d38..31c3dd8009de 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8424,6 +8424,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, if (mtag != NULL) m_tag_delete(m, mtag); } else if (pf_normalize_ip(m0, kif, &reason, &pd) != PF_PASS) { + m = *m0; /* We do IP header normalization and packet reassembly here */ action = PF_DROP; goto done; @@ -8629,6 +8630,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, done: PF_RULES_RUNLOCK(); + + if (m == NULL) + goto out; + if (action == PF_PASS && h->ip_hl > 5 && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; @@ -8968,6 +8973,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, kif, &reason, &pd) != PF_PASS) { + m = *m0; action = PF_DROP; goto done; } @@ -9237,6 +9243,9 @@ done: n = NULL; } + if (m == NULL) + goto out; + /* handle dangerous IPv6 extension headers. */ if (action == PF_PASS && rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { From nobody Mon Jan 20 16:27:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcG3F1Xj6z5kJyY; Mon, 20 Jan 2025 16:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcG3F0mQYz3SwY; Mon, 20 Jan 2025 16:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w4FnXSwKJghk8Q6ekNWLhBUmMLPG5Xw2P3Yy+QC/JuI=; b=FMfs610vHf0OQ/xXaXKm1l9xCSiG9mASmYlRSMyMv+VE0eOR300SODIjLCUdCvsXFRfP0h dTXV53Gcj0orW3EF8MjIhd3aNGdNCjPjTs1B8NXkWSVbyk83xKXBRtFLsEwYfutqn7SrLq i5MkNqNd/ZLVgMVY4qVDbhUnjcBLCXb1z4ufOtkSF1DUx2EHRB9BPDBVOR8CE4YPRS0y2s 1gq83ZwPC4JQPTTBT90EjoNlNHTL4SMDvTf3yQOGRe0LvpOxw6R80jdon6BrJhQQDn98Ox kzOzs8ErUwb9RM8uUf8Nd3RnD8nHJ9yBIsv3s3ShiVhiAn/1Kpc+wh2ADVQmGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w4FnXSwKJghk8Q6ekNWLhBUmMLPG5Xw2P3Yy+QC/JuI=; b=qtnCtaJm9VGrbvVR2v4UVvv+VrVt/uiWl07hlgIqjTfVU2aiPsylXN+NhjT8gvQOyA7Uio WdsDElPBoiqZGfFP523IwZhkSJwHQwyxgWg0n1qNbSTyjdfFO9OIn2HuQB1pq+hNV2yE/R 7nu3yqvGXgivIPuVAd6zb5v1SWIby28p7uLTEMYyyTEqBiprPY7FAbpH4/jTh/EzFo7i3U pyqHRcVBfsnlkCalDuw4zWNtW5l+jYXHt/M9pIlC2l70CA4XCmtP34+eDsIPte45g4Oc1C XbhdT9ZgQyZLZHrA8+kaFKm2qvssGyEk8PbJoh9wjKdCnos95bqUKPe2eah+MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390473; a=rsa-sha256; cv=none; b=T+jy9tKMh/BkG1NQldlMmBF1YqMJhBt/HiNwD4lVsUGDlBDNhnvSend+y4YB1CBixHzhfw UaAgUZ9c4H0xO70GsyEEdk6AmljfQ2LDO8T+iliyqLrDcpMnLuSybFMeaZZirnZtAqb1R3 GdYUoTYwdeSAe9TLv17w8CKWngcr2zHFJqLMrEP+LNSfLCaWqZhTiZCeXI24/plR+0PrBm AU3/WawTnAAlNpaSf6M6vN1b8zZ/rBODR8fui1KxuXPDSC6iUT848QkIvGFoyDADXCjFhP iLbgfzpU1Mbbj3nTMU9329Bw8OnXadpQOVANRPbqvXfj3DEoPjnRa4JxgPX07Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcG3F0DdVzC73; Mon, 20 Jan 2025 16:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGRqnM012670; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGRqSL012667; Mon, 20 Jan 2025 16:27:52 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:27:52 GMT Message-Id: <202501201627.50KGRqSL012667@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: faec43a79bf9 - stable/13 - pf: avoid use-after-free on reassembly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 commit faec43a79bf9a43ac3e2bc3e1de244dd31868dd3 Author: Kristof Provost AuthorDate: 2025-01-20 07:11:14 +0000 Commit: Kristof Provost CommitDate: 2025-01-20 16:17:10 +0000 pf: avoid use-after-free on reassembly Ensure we update the mbuf pointer returned by pf_normalize_ip() or pf_normalize_ip6() even if they fail. Otherwise we'd risk using a freed mbuf. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5d28f4cab8d5919aba1365e885a91a96c0655b59) --- sys/netpfil/pf/pf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e5cd0b83ac0c..b5f872d40b02 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7468,6 +7468,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * pd.pf_mtag->flags &= ~PF_FASTFWD_OURS_PRESENT; } } else if (pf_normalize_ip(m0, dir, kif, &reason, &pd) != PF_PASS) { + m = *m0; /* We do IP header normalization and packet reassembly here */ action = PF_DROP; goto done; @@ -7679,6 +7680,10 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * done: PF_RULES_RUNLOCK(); + + if (m == NULL) + goto out; + if (action == PF_PASS && h->ip_hl > 5 && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { action = PF_DROP; @@ -7936,6 +7941,7 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb /* We do IP header normalization and packet reassembly here */ if (pf_normalize_ip6(m0, dir, kif, &reason, &pd) != PF_PASS) { + m = *m0; action = PF_DROP; goto done; } @@ -8210,6 +8216,9 @@ done: n = NULL; } + if (m == NULL) + goto out; + /* handle dangerous IPv6 extension headers. */ if (action == PF_PASS && rh_cnt && !((s && s->state_flags & PFSTATE_ALLOWOPTS) || r->allow_opts)) { From nobody Mon Jan 20 16:36:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGDl0mmcz5kLKc; Mon, 20 Jan 2025 16:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGDl015yz3Tmt; Mon, 20 Jan 2025 16:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zJ7hJSkfS8Xdf8UgwvjlNdwd6KmmmqgRuBZ1JPF600=; b=BwWgNCtBeP/1sw9d5YgIUJbOEMEyVaW3f7mWWyd9VPKC9lTJ/CdhU9Ijq/+ss+HkgWeoIe ZWF8X6EwWRVGbQTHPOzV36uew7J4EXqeQKkXbleZfCVv2Rcev0D8K1YNd/bUDqxptRqsJA 1FPpFMYSiVh359hmBg9oAvizXLgBwn7obvXzJW6QzBgIKoBDNJ9fLX2DMpUoN7DRWU1R6N H9EvhLZ3CAj90NWWb8Vj/8Oe+kHWm32WeEoJBW3VhBMl453BcFnFBGPiA7pBdX71kXRrPu hvGmh0odyySQv0eZ469ZQrbqzFjBRLuk9TMz72prMaQTSc20xlj2XqP9LOlWpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737390967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zJ7hJSkfS8Xdf8UgwvjlNdwd6KmmmqgRuBZ1JPF600=; b=bNSbrWEXvZCGeBNg5Uali/bOcmPwar9hxwDpMrsMKHYeEdZS3RNgRDRq2lt6rpR7M+oUP/ LC7Q6dcW9wRWJgIRXbr/fucunThFlSqNQBBHUrPiQYS6xFpyirESH57e5p+hiq2egRKOEp xZIu9JD91sol1Uz3UPbVAumMUqsF3gSHBbqygIWDLu48ZIno9zARr8x5Vy/37B671NFGUj ERZ2k+5BVcwDf2bmT6uYtJFtg/sMmrTIAITz5vQ9J0gRAyoO/n3n7DPjsT/ynZpITV9ghP IedZ5XCK4ajFBj7gcTRARFt0ByMIX9juRxW9tH1JeWsloSBdIfDIKqdPIy4DKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737390967; a=rsa-sha256; cv=none; b=GV0gToCk0UpBBmndePlgrbJFxUPNeSVJL213esPEmdZnkWshsOWnAgRiSPnYr52CrBqg88 it0nLCm/wlqfVCKevu3VWLGXY3+R5juI44bYbT6G2jyxbXQL4maiSqd/NSw0J/ne5d2iOY KLZOOMn99qgja5YuztqWmNfGXiUvRzpVx3GSBlM5Vf5nLw1KU4Jv+8r07iv5PfuzM0qy91 Oy2i9YnG2wx1gdaZqC+78acseaCVNsVmDdmdwtKPyovnUe33+5NhvYoKBz11X2FFEh6OX9 lph3MaQnN/ZtLOHvgRKkYsc7aiHfhA54gNP8sGvisul2qXHrubM3ctOyS0h9YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGDk6X4dzCgb; Mon, 20 Jan 2025 16:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGa6lZ031002; Mon, 20 Jan 2025 16:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGa6IN030999; Mon, 20 Jan 2025 16:36:06 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:36:06 GMT Message-Id: <202501201636.50KGa6IN030999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: b797d07560a7 - stable/14 - fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b797d07560a76d790c0256a70d65b2b684ab6ee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b797d07560a76d790c0256a70d65b2b684ab6ee7 commit b797d07560a76d790c0256a70d65b2b684ab6ee7 Author: Alan Somers AuthorDate: 2024-12-13 14:00:20 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:36:02 +0000 fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY messages are fully asynchronous. The server sends them to the kernel unsolicited. That means that unlike every other fuse message coming from the server, these two arrive to a potentially unbusied mountpoint. So they must explicitly busy it. Otherwise a page fault could result if the mountpoint were being unmounted. Reported by: JSML4ThWwBID69YC@protonmail.com (cherry picked from commit 989998529387b4d98dfaa6c499ad88b006f78de8) --- sys/fs/fuse/fuse_device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 5df9be59ce36..2fd43bc742dc 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -440,7 +440,6 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); - mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { SDT_PROBE2(fusefs, , device, trace, 1, @@ -543,6 +542,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) } else if (ohead.unique == 0){ /* unique == 0 means asynchronous notification */ SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + mp = data->mp; + vfs_ref(mp); + err = vfs_busy(mp, 0); + vfs_rel(mp); + if (err) + return (err); + switch (ohead.error) { case FUSE_NOTIFY_INVAL_ENTRY: err = fuse_internal_invalidate_entry(mp, uio); @@ -567,6 +573,7 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) /* Not implemented */ err = ENOSYS; } + vfs_unbusy(mp); } else { /* no callback at all! */ SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, From nobody Mon Jan 20 16:36:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGFd4zn3z5kLHP; Mon, 20 Jan 2025 16:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGFd4JZnz3V3C; Mon, 20 Jan 2025 16:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z03LKoRcmGqXNgkSB3yPUwRnLk4aYnaGh0hunpew5A4=; b=FIPUJKyzEGg3FZg9frC6Ab1iHqQKTtfXyapv5ZzboQQdvc2pz8ESNuBBcix0qTh6Tj248s X//qcaxwkWsti6chrp0GDAsfAuGausEYCIiyZH5vtrZULFQiH+4erHhLEp0SYS+FtEerSv HvtoB9+H6AlUYR+2IrQlQBFe46LFeafHL1OHlvAsJKTl7MhHG8IMmm9s7Bp2PdEIUVDrIs MreG6ePvk53kr7hyeiMUkpb1Copg7AUjvwmSod2Pi57jNyMDx/K2cdXMRDKajUP3OUJbKv FHfDnfitehVoPwooEOhaz0+2ZyLeoMSd9AFF+BtKGnlQ9Ena2RP3P3xPSN0SYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z03LKoRcmGqXNgkSB3yPUwRnLk4aYnaGh0hunpew5A4=; b=CE2oFAlbvJ6VTikqnLgORM8pkbTJXQRYGEhEfj11z7Gy0CsgtoYmhsYyVHCSQUVrGIIcw2 bFV3VvcFEJR4aKl6tDLwnMYGbD0jJ/wGM0zxOCQha45ATmBXJaGXOyq90jUHkTBFGAngfL dOdV/POBqqKS/3GNMIuNK3FvjbPmGwbNYMkh+L7zBqycBkotLofDE2nW0/dPfsk2B8Qw8d CLODbiYS8OCs//VEzo1kgO1otF6FRqsr4wGETYeALzw1DT6rCSLXvzTUsmDRD2RJoN+59g aHCK245it4NLdmUsrakbDGU/H7+qBpghHWTMhiyd3lGZ4rU8KpEix/iIyluOZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391013; a=rsa-sha256; cv=none; b=ZoezsYHdEKwG9evQGvVPtbSgwf3mQ65Q6EZAGqJ/jNwFFm9RF7FGJPHG2NRcJMu7n504jQ BWcYMv7vI+Kcf9mhYuhNb8pzycq1TBzadKzzmMTVRbVMIvOIef67NFeLlh86jHcQpTTjPX 4KDo4glR5UU4uXP3M7eDjY4vnzMf//i6jsjqhxE2uy5bC60v6arv9TH9z4JESG518hSAyR YZPnYDo1cjxpkNV1Ba+SbdFqcbiy1DAggcHcMxS6Ufthai77ZIJbn+Jlr+piXqxpKSu67j W0MgdWhPPM95H9X8pQFib9RGma3u32NpLrKgeCsmssDIHaG9bwlJg3/mcsMHzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGFd3s4qzC65; Mon, 20 Jan 2025 16:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGarHw031328; Mon, 20 Jan 2025 16:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGarMh031325; Mon, 20 Jan 2025 16:36:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:36:53 GMT Message-Id: <202501201636.50KGarMh031325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 887494153482 - stable/14 - namei: add more detail about LOCKSHARED's behavior List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 887494153482e4332f90a64a499ee1ed196ff25d Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=887494153482e4332f90a64a499ee1ed196ff25d commit 887494153482e4332f90a64a499ee1ed196ff25d Author: Alan Somers AuthorDate: 2024-12-17 20:10:57 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:36:24 +0000 namei: add more detail about LOCKSHARED's behavior [skip ci] Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48125 (cherry picked from commit 22bb70a6b3bb7799276ab480e40665b7d6e4ce25) --- share/man/man9/namei.9 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 0be73f68cdda..63a6d3b11f6f 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -31,7 +31,7 @@ .\" If you integrate this manpage in another OS, I'd appreciate a note .\" - eivind@FreeBSD.org .\" -.Dd July 8, 2023 +.Dd December 17, 2024 .Dt NAMEI 9 .Os .Sh NAME @@ -124,7 +124,6 @@ Lock vnode on return with unless .Dv LOCKSHARED is also set. -The .Xr VOP_UNLOCK 9 should be used to release the lock (or @@ -153,8 +152,20 @@ and .Xr vrele 9 . .It Dv LOCKSHARED Lock vnode on return with -.Dv LK_SHARED . -The +.Dv LK_SHARED , +if permitted by the file system that owns the vnode. +The file system must explicitly permit this by setting +.Dv MNTK_LOOKUP_SHARED +in +.Dv mp->mnt_kern_flag +during mount and by calling +.Fn VN_LOCK_ASHARE +when allocating the vnode. +If +.Dv LOCKLEAF +is specified but shared locking is not permitted, then the vnode will be +returned with +.Dv LK_EXCLUSIVE . .Xr VOP_UNLOCK 9 should be used to release the lock (or From nobody Mon Jan 20 16:44:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGQf3kSBz5kLXj; Mon, 20 Jan 2025 16:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGQf2sw7z3Vjb; Mon, 20 Jan 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hxy6C2S2sKA627E8kBoV5/LUhnawbUQrUYnR8X5qsrY=; b=l1x2tH/fw0tNoDtNjB7BTyfqeUPQ1S3rNmyUjo48OwaDcm/j2nj0wb6RoLSzJ/vWxH+hI/ f2xViE1CDt+1ievlkOVFZPLsZh6VgJGXnuWL3zijXE3/2eX109tkso28LCVh72xhU5eAFy Y8lFty6RtYUoGxvDS3yAQHAc2LtW53Wv4NIDGEPR9Dn8ZTarD11CycQCfeOqgzVNUZX6VZ cxn4DrWUQs2TTNMFWdm94ZcpCH9VkoDH+2WPb/foCyFyB+w9EICyFcHTbb/m9svAGsnohP xzpioAWmiw5Y/R5EyMO64JaRzdnJ9v7awCFLbIMMXIP5L0Lsj4OPUx+KApBDwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hxy6C2S2sKA627E8kBoV5/LUhnawbUQrUYnR8X5qsrY=; b=U7era29Ra+lSweMtrCzgF/v2bdUJWD8qg/VtOz1DPx6wHgV0rTIW4HyzPAwuoRWQtfxf1c N5NKKfB5cAXPIbggUogYm8Q6pOeOH0OcAbKNAxc1gsqGSa8T8heL7cH56C5tb38zGTxMWM Rdo/a5flt4k1n7wnaR745JLqR9DphHAeYbTqSngbRT3E61ekuMH5WZqRa8Y9oXoMC+gUSk CSjCIu9Z7NRnYw7zVBthIq1ctxn8781EbwLIfuDbraiL/mqKwemKAF+LZKPJNVV84jgZWt oPw1+sWo5m9U+ZFBcjLRaifKtwx+aq+LIlTjiAfbkolOVgmICpCUvPPGIPhAdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391482; a=rsa-sha256; cv=none; b=osp05gRNwb0TM8nI0tDfG+hy6St17T9Kcs6rFwz16X3JVZLSq5BRqWwlMX5ZpcMzlJWzK9 ydPKhy26pAGAinP76A/5gMxwIRB7R+NMqkZGM5OwwWwkODV1vZHhzgHHhybOz8xAL2iTdD XTSbgdFtAaBo3bTobj9SaBiwCqEyniU5D6d955YO1cRwWs5ER2itzokxZwzKf09ahcgB82 H6gVRoz5p/hJQ+Y/Fv+U1iv68necwehljVZjCTMBkqcF4gl1ticaiDVf2lvYQadEBx4oa3 9CXW1uf48onyYBDhaHDh57hZG/12xQoTFHnMJPsQcTfgS8Kb85D0zjNDfmjSyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGQf2SpLzCjK; Mon, 20 Jan 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGig6O048924; Mon, 20 Jan 2025 16:44:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGigBK048921; Mon, 20 Jan 2025 16:44:42 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:44:42 GMT Message-Id: <202501201644.50KGigBK048921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4f4b2b7a4b6c - main - boottrace: Don't say we've unmounted if we haven't. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f4b2b7a4b6c5642320479a765f850c394766276 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4b2b7a4b6c5642320479a765f850c394766276 commit 4f4b2b7a4b6c5642320479a765f850c394766276 Author: Dag-Erling Smørgrav AuthorDate: 2025-01-20 16:44:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-01-20 16:44:25 +0000 boottrace: Don't say we've unmounted if we haven't. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48515 --- sys/kern/vfs_bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index d6392c025a94..08ba752bcf29 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1518,8 +1518,8 @@ bufshutdown(int show_busybufs) if (!KERNEL_PANICKED()) { swapoff_all(); vfs_unmountall(); + BOOTTRACE("shutdown unmounted all filesystems"); } - BOOTTRACE("shutdown unmounted all filesystems"); } DELAY(100000); /* wait for console output to finish */ } From nobody Mon Jan 20 16:52:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbP72snz5kMDR; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbP6Wcfz3Wwd; Mon, 20 Jan 2025 16:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnIE1+0seA3GBNylb6o/77poARRCiN4NwjGaZbdQ7oU=; b=AGaDbJhYJQZQoBZ3QA4zTqpzuaQdRKhQDdONUhTkpxtPhk/sAx9uQjqCYSrESiJxH/+LoX mjXZgX5MXcJsvcGBsyshxIcvJ8tE4kO7JxVjQiCOMvhbSjmL1qBCSEW1PXydKvU90Dga2f g00SkAqLqAyA9MJG1cjWiTZgs1NaQ/Em1RlCSw+ma1zMahvuWN0uPJYbetqAveoT54zvb8 jaSn28pgyaubzIIAyybRB+Zv8pcZzWGmU5VkEAg61vHNkCdARQrA1bXHgCnWn1c4kgFIGt 8d1UuK38LhlC2s4J6xHYLQl51rWaIQDZbyd/rnzgHUCMeQQRvVVJwuL48Bp1Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnIE1+0seA3GBNylb6o/77poARRCiN4NwjGaZbdQ7oU=; b=ttKf+4EKCRfdCK5Lq3YBiv6JK11roRuN8dZ2da0lUmFBzlWIRULF9jQu65nBFis0yI8BDF 3HnJXmdmeVTItn0zRj5gCLSbMWb/Em8IHmx+M0/a8DBK9DRQ5kHWYQQv0taJtVOLgTjHC4 JVD8l+Vf1co5c7FLV5NsYeMvEta52Q5kWAXoxlpYUObSPPxz2S92QmiWvALdztRXLzhwN0 i9s0Qsgm99RuzqlpMDg2zQgIV+rgPCiZDfLKOY4KLE6zrXSdNdgNUC3sU2Xtkw2QZqWJQn /oITwKlHuZvfm/OVaR/ZxaVG0D5HX2uS8lCMmN/0WtYmI62WiopqH/7q/mgvSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391937; a=rsa-sha256; cv=none; b=QI4Hkxk2YApUt2/XaGKLGnhJEp41NcQwtffdPngco+na01GFMmpRXlxm4oG50EA1EJ/GqX kQK2DHd2tW+yAhqQxHU94LPjSXEDzZhDY+ijSTJ6qkZ5A/l7dLX4/69nKldV4N0sl6itlJ gUFtCQJW3cF7otdWt9s9lHBwikDTQ7nzU9VgoQGmyPSat4abcL+SvIQGeJkeKowvh80j3+ 3hKrVsr8D9kT5eyLgy4yrMV/gbaEIh59VWaxYGJefrUGIDsRTs43MRzxnoxjHFJUReYmja gkMS+FwOMII4ip6FE+ffAZhfjBMrUxgmaajT3kaTEuMTLDgfP+3OY9Tt4XeWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbP64BRzCmC; Mon, 20 Jan 2025 16:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqHc5065176; Mon, 20 Jan 2025 16:52:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqHOj065158; Mon, 20 Jan 2025 16:52:17 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:17 GMT Message-Id: <202501201652.50KGqHOj065158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: b0348117953a - stable/14 - fusefs: More accurately test the unique tokens in the test suite List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b0348117953a117244056032e468dd6a742dc678 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b0348117953a117244056032e468dd6a742dc678 commit b0348117953a117244056032e468dd6a742dc678 Author: Alan Somers AuthorDate: 2024-12-18 01:38:05 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:31 +0000 fusefs: More accurately test the unique tokens in the test suite Every fuse ticket has a "unique" token. As the name implies, they're supposed to be unique. Previously the fusefs test suite verified their uniqueness by relying on the fact that they are also sequential. But they aren't guaranteed to be sequential. Enhance the tests by removing that convenient assumption. Sponsored by: Axcient (cherry picked from commit b1879975794772ee51f0b4865753364c7d7626c3) --- tests/sys/fs/fusefs/mockfs.cc | 15 ++++++--------- tests/sys/fs/fusefs/mockfs.hh | 6 ++++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index bd7bd1b663f9..023cecd0276f 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -421,6 +421,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool noclusterr, unsigned time_gran, bool nointr, bool noatime, const char *fsname, const char *subtype) + : m_uniques(new std::unordered_set) { struct sigaction sa; struct iovec *iov = NULL; @@ -436,7 +437,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, m_pm = pm; m_time_gran = time_gran; m_quit = false; - m_last_unique = 0; + if (m_pm == KQ) m_kq = kqueue(); else @@ -738,14 +739,10 @@ void MockFS::audit_request(const mockfs_buf_in &in, ssize_t buflen) { default: FAIL() << "Unknown opcode " << in.header.opcode; } - /* - * Check that the ticket's unique value is sequential. Technically it - * doesn't need to be sequential, merely unique. But the current - * fusefs driver _does_ make it sequential, and that's easy to check - * for. - */ - if (in.header.unique != ++m_last_unique) - FAIL() << "Non-sequential unique value"; + /* Verify that the ticket's unique value is actually unique. */ + if (m_uniques->find(in.header.unique) != m_uniques->end()) + FAIL() << "Non-unique \"unique\" value"; + m_uniques->insert(in.header.unique); } void MockFS::init(uint32_t flags) { diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 958964f769d4..38efcd049a61 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -36,6 +36,8 @@ extern "C" { #include "fuse_kernel.h" } +#include + #include #define TIME_T_MAX (std::numeric_limits::max()) @@ -298,8 +300,8 @@ class MockFS { /* pid of the test process */ pid_t m_pid; - /* The unique value of the header of the last received operation */ - uint64_t m_last_unique; + /* Every "unique" value of a fuse ticket seen so far */ + std::unique_ptr> m_uniques; /* Method the daemon should use for I/O to and from /dev/fuse */ enum poll_method m_pm; From nobody Mon Jan 20 16:52:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbR14szz5kMGn; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbQ6zkfz3Wr9; Mon, 20 Jan 2025 16:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jhqsr8wYKZWt/ub9OkWv81xD1Fyyl67/pmL+10BmdIc=; b=fTON4E3MJ/ecw3RSyiuCdVP8qMEDnrtaGk8Vq+aBqVla5NVWEEcqZm1WgcGebfpkDVLs1E EbS+Brb7lqdfceyGpykbsQ+q04Kc+Ayk6zoYpjwVjIKq3NPIG2YBACbU7o8fUa/5W6QRO6 P9Vl2xyhtknaWrqT1De2OJ5T74OKKdrlQ+vxpAmQykHpM9nWHZE506p8QlsDahzGX/P5Aa KAXnGMGG3lce7XbjKKr+0LaUu9U1ru6R+1mHoz/Z4JkF4cXSKvebyED6gIu0E4VcXV6qpZ OSJ8MrYzpXyAgDjFD5N/kiIaLlkcvkE49KEbcrXy+DdkDwGwHzhN+7wfuMzplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jhqsr8wYKZWt/ub9OkWv81xD1Fyyl67/pmL+10BmdIc=; b=SuhEDeGMNSweWEGsobHIIpHT5DoWvI3cdCY1m0ffS4mMOvukyajk82o66+trF7sFa2PX24 zKvWlRHLB+m4J1refCex21tE3iJYhJss3ffgSsmrbEDUf+TknCJz0+Rif0IcaL8Zt9qeZA y/0IT+Sr0W1JdJ+5DrN61ROAFjBqcqrbFRwz17fJ0Y4XYIqwdM5xuaWNAcS5YaS4hN0LBM sYB/WfxOJiVrUKNRDaSh4Gsn12gdawGhDwmwt/zjP9ZmUQlkz6fvf1eqdgOCkHfyC1ZaLm u0nT93qNl9IRtc9L2KAxbKBT4l4XMc4VuZtsNB1mIBN+QTmoNQFYUO6QcW1HSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391939; a=rsa-sha256; cv=none; b=mH+fsgsNBDepjNPiHb8fXDjEkGsY0TfGoz4yK48yy+zNSQLxIZ0fu+p/T5TCZi+k8ZbSFn 49FPTlZR/QVZMdWY0HBke1uj5fbL28N8MtHYDJStOQAWmxktfMi0yj9PlQlStpq7Ndrbys B5kEZ5KOaFxm08n+0Mo9JwSNDrIZBT0129alLeZWDDKigvPosTLS4er4O8KIBGu2rV0CqN GQoSo5n2pDYlYX6J3/0Ui0hPf/xUs/bckzqGh8OjxlfkkR4RjQ5nW46/JJla/PoJ/jWUeh Afpajn5/NVZ46gVHLYxBz89kgOzW6C4nTRWNj6QPZedCwgoZfNhRzFYX+LIc9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbQ6XpKzCxp; Mon, 20 Jan 2025 16:52:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqIvX066524; Mon, 20 Jan 2025 16:52:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqIM0066512; Mon, 20 Jan 2025 16:52:18 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:18 GMT Message-Id: <202501201652.50KGqIM0066512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: fb4e0325c758 - stable/14 - fusefs: delete a comment in the tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb4e0325c758f393b61dab4219f195f1674fcd70 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=fb4e0325c758f393b61dab4219f195f1674fcd70 commit fb4e0325c758f393b61dab4219f195f1674fcd70 Author: Alan Somers AuthorDate: 2024-12-18 18:24:03 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:35 +0000 fusefs: delete a comment in the tests Even on a riscv embedded system, the fusefs tests run fast enough that 10 seconds is a reasonable timeout. [skip ci] Sponsored by: ConnectWise (cherry picked from commit 53f73aaffddaedff019555679d686ec401330d39) --- tests/sys/fs/fusefs/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index f45f2f93e1c0..00e2e208989e 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -66,7 +66,6 @@ TEST_METADATA.default_permissions_privileged+= required_user="root" TEST_METADATA.mknod+= required_user="root" TEST_METADATA.nfs+= required_user="root" -# TODO: drastically increase timeout after test development is mostly complete TEST_METADATA+= timeout=10 FUSEFS= ${SRCTOP}/sys/fs/fuse From nobody Mon Jan 20 16:52:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbS6Z6hz5kM7l; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbS3Bwkz3X2Z; Mon, 20 Jan 2025 16:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsmuG0GEIlRrlIjNzn6bECnp8iaL+69VEGmrW0tOZdU=; b=yaDu+Wu+VQRd7rNxq/Hp13PJP2sDcwNSN3Yh/+lsflU3bA3nndW0SDHX+J+hh8xTUp5KY/ AUFyFV6ba32MU5k2OOBF2Ii4qy4bkkVFjHgUwgStlUiNJVgMR+IuAtjvffYAye3T1KFAX5 us5/tmc/lDIe081dybiEvYpRFWlpprX8zjGrgsiUY8n1wXlSHINPmGRId+dKG9Zqet5AN3 6BePJeY1deL4MSTImUP0TYRkl1qTFWsOFpWgStzjIZVcP9nl3gi+w171qEi2wofVmCRTjk S8d1/eCXC3aWacs2SNzNVv3N/tbP4ainprSq2nnrHJE0EX2Cl24bxHPBttwTyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lsmuG0GEIlRrlIjNzn6bECnp8iaL+69VEGmrW0tOZdU=; b=irWwh2IgWr6ZNunCz09VzKd8109YdpsqMcd6Puo7sla5XhqWBH08BZy0a6K5mGru/RX5l6 b9jp4U9qy5o/rGFas6zAh1og6dCVqw3qELbDNTlYLm0I7ex7we4s1UGVTK6zLnwBFlruWl lOA5sE6QzBh0d6YVRBku8oX7fJ0DA5i6BAwvajNV8bo0wIsg3KY6TaEy+5dmz1Vi5JGxVv DpJ8RYjK1IV/zwnt8nSfi8viJT+C3cfn+mehds0yutbNi1okRGJ0wjmUynDVBhoO/nL9eW nrTq9WLv0jQCW0KknXiKug7oagKNnLIE7O+b4vJL/YwBliNjpL3FwgFperIqMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391940; a=rsa-sha256; cv=none; b=l/SW+1XlIm7MAFcmyWRLEt4e8quBuU527aIQgUmZRD7P+q1XfZ3VfOwIg+iiTmp3EDCTxs 6pUEqxMmZknaoRxa0D37EwnKoSmkQRbs1qeK04kTmHdmH+/KjTnjqBxgFl1wlXwyfueNdD H63rcX3UJ26me/SS29RghSVG8nI7A2k0g1XDpevSJvE2mqniHYLMnkt+UGlMg5Qy+zfKxU 4cPrwgV2Vdh0cw7MTkOUfkQXhTkYWhHvQ4gjRjgp6VEoYjIS4L2eLCl72BHFNJj/uehakO OCehUOxE4313Clsvkz+4TcAb9qRr7F6afgcHnTYIJHm/2Dk5bDPC8eRJJAvhcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbS0Q2GzC8D; Mon, 20 Jan 2025 16:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqJFw067287; Mon, 20 Jan 2025 16:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqJkl067284; Mon, 20 Jan 2025 16:52:19 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:19 GMT Message-Id: <202501201652.50KGqJkl067284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: d2c25c4c5e5b - stable/14 - fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 commit d2c25c4c5e5b13a0933fb71781e1f04ac179c3a8 Author: CismonX AuthorDate: 2024-11-02 20:19:15 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:40 +0000 fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags The FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT flags are only meant to indicate kernel features, and should be ignored if they appear in the FUSE_INIT reply flags. Also fix the corresponding test cases. Reviewed by: Alan Somers Signed-off-by: CismonX Pull Request: https://github.com/freebsd/freebsd-src/pull/1509 (cherry picked from commit f0f596bd955e5b48c55db502e79fc652ac8970d3) --- sys/fs/fuse/fuse_file.c | 9 +++------ sys/fs/fuse/fuse_internal.c | 4 ---- sys/fs/fuse/fuse_ipc.h | 2 -- sys/fs/fuse/fuse_vnops.c | 17 ++++++++--------- tests/sys/fs/fusefs/open.cc | 38 ++------------------------------------ tests/sys/fs/fusefs/opendir.cc | 27 ++------------------------- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index ecaa641a9261..22fc283e263c 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -123,7 +123,6 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; const struct fuse_open_out default_foo = { .fh = 0, @@ -133,12 +132,10 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_open_in *foi = NULL; const struct fuse_open_out *foo; fufh_type_t fufh_type; - int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; int relop = FUSE_RELEASE; - int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); @@ -146,12 +143,11 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, if (vnode_isdir(vp)) { op = FUSE_OPENDIR; relop = FUSE_RELEASEDIR; - fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + if (fsess_not_impl(mp, op)) { /* The operation implicitly succeeds */ foo = &default_foo; } else { @@ -161,7 +157,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, foi->flags = oflags; err = fdisp_wait_answ(&fdi); - if (err == ENOSYS && dataflags & fsess_no_op_support) { + if (err == ENOSYS) { /* The operation implicitly succeeds */ foo = &default_foo; fsess_set_notimpl(mp, op); @@ -175,6 +171,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, goto out; } else { foo = fdi.answ; + fsess_set_impl(mp, op); } } diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index f67bfe0e91c3..f3206a3ddf9c 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1011,10 +1011,6 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) data->dataflags |= FSESS_EXPORT_SUPPORT; - if (fiio->flags & FUSE_NO_OPEN_SUPPORT) - data->dataflags |= FSESS_NO_OPEN_SUPPORT; - if (fiio->flags & FUSE_NO_OPENDIR_SUPPORT) - data->dataflags |= FSESS_NO_OPENDIR_SUPPORT; /* * Don't bother to check FUSE_BIG_WRITES, because it's * redundant with max_write diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 0ec556138be0..5648624f4c63 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -227,8 +227,6 @@ struct fuse_data { /* (and being observed by the daemon) */ #define FSESS_PUSH_SYMLINKS_IN 0x0020 /* prefix absolute symlinks with mp */ #define FSESS_DEFAULT_PERMISSIONS 0x0040 /* kernel does permission checking */ -#define FSESS_NO_OPEN_SUPPORT 0x0080 /* can elide FUSE_OPEN ops */ -#define FSESS_NO_OPENDIR_SUPPORT 0x0100 /* can elide FUSE_OPENDIR ops */ #define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 22564c65c44d..87e44051d9a9 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1946,10 +1946,9 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); if (err == EBADF && mp->mnt_flag & MNT_EXPORTED) { - KASSERT(fuse_get_mpdata(mp)->dataflags - & FSESS_NO_OPENDIR_SUPPORT, - ("FUSE file systems that don't set " - "FUSE_NO_OPENDIR_SUPPORT should not be exported")); + KASSERT(!fsess_is_impl(mp, FUSE_OPENDIR), + ("FUSE file systems that implement " + "FUSE_OPENDIR should not be exported")); /* * nfsd will do VOP_READDIR without first doing VOP_OPEN. We * must implicitly open the directory here. @@ -3209,21 +3208,21 @@ fuse_vnop_vptofh(struct vop_vptofh_args *ap) return EOPNOTSUPP; } if ((mp->mnt_flag & MNT_EXPORTED) && - !(data->dataflags & FSESS_NO_OPENDIR_SUPPORT)) + fsess_is_impl(mp, FUSE_OPENDIR)) { /* * NFS is stateless, so nfsd must reopen a directory on every * call to VOP_READDIR, passing in the d_off field from the - * final dirent of the previous invocation. But without - * FUSE_NO_OPENDIR_SUPPORT, the FUSE protocol does not + * final dirent of the previous invocation. But if the server + * implements FUSE_OPENDIR, the FUSE protocol does not * guarantee that d_off will be valid after a directory is * closed and reopened. So prohibit exporting FUSE file - * systems that don't set that flag. + * systems that implement FUSE_OPENDIR. * * But userspace NFS servers don't have this problem. */ SDT_PROBE2(fusefs, , vnops, trace, 1, - "VOP_VPTOFH without FUSE_NO_OPENDIR_SUPPORT"); + "VOP_VPTOFH with FUSE_OPENDIR"); return EOPNOTSUPP; } diff --git a/tests/sys/fs/fusefs/open.cc b/tests/sys/fs/fusefs/open.cc index 7ab3aeb6ba2a..e80d1aa2a393 100644 --- a/tests/sys/fs/fusefs/open.cc +++ b/tests/sys/fs/fusefs/open.cc @@ -70,14 +70,6 @@ void test_ok(int os_flags, int fuse_flags) { } }; - -class OpenNoOpenSupport: public FuseTest { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPEN_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * fusefs(5) does not support I/O on device nodes (neither does UFS). But it * shouldn't crash @@ -281,37 +273,11 @@ TEST_F(Open, o_rdwr) } /* - * Without FUSE_NO_OPEN_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Open, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - int fd; - - FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_OPEN && - in.body.open.flags == (uint32_t)O_RDONLY && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).Times(1) - .WillOnce(Invoke(ReturnErrno(ENOSYS))); - - fd = open(FULLPATH, O_RDONLY); - ASSERT_EQ(-1, fd) << strerror(errno); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPEN_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPEN, then it and subsequent FUSE_OPEN and FUSE_RELEASE operations will * also succeed automatically without being sent to the server. */ -TEST_F(OpenNoOpenSupport, enosys) +TEST_F(Open, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; diff --git a/tests/sys/fs/fusefs/opendir.cc b/tests/sys/fs/fusefs/opendir.cc index dd837a8d43c1..e1fed59635fc 100644 --- a/tests/sys/fs/fusefs/opendir.cc +++ b/tests/sys/fs/fusefs/opendir.cc @@ -71,13 +71,6 @@ void expect_opendir(uint64_t ino, uint32_t flags, ProcessMockerT r) }; -class OpendirNoOpendirSupport: public Opendir { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPENDIR_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * The fuse daemon fails the request with enoent. This usually indicates a @@ -179,27 +172,11 @@ TEST_F(Opendir, opendir) } /* - * Without FUSE_NO_OPENDIR_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Opendir, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - - expect_lookup(RELPATH, ino); - expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); - - EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPENDIR_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPENDIR, then it and subsequent FUSE_OPENDIR and FUSE_RELEASEDIR * operations will also succeed automatically without being sent to the server. */ -TEST_F(OpendirNoOpendirSupport, enosys) +TEST_F(Opendir, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; From nobody Mon Jan 20 16:52:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbV5HrHz5kM52; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbV2gZXz3Wrk; Mon, 20 Jan 2025 16:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih8Pye3wcoa7OO+fQ+BSCRb7vZDGabatpLferJIFYLo=; b=fjbdzgqSDOo3F7urIu4w61UsX+hK87isRThOVC1hb0n38gn0ng7WX51i5RkknopLvHmTmA 5A1K+dfwVIcKKSJ4Uo6SsJe8tsCWfOcUXH7LQiva1Ne0Y9dzuN8rzyzguvHLPgiHvcmln4 sxojB5eSW+e/5EpXMPb9HcjlucKan6QOMZgJKQSxl1dGFdZCgtlydQSS8Ut1g/5Kq+dlbi h+AsJa1kZKzVjyvdkzzqLQzIqaCxC7nURXtyWV82ehw2ad87ha54VHJUqY3W+wlNXe6y13 cmZt/wsLj7hmi39Rd1ZN3DQyfa+G9epcutzUzFCDRkkyeR6ri0dx3PVUXWexLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih8Pye3wcoa7OO+fQ+BSCRb7vZDGabatpLferJIFYLo=; b=XSK58DiW52rrWcpcIlNyQKSXTlB2Aj8z/qiF/sI9CJ2GEqI6+zmmotdMx1xjlhObuW1Tsm ylTRlQ2IP/lrOu81mQ2S6PUewqo28kAKks3tu4YKCqphzGjfoALv3FL850TVVxrbEGeSoK JWhR1fuVi0W/46PJAWLfo7OyIVrc53esDS8zoAZPdf8HJSbaC2xZY7VHP9GNhD1XdZax1q EbPoxng9yizetQ/nfr/QhL23xAlSc7Ea1JDjN9eWHARHrjUJczo/dL8QulbymaYWGOc7Va JbE00JJ5JAyl61s9w39HiZFkK7epEb0iemGnu8hfKYgXYr6LkLSmFhgB3AL59A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391942; a=rsa-sha256; cv=none; b=Xb9nxb3Ubsr/R9ukX4Zv4AC6SCrMeub9M6ASCgq8T/PqlPZRIVWu97CpZYbIJ1Z+H0nebe M+oJRnzfHW4iVRit1a+QowbZQbV4uSNU/7B2sMq5gLoFN+KTgLVQIwBX3/vVRbcFdF7AaX 6KUysOCMxeAYJQaHFF4y87ufpIcia7Yg3B/T0kkLEkmoRQ5cXNZu2E42ltU56Mv8Vqwu9Z yQpZIIa4UObDoucqRQXuyeF/YK7oWikI5EOehOaKB9aoFa5MImqKpaHho6kZ5rGbyLkBPJ +vR1HVlf0axMzZqOfG5JqDRyPIzknklPZGwFwKDaxIzdLtDpCabOlzlBMnNvIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbV1zf5zD7G; Mon, 20 Jan 2025 16:52:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqMj5067354; Mon, 20 Jan 2025 16:52:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqMiU067351; Mon, 20 Jan 2025 16:52:22 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:22 GMT Message-Id: <202501201652.50KGqMiU067351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8b2b77c32f2e - stable/14 - fusefs: minor cleanup in the tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 commit 8b2b77c32f2e46c89aa7b60610003b1733f7a0e0 Author: Alan Somers AuthorDate: 2024-12-27 21:24:17 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:48 +0000 fusefs: minor cleanup in the tests Delete some unused includes and member variables. Sponsored by: ConnectWise (cherry picked from commit c2153a533ffb9691848a072c7628dcf56e0e6442) --- tests/sys/fs/fusefs/allow_other.cc | 3 --- tests/sys/fs/fusefs/forget.cc | 1 - tests/sys/fs/fusefs/io.cc | 1 - tests/sys/fs/fusefs/notify.cc | 1 - 4 files changed, 6 deletions(-) diff --git a/tests/sys/fs/fusefs/allow_other.cc b/tests/sys/fs/fusefs/allow_other.cc index dae6290ea8e5..24a161166a90 100644 --- a/tests/sys/fs/fusefs/allow_other.cc +++ b/tests/sys/fs/fusefs/allow_other.cc @@ -52,9 +52,6 @@ const static char RELPATH[] = "some_file.txt"; class NoAllowOther: public FuseTest { public: -/* Unprivileged user id */ -int m_uid; - virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "This test must be run as root"; diff --git a/tests/sys/fs/fusefs/forget.cc b/tests/sys/fs/fusefs/forget.cc index 846198e75925..1e7764ac4782 100644 --- a/tests/sys/fs/fusefs/forget.cc +++ b/tests/sys/fs/fusefs/forget.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc index 99b5eae34e09..766148044b32 100644 --- a/tests/sys/fs/fusefs/io.cc +++ b/tests/sys/fs/fusefs/io.cc @@ -31,7 +31,6 @@ extern "C" { #include #include -#include #include #include diff --git a/tests/sys/fs/fusefs/notify.cc b/tests/sys/fs/fusefs/notify.cc index e3f539f57599..1e22bde13db7 100644 --- a/tests/sys/fs/fusefs/notify.cc +++ b/tests/sys/fs/fusefs/notify.cc @@ -30,7 +30,6 @@ extern "C" { #include -#include #include #include From nobody Mon Jan 20 16:52:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbT59vKz5kMBD; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbT2SS2z3Wtl; Mon, 20 Jan 2025 16:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JBn/Kka3zcYaiilBQd/RLQXdCQoAW/w3JU/5TGwvGeM=; b=Mv1ILLlG0o5HTHcikuydJPt6/TLTMuiZdooPCnMkfBguysBMo7egVwB3cAPi2BfyDgXPBX trMpkOHKAyYnED6QiBTzM+0WAjxHlC9qoleLUxu7jUaRArxfO4VNB9GpbosK4l+hzqEro0 I0u6BcTDMv99blfz66xSrydiMWyjdHPm9ZwSqlMC8omjCC4OiYQGWSaXYBWxc3eKggpVBE hInX/qtKtgtVmritOXVqHG/QOaX0TqSC4GCiX/CFwHBJgg4m3zquG30+AhNF0os81+gNfb CZFNArZLFC+VkiikQpYcvzPcmRFX4g+ZuYyDVgcy3v+Xb1T39eYeXGtRgr112Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JBn/Kka3zcYaiilBQd/RLQXdCQoAW/w3JU/5TGwvGeM=; b=Qd+VZNHQMwOI2r46Iur1bmnrPPXDZdb33uxNuGNnEWDNHmIVTixSYAyx5u0XW7ps3w6jO6 wdk6jFbvXL8F+kjtOmNHZCPhBwtr3ZTI6JHRuVNw7b4+J0lErMr4Px0QAyGAAi4SU5MV07 VG85DVPnJd2Q0WchbkFuEO18o5K8mXO87ODLneb9So7QxMRPm5m2HxBEUOPua/yEfJWKgc IogQGz9prnPuIYdN2y9QA3Cyt6c11HePYLoqmk+/5YWVcYZKB6Nittbslye2ZFbNHPrwql OXghJkcxAi6Znt+lFp+fKTJymobqqEk2mCL+A2Zh1+jgk0HpWbPD/rQMM+iJjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391941; a=rsa-sha256; cv=none; b=N9F1MWOZwEFQs1aVdVFO3Yz14lsLoKu0m13CgrCDu2XIweL5ZFVPT0swUXKVDsNQS/VLXV NnkUCJg0k+oKPFlMAMCLEXaHhkez18usCGhADZXj4F+O/oUh3cEYgwI2rTDCL4AJu5eZGH FfhUUX22NpCXqQOJOcx49hIR02u/mpESbnlDm7+VZWiw8Bdf/FXlKFGXfv/6esljiL3g8c 3nXZbzZB063Altgasc4H479zxhoXYktZDyGyU875YpA01k6ti8kflfzBHRmC+0LVBYPcu+ iAyoFWzIJ5H75u/eUoiORvo40qfUzNslXgTrfxaoFgu8E4S0PIejGS4YmMnIZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbT1L0qzD88; Mon, 20 Jan 2025 16:52:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqLx3067321; Mon, 20 Jan 2025 16:52:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqL6R067318; Mon, 20 Jan 2025 16:52:21 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:21 GMT Message-Id: <202501201652.50KGqL6R067318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 60311a50779d - stable/14 - fusefs: fix a memory leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 60311a50779d27467f4f1cc38d62cb098ed80607 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=60311a50779d27467f4f1cc38d62cb098ed80607 commit 60311a50779d27467f4f1cc38d62cb098ed80607 Author: Alan Somers AuthorDate: 2024-12-23 20:26:11 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:44 +0000 fusefs: fix a memory leak Fix a leak of a fuse_ticket structure. The leak mostly affected NFS-exported fuse file systems, and was triggered by a failure during FUSE_LOOKUP. Sponsored by: ConnectWise (cherry picked from commit 969d1aa4dbfcbccd8de965f7761203208bf04e46) --- sys/fs/fuse/fuse_vfsops.c | 2 +- tests/sys/fs/fusefs/nfs.cc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 4a4f9dac3fae..ce9c1d7fd946 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -566,7 +566,7 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) error = fdisp_wait_answ(&fdi); if (error) - return error; + goto out; feo = (struct fuse_entry_out *)fdi.answ; if (feo->nodeid == 0) { diff --git a/tests/sys/fs/fusefs/nfs.cc b/tests/sys/fs/fusefs/nfs.cc index 79fead8e77cb..27ffc8f5cbc1 100644 --- a/tests/sys/fs/fusefs/nfs.cc +++ b/tests/sys/fs/fusefs/nfs.cc @@ -144,6 +144,36 @@ TEST_F(Fhstat, lookup_dot) EXPECT_EQ(mode, sb.st_mode); } +/* Gracefully handle failures to lookup ".". */ +TEST_F(Fhstat, lookup_dot_error) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = mode; + out.body.entry.nodeid = ino; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnErrno(EDOOFUS))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(-1, fhstat(&fhp, &sb)); + EXPECT_EQ(EDOOFUS, errno); +} + /* Use a file handle whose entry is still cached */ TEST_F(Fhstat, cached) { From nobody Mon Jan 20 16:52:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGbX0m69z5kM2M; Mon, 20 Jan 2025 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGbW3ycMz3Wxp; Mon, 20 Jan 2025 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6B/8Y2XY1bbGTWc0c3t/lqmWrFN7XW3qH+whYFxMGPk=; b=Ys8ftwwBLz0XSHot1CTlVK7/hwCKMgeBDxlExTPUiwnhH8yQRozsowl/Kc6ZLsF61yBboW WRPciu7hRsgxd37fYWvsCBc2fbzAmqA9ZNpJKt/1V/2tGyYtx/bG0vCgQIQBO4ULl9kdIW L9YpJxIRVN7qijVWZGJ+TNSgdYQRkCBA5BOz6Ii+p4wQIPc8XiP38eBNfyIVv49PdFicwN nisLMYgHOLB+WxG4L8KwOMXLTUfdCMiyZ+vc38lxChv6lHBCSGAdfQXlm2+8c89ySkOX3C hfOvLzTEFD2GdgoyuiQuDQYcfTTd9OLqF1nHoK8PccMVtyGr7Z23n7yO6XQd0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737391943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6B/8Y2XY1bbGTWc0c3t/lqmWrFN7XW3qH+whYFxMGPk=; b=oTjvDHmqKxKxWsHXaT8UDdJKS+jKoHhITDx4QB96CAlq6Il+/ylWCBoBEyD3bdmvI07/e/ 4PnHQDDcJMzdwfMEePHLKz3Ybs/5l/3H+9aKk2zS8F401JAnJKcwLn/noNOTgX037Uqwak pKOpcJpfR2LLRF3TV6LPRgF1FkqRCO5Jr/mt+L3lkxCTEzvRrP/7YszpaSB+zZjzVAH4lJ C77UF2l5Nub0g+cFP7kvb7kl3ebEhfpoErQP2R0ij1KhDuez9uWKWTArsj67rGUxGcsk0x LxcnS0a7AhH3UUaNyRAef32NqHDmgxn2LocqZ3In4gIsvYwLM2HgxbeH6sAJkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737391943; a=rsa-sha256; cv=none; b=dd0Ow8VP4c0y69eErQuDIe+LBTBUg8lYkVgmrSM19ng3TgvRLretzauqRUcSoGfKKBPf+D eay1zJT055X1+NAKzlWFN9tJl/ZoI2+0Bj9yYtv/VDpsT2fQh9Stz9693AuaNXg/LcjD5V dN51uj3CTt/2Fo8onbXHJ2Li80OkHxG3XFIjaCxi2uZWN0zWQ5WNnHh/JOhdUNbhCSXCI2 Do510dkF+Xkn70QWbR1Yd9cLiSMM/dWatllPBCXAJIsukp+RlcELhZAZsPrsEt9hwqo7Me nQQcHdzt01Zc9u0G40czgxYGQ1PqJxxQXsDtvRVdR20wju8CzKlGuMM81y+mWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGbW2z9fzCxr; Mon, 20 Jan 2025 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGqNJN067387; Mon, 20 Jan 2025 16:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGqNvN067384; Mon, 20 Jan 2025 16:52:23 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:52:23 GMT Message-Id: <202501201652.50KGqNvN067384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 09df42f1d592 - stable/14 - fusefs: Coverity cleanup in the lseek tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 09df42f1d5925a81c76da163f0f6d647129729c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=09df42f1d5925a81c76da163f0f6d647129729c6 commit 09df42f1d5925a81c76da163f0f6d647129729c6 Author: Alan Somers AuthorDate: 2025-01-06 19:21:29 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:51:52 +0000 fusefs: Coverity cleanup in the lseek tests Always check the return value of open(). Reported by: Coverity Scan CID: 1471118 1471133 1471215 1471896 1471901 1472116 1473799 CID: 1473879 1473996 1555269 1558044 Sponsored by: ConnectWise (cherry picked from commit f415b2ef30f7bf0db753f09fbba7b0910475b0d2) --- tests/sys/fs/fusefs/lseek.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/sys/fs/fusefs/lseek.cc b/tests/sys/fs/fusefs/lseek.cc index 2a1cb198bcce..12d41f7af1b2 100644 --- a/tests/sys/fs/fusefs/lseek.cc +++ b/tests/sys/fs/fusefs/lseek.cc @@ -71,6 +71,7 @@ TEST_F(LseekPathconf, already_enosys) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_in, lseek(fd, offset_in, SEEK_DATA)); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -105,6 +106,7 @@ TEST_F(LseekPathconf, already_seeked) out.body.lseek.offset = i.body.lseek.offset; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset, lseek(fd, offset, SEEK_DATA)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -171,6 +173,7 @@ TEST_F(LseekPathconf, eio) .WillRepeatedly(Invoke(ReturnErrno(EIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EIO, errno); @@ -203,6 +206,7 @@ TEST_F(LseekPathconf, enosys_now) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -266,6 +270,7 @@ TEST_F(LseekPathconf, seek_now) }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_initial, lseek(fd, offset_initial, SEEK_SET)); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* And check that the file pointer hasn't changed */ @@ -299,6 +304,7 @@ TEST_F(LseekPathconf, zerolength) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); /* Check again, to ensure that the kernel recorded the response */ EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); @@ -327,6 +333,7 @@ TEST_F(LseekPathconf_7_23, already_enosys) ).Times(0); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); EXPECT_EQ(EINVAL, errno); @@ -391,6 +398,7 @@ TEST_F(LseekSeekData, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, offset @@ -431,6 +439,7 @@ TEST_F(LseekSeekHole, ok) out.body.lseek.offset = offset_out; }))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(offset_out, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(offset_out, lseek(fd, 0, SEEK_CUR)); @@ -463,6 +472,7 @@ TEST_F(LseekSeekHole, enosys) _) ).WillOnce(Invoke(ReturnErrno(ENOSYS))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); /* * Default behavior: ENXIO if offset is < 0 or >= fsize, fsize @@ -500,6 +510,7 @@ TEST_F(LseekSeekHole, enxio) _) ).WillOnce(Invoke(ReturnErrno(ENXIO))); fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd); EXPECT_EQ(-1, lseek(fd, offset_in, SEEK_HOLE)); EXPECT_EQ(ENXIO, errno); From nobody Mon Jan 20 16:58:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcGk33KRTz5kMqv; Mon, 20 Jan 2025 16:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcGk32c1qz3YCg; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=PsxI5Po4BPi/wdjbpWd8lrBTXl/YL2/C/G0TcD2G9oQXuzuetLVg1BzNVX+PBcDPzFDE0N t90LuBwnqGQEWqdMpuOD5p2opfaWNwefUKkgcaHbDOWgBMaUZnd9ZPk+h+POEMHKgNhGH5 J0fPqx6C46Htsz8FMmz0OoWQXxpfVxcF7JL4GwOdTb9rPaauytuVpuA2f/VPUI1Offx7MW oNuqBFozRbQhp0pvN5g46ydz6E4sxNQNQyIBuDhRSmcPZ+dVZzg3g9nDN660FqnF/BCKIY GIaB/3W0krC65lvqz+ejPEc0E/7s89xCcsfz8S98PCteingKES0qZg9HcQ4trA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737392283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q5RjYd/zbFLzTPMFPiwEMWtqhU88hXVL8TrGQh17GFo=; b=rBdA9rN8JfJrJTjPEjLnHA5PlKb1T+1yVliGPVeqq2Wqa0pZtfMCakrHZPYo58cQvH5ykI 7LdoYqxRPRSy/eFHvbIv1LvOayTrhSUPmKKzZ2FSvGrFbMmlm3H4CHuuxEJch7HGxmOXeS vJe60X7eOSmr27n8z5UIlSa4z30UW61e2/JeqK7hlvEcRZCDLazvTBsdnzB9t3Va2D49b3 DVdOA/udH/5MhdLvQwafKO7cPR4/S+ej+uITGO5/i2vgsW7gshZ0IIlx1VuE9hYUrozW69 0He3KHSjBI+VHSLeH9B0L3zpE5rnEgy3MmHtRibgBTjBmfJ5ywLn2g7ys1uTUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737392283; a=rsa-sha256; cv=none; b=QWo1HhNopA4ir616ol1nV2GLed7tWyCwxlvf3Ql7nj3SnPNl8p8Sc6UTKvUd1lZWBK5plV tcPGND4Rmol1OkAMqbHLrEvbZv3udf8OQRfROwSGNH71q85Ojj4wa4LyS7hZelUawvAEVd yqfHsVOgHXPtMUB0C6Cq5R+9FxWCxdR++EW4Yo9g+0Zo3E2iNfd2epnc96FGbOwvO/D7yD FrcmGRVwLPl0dWrgDM463FESLPsL4BiVFyqXK1dJH5Q1QzogiPG6AFoRaUeWr6cdT/zc19 F8pMelWbwBy2o310WBQawpwmn+1p/ShXrvvfyD+ZigheUHPI86LBNKH5BFv5VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcGk31klPzCmH; Mon, 20 Jan 2025 16:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KGw3H4069188; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KGw3Z6069185; Mon, 20 Jan 2025 16:58:03 GMT (envelope-from git) Date: Mon, 20 Jan 2025 16:58:03 GMT Message-Id: <202501201658.50KGw3Z6069185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 3dc01440a064 - stable/14 - Fix lib/libc/nss/getgr_test with large numbers of groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc01440a064c95bc5f125acf7c0ef6acbb5c257 commit 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 Author: Alan Somers AuthorDate: 2024-12-31 20:41:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 16:54:45 +0000 Fix lib/libc/nss/getgr_test with large numbers of groups These tests create a linked list with one entry for every group on the running system. On a system with about 30,000 groups, the test took 69 seconds to run, and crashed Kyua with the below error: kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db). Fix the test by limiting it to operating on the first 1024 groups. Apply the same change to getpw_test and getserv_test too, which are vulnerable to the same problem. Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48275 (cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd) --- lib/libc/tests/nss/getgr_test.c | 4 ++++ lib/libc/tests/nss/getpw_test.c | 4 ++++ lib/libc/tests/nss/getserv_test.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 7c0e265fa6f6..974632d4b7c7 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -293,6 +293,8 @@ group_fill_test_data(struct group_test_data *td, int (*cb)(struct group *, void *)) { struct group *grp; + const int limit = 1024; + int count = 0; setgroupent(1); while ((grp = getgrent()) != NULL) { @@ -303,6 +305,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 3a44497cf848..434d86a31591 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -240,6 +240,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -250,6 +252,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index 486a8c20836f..cc66fdb2fa52 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -283,6 +283,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -290,6 +292,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent(); From nobody Mon Jan 20 18:59:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcKQR6jF0z5kmrQ; Mon, 20 Jan 2025 18:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcKQR5xqlz3qbm; Mon, 20 Jan 2025 18:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737399583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5TE0HfQnesz4Dzf33eKlKBxBUU0X5+Ou7EbGiQ6i8D0=; b=D2PeYIB1ZMm6vB+0YfsvBzus7NVaCTYWhvppb0EewfBlwA1fbMGFppsMWR+iK3OZizZVeZ gJxIRVX5vlHrY5kdTRgI1lAlQ4aks534Tf5n5/4bs9O49yYRZG2a81oeP+3w3iSJQUnS4R nJey3L+BTmg7txErXyas/e6cmBp0q85jI9aKCQ1Ps78RPLJw64Q9D/9KM/hyMeJgWK/Mrc 71vbMoi4hDkcwQr5ZjIQctpiuoLU4K76O874jAQoA342PGcJ3b68/2e7EbA7qhLgNceJdA WkEH+lerKThvf5bzyb0WTSDv4xiYJny8ieD1jHqYcGpeEPuroE7bLDwnZKp+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737399583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5TE0HfQnesz4Dzf33eKlKBxBUU0X5+Ou7EbGiQ6i8D0=; b=Hsv2O+ECIZYNNNd45tUEWyFgAPGzyRKA2v7beBXvItJ+oGLKsmPjNAceynXcqNLfAhbVB1 CBm3VXNhKed3dCVfmFu43A1MYPPQ5z0rHnuW8diVVpw+8TiCb3Z+bGknM0OOAEQnZJ3rDD 9cWpeOjU1lkQIuhiDbiV9ILjB/5tv544dgac9dOoPhDTnFIfJSXQH17p4ZGeoWpQnwAN8w 8PWZqMRMixv9c1+tcAJPi0xj1ZboKt5OMoMiI2EHr1e34iBe2h4UwUt2WXvF0zFtS5AQtv wR5bdiBTDSosInE4kndkaoGlyaWY83SLIhllBg1tcY3adeuHyhUy3NjuBEYjwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737399583; a=rsa-sha256; cv=none; b=bd47PqwL1QS2qXormzWJhrTSeRRwNIant0LkdyWZBBYPpdd0ueU+X8QzCAGSNgMP6SThzx +SyFUSYjzkWnsi3ger4QyMs3/NrZyR5wdHFRJ+Ue0CjwGdCDszTHYEq/6kOZNxy+MLR3XL Dfu4ROv1cWn+NbKWMBW6FaqSVNhmwwWPZgxTqZtlkT/ZIIYcCMb68fzXLs6O4Y6KUElJdP HTgJS5ucpljvteJLdD9I3LCMFRIPekcR9rmwsln/By+14ejsUdPSd51qd+JktJx2zM22nM vDpgm5PnaB1w2MtDXa2GRuyigtE/DV3nbSf+xDqrUwhMlGt9oUzUuPJwGxhTWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcKQR5XtGzYqP; Mon, 20 Jan 2025 18:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KIxhJE093611; Mon, 20 Jan 2025 18:59:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KIxh3v093608; Mon, 20 Jan 2025 18:59:43 GMT (envelope-from git) Date: Mon, 20 Jan 2025 18:59:43 GMT Message-Id: <202501201859.50KIxh3v093608@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: caaeab697bf9 - main - libsecureboot: Report failure for unsupported hash algorithm List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: caaeab697bf98bf96e2fa8cb4a1e22240511fbcc Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=caaeab697bf98bf96e2fa8cb4a1e22240511fbcc commit caaeab697bf98bf96e2fa8cb4a1e22240511fbcc Author: Huwyler AuthorDate: 2025-01-17 14:55:15 +0000 Commit: Ed Maste CommitDate: 2025-01-20 18:59:20 +0000 libsecureboot: Report failure for unsupported hash algorithm Reviewed by: sjg Pull request: https://github.com/freebsd/freebsd-src/pull/1574 --- lib/libsecureboot/openpgp/opgp_sig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libsecureboot/openpgp/opgp_sig.c b/lib/libsecureboot/openpgp/opgp_sig.c index b99a1be459c1..73c482e4c28d 100644 --- a/lib/libsecureboot/openpgp/opgp_sig.c +++ b/lib/libsecureboot/openpgp/opgp_sig.c @@ -341,6 +341,7 @@ openpgp_verify(const char *filename, break; default: warnx("unsupported hash algorithm: %s", hname); + rc = -1; goto oops; } md->init(&mctx.vtable); From nobody Mon Jan 20 20:24:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcMJ665Rwz5ktjY; Mon, 20 Jan 2025 20:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcMJ65VHdz41ZK; Mon, 20 Jan 2025 20:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737404662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRM3+dBz/tVOPGKu2k7uQdceqlyFyp4m/MQlwyzUWrI=; b=nQz35Ke1bScqCVbIdQDV6/aQGXoBP9ysaKN/0Ug3+UBu3DWi2vhgU+UWBVeSb2vOprJjo2 t1X4VgKWFwoWfDUsCGgwN3rDmsMnNHBW5gWw21CEuLWYCY04CpbC+LTdkX+kqIfVk7X1c3 BPNXE2JuFF72C07r7jRyIJlh0LsNRfSOIIeiAptdbEJmoJM6coPOz6BJDCooQ7sRKhhdEH KKVWSAB3OdsgG2QuePavcNtBwswIoiXHz8VoZ4sXccc9gqfC+wwL4Y8CbmsR+pzjuHSMdc if/zoMlZ42tYTjRTcqVnltt/R0Z1HjwkXueLWiX/QY0YTVLEmSK71KnpWa1q3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737404662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRM3+dBz/tVOPGKu2k7uQdceqlyFyp4m/MQlwyzUWrI=; b=eUMGgNbyIgswCekZ4RtSnW65AdTQqyVAM9Rn57kb0vrDXWaInaHmBVcvutLXBQFpKJZnMn UJ4/I8AeN4Bdo9xEcMy8hmsjActoyB8bgrkdTI3Nb1I6zU9K8NhdWsARSbPSxGmU62+OQX CrJ35rghJ957UIWq8AHsu1ef5/oJGmr+DM61mqUJ7vXH8aXaRUG0Fk411Y+s02WcGZjMC0 ddFiHoI9CmXIv7D9mmWlNqOXdQh21JpdpHkMIQi1t9G9W+u+txvVJEd7D/6CnLGFVZAf8J 1cEa+sJ0dsQK2u9AfJjjx+6Tn3XpJKSdFAUFHDF6LVrLwmGZQGrWYDmvrmYUGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737404662; a=rsa-sha256; cv=none; b=Qp9kJeEr9d0RLAy7KAlOW+UOc8jXgcjrkStziO/zcXzGkkQ9LdwsYInC+9C/Qv9fmJbz6M UuDDbTNNjPS0sk7omBjzluc/dMP1f/E9oRq64oHiu1sqgATjGYghxPZUb1yXzeiSK8sQtY xoZg+cKasJCoCSKu/IjcqjRtMGSTpLcw+Q3+6B9frSUaAi5xes5TH+sDLj31R5MB+AyCpg N5zgZkqjTOCmNcvlPVq7Sty0U595ZEm+Or9tYaSt/qBLHKrW+5sOsrsNlL8RzoB0vQzL0f cr0Tzt8RILpXFETqnwuwr3fWBiSiFludCN97wlk8b3+u3Qck+77uIZs6/1egpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcMJ651L8zc5d; Mon, 20 Jan 2025 20:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KKOMHq060578; Mon, 20 Jan 2025 20:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KKOM2k060575; Mon, 20 Jan 2025 20:24:22 GMT (envelope-from git) Date: Mon, 20 Jan 2025 20:24:22 GMT Message-Id: <202501202024.50KKOM2k060575@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: 3433daae0d20 - main - vtfontcvt: Improve error message for unsupported DWIDTH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3433daae0d20d55503084c4d17b8a3e685657ad2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3433daae0d20d55503084c4d17b8a3e685657ad2 commit 3433daae0d20d55503084c4d17b8a3e685657ad2 Author: Ed Maste AuthorDate: 2025-01-20 20:04:20 +0000 Commit: Ed Maste CommitDate: 2025-01-20 20:23:49 +0000 vtfontcvt: Improve error message for unsupported DWIDTH vtfontcvt requires that all glyphs are 1x or 2x a common width, reporting for example "bitmap with unsupported DWIDTH 27 0 on line xxx" if the font is expected to be 32 pixels wide. Add the expected / permitted values to the error message to make the issue more clear - for the same example, "bitmap with unsupported DWIDTH 27 0 (not 32 or 64)". Reviewed by: ziaee Sponsored by: The FreeBSD Foundation --- usr.bin/vtfontcvt/vtfontcvt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c index ddff1580a993..773072813d8a 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -450,8 +450,8 @@ parse_bdf(FILE *fp, unsigned int map_idx) if (sscanf(ln + 7, "%d %d", &dwidth, &dwy) != 2) errx(1, "invalid DWIDTH at line %u", linenum); if (dwy != 0 || (dwidth != fbbw && dwidth * 2 != fbbw)) - errx(1, "bitmap with unsupported DWIDTH %d %d at line %u", - dwidth, dwy, linenum); + errx(1, "bitmap with unsupported DWIDTH %d %d (not %d or %d) at line %u", + dwidth, dwy, fbbw, 2 * fbbw, linenum); if (dwidth < fbbw) set_width(dwidth); } From nobody Mon Jan 20 20:29:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcMPf5LWhz5ktms; Mon, 20 Jan 2025 20:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcMPf4ggGz42Bc; Mon, 20 Jan 2025 20:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737404950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODqNnn9kd3/623C4tZS9M5UBq1H6kA7ZRK/qu9gEa0w=; b=w4xoR/a8ZPUiWbWIIPKjxvPBpLvV6Qf4S150qtTH3cz0sgoAKLAcz5+eWkrZshdKx61BNB bvAgZ9tQXnVcPahyvOHOwSV6bvmzWmVnhfnyExLo4ZJab+qB3hurwQNpN/XVmqEzQihTAt kMUKxek5+ygaaulLc7W/KjIGYW0Q6OniupIVSu0GBchD+yOJu7qAnXbK2kbvVuE6gGukJt 6xV/cVSrZsJjqdaqVEdy7ab+KculCyHcpVmQpFo4BPyg4BzwAAN6vAHhb90ryfI8Xe5X3E 30cnIdMM2Lpf4cemAGZ8avHvU0Xy6QcQgougMeyTHHQG+wnl2NhrrjaK0Z6txA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737404950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODqNnn9kd3/623C4tZS9M5UBq1H6kA7ZRK/qu9gEa0w=; b=qwRW9IbF7Fa3A0LbAsz4tm9wSm3g2/k/ZAJBb7HqsFBemUpN7KriTay8ZTMbOMkDX4eH6+ V3SlaYNrIyrHF0JmJSECtwc1Bm8CiwbUak5DPKQGatELpbRV09uR2W7RdIzkPtjAnDKXVJ ihWcTy4f0q7DEoSaG+b2JrDMjCxpLgR7RJ3rxywrhpVkWi6vYo6HDV8qyYol0V0b+NeMWY 3BPNbSinp3CRpniO8mSC/vW+5+mm0KPM0ty42D4aCOFPIzHsl3Vx15p7800RE/HCwvF1CL LlCGMdcyG9ITo5D1rLvQ8HdtJSy+TfSCD69iE5MKf/wwErjUs09ssWqwQVU0yA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737404950; a=rsa-sha256; cv=none; b=hMwTT9g7kQAiww7k9Z6E+VkhapYyRqrf7ehQDnU4fmL32aiHkVu3WrpfAKcGDwL/FnuEPz AiNvdgQlXDJN/ZOoa6gK5e1i/Y0IKUnqAaTC2Z0Kr0QyzO4MrpXzRnLXUFPKUVhWcm5fRi qh+G34nz8AWx+wniWVYzVzmJIGfBiWtEWbcyaxNYS5nug6Ar1NUhQ3ZemKSep0F9BLSTRI 9PENCTPpuFO4OQQv+pA3Kg9Nqulp0MCaVjjK+UbutUaREdNNESFjlRlTniZhi4Z6u/9zai wxIh8VQ+JUmtjVWawA9p8sNLRaHuHSdHsKDkSFOzhKmdA+nsFa/kdcFOFczRbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcMPf4FQ6zc0b; Mon, 20 Jan 2025 20:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KKTA8a062076; Mon, 20 Jan 2025 20:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KKTAGP062073; Mon, 20 Jan 2025 20:29:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 20:29:10 GMT Message-Id: <202501202029.50KKTAGP062073@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: 127b443124d1 - main - gvinum: Emit deprecation notice upon drive tasting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 127b443124d1e720b246ad381648c436c3d240de Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=127b443124d1e720b246ad381648c436c3d240de commit 127b443124d1e720b246ad381648c436c3d240de Author: Ed Maste AuthorDate: 2022-12-12 21:07:26 +0000 Commit: Ed Maste CommitDate: 2025-01-20 20:25:33 +0000 gvinum: Emit deprecation notice upon drive tasting Reviewed by: phk, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38607 --- sys/geom/vinum/geom_vinum_events.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/geom/vinum/geom_vinum_events.c b/sys/geom/vinum/geom_vinum_events.c index e1206a671091..4175a438aa9f 100644 --- a/sys/geom/vinum/geom_vinum_events.c +++ b/sys/geom/vinum/geom_vinum_events.c @@ -39,6 +39,8 @@ #include #include +static bool deprecation_printed; + void gv_post_event(struct gv_softc *sc, int event, void *arg1, void *arg2, intmax_t arg3, intmax_t arg4) @@ -179,6 +181,13 @@ gv_drive_tasted(struct gv_softc *sc, struct g_provider *pp) gv_setup_objects(sc); gv_set_drive_state(d, GV_DRIVE_UP, 0); + /* Emit deprecation notice. */ + if (!deprecation_printed) { + gone_in(15, "gvinum volume manager"); + deprecation_printed = true; + } + G_VINUM_DEBUG(1, "drive '%s' relies on deprecated gvinum", d->name); + return; failed: From nobody Mon Jan 20 20:54:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcMyQ4RS5z5kwkp; Mon, 20 Jan 2025 20:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcMyQ3yS0z44FC; Mon, 20 Jan 2025 20:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/LE18Pojf6tFa850QAv2j5VJSvQQU8dl79hHE4fUTE=; b=VEpWuCoWxlfMsUsPb1gDyRE8qXC72rlDiSZUBxCdgY0VDL0DcQKyjL7YbIpwMSA3M0R3JI I3fDnp2Y+ztIdsZD+rHEjadQ/jPEoEyJYWrHtJD9P3n2D1cfqoC4so3fqS2mNV+JzhIwfg 3204yRgUiM7Qcb21cC8qmMacCxThlMRn25rcG0qyg6WwDUEB163cDf980vtlnnFQpGquXk IlPPWzRbCIwvVbobKF10Fw20hcXIHWJIrQeJKjvXmuaS+QtgJbr1w61ohQx6TmyeorfRCh E4+lv8HSBwKb0jXDf94w/nxMJAzIyQiqrjMmxOcG8+PKNXKGWFv0VZKf62l3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/LE18Pojf6tFa850QAv2j5VJSvQQU8dl79hHE4fUTE=; b=r+MVCmc4YJ56Sf6YCNVP4FW7Md5FPHLpL27HE6tOAQGyNIiwepnooBd6yeXIfbxfemirY/ wHuL6rmf74sFgmm6QulXelHwM7Ev37e8R6q1RaqVUfAIwBUxbDA6ldLTi2tXzqRAuf3HCF ynicbyjLClorW4AOpU7dc6rt52Tgu4+XQ195MjFmiDMrUCC7VaCKQVn5i31oyitU4hYpgE uqUUAECJh5t2yQtb9uHhlqHlB99floPZBDNF61JN+zmkP4CjNQjR03Qp65Gq7NcTWNvPDe fMvNIIprltJ6fzdHcbB28wZH0PPHN68WhB2pGY5Fu3rlowP3ZLRXnTn1GJmxAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737406446; a=rsa-sha256; cv=none; b=oIQsTOrLSCTrnoy65g7LPhNXu5q5t85/nVgGgF3wzzZjqvIbxYNdr0mr7YQFirk5AXVh2L K5jSHC1dZ9IVkpSeJ2kzA7mnmbpGNqvsvxJRsHtnlwUFpo2M/XtGWtG+BrMJ1pbqtaO3k6 hi544FmN5++7CCeQv3qqrG+xriQJ/4fJQw4aRGmBxVqo3gyM/k96VXeKPoxb7s2+6GQBJR W92XSeZGgCd5EQeaSd58PLSi47oaHNZ0V2A6+6k3t6/KAP9hF4fOx8PPpAD5djxrbC6iJn IDHD4pfiat2nMJWXIAlWy/hW8YwrpHsLmUOPcab3q+9QiQ5niuBS1QHllEjFdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcMyQ2pPtzcC8; Mon, 20 Jan 2025 20:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KKs6f3017491; Mon, 20 Jan 2025 20:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KKs6Mp017488; Mon, 20 Jan 2025 20:54:06 GMT (envelope-from git) Date: Mon, 20 Jan 2025 20:54:06 GMT Message-Id: <202501202054.50KKs6Mp017488@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: fb63082c0cc6 - main - netlink: provide snl(3) API for variable length raw data attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: fb63082c0cc6a7da68ff9c5b3a9bd023abafe1d2 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=fb63082c0cc6a7da68ff9c5b3a9bd023abafe1d2 commit fb63082c0cc6a7da68ff9c5b3a9bd023abafe1d2 Author: Gleb Smirnoff AuthorDate: 2025-01-20 20:53:07 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-20 20:53:07 +0000 netlink: provide snl(3) API for variable length raw data attribute Rename supposedly internal _snl_reserve_msg_attr() into an official snl_reserve_msg_attr_raw(), that would return pointer to a struct nlattr followed by allocated memory. Adjust the snl_reserve_msg_attr() macro to work on top of that function. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48311 --- sys/netlink/netlink_snl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 0f3b3b44622d..44967b6f444a 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -1109,20 +1109,22 @@ snl_reserve_msg_data_raw(struct snl_writer *nw, size_t sz) #define snl_reserve_msg_object(_ns, _t) ((_t *)snl_reserve_msg_data_raw(_ns, sizeof(_t))) #define snl_reserve_msg_data(_ns, _sz, _t) ((_t *)snl_reserve_msg_data_raw(_ns, _sz)) -static inline void * -_snl_reserve_msg_attr(struct snl_writer *nw, uint16_t nla_type, uint16_t sz) +static inline struct nlattr * +snl_reserve_msg_attr_raw(struct snl_writer *nw, uint16_t nla_type, uint16_t sz) { - sz += sizeof(struct nlattr); + struct nlattr *nla; - struct nlattr *nla = snl_reserve_msg_data(nw, sz, struct nlattr); + sz += sizeof(struct nlattr); + nla = snl_reserve_msg_data(nw, sz, struct nlattr); if (__predict_false(nla == NULL)) return (NULL); nla->nla_type = nla_type; nla->nla_len = sz; - return ((void *)(nla + 1)); + return (nla); } -#define snl_reserve_msg_attr(_ns, _at, _t) ((_t *)_snl_reserve_msg_attr(_ns, _at, sizeof(_t))) +#define snl_reserve_msg_attr(_ns, _at, _t) \ + ((_t *)(snl_reserve_msg_attr_raw(_ns, _at, sizeof(_t)) + 1)) static inline bool snl_add_msg_attr(struct snl_writer *nw, int attr_type, int attr_len, const void *data) From nobody Mon Jan 20 20:54:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcMyR5Bb4z5kwqk; Mon, 20 Jan 2025 20:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcMyR4VCGz44QP; Mon, 20 Jan 2025 20:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xkw+zh6SDp8ylxBNA4DNu1KWGyxuZh7ufrHXu03r68o=; b=YehUeWZpYmLCm0tFqhhpH3zrk+JYvoNfXFgiGPu5kxA++ysazAyFe/yW3dWNfHU3jR0wek Gin1k4wpSQBFKvrQELddF+h0ziDGZc82f3NtUrJrPNoqkcTaaYB8RnvTcA1P/GdxTx9Umh iMlqqdVYWND0viZMkWWCTMeotyg8ukDI6sC+BYyjxkL8E3/okHo506b3q45HHZmPJWbp6S vhiH9TSlu0UAhAnB7jwTzumXB4MJomuhyshD8Du5Rq6RaJsRenD3QWnidvd35nUJL7+6y+ sh7Lr5XcTL2HLEgajHkSHCa0PGXhxUSqQ4574NhqDJTBE0hGjsWrFuDAxC6YCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xkw+zh6SDp8ylxBNA4DNu1KWGyxuZh7ufrHXu03r68o=; b=h/VPJhUySdViwROMKLzrCpT9pcrWwKHDyP91nC8HRjPnmr3TIZA9Lb6VZp041HgScUdqsv /5iU/ug2Ybv+BXjYjX/CmCaQgIqxLxpSW+o9U9f2MmbbSSdUSj0WJur7X+u612TmUiK4Z/ Ev1cy3ep+EvgKBI9gs/n1WPWR0ix8I7Fu3ZxduKPtq5OqIS+wg+FSViOGBObHA+8rj8wFK ZRFP1W8L+6RM7iGWvchfwcfV1eBkRKFE2m1CkYo/LSQysHYIUsFlcYb+XS0+6WsKZeK/Nl H5mF22rHPUO2WNqVJbci9mH8+idJeS+s1J4iMefGczIzlAqBx5Mz3N47UqPkMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737406447; a=rsa-sha256; cv=none; b=rhIu+xJOQZqYJisv+aYSDyWknXoNxsB58qewol18ycD7K4XjpyiDttdpOTyuKSON1BRsfj PMuWDIziNcNLwiYRWuGQgpoljD4VdIpk0ubVGckTPbR+P1xuYyV2oNFWGz0XXbk9zNTAn7 TkcHSCVh61VowhhbHEavxw0CGmoFKaU1agxwAXUiYuPJ0Q9LUsKKsPBJSXu9hPHdLAQVSM z/M6q3JwUoTEm6JhRkMY4E0jxR+ryzmy85xWlUt/rwF6YLnSodrySKnT1JKCXAGgmlRMkD u0cpN9T3WIIt5k2ZzEFdH2DVPtNdxCEfvFx99MrfcQasH4jggiSuf9mYIMNqbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcMyR41ykzcqS; Mon, 20 Jan 2025 20:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KKs7KF017524; Mon, 20 Jan 2025 20:54:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KKs7qh017521; Mon, 20 Jan 2025 20:54:07 GMT (envelope-from git) Date: Mon, 20 Jan 2025 20:54:07 GMT Message-Id: <202501202054.50KKs7qh017521@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: f2a4eed3e13b - main - netlink: underscore snl_get_genl_family_info() to discourage its use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: f2a4eed3e13b6aeb9ddeef580d3b931cf22a14e3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a4eed3e13b6aeb9ddeef580d3b931cf22a14e3 commit f2a4eed3e13b6aeb9ddeef580d3b931cf22a14e3 Author: Gleb Smirnoff AuthorDate: 2025-01-20 20:53:37 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-20 20:53:37 +0000 netlink: underscore snl_get_genl_family_info() to discourage its use This function uses already supposedly opaque struct _getfamily_attrs as the argument and it fills it with pointers to volatile memory, which makes it is unsafe for general use. While here also underscore structures that hang off the struct _getfamily_attrs. Small programs like powerd(8) and RPC daemons are converted to use snl_get_genl_mcast_group() and/or snl_get_genl_family(). The genl(1) utility was fixed not to mix its own parsers with parsers declared in netlink_snl_generic.h. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48480 --- sys/netlink/netlink_snl_generic.h | 36 +++++++++++++++++++++++------------- tests/sys/netlink/test_snl_generic.c | 2 +- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index bdbefb914259..7dc8980e1c5c 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -60,17 +60,17 @@ static struct snl_field_parser snl_fp_genl[] = {}; #define SNL_DECLARE_GENL_PARSER(_name, _np) SNL_DECLARE_PARSER(_name,\ struct genlmsghdr, snl_fp_genl, _np) -struct snl_genl_ctrl_mcast_group { +struct _snl_genl_ctrl_mcast_group { uint32_t mcast_grp_id; const char *mcast_grp_name; }; -struct snl_genl_ctrl_mcast_groups { +struct _snl_genl_ctrl_mcast_groups { uint32_t num_groups; - struct snl_genl_ctrl_mcast_group **groups; + struct _snl_genl_ctrl_mcast_group **groups; }; -#define _OUT(_field) offsetof(struct snl_genl_ctrl_mcast_group, _field) +#define _OUT(_field) offsetof(struct _snl_genl_ctrl_mcast_group, _field) static struct snl_attr_parser _nla_p_getmc[] = { { .type = CTRL_ATTR_MCAST_GRP_NAME, @@ -85,12 +85,12 @@ static struct snl_attr_parser _nla_p_getmc[] = { }; #undef _OUT SNL_DECLARE_ATTR_PARSER_EXT(_genl_ctrl_mc_parser, - sizeof(struct snl_genl_ctrl_mcast_group), _nla_p_getmc, NULL); + sizeof(struct _snl_genl_ctrl_mcast_group), _nla_p_getmc, NULL); struct _getfamily_attrs { uint16_t family_id; const char *family_name; - struct snl_genl_ctrl_mcast_groups mcast_groups; + struct _snl_genl_ctrl_mcast_groups mcast_groups; }; #define _IN(_field) offsetof(struct genlmsghdr, _field) @@ -118,7 +118,7 @@ static struct snl_attr_parser _nla_p_getfam[] = { SNL_DECLARE_GENL_PARSER(_genl_ctrl_getfam_parser, _nla_p_getfam); static bool -snl_get_genl_family_info(struct snl_state *ss, const char *family_name, +_snl_get_genl_family_info(struct snl_state *ss, const char *family_name, struct _getfamily_attrs *attrs) { struct snl_writer nw; @@ -126,10 +126,16 @@ snl_get_genl_family_info(struct snl_state *ss, const char *family_name, memset(attrs, 0, sizeof(*attrs)); - snl_init_writer(ss, &nw); - hdr = snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); - snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, family_name); - if ((hdr = snl_finalize_msg(&nw)) == NULL || !snl_send_message(ss, hdr)) + if (__predict_false(!snl_init_writer(ss, &nw))) + return (false); + if (__predict_false(snl_create_genl_msg_request(&nw, GENL_ID_CTRL, + CTRL_CMD_GETFAMILY) == NULL)) + return (false); + if (__predict_false(!snl_add_msg_attr_string(&nw, + CTRL_ATTR_FAMILY_NAME, family_name))) + return (false); + hdr = snl_finalize_msg(&nw); + if (!snl_send_message(ss, hdr)) return (false); hdr = snl_read_reply(ss, hdr->nlmsg_seq); @@ -146,7 +152,9 @@ snl_get_genl_family(struct snl_state *ss, const char *family_name) { struct _getfamily_attrs attrs = {}; - snl_get_genl_family_info(ss, family_name, &attrs); + if (__predict_false(!_snl_get_genl_family_info(ss, family_name, + &attrs))) + return (0); return (attrs.family_id); } @@ -156,7 +164,9 @@ snl_get_genl_mcast_group(struct snl_state *ss, const char *family_name, { struct _getfamily_attrs attrs = {}; - snl_get_genl_family_info(ss, family_name, &attrs); + if (__predict_false(!_snl_get_genl_family_info(ss, family_name, + &attrs))) + return (0); if (attrs.family_id == 0) return (0); if (family_id != NULL) diff --git a/tests/sys/netlink/test_snl_generic.c b/tests/sys/netlink/test_snl_generic.c index d84d3f88f487..839127fe5232 100644 --- a/tests/sys/netlink/test_snl_generic.c +++ b/tests/sys/netlink/test_snl_generic.c @@ -98,7 +98,7 @@ ATF_TC_BODY(test_snl_get_genl_family_groups, tc) ATF_CHECK(snl_parse_nlmsg(&ss, hdr, &_genl_ctrl_getfam_parser, &attrs)); ATF_CHECK_EQ(attrs.mcast_groups.num_groups, 1); - struct snl_genl_ctrl_mcast_group *group = attrs.mcast_groups.groups[0]; + struct _snl_genl_ctrl_mcast_group *group = attrs.mcast_groups.groups[0]; ATF_CHECK(group->mcast_grp_id > 0); ATF_CHECK(!strcmp(group->mcast_grp_name, "notify")); From nobody Mon Jan 20 20:58:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcN3m1CwDz5kwvJ; Mon, 20 Jan 2025 20:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcN3m0P1Hz45Hl; Mon, 20 Jan 2025 20:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63uKdV7HbjHSHaqorujUIoB2/49aDzNmeCduvMh9ko0=; b=Q+5wCHQRN7KHY9b9iHGxHcL6fOMUa4LTFUpzfT0e5s8RvNIB6+MAz3LH67+Og+fxjW0Hyo hMMz6rQoxs/mx9BUxEDuLD1LIsbJdeVwmEwQdbGX5ECSJQomhd4jiQKGNt/bkkmOgvAeXH sUqWcjHJs7wH9smNVcSzNwpwoVJ6aDOIIxTQVnVhvn0ydTOwjQCqGCFugbNgH3n7IXY4Ro /HekwXE+yCgh4m99y+2hkr1l2X8MpL4Jfxj8o4NSv1/2uAlbANx1qinW+UPZv2wAdPVt+7 Sar4KA1mdfPYz801CXndmH668MPRGVrsIoBvCNRfsVIaFyn+XtgRy5dsa9FWDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737406724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63uKdV7HbjHSHaqorujUIoB2/49aDzNmeCduvMh9ko0=; b=m/1gDFcHyh22k/bVF6Nr20OZsZiuq81fOPO/4foDV7DM2gjn/L08Rk7ks1qfUb80mmMbhY frSEINJeYB5JCOo8bov3ZhS1eG4oNButr5HQe2VXCJq6lwDKHe7C8uEBBU+v0NnvN14LP0 nZtA5QKF8LmMLu9iNShcK6Y4nho050SYuDsKAumWZHVKGggRe7m19dBL6jLxdaFUig3qV9 /LB4LAP25oJy7ZBKcgVtZKKpjZDl98X66eqAaZjEGhFm9LliCMZf2DQq3A5jbKE4byNso/ Oinm2T3fFupYmggXWvQLiGuEh/llohOMf/QryYiiIOv/YGfA+MRC7syIcuMY0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737406724; a=rsa-sha256; cv=none; b=TqBNzNJQwSELJBnxUPKc3SJsT9snXqp42FKDGZgsra5pZsURnJYUbMAnCvEZffPFl9ifEY O9BBSvxHF2lYkSdYqdD2jimJtvJlX2ULj2DoCMQoVfdo42pvlSnVP57OJsyVZR4JMF06vO hXQiTSwehE8Mjy/CfZ1xOBc/lZMgjOonrLuS9L+geDWQVTt7jmO9tIeMZHiVOsQGQpPeew JFj5W4KbenW+CjFY1nFuE8KHm5FuUFBuyfH/zTuAI/HoHIcrrFrY0+OqNONIBfmOInFF0A muq/gLbpaPQlM/YpkGaZUyViTk4iDGmqFY/DxpWcnTuokK/2AiohS5TAQJCL0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcN3l6nHBzcqT; Mon, 20 Jan 2025 20:58:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KKwhlD018964; Mon, 20 Jan 2025 20:58:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KKwhp4018961; Mon, 20 Jan 2025 20:58:43 GMT (envelope-from git) Date: Mon, 20 Jan 2025 20:58:43 GMT Message-Id: <202501202058.50KKwhp4018961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: dae4eb623e86 - main - libsecureboot add sha384 and sha512 for OpenPGP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dae4eb623e862789533dca8b644ea531502a088f Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=dae4eb623e862789533dca8b644ea531502a088f commit dae4eb623e862789533dca8b644ea531502a088f Author: Simon J. Gerraty AuthorDate: 2025-01-20 20:56:44 +0000 Commit: Simon J. Gerraty CommitDate: 2025-01-20 20:56:44 +0000 libsecureboot add sha384 and sha512 for OpenPGP gpg supports SHA384, SHA512 as well as SHA256 so allow for them. Tweak Makefile.inc so we can build libsecureboot with only OpenPGP trust anchors. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48546 --- lib/libsecureboot/Makefile.inc | 6 +++++- lib/libsecureboot/openpgp/opgp_sig.c | 10 ++++++++++ lib/libsecureboot/vets.c | 30 ++++++++++++++++++------------ 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lib/libsecureboot/Makefile.inc b/lib/libsecureboot/Makefile.inc index b9d986cdc6b3..21ad019a0cb5 100644 --- a/lib/libsecureboot/Makefile.inc +++ b/lib/libsecureboot/Makefile.inc @@ -77,12 +77,16 @@ VE_SIGNATURE_EXT_LIST?= sig # needs to be yes for FIPS 140-2 compliance VE_SELF_TESTS?= no +CFLAGS+= -I. + +.if ${VE_SIGNATURE_EXT_LIST:M*sig} != "" # this is what we use as our trust anchor -CFLAGS+= -I. -DTRUST_ANCHOR_STR=ta_PEM +CFLAGS+= -DTRUST_ANCHOR_STR=ta_PEM .if ${VE_SELF_TESTS} != "no" XCFLAGS.vets+= -DVERIFY_CERTS_STR=vc_PEM .endif +.endif # clean these up VE_HASH_LIST:= ${VE_HASH_LIST:tu:O:u} diff --git a/lib/libsecureboot/openpgp/opgp_sig.c b/lib/libsecureboot/openpgp/opgp_sig.c index 73c482e4c28d..8846296d7122 100644 --- a/lib/libsecureboot/openpgp/opgp_sig.c +++ b/lib/libsecureboot/openpgp/opgp_sig.c @@ -339,6 +339,16 @@ openpgp_verify(const char *filename, mlen = br_sha256_SIZE; hash_oid = BR_HASH_OID_SHA256; break; + case 9: /* sha384 */ + md = &br_sha384_vtable; + mlen = br_sha384_SIZE; + hash_oid = BR_HASH_OID_SHA384; + break; + case 10: /* sha512 */ + md = &br_sha512_vtable; + mlen = br_sha512_SIZE; + hash_oid = BR_HASH_OID_SHA512; + break; default: warnx("unsupported hash algorithm: %s", hname); rc = -1; diff --git a/lib/libsecureboot/vets.c b/lib/libsecureboot/vets.c index c86b198c45c5..67d27d567485 100644 --- a/lib/libsecureboot/vets.c +++ b/lib/libsecureboot/vets.c @@ -200,11 +200,13 @@ ve_utc_set(time_t utc) } } +#ifdef VERIFY_CERTS_STR static void free_cert_contents(br_x509_certificate *xc) { xfree(xc->data); } +#endif /* * a bit of a dance to get commonName from a certificate @@ -372,13 +374,15 @@ ve_trust_anchors_add_buf(unsigned char *buf, size_t len) size_t num; num = 0; - xcs = parse_certificates(buf, len, &num); - if (xcs != NULL) { - num = ve_trust_anchors_add(xcs, num); + if (len > 0) { + xcs = parse_certificates(buf, len, &num); + if (xcs != NULL) { + num = ve_trust_anchors_add(xcs, num); #ifdef VE_OPENPGP_SUPPORT - } else { - num = openpgp_trust_add_buf(buf, len); + } else { + num = openpgp_trust_add_buf(buf, len); #endif + } } return (num); } @@ -398,15 +402,17 @@ ve_trust_anchors_revoke(unsigned char *buf, size_t len) size_t num; num = 0; - xcs = parse_certificates(buf, len, &num); - if (xcs != NULL) { - num = ve_forbidden_anchors_add(xcs, num); + if (len > 0) { + xcs = parse_certificates(buf, len, &num); + if (xcs != NULL) { + num = ve_forbidden_anchors_add(xcs, num); #ifdef VE_OPENPGP_SUPPORT - } else { - if (buf[len - 1] == '\n') - buf[len - 1] = '\0'; - num = openpgp_trust_revoke((char *)buf); + } else { + if (buf[len - 1] == '\n') + buf[len - 1] = '\0'; + num = openpgp_trust_revoke((char *)buf); #endif + } } return (num); } From nobody Mon Jan 20 21:15:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcNRR3pvyz5kyD4; Mon, 20 Jan 2025 21:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcNRR345rz47q8; Mon, 20 Jan 2025 21:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737407747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3SHm6WJ+QYPQPjcNDA9P1t8xo5THeQ5YUp+k/gilES8=; b=r5tzZXGtzhJXCw/l+6Q8JElTLGeKwVSvMpwZG9/xSGZVtZrdRwpP59/itl2LL8GAtVKEZo 4XgZX/lEo3ZDtl15NUgYfBMNRO2Iyi9MvWlWeu3L1q6wRE0aF2n/nmXvzrg1ClfBpPyz/e Eyr+/UcTDaiH+dltijbV+wqVpolumWDGJ2xLyQfqzcGKQGmBV0uLGhT5uiPc5UPrODdynp SbzWzDczPwOlYz9Kze6mGp/qqFeCCuiqdj0Fb4+GQEyXq5n5r+wZ0SK7ynJAqUfvFvHlIi NMRSRD5+Z8EBvtMQOqseaOM21jeym1D8+QRFBz00K+0Kk6f0nWkHwLrXR7nyXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737407747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3SHm6WJ+QYPQPjcNDA9P1t8xo5THeQ5YUp+k/gilES8=; b=HpYqHvvOpi7wZwhVUGxcR4eM4rkySOAhakWaTNMe17nyaeoV0D5eVEUbFQdGMDIb1xP9OL JfxDObYdUd/BK/DrFg7UrdnbOeJD4xjkbSALdWtvyi85BCTQAcsjvH2Ge/pDcdXZhSlJDW lNmb05hHucguMr5xT1GBwGI394JB32lbfUGOzNYeDhN9f6/OW56AZVxxurEdCWAxrV6g6l M3fjqfBAKzNRtbcsYcYLZgjO8dzL7wQSMBP5vJiSg/3ny+L1/nBvIwfOLnloxUuYTeqyqz GrZKwE38XiTFJvWQLRNSsQf7Z8a3estEQVC06CdRVZr+ZBnEV4qd9UynLj2MJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737407747; a=rsa-sha256; cv=none; b=WKQgsRnm41XFxnBQG9y0gxHWCgV26VDc1V1y4g2gzAsbP87vwI7gNusCT27KC7j06MVNN9 S7R7Zx54vX98xRajvU0TfEugqIrQzEuQL06ujzV+oHi7coSm4iPfdpu2b6MoGLRhK+s49l zl4tDK0IBeW2I0YRE0BqKdmJKmB4yccT7ppzoKRGp8Rq9iHf1asiL3ffUd8Cq/pF22butf vJZqFFB1Mfeb7Yc6R3wzv4SEQ8h8XZKnv+DrCB2vuspNhpyOUTq/R8kWsXC6R0envbeYiZ Kl5IN+FleC3D+X9rPt5S6eZp9k2migQnipdtQ9l4qf8HABTIhwbIBpj0scVqgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcNRR2S1szdMg; Mon, 20 Jan 2025 21:15:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KLFl1X057493; Mon, 20 Jan 2025 21:15:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KLFlcd057490; Mon, 20 Jan 2025 21:15:47 GMT (envelope-from git) Date: Mon, 20 Jan 2025 21:15:47 GMT Message-Id: <202501202115.50KLFlcd057490@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: ddc7fd6641c3 - main - netlink: provide snl_clone() to create a secondary snl state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ddc7fd6641c38a00d8d299d69ba57f0657f5eaac Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ddc7fd6641c38a00d8d299d69ba57f0657f5eaac commit ddc7fd6641c38a00d8d299d69ba57f0657f5eaac Author: Gleb Smirnoff AuthorDate: 2025-01-20 21:15:39 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-20 21:15:39 +0000 netlink: provide snl_clone() to create a secondary snl state The function will clone an existing snl_state(). The clone points at the same socket, but has a separate allocator. Closing a clone frees the memory, but doesn't close the socket. Such clones are handy in a multithreaded process that has a single socket with multiple writers and a serialized reader. It can be easily extended to support multiple readers, too, but now there is no use. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48568 --- sys/netlink/netlink_snl.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 44967b6f444a..faaeebe52eac 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -240,14 +240,13 @@ snl_clear_lb(struct snl_state *ss) static void snl_free(struct snl_state *ss) { - if (ss->init_done) { + if (ss->init_done) close(ss->fd); - if (ss->buf != NULL) - free(ss->buf); - if (ss->lb != NULL) { - snl_clear_lb(ss); - lb_free(ss->lb); - } + if (ss->buf != NULL) + free(ss->buf); + if (ss->lb != NULL) { + snl_clear_lb(ss); + lb_free(ss->lb); } } @@ -290,6 +289,16 @@ snl_init(struct snl_state *ss, int netlink_family) return (true); } +static inline bool +snl_clone(struct snl_state *ss, const struct snl_state *orig) +{ + *ss = (struct snl_state){ + .fd = orig->fd, + .init_done = false, + }; + return ((ss->lb = lb_init(SCRATCH_BUFFER_SIZE)) != NULL); +} + static inline bool snl_send(struct snl_state *ss, void *data, int sz) { From nobody Mon Jan 20 21:40:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcNzb3RSvz5l0Gy; Mon, 20 Jan 2025 21:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcNzb2vH5z4Ggj; Mon, 20 Jan 2025 21:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737409211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fkBU6A7tWcr4U5k16RhfJFYXJHWdQEZIsgjU7rPi8U=; b=r/CNF+34WzINaI+2m9WXR6whEHdxJQRiLxkQFUsSjcBNplHqSmsHxW+zrx+7ALsGiwHgLN a4pVUQcrVGp3/ZLRbeNtgR+oQZVzyDyzxf9ozxIcr+ZwLaJYBleOThSFt60q9CCPjqWWQJ 8pOnrung9XpWhdveHScclSE26Vd9HOgIR6cpMcuV+jkbqh86bEywp50WoFz9j8pRp7j12J K3Ks5+57wUQiRy+xjO10jndsDGyZqdbbJTastkXtC6lExCYpk7st/jlXtWDKQu/vWLV4LL 7i1YKakhHmD0Aqo2YbUZ960nNbPPUYnGdw6AFjaqYL2otD8NzEZGI5WaYrzZ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737409211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fkBU6A7tWcr4U5k16RhfJFYXJHWdQEZIsgjU7rPi8U=; b=hlveEUpdO05n1ecn05xPa5uXQIEPnalwYk3g6iJOldaWMVR4HuEkrIt9fdDFyXncv6H2qc vX/Lcu69IW8tcBmo0fB2ZqyVC9xCTvk8nODymqZWTbPf62/f51j5Kh9coH1IxorgdHs9J7 RFygB7zClGSrFQfC+q0HV1bK6YHh9Y1/ehl6SAQ7tKb7wc1w+gxr1DWb9YXIFplB8ZYNMu 5JTYShsQHyqrOw7d7No2l4pb6RxNrrUeWBNJ1/nZlP/SxhX6HMzyeawx5ujgM3AJjo/NhU qd8qXj/jrdqfzXh+qeOVd/bH9qa8wBMqYNMyQ9xZ4b4IErH3NNPP5fSTTiJDrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737409211; a=rsa-sha256; cv=none; b=xz2zUsDPAahZzmAIoFu4r2G2ygM8BB1z3ZKymE8PWCJTwvqAYVZdfNNfa1W3+mkvZBgOXi EIDuViIL83kuS6EpqzsSBo9IwBKsrya2wMQ+yD3s/O6HmguiwtBwhX9o+ahUkt1OZ03SU+ 6uX0bs3ZcgLOlLkScYqRtTvf8bQjrfIPvMrgILnZd3QJV9DDCpl+7/IYZ3YSGgXd9TEsNF TASiZOmkoi8BPCL96R2irojiSNEo6SfcEtTUK8r5BQHNGLnqws8XyNJCpJq+xSn9V5pJhm 5fWaEy9rtHjZ58a34hDT7sJycZaZ3OH5LylzA9vIuvNkrx1q4TtWW33fqY3y0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcNzb2Ry0zf6J; Mon, 20 Jan 2025 21:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KLeBrq000500; Mon, 20 Jan 2025 21:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KLeB2n000490; Mon, 20 Jan 2025 21:40:11 GMT (envelope-from git) Date: Mon, 20 Jan 2025 21:40:11 GMT Message-Id: <202501202140.50KLeB2n000490@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: d521362f8f7e - main - netlink: fix build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: d521362f8f7e74178eeea1b7e333ca02a440f3e5 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d521362f8f7e74178eeea1b7e333ca02a440f3e5 commit d521362f8f7e74178eeea1b7e333ca02a440f3e5 Author: Gleb Smirnoff AuthorDate: 2025-01-20 21:38:02 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-20 21:38:02 +0000 netlink: fix build The commit checked in had a dependency on not yet reviewed changes. Revert them, but the main gist of the commit is not reverted. Fixes: f2a4eed3e13b6aeb9ddeef580d3b931cf22a14e3 --- sys/netlink/netlink_snl_generic.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index 7dc8980e1c5c..acf483ac0243 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -126,16 +126,10 @@ _snl_get_genl_family_info(struct snl_state *ss, const char *family_name, memset(attrs, 0, sizeof(*attrs)); - if (__predict_false(!snl_init_writer(ss, &nw))) - return (false); - if (__predict_false(snl_create_genl_msg_request(&nw, GENL_ID_CTRL, - CTRL_CMD_GETFAMILY) == NULL)) - return (false); - if (__predict_false(!snl_add_msg_attr_string(&nw, - CTRL_ATTR_FAMILY_NAME, family_name))) - return (false); - hdr = snl_finalize_msg(&nw); - if (!snl_send_message(ss, hdr)) + snl_init_writer(ss, &nw); + snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); + snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, family_name); + if ((hdr = snl_finalize_msg(&nw)) == NULL || !snl_send_message(ss, hdr)) return (false); hdr = snl_read_reply(ss, hdr->nlmsg_seq); From nobody Mon Jan 20 21:52:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcPG32L1Jz5l14C; Mon, 20 Jan 2025 21:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcPG31T39z4HlQ; Mon, 20 Jan 2025 21:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737409963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcR0m1u2fHEewNaNWjYfhteXS9AUlfZggYQHClpx2TU=; b=EnsEfVydTJlhaOglbWwLjnENwr+jZmUcxDT6dTRbMrkpe1tUSqGDbjHt+HvZSPFoomxKcx fa0LLWDTfhbYBPZ9oc9CQEs4DfV6k4dIiV/iVXlZy0MRtY7AziSPwBUyvSUb2zwmU8aTzu W4w4u5yDgaOQlMUE6m1135TqWQOsWXCMJjp6oinhUZ5EZZSaMfkXeHPT1CVqNYeYKsQLXd Xiea3Z+CtZ0LSRZS9rJq5tQUEHR4ur/CQMTjw0pPoVBMa1O8SlhwuKr0mJWdP2e95F1bDR RKtAm9OSmXwONDrl2cmGzYJEdzrG7Nt2NrvgkJy7dekJjw21DBdQdsEf1QBz6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737409963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcR0m1u2fHEewNaNWjYfhteXS9AUlfZggYQHClpx2TU=; b=pE2wS5hTqYygiBf3byZ5aWdLeHUhOl81b0F+BGC4Xm6V6A8aBvQbqhn0W9mJKN7ARt7frB svYPRKrjba7u8DZb7lLeqBuc7xXpv9Yio3Iac6Jdjfreq6+Pyz3vStAiFLte8UhcGJL67c cddMlAaqyPYe07jZm5t4NEfzpojgVHVcuajkBZDTIAI8nnakfqUamOgWJz5GqnHDtPP5DY x3kZHyBqVmyBH6TEUQW1bjTxI7m/ncrAYU+R8FW+q/N6P7ARMoQlNrDh77P+xHNz+95y5j CEvoaycGqLMUHeuyW2MSTifV9pyfLPzG9KGydtatvgWi1kkm1MDJ7plSB9jEWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737409963; a=rsa-sha256; cv=none; b=LSRl8XjH72ZozYny/02kTe74VvuojtjL8bwH96AKHIvxm5WU2/yKTZAhpYMTeOXrycQXxX qcpBF7r61lneukvGwwfUEZn9DXIg/NLwEAAm7ojpSaEVFppI/WTMOwASBGnX5hxK0BBdUc +NbOiJ87Z1FnM/xoorqUEemQAOiu8i+JuUOimmbd1p0kMptpbrJUSu284wVwWjg8zlvJ4Z L4vlesF+BcikMkdf99I+PURi31Q5wc1uG07T9TH22PkATRZY8nNYNOoE31aQGT0S4YRdKX vlZQymCOOAPFRr5ONZrpUpwjf00kmmPaMrY7G4fks8AyNSOeMnaCN4jG1eYpgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcPG30JhSzfdC; Mon, 20 Jan 2025 21:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KLqgqW030399; Mon, 20 Jan 2025 21:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KLqg1C030396; Mon, 20 Jan 2025 21:52:42 GMT (envelope-from git) Date: Mon, 20 Jan 2025 21:52:42 GMT Message-Id: <202501202152.50KLqg1C030396@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: 709c18911ad7 - main - nfsd: Add support for the NFSv4.2 change_attr_type attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 709c18911ad70978d47198556c0fb1c0e703fb68 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=709c18911ad70978d47198556c0fb1c0e703fb68 commit 709c18911ad70978d47198556c0fb1c0e703fb68 Author: Rick Macklem AuthorDate: 2025-01-20 21:51:33 +0000 Commit: Rick Macklem CommitDate: 2025-01-20 21:51:33 +0000 nfsd: Add support for the NFSv4.2 change_attr_type attribute Richard Kojedzinszky reported an intermittent problem where the Linux NFSv4.2 client would sometimes not see changes done to a directory by another client, although the change attribute for the directory had changed. A test patch that added the change_attr_type attribute to the server and always returned NFS4_CHANGE_TYPE_VERSION_COUNTER_NOPNFS seems to have resolved the issue. Somewhat oddly, the Linux knfsd server does not support this attribute but does not seem to exhibit the stale caching problem. This patch uses the VFCF_FILEREVINC flag on a file system (UFS, ZFS) to return NFS4_CHANGE_TYPE_VERSION_COUNTER_NOPNFS. It also returns NFS4_CHANGE_TYPE_TIME_METADATA if VFCF_FILEREVCT is set, which may be useful for exported fuse file systems. PR: 284186 Reported by: Richard Kojedzinszky Tested by: Richard Kojedzinszky MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 32 ++++++++++++++++++++++++++++++++ sys/fs/nfs/nfsproto.h | 11 ++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index fc01630f77f9..d4d97f4eb966 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -2303,6 +2303,23 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (compare && !(*retcmpp) && i != nfs_srvmaxio) *retcmpp = NFSERR_NOTSAME; break; + case NFSATTRBIT_CHANGEATTRTYPE: + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + if (compare) { + if (!(*retcmpp)) { + tuint = NFSV4CHANGETYPE_UNDEFINED; + if ((vp->v_mount->mnt_vfc->vfc_flags & + VFCF_FILEREVINC) != 0) + tuint = NFSV4CHANGETYPE_VERS_COUNTER_NOPNFS; + else if ((vp->v_mount->mnt_vfc->vfc_flags & + VFCF_FILEREVCT) != 0) + tuint = NFSV4CHANGETYPE_TIME_METADATA; + if (fxdr_unsigned(uint32_t, *tl) != tuint) + *retcmpp = NFSERR_NOTSAME; + } + } + attrsum += NFSX_UNSIGNED; + break; default: printf("EEK! nfsv4_loadattr unknown attr=%d\n", bitpos); @@ -3127,6 +3144,21 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, *tl = 0; retnum += 2 * NFSX_UNSIGNED; break; + case NFSATTRBIT_CHANGEATTRTYPE: + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4CHANGETYPE_UNDEFINED); + if (mp != NULL) { + if ((mp->mnt_vfc->vfc_flags & + VFCF_FILEREVINC) != 0) + *tl = txdr_unsigned( + NFSV4CHANGETYPE_VERS_COUNTER_NOPNFS); + else if ((mp->mnt_vfc->vfc_flags & + VFCF_FILEREVCT) != 0) + *tl = txdr_unsigned( + NFSV4CHANGETYPE_TIME_METADATA); + } + retnum += NFSX_UNSIGNED; + break; default: printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos); } diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index ce7acf102d41..323746ebbb6c 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -1176,6 +1176,7 @@ struct nfsv3_sattr { NFSATTRBM_LAYOUTBLKSIZE | \ NFSATTRBM_LAYOUTALIGNMENT | \ NFSATTRBM_SUPPATTREXCLCREAT | \ + NFSATTRBM_CHANGEATTRTYPE | \ NFSATTRBM_XATTRSUPPORT) /* @@ -1221,7 +1222,8 @@ struct nfsv3_sattr { * NFSATTRBIT_NFSV42 - Attributes only supported by NFSv4.2. */ #define NFSATTRBIT_NFSV42_2 \ - (NFSATTRBM_XATTRSUPPORT | \ + (NFSATTRBM_CHANGEATTRTYPE | \ + NFSATTRBM_XATTRSUPPORT | \ NFSATTRBM_MODEUMASK) /* @@ -1657,4 +1659,11 @@ typedef struct nfsv4stateid nfsv4stateid_t; #define NFSV4SXATTR_CREATE 1 #define NFSV4SXATTR_REPLACE 2 +/* Values for ChangeAttrType (RFC-7862). */ +#define NFSV4CHANGETYPE_MONOTONIC_INCR 0 +#define NFSV4CHANGETYPE_VERS_COUNTER 1 +#define NFSV4CHANGETYPE_VERS_COUNTER_NOPNFS 2 +#define NFSV4CHANGETYPE_TIME_METADATA 3 +#define NFSV4CHANGETYPE_UNDEFINED 4 + #endif /* _NFS_NFSPROTO_H_ */ From nobody Mon Jan 20 22:09:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcPdt0XdPz5l2W2; Mon, 20 Jan 2025 22:09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcPds6vyfz4LTX; Mon, 20 Jan 2025 22:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737410994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/QVT99ZWnhfRXpxzZeAt4fYdM8P0QU6JBan/8f0Ybo=; b=UA2zXHCv6DwG17mfaDRCfg7j2velq+TWAwHhEWOt16iwGm8qQrj4MdolaSYhQePybz++OJ SKO0Ub3aplXrcGkOB5+KNVg/7+Rfz3ulFyF3GaJP1R+TBnwHs9VsM5kQYzK5z/GWu+IZc6 EGWk7Yxf3Q5iKr6c3UMWKLWfqZNqH5m/5sCHAVDo773WKqBSDBRH7YY19kMsMWBX6nu/aQ JNP6LoYcgtzKKbMvAtDr/Nerzw+XBBxvgaiBG/BY21x/UajFXhuYMSiFHrnAqYVL46sQwm rKF+i609j3NnBfk1Q37QOW+PiG1nQBJ7QPN1cTNNthnJAllmbOrOHto32G43Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737410994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/QVT99ZWnhfRXpxzZeAt4fYdM8P0QU6JBan/8f0Ybo=; b=F1RbjIZs+wIEgpKa7Vz3TvipXn+Y+BkoxUUNN62XY3ujQY4CHs/57MJ55QHhekwZrrxe8B TQe+IKNwFC7Hf9OBFlZ/x1kH/Lo0QOytFcpq3aEriLQVjODzjKwAdZRH4hidsRLkOMdRVI WhWLsJVsiAHNvtDyBk1LE6gnWGdiG4mDEXopgKmINvPvj1BToWdpPTNW0fhBMlblIdpSiO oDsS7GhqbJ/oFgNskVwLp44oShFtacz2iUNa0df2o45ime3I619uTYoRkoPrnoMpUj9IA/ odCm8wUtHqveokb5yXC/tLuy7plxCOEUFKXdLwtN4JnA3Ms5ram7loZb7xDB+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737410994; a=rsa-sha256; cv=none; b=E1IkG9Lzt8HcYHElgdBAjwgLXa2DFsX7D4+2tBfTZabIHxRax+sv1HQis7uAd1UCI+aEML U9ptXRhBe8O4tkRZj7htYLDCK12rSAZDEnILyEJtLFdHlQBanbQsvFUD3pEPAe1lkWmF7+ 3/3x9zLu1mynPU9/T3XhhS4D0UqlfPLFz9o5WiCrJdDgGP1LmAAP8OAeYaxUTVxXemK1nn R4SJP98HQsx7AquJvOlQdk5YXFuCuYj3ALNu5AIgRGrIaQvTK9bTi1fLwXG6dzRCDznU2N 265Pp2eXj31u4P/KWe3qG/+AqY0lm8yWy/kCyB459taB4qcP7PPXH4WI4IRlVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcPds6KBWzffH; Mon, 20 Jan 2025 22:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KM9rLs052406; Mon, 20 Jan 2025 22:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KM9rSw052403; Mon, 20 Jan 2025 22:09:53 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:09:53 GMT Message-Id: <202501202209.50KM9rSw052403@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: 99d5ee8738a3 - stable/14 - ktrace: Fix uninitialized memory disclosure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 99d5ee8738a354e0d8f12453a82ed87e47bd62f1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=99d5ee8738a354e0d8f12453a82ed87e47bd62f1 commit 99d5ee8738a354e0d8f12453a82ed87e47bd62f1 Author: Mark Johnston AuthorDate: 2025-01-20 13:50:04 +0000 Commit: Mark Johnston CommitDate: 2025-01-20 22:08:45 +0000 ktrace: Fix uninitialized memory disclosure The sockaddr passed to ktrcapfail() may be smaller than sizeof(struct sockaddr), and the trailing bytes in the sockaddr structure will be uninitialized, whereupon they get copied out to userspace. PR: 283673 Reviewed by: jfree, emaste Reported by: Yichen Chai Reported by: Zhuo Ying Jiang Li Fixes: 9bec84131215 ("ktrace: Record detailed ECAPMODE violations") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48499 (cherry picked from commit 5b86888bae651e54ccc0adde0ed897ec1c1e0d45) --- sys/kern/kern_ktrace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 1c6a2ae01f3d..2b311f2d36dc 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -958,9 +958,16 @@ ktrcapfail(enum ktr_cap_violation type, const void *data) case CAPFAIL_PROTO: kcd->cap_int = *(const int *)data; break; - case CAPFAIL_SOCKADDR: - kcd->cap_sockaddr = *(const struct sockaddr *)data; + case CAPFAIL_SOCKADDR: { + size_t len; + + len = MIN(((const struct sockaddr *)data)->sa_len, + sizeof(kcd->cap_sockaddr)); + memset(&kcd->cap_sockaddr, 0, + sizeof(kcd->cap_sockaddr)); + memcpy(&kcd->cap_sockaddr, data, len); break; + } case CAPFAIL_NAMEI: strlcpy(kcd->cap_path, data, MAXPATHLEN); break; From nobody Mon Jan 20 22:26:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQ163bnWz5l3W2; Mon, 20 Jan 2025 22:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ16325hz4MQk; Mon, 20 Jan 2025 22:26:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737411994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bf44mUCweZEZUUc4+vIUNgOya69SnVBlIp18c/9oE54=; b=gYrE/zBx+CB11aZ45lmBoswoC9F2z1OAhNVR0G4JenhVcBKgN4+90d3z8ZEFyAA9gzthet e4FbfJizegagtTDNpbfaStu3WSYf8hlcCNlduKj9ZwM1FK3/PGn2dcTfQfqLXuVGHxgPYV 01tVUybKZXfjhby7zp2AD0nWbF8a69FSW/wFd0V8gKrDOX7at3gXq9hfbsFLGgOwlEW++4 IqaEqWP5Gxkic7XNZ5K4wqHymQFVXltoDBLZi3pMnUv3B5WcH4zkVqMCO4SDyR7SjZnDNO vS2Lsv9zXocYEnlMnuU+PEZoRlle6ryzVSRGi6gcGjNXPcvQKssrIFO388Vu9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737411994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bf44mUCweZEZUUc4+vIUNgOya69SnVBlIp18c/9oE54=; b=TWNBbpWROc5gvq9MCxPrXz76dVrEae8wt/ihBVxOr7U+iyhnRO+Sph9JmLcGQvohUL3z4q Ri5iP2Xtnqp1Mc85jJGPKUEUNurTW4Xre8+zRZw2F/8ybG6NtCc96De7d5KHrFx5OkkzpK wTHLwTSd5AxP7/V9kGiVwshbG5KnuFL0piNvCehCYhO31Bv2l8ZXYnXUhyXEfhERpOJNk6 2lyq2fEOYMSvjCIq6DFCkh7YV9if4Md7RtYYxRBEs1815nWOAvAP4ZEfQ8Be1ochPCASXU g/sLp08OBPrn8QCH/8HrSY9gee7G0nl7jaYiIhqqNzQoxTXL4KU8sUgtSKfzCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737411994; a=rsa-sha256; cv=none; b=OYXR57gnXsFmmxIxK9Nb+3zYCJOUaRK4ADlCINHjSW2mqU6ecQ0uxnTdLTjfLJPhuRANt9 t0xfpPvXMbyuMtIaMMv8GnlwJwzcZR7DXvFJEG9fpZc2RKxH9V+Wut2Huy7U1DakseH9+K /AQ5Xj2OfO9bXEYSk4gVVmb9+LWL0n/FyENEUF3o0Z4f9IH+Hh7L8HHbqSlZwfmLt+zMbI p1I9M5px3DuO4y1Rpfl6r6MjOufkltjPAsRZMOWUvkUv9pq9WjZVr6QqYgx+3XFauaOz2H fDI1tocEAH0/Y05XRGWnmyuKxKEeSBnJcUpPC2aodoUr5R8rlDwi3CF1aT8fFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ1627lQzg7R; Mon, 20 Jan 2025 22:26:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMQYqV088267; Mon, 20 Jan 2025 22:26:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMQYdY088264; Mon, 20 Jan 2025 22:26:34 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:26:34 GMT Message-Id: <202501202226.50KMQYdY088264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e758e5512005 - stable/13 - nfscl: fix uninitialized memory in nfsv4_loadattr List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e758e5512005abdc30285e95e39f98c01ae12d85 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e758e5512005abdc30285e95e39f98c01ae12d85 commit e758e5512005abdc30285e95e39f98c01ae12d85 Author: Alan Somers AuthorDate: 2024-09-08 20:42:38 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:16:11 +0000 nfscl: fix uninitialized memory in nfsv4_loadattr When processing an RPC response that did not include any Owner attribute, nfsv4_loadattr would return na_uid and na_gid uninitialized. The uninitialized values could then make their way into the NFS attribute cache via nfscl_loadattrcache. PR: 281279 Reported by: KMSAN Reviewed by: rmacklem Sponsored by: Axcient (cherry picked from commit 44328abfb7aca8150b07b83ff502c9185677e3fb) --- sys/fs/nfs/nfs_commonsubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index ebed4a4b5905..e35fd8d1185f 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1280,6 +1280,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, * Just set default values to some of the important ones. */ if (nap != NULL) { + VATTR_NULL(&nap->na_vattr); nap->na_type = VREG; nap->na_mode = 0; nap->na_rdev = (NFSDEV_T)0; From nobody Mon Jan 20 22:29:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQ3y0fHhz5l3Sh; Mon, 20 Jan 2025 22:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ3x4xNbz4MxD; Mon, 20 Jan 2025 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9gn9D0j9BSG/lWEHx1DLHqV0Y7nUpgPUaMYp1ODZ9c=; b=tTRuGou5veBA+mVwz1oenmtEqUdUPBfJMaXRFK6wlcB1GvDRqv4ATi0O1X/HVm0WUZchGX nvjMA78zG9HD8u+MOgGfjMH6FrM9fkf+bV0IiONLlcvy9l0T5ArlcfupufBPdQk2OhXxp5 piQhvfzFG4Iuf5hxm7Nqd6V+OabiI8AXYiPAslGeCBYcu5Myu24VH8FIaEhOcuQxNBumrZ 8ZMaP3/r12n4Lwo2sexSbuBFsTk7u84lbdhUyFSj1l1UbxmvLohXSAb8UN1kLfVm/0BZ2Y Ur/wUcAMvxNOeKFOLIYZ/iyOBzwdaOmIE8FkRFA1K+YHm1pHFB4qB8k1kADJRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9gn9D0j9BSG/lWEHx1DLHqV0Y7nUpgPUaMYp1ODZ9c=; b=kWP7DoBFPOHOayhjye1ykastEQQQor0BZs/LZ14kFRaskPeS3V88akMRAZGvoWpw7+1qgk WJOZM90e1NaKnY1oGNBwzJ94BLg/j8DkuDY8eJLKPn7pr4OkV/SirNWLZWo1s2dJoYz66Q pD85uNxmyeZdmWIHV84HLHHFitMbHgFwTvfS/nEhggwHBdfRINXtMvaiW0dhtnu71c9nyv 78bZEZ8642QCWwUreNtHO2/rAzVSVFwnlldGzj9I0M43jLfGcKJCKUeqYFPFmuVifCkRf8 M4odVepPSFmXxaAQhWEY3CG+DgZFRo6ebW5TVkZzSiuhrlFIxkRj3vEESKZwYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412141; a=rsa-sha256; cv=none; b=cz5vXIRrzV8R07SGOJE2QcUIFxLwBiVmQYw2jr0iOR2+hNFOc/EQ46/WOPzbB0T/9Nt4gM JSipghK0Ib/oBxUZoZ5NDrpa36Fjq9pyF4ilFMynkwc2NJyrOPuo9PFA0UYUnZPeY87DQ+ u8wz7g7t5RtPYYIynTcpI1ZHpSXo2JChbtRB7fA+6fgQWTFiZOHWmK5Aw/1pyRP2QY58Tq aY3luw/hI9eilwesDWfV3wV4Od1Bqq9K6U/DEp9UX758/nJ4GOdKMJpQ02+vTTzskhMZKy H+GhmOQBZpS4r9VuNXxHmp6jUaA26w9fNVtWo5pXerLhohfMB8QsYtY0wR//6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ3x4VbnzgDP; Mon, 20 Jan 2025 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMT1l4089134; Mon, 20 Jan 2025 22:29:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMT1vr089131; Mon, 20 Jan 2025 22:29:01 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:29:01 GMT Message-Id: <202501202229.50KMT1vr089131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 06b782abaafe - stable/13 - tmpfs: remove duplicate flags check in tmpfs_rmdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06b782abaafe56674fc2be847dea4ab28c1cddf0 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=06b782abaafe56674fc2be847dea4ab28c1cddf0 commit 06b782abaafe56674fc2be847dea4ab28c1cddf0 Author: Claudiu AuthorDate: 2024-10-13 20:00:42 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:27:26 +0000 tmpfs: remove duplicate flags check in tmpfs_rmdir Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D47100 (cherry picked from commit ec22e705c266ff629cc5ec47b84f67ba02b7b924) --- sys/fs/tmpfs/tmpfs_vnops.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 3c61938f8cae..f1add1ed6ab9 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1307,6 +1307,7 @@ tmpfs_rmdir(struct vop_rmdir_args *v) goto out; } + /* Check flags to see if we are allowed to remove the directory. */ if ((dnode->tn_flags & APPEND) || (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND))) { error = EPERM; @@ -1324,13 +1325,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) v->a_cnp->cn_nameptr, v->a_cnp->cn_namelen)); - /* Check flags to see if we are allowed to remove the directory. */ - if ((dnode->tn_flags & APPEND) != 0 || - (node->tn_flags & (NOUNLINK | IMMUTABLE | APPEND)) != 0) { - error = EPERM; - goto out; - } - /* Detach the directory entry from the directory (dnode). */ tmpfs_dir_detach(dvp, de); if (v->a_cnp->cn_flags & DOWHITEOUT) From nobody Mon Jan 20 22:31:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQ6Q6sJCz5l3X1; Mon, 20 Jan 2025 22:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ6Q5G8rz4N6L; Mon, 20 Jan 2025 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClAYY6SyotThsffXwxqDKRbq9ng3J19+e8fOA4YoTMQ=; b=nM9UfAqAqjbfX038sda8o1+98KMW/gJSKHtVmdbEfIelQVMXPW4QkPOrNItpqG/IUMpVes 6OHfIoNcigKsCwmRj3P0ua+HbfXGZliyGz2cIEZkBlM5/H+XOrJw1bK1us4B4cU9zqU2m1 TVss5rtQQg+iQ5tdGo4la02QQDnNimw0i1/QK46VHHpXG1MsJ8THaeRlTmkzO1pIUJ9u0X dLYbfPCDkFq5rTaFICS9sGaD8RMU0AojFpPQ9sLVaKwmFvUt1QhezKeDZ+k/Y7/tAWGykq LKhmA3VPQzQWQXHSDhGd9fVHyrgKvZ9nCeQgXIavoxis1bm96CVdhUFWg0O1+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClAYY6SyotThsffXwxqDKRbq9ng3J19+e8fOA4YoTMQ=; b=B9eloIu1qU3+A6HM4VH9EOhSxelLuXBKrBYihEAWH49wX+tsLg0sX119GkScgc/jPEZHs9 Jkn5kSq71iDORboNlhxdlnGsm4BfrP7IAl2XXQD7h4IuZd/0k1ar8Dp265RBqF7YtH1jWA XBE0KSRkCHoyeWSX/7jBTzNH+VGFnS/uJ1UsvSpT5Mq/KghYWEam1Smm1xBrc88/+tEYNv WgAJqK9AuOPs62yedvFdCE4jxaQ+STBysDTTsIOjavL9tqq0NAwN1v8jY8M4quTK3g+UGB 4wG14vIDWQhAGTxhZJjiK+4uv5g4pbkzyD5Z1fSMi/Zslujb6rlfIHhi3UBuTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412270; a=rsa-sha256; cv=none; b=oy030Hhnen11mf5z5zIFTsZZJKPThjV/WY6NI/cWmEXvaexQ5wTymG2c/FMw73cTEPGLCY 38QzzP7QjL/F3UmmIJJAAvGrTKMpjVaFZ2PRZz5rORgsYqY0MoONT8/SuIX3YSENpZ5GVt sInwwCH6ruNp4SdT3R1geFkcwhLNOdHf456FLOIYElytrP6fTd6uYg6Rn77OjDVgOenMNJ Y6zufHEXMA294/kJHKmU5dSIteLVGnHSvGK3Zu92RTQiUChbmx4bh6w4SVxGj/A2KeGBlI u0wcAPoWIOT4zdgYuTEm/luAksmKcExCFzeah9byHyO04Kgb2Q0qjUAFQz7XwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ6Q4sYJzfpm; Mon, 20 Jan 2025 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMVADU000331; Mon, 20 Jan 2025 22:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMVA8l000311; Mon, 20 Jan 2025 22:31:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:31:10 GMT Message-Id: <202501202231.50KMVA8l000311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1bcf8494d934 - stable/13 - ktls.4: note that security/gnutls now supports ktls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bcf8494d934bda897ca52e8dbbebec55e940e68 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1bcf8494d934bda897ca52e8dbbebec55e940e68 commit 1bcf8494d934bda897ca52e8dbbebec55e940e68 Author: Alan Somers AuthorDate: 2024-10-28 15:14:06 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:30:57 +0000 ktls.4: note that security/gnutls now supports ktls [skip ci] PR: 278083 Sponsored by: ConnectWise Reviewed by: diizzy Differential Revision: https://reviews.freebsd.org/D47310 (cherry picked from commit 7200d90644ba61d63e6fec33855bba5d3b7eb7bd) ktls.4: note that there are multiple openssl ports with KTLS knobs [skip ci] Reported by: "Herbert J. Skuhra" Sponsored by: ConnectWise (cherry picked from commit 1e4da42a36d5cf44bacf0e261626b69a4761f0cc) --- share/man/man4/ktls.4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index a2942544a5eb..b6e89f054bf7 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd May 26, 2021 +.Dd October 31, 2024 .Dt KTLS 4 .Os .Sh NAME @@ -229,8 +229,10 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa security/openssl-devel -port may also be built with support for +.Fa security/openssl* +and +.Fa security/gnutls +ports may also be built with support for .Nm by enabling the .Dv KTLS From nobody Mon Jan 20 22:33:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQ8k3VWgz5l3ng; Mon, 20 Jan 2025 22:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ8k2kZTz4NY7; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=kMIE77DoMkli0egqzTb2XBA+eYxzzL2745QfjvYdvKye866ZDc6ruCGWmj/jqykY403m4g XBfMl/iIeGce8Zdu2O7JWn/cfCdd6gofrf2u9Y7W3CsbPrxyPhrUzynOXdmriXMAD/waw/ VLsCJA7KbPV+2dHSAZ5PDSxCxAmRA4NqIiEaNrKhwDFKKxOkXXLOB/j/4VIpYz/OBmwRKq VZmlX4+i0ARpr5KSR3IpsclQGReEeaNnyMpnqHbBXSPxBevgWLiIodbCkb/S8v2ezD3Z6L CgL1aBlEv56IYGWn3uW3UOhvXeZBS9m9RvVNKQiJTLLi2Z+9hXVtPThUUjh0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GGkjC5Pj2ZaRZfpglaNsoUK5gj0PTLOxhX+p9isKfws=; b=VH4gX/blK56UIhtsAp3fAbgv091PT6qtMtbGCwyT+SVTJCtSbg0fWd/iR9tu45jpwpJgbY /TWKws59NFVg3694KsYQEtE0eThKZjUKzPgUr0ZBuSy8JEwP1bULtr1+HUTzjhIAVTwEGZ +inii79RnfGD5pXQGkPHHrX0GthCAG/y68uRLdFUEmvS21PBBkzt8tyaxoVZF4U3iBjQl4 JUnCcWkrB7xBe+TNYQtIJoF85JJKsQNlRR9MF21Uv9yfRhxDfdOZ//PI/EjVO22mVCZnTw 39FDdRN1d/5yA99dW4WxctG0gbkWgv5yP/1NV/EFt4K8OaWOd2XuUNV5yOvt9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412390; a=rsa-sha256; cv=none; b=vW3L1jhGBsAn3dLZBanNm1HFp4WdP/4x0ou+qGeyLF/FHPCsxKietV1yw0/griHfdD3VXN 8W+UABmgDGq08PaEs5r4z/6sVvx8u2j7/6GkuHsm0KY/WNY9M7GugExPaUR5pEimL7XToJ RFleMCKDAy2mueY/eSZd6/dxaxvdLIIdiMSsaFXbsaGWpwU8cQtUP1uep4d4Ul+ErEeCWl QvrShdtFubv7BTNZ/kIJembJwcFK2HjGqliHNwVBMIxNJqIzM8+xwjb3t356pCzfJiQQMl RSHkRMamnCmNX7r9sKIgUVqovg2MyXcE5P22V8Srr45hA2HdmBw7wr8EFdqkhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ8k276pzgRW; Mon, 20 Jan 2025 22:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMXAqx006278; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMXAbL006275; Mon, 20 Jan 2025 22:33:10 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:33:10 GMT Message-Id: <202501202233.50KMXAbL006275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 2b4a45992a04 - stable/13 - fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b4a45992a043459ab0d63410059822a2efb6045 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4a45992a043459ab0d63410059822a2efb6045 commit 2b4a45992a043459ab0d63410059822a2efb6045 Author: Alan Somers AuthorDate: 2024-12-13 14:00:20 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:31:29 +0000 fusefs: FUSE_NOTIFY_INVAL_* must busy the mountpoint Unusually, the FUSE_NOTIFY_INVAL_INODE and FUSE_NOTIFY_INVAL_ENTRY messages are fully asynchronous. The server sends them to the kernel unsolicited. That means that unlike every other fuse message coming from the server, these two arrive to a potentially unbusied mountpoint. So they must explicitly busy it. Otherwise a page fault could result if the mountpoint were being unmounted. Reported by: JSML4ThWwBID69YC@protonmail.com (cherry picked from commit 989998529387b4d98dfaa6c499ad88b006f78de8) --- sys/fs/fuse/fuse_device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 88ebe702ec0a..7b163bc04bc2 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -440,7 +440,6 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); - mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { SDT_PROBE2(fusefs, , device, trace, 1, @@ -543,6 +542,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) } else if (ohead.unique == 0){ /* unique == 0 means asynchronous notification */ SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + mp = data->mp; + vfs_ref(mp); + err = vfs_busy(mp, 0); + vfs_rel(mp); + if (err) + return (err); + switch (ohead.error) { case FUSE_NOTIFY_INVAL_ENTRY: err = fuse_internal_invalidate_entry(mp, uio); @@ -567,6 +573,7 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag) /* Not implemented */ err = ENOSYS; } + vfs_unbusy(mp); } else { /* no callback at all! */ SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, From nobody Mon Jan 20 22:34:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQ9h4f5Cz5l3XC; Mon, 20 Jan 2025 22:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQ9h44nGz4NrV; Mon, 20 Jan 2025 22:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EcxDoGDWQnoGaG8omec9RCot2a5QA73F58v44rQOsMg=; b=IaT6wNZzuONk08HOuaXAOjZqdl0a5SyyZKR+eeTeZSBrK8mXkqNAq13ZrxL4wvaGV/j/b8 uS+a+z+LAdsciUFh8a5snMiaRe4GREI666SCEjweWuszwWvwQA2Js2NgTOHB0nZP5ZbfDf NAjIqWip/oLvtBYm1t4mbdn5UqXnOODYOP9vMnQaAM7Ra/oWiIGJOy96ww1S1tvUQTJxnQ TKhAbqPMY+lUKE59GT78ALmjoEG6nUdPlOKnEXnpWfEJq14DnoCyhEoGaybWlxws0gh6kv yXQLvZqb5e0nYpt0qTl8jcEYIRAlob2M+KdB3jFPrn6A1NFWK60CKqAwWYi7kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EcxDoGDWQnoGaG8omec9RCot2a5QA73F58v44rQOsMg=; b=EjgJ4exgcyMUC+B6Rs8KxGEk5sHy3U7MureXE0aSLZ9zJ5lmMPmGF9yhuuTBPbNi4nsixb cIsqzR4k+PnNb+RdTAGMsqoxI6xFpHVfnSijdr3V2UtFoJDw/nETdasnvfaoq9Gjygx3+e 27Cm0+PebsB5pOc1KrlReTTfJxvy3OnY2OgATHAlqxDRj4WQ21Hsu+X+0s/iCPkX3s6Q19 jBJNEn3SnkPJ0yDCh4VqyZFDGnYgvyXtZggssAS/gQEcqdUYrxNWXxKHrcmvQjriEsNxqf tz4YZ8SAfhFZHTz2wocsMJryGBgWHhqrcKHCxPAwv2NuKhlwrZhGLRv33X3N/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412440; a=rsa-sha256; cv=none; b=G0+XByU3bOIv3WpSwFC7qf1R5JlnEDAKVuRd8QAPcVtG91bSZEU4XWN9ZPdv+XJoWCYaEJ c6IucZfm3/+kqOi9Sx2LE+q95E+dXvytUGbioYw3d8adYqYXB45M4jTFrTfq9EgX8ZeDpJ W59VpAX5w/yK1HhdQ8cSMxU2Oyqv6uHh7dYyswORcxV9IX8qFG7wR9shSnhGGZ+ng5uG2U RLjC0hOEmvK6oV7gkWaU0toP+lee5dNhGjlPVnz42sP2+xs45m1fQHh4vNu6Pc5Z4O3dV8 NnUzlSxjQW0HJ5FM9l4Fcg5T8/XiI/PJSSLh0v9TL+ZmEV8EeUba6RS6a518rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQ9h3hJYzflT; Mon, 20 Jan 2025 22:34:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMY0jk006666; Mon, 20 Jan 2025 22:34:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMY0K8006663; Mon, 20 Jan 2025 22:34:00 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:34:00 GMT Message-Id: <202501202234.50KMY0K8006663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 4ded81daacec - stable/13 - namei: add more detail about LOCKSHARED's behavior List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 commit 4ded81daacec72e16da6cdb64bde8edd4a8fe0e4 Author: Alan Somers AuthorDate: 2024-12-17 20:10:57 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:33:53 +0000 namei: add more detail about LOCKSHARED's behavior [skip ci] Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48125 (cherry picked from commit 22bb70a6b3bb7799276ab480e40665b7d6e4ce25) --- share/man/man9/namei.9 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 8890abedcc59..9e60985a4965 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -31,7 +31,7 @@ .\" If you integrate this manpage in another OS, I'd appreciate a note .\" - eivind@FreeBSD.org .\" -.Dd May 23, 2015 +.Dd December 17, 2024 .Dt NAMEI 9 .Os .Sh NAME @@ -124,7 +124,6 @@ Lock vnode on return with unless .Dv LOCKSHARED is also set. -The .Xr VOP_UNLOCK 9 should be used to release the lock (or @@ -153,8 +152,20 @@ and .Xr vrele 9 . .It Dv LOCKSHARED Lock vnode on return with -.Dv LK_SHARED . -The +.Dv LK_SHARED , +if permitted by the file system that owns the vnode. +The file system must explicitly permit this by setting +.Dv MNTK_LOOKUP_SHARED +in +.Dv mp->mnt_kern_flag +during mount and by calling +.Fn VN_LOCK_ASHARE +when allocating the vnode. +If +.Dv LOCKLEAF +is specified but shared locking is not permitted, then the vnode will be +returned with +.Dv LK_EXCLUSIVE . .Xr VOP_UNLOCK 9 should be used to release the lock (or From nobody Mon Jan 20 22:36:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQDD1xXkz5l40p; Mon, 20 Jan 2025 22:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQDD1Gs9z4PNb; Mon, 20 Jan 2025 22:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8cOFrXr9SzMMm2vTufQEs4PLbdIMo3IL2MuEB9+RRg=; b=TAQ/Ak2HhWJVJAMMpFOMMAvttGeqYHXNw1SJhSekeF4/VDg6HuOi8X9cT+m89lX/e9NhA8 fUQrFrJlVZ/Kt9gpd4P1xaz6wAEFMjTQghJQhi1LQFeTiqKfEKF97wzJke8We+csCAA1jF 0zBf0gUcWpeYBAVGbgM5DpwaU/hvP/Dfr2Km813KjPlQfFxpNAWYJSLrLtPGn9p+ZF0fWv 37b8ahAO/ru8j95FQszk5oqZkpEqxdfkepCwBrB/y9e5d3xDMmAnVm+otN+Gar6nJCNM/6 0/+TnGln0OiTrxKIZUKU3PNXVgjOjJIYKklWoJ5MV1tUIZ2a0yZD3AxgjqZ7dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8cOFrXr9SzMMm2vTufQEs4PLbdIMo3IL2MuEB9+RRg=; b=yjprEesQzbVKGn7/VBhuInuj6dzjK+dYZ8sJxNHQclSkfkcv/D7oXhGNkbFliM7ip9ZyAD CBZQ2TwASwBmo990yquuuJaXDHz1ZGZghI99P38CyXUYTkS0ZCvd2PmAklydV+he+rjnNJ 8SyAQRoNjM7nJx62UXf9EYtEBjUZWsJLIkviJ32jGWwTdyGGXaAI+epR2tAaiMF6F87eBf LMBW3Wxr+iuiVCpg+EPFgnHKak6JdAZewKm+Q8/8AstbzVXXlNyhv0eg9DlJGZnNS+P9AX vxc5Vtzkhh77eD3voZhlClCVs07EcHD5AaklDMCon1uY2iRl4l41zz6D6xgQlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412572; a=rsa-sha256; cv=none; b=Mjwln21aGXQ/ApHcf5+hv8kGOYBUNjRKO1mpV9+DPqR/m96yqISkFL0OMiyIhYgX6PDeZW /tvu4Czdhid9LVG+2i1KK4/Odn0v0ueLIqG/TWfFD8yNy3lHpXK5M4cCRQFbK4OZkdvnwO ul0lRoZiivudrupbJs6a7DimGGNCz0Di51efNhe2wVOG8SurlmQ2jicm65aCq9bxE2qWDU c/l7rogIfZKG+xOKZj5/Rvd3N4C/oP34vzjKdcACRHIPuUBGhFcsaYBEmRfZg+0jrBYmsY R/h7ATKiLzbfFwYuyNN55WW+wFvdOOB7cWuMt/kpomFm75U5HpPI4ksnQwgr9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQDD0s5tzgDl; Mon, 20 Jan 2025 22:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMaCCW007404; Mon, 20 Jan 2025 22:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMaCdQ007401; Mon, 20 Jan 2025 22:36:12 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:36:12 GMT Message-Id: <202501202236.50KMaCdQ007401@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 039609b04d63 - stable/13 - fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 039609b04d63f2e597d70fec66915a766834e81c Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=039609b04d63f2e597d70fec66915a766834e81c commit 039609b04d63f2e597d70fec66915a766834e81c Author: CismonX AuthorDate: 2024-11-02 20:19:15 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:34:18 +0000 fusefs: ignore FUSE_NO_OPEN(DIR)_SUPPORT flags The FUSE_NO_OPEN_SUPPORT and FUSE_NO_OPENDIR_SUPPORT flags are only meant to indicate kernel features, and should be ignored if they appear in the FUSE_INIT reply flags. Also fix the corresponding test cases. Reviewed by: Alan Somers Signed-off-by: CismonX Pull Request: https://github.com/freebsd/freebsd-src/pull/1509 (cherry picked from commit f0f596bd955e5b48c55db502e79fc652ac8970d3) --- sys/fs/fuse/fuse_file.c | 9 +++------ sys/fs/fuse/fuse_internal.c | 4 ---- sys/fs/fuse/fuse_ipc.h | 2 -- sys/fs/fuse/fuse_vnops.c | 17 ++++++++--------- tests/sys/fs/fusefs/open.cc | 38 ++------------------------------------ tests/sys/fs/fusefs/opendir.cc | 27 ++------------------------- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/sys/fs/fuse/fuse_file.c b/sys/fs/fuse/fuse_file.c index ecaa641a9261..22fc283e263c 100644 --- a/sys/fs/fuse/fuse_file.c +++ b/sys/fs/fuse/fuse_file.c @@ -123,7 +123,6 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_filehandle **fufhp, struct thread *td, struct ucred *cred) { struct mount *mp = vnode_mount(vp); - struct fuse_data *data = fuse_get_mpdata(mp); struct fuse_dispatcher fdi; const struct fuse_open_out default_foo = { .fh = 0, @@ -133,12 +132,10 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, struct fuse_open_in *foi = NULL; const struct fuse_open_out *foo; fufh_type_t fufh_type; - int dataflags = data->dataflags; int err = 0; int oflags = 0; int op = FUSE_OPEN; int relop = FUSE_RELEASE; - int fsess_no_op_support = FSESS_NO_OPEN_SUPPORT; fufh_type = fflags_2_fufh_type(a_mode); oflags = fufh_type_2_fflags(fufh_type); @@ -146,12 +143,11 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, if (vnode_isdir(vp)) { op = FUSE_OPENDIR; relop = FUSE_RELEASEDIR; - fsess_no_op_support = FSESS_NO_OPENDIR_SUPPORT; /* vn_open_vnode already rejects FWRITE on directories */ MPASS(fufh_type == FUFH_RDONLY || fufh_type == FUFH_EXEC); } fdisp_init(&fdi, sizeof(*foi)); - if (fsess_not_impl(mp, op) && dataflags & fsess_no_op_support) { + if (fsess_not_impl(mp, op)) { /* The operation implicitly succeeds */ foo = &default_foo; } else { @@ -161,7 +157,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, foi->flags = oflags; err = fdisp_wait_answ(&fdi); - if (err == ENOSYS && dataflags & fsess_no_op_support) { + if (err == ENOSYS) { /* The operation implicitly succeeds */ foo = &default_foo; fsess_set_notimpl(mp, op); @@ -175,6 +171,7 @@ fuse_filehandle_open(struct vnode *vp, int a_mode, goto out; } else { foo = fdi.answ; + fsess_set_impl(mp, op); } } diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index adf84d30e801..9f47d960d050 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -1012,10 +1012,6 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) data->dataflags |= FSESS_POSIX_LOCKS; if (fiio->flags & FUSE_EXPORT_SUPPORT) data->dataflags |= FSESS_EXPORT_SUPPORT; - if (fiio->flags & FUSE_NO_OPEN_SUPPORT) - data->dataflags |= FSESS_NO_OPEN_SUPPORT; - if (fiio->flags & FUSE_NO_OPENDIR_SUPPORT) - data->dataflags |= FSESS_NO_OPENDIR_SUPPORT; /* * Don't bother to check FUSE_BIG_WRITES, because it's * redundant with max_write diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 0ec556138be0..5648624f4c63 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -227,8 +227,6 @@ struct fuse_data { /* (and being observed by the daemon) */ #define FSESS_PUSH_SYMLINKS_IN 0x0020 /* prefix absolute symlinks with mp */ #define FSESS_DEFAULT_PERMISSIONS 0x0040 /* kernel does permission checking */ -#define FSESS_NO_OPEN_SUPPORT 0x0080 /* can elide FUSE_OPEN ops */ -#define FSESS_NO_OPENDIR_SUPPORT 0x0100 /* can elide FUSE_OPENDIR ops */ #define FSESS_ASYNC_READ 0x1000 /* allow multiple reads of some file */ #define FSESS_POSIX_LOCKS 0x2000 /* daemon supports POSIX locks */ #define FSESS_EXPORT_SUPPORT 0x10000 /* daemon supports NFS-style lookups */ diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index aa44366ccb95..79317e4e4cd2 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -1961,10 +1961,9 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); if (err == EBADF && mp->mnt_flag & MNT_EXPORTED) { - KASSERT(fuse_get_mpdata(mp)->dataflags - & FSESS_NO_OPENDIR_SUPPORT, - ("FUSE file systems that don't set " - "FUSE_NO_OPENDIR_SUPPORT should not be exported")); + KASSERT(!fsess_is_impl(mp, FUSE_OPENDIR), + ("FUSE file systems that implement " + "FUSE_OPENDIR should not be exported")); /* * nfsd will do VOP_READDIR without first doing VOP_OPEN. We * must implicitly open the directory here. @@ -3118,21 +3117,21 @@ fuse_vnop_vptofh(struct vop_vptofh_args *ap) return EOPNOTSUPP; } if ((mp->mnt_flag & MNT_EXPORTED) && - !(data->dataflags & FSESS_NO_OPENDIR_SUPPORT)) + fsess_is_impl(mp, FUSE_OPENDIR)) { /* * NFS is stateless, so nfsd must reopen a directory on every * call to VOP_READDIR, passing in the d_off field from the - * final dirent of the previous invocation. But without - * FUSE_NO_OPENDIR_SUPPORT, the FUSE protocol does not + * final dirent of the previous invocation. But if the server + * implements FUSE_OPENDIR, the FUSE protocol does not * guarantee that d_off will be valid after a directory is * closed and reopened. So prohibit exporting FUSE file - * systems that don't set that flag. + * systems that implement FUSE_OPENDIR. * * But userspace NFS servers don't have this problem. */ SDT_PROBE2(fusefs, , vnops, trace, 1, - "VOP_VPTOFH without FUSE_NO_OPENDIR_SUPPORT"); + "VOP_VPTOFH with FUSE_OPENDIR"); return EOPNOTSUPP; } diff --git a/tests/sys/fs/fusefs/open.cc b/tests/sys/fs/fusefs/open.cc index 7ab3aeb6ba2a..e80d1aa2a393 100644 --- a/tests/sys/fs/fusefs/open.cc +++ b/tests/sys/fs/fusefs/open.cc @@ -70,14 +70,6 @@ void test_ok(int os_flags, int fuse_flags) { } }; - -class OpenNoOpenSupport: public FuseTest { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPEN_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * fusefs(5) does not support I/O on device nodes (neither does UFS). But it * shouldn't crash @@ -281,37 +273,11 @@ TEST_F(Open, o_rdwr) } /* - * Without FUSE_NO_OPEN_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Open, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - int fd; - - FuseTest::expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_OPEN && - in.body.open.flags == (uint32_t)O_RDONLY && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).Times(1) - .WillOnce(Invoke(ReturnErrno(ENOSYS))); - - fd = open(FULLPATH, O_RDONLY); - ASSERT_EQ(-1, fd) << strerror(errno); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPEN_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPEN, then it and subsequent FUSE_OPEN and FUSE_RELEASE operations will * also succeed automatically without being sent to the server. */ -TEST_F(OpenNoOpenSupport, enosys) +TEST_F(Open, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; diff --git a/tests/sys/fs/fusefs/opendir.cc b/tests/sys/fs/fusefs/opendir.cc index dd837a8d43c1..e1fed59635fc 100644 --- a/tests/sys/fs/fusefs/opendir.cc +++ b/tests/sys/fs/fusefs/opendir.cc @@ -71,13 +71,6 @@ void expect_opendir(uint64_t ino, uint32_t flags, ProcessMockerT r) }; -class OpendirNoOpendirSupport: public Opendir { - virtual void SetUp() { - m_init_flags = FUSE_NO_OPENDIR_SUPPORT; - FuseTest::SetUp(); - } -}; - /* * The fuse daemon fails the request with enoent. This usually indicates a @@ -179,27 +172,11 @@ TEST_F(Opendir, opendir) } /* - * Without FUSE_NO_OPENDIR_SUPPORT, returning ENOSYS is an error - */ -TEST_F(Opendir, enosys) -{ - const char FULLPATH[] = "mountpoint/some_file.txt"; - const char RELPATH[] = "some_file.txt"; - uint64_t ino = 42; - - expect_lookup(RELPATH, ino); - expect_opendir(ino, O_RDONLY, ReturnErrno(ENOSYS)); - - EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); - EXPECT_EQ(ENOSYS, errno); -} - -/* - * If a fuse server sets FUSE_NO_OPENDIR_SUPPORT and returns ENOSYS to a + * If a fuse server returns ENOSYS to a * FUSE_OPENDIR, then it and subsequent FUSE_OPENDIR and FUSE_RELEASEDIR * operations will also succeed automatically without being sent to the server. */ -TEST_F(OpendirNoOpendirSupport, enosys) +TEST_F(Opendir, enosys) { const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; From nobody Mon Jan 20 22:41:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQLS14Kbz5l3w2; Mon, 20 Jan 2025 22:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQLS0c51z4PqL; Mon, 20 Jan 2025 22:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmIMeodK1dhZEBu7RSPwC+mzxNYJRGA2Hk/abyZsSGA=; b=S2KU0/W4OaHMUIa5QM62THenaaKN3atx2ZmClFktK0FQxFyfmo2zarzo48fDZjISXNG0nr coYQ7k7wXFG6TKFgN9MIHXX0QzT04VpBMzo9lP2RDvd8jdY9IJ0iqsG+/ul7MdupF27P8S w8jXndKppNhVLzQwX/PL5DIcIOfnVpHI1B/UysVZAjVpVBJmOJuU05agCMyhn6qBLbnDft UJQFgyFSXtMN0AZlxAkWQ39qIduwL67TpQKX5d+WcWYY479mf0oeYfUWLLgxDK/gg6AI5Y IRbJ1acBgBjPTgZ6rudwkO43dOqf/lD6DO93YjGIASmrsIdjokftBjDQBOVuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dmIMeodK1dhZEBu7RSPwC+mzxNYJRGA2Hk/abyZsSGA=; b=JLs9qnmyTbXhTj4NSmTt3+rg56/M//E550MpXr7vX/U5/gTFpGwMZDhbWwJX1MTSYseUYX KssSr/NqtJR8y9OEhaRcAzVGpQMF8S/q8eXrXA84XKavNBYsr7x73yR18jWipSwk/B1lP8 ubMTOcI3S5oAOiOmy38Il5O0g2AwAkwRMzYHpiSFyXgJfKZx2624EVU+vaV+AE7YR29F8u Pey1MDQWjO7R04Elnclr9aCZzCw6rThR7mfLodhgazPR1JIX9N2CHAc4mqRaRk3tokNjJ2 PqDWePkXYCyaFanNtkNybalr0cM2VcNwB2J+9L+jmTHZv0/XqR33sQ9XVchk9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412896; a=rsa-sha256; cv=none; b=DdLOH/eGvDivRg8E4q+epncXspeVlGiENTwf7JZNx8sUviGf+onaN0gn51TNxvj1TtA0G2 WoOS0cjiT6ihnkUgipzX1K72yBlVGJLVxFQdLD2HWR3CB4ORBWovvGzkCh68q/udanZASf Ulo1jMts95CYe1srFDUIlVa6zOtcjobJUyfrzYS2/XTl0JD6XJL25wsZ3vXG0pgE2Ug5RG L2l/S80ao1rFFBHVWwAH4ChiljFgMIbdc4PgQyb2omkuuJZigT5sdyKGHxN5STDUZc1JGX moFmgU1mtCfhOKtP27weCXR6EB4MyMKpTGuqItOHXDS0+obe0w7vxQzoRD6hbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQLR70v5zgX6; Mon, 20 Jan 2025 22:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMfZS8020836; Mon, 20 Jan 2025 22:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMfZf7020833; Mon, 20 Jan 2025 22:41:35 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:41:35 GMT Message-Id: <202501202241.50KMfZf7020833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: e8a272048a0f - stable/13 - fusefs: fix a memory leak List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e8a272048a0fc9f558c7788dd06b0159b56c4585 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a272048a0fc9f558c7788dd06b0159b56c4585 commit e8a272048a0fc9f558c7788dd06b0159b56c4585 Author: Alan Somers AuthorDate: 2024-12-23 20:26:11 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:36:27 +0000 fusefs: fix a memory leak Fix a leak of a fuse_ticket structure. The leak mostly affected NFS-exported fuse file systems, and was triggered by a failure during FUSE_LOOKUP. Sponsored by: ConnectWise (cherry picked from commit 969d1aa4dbfcbccd8de965f7761203208bf04e46) --- sys/fs/fuse/fuse_vfsops.c | 2 +- tests/sys/fs/fusefs/nfs.cc | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 858fd768cb1d..156e7b288c85 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -566,7 +566,7 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) error = fdisp_wait_answ(&fdi); if (error) - return error; + goto out; feo = (struct fuse_entry_out *)fdi.answ; if (feo->nodeid == 0) { diff --git a/tests/sys/fs/fusefs/nfs.cc b/tests/sys/fs/fusefs/nfs.cc index 79fead8e77cb..27ffc8f5cbc1 100644 --- a/tests/sys/fs/fusefs/nfs.cc +++ b/tests/sys/fs/fusefs/nfs.cc @@ -144,6 +144,36 @@ TEST_F(Fhstat, lookup_dot) EXPECT_EQ(mode, sb.st_mode); } +/* Gracefully handle failures to lookup ".". */ +TEST_F(Fhstat, lookup_dot_error) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino = 42; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.attr.mode = mode; + out.body.entry.nodeid = ino; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino, ".") + .WillOnce(Invoke(ReturnErrno(EDOOFUS))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + ASSERT_EQ(-1, fhstat(&fhp, &sb)); + EXPECT_EQ(EDOOFUS, errno); +} + /* Use a file handle whose entry is still cached */ TEST_F(Fhstat, cached) { From nobody Mon Jan 20 22:42:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcQM500Nnz5l3w5; Mon, 20 Jan 2025 22:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcQM46V99z4QD3; Mon, 20 Jan 2025 22:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4EVGgSfJrXYEJjWMBdevhoKKYo9z9tCdNwBn2Qxboo=; b=xFioA5yFXI7dbWDUsRCJjUms/3VbZi8NDkYamKodjP0PpfPrAsO2tnINuIPA9ksVc9E5y0 K4CaWfuWFy6en4rAXcT6/2UL0ZIgDeNlRhGdyZVUUNtPXeJ4KjpnQWsjyRvHXFX/5U8Xx/ usj6IgH4Qqh/tGF/U6rXGAfP7wlvGKkHzojRTlH/yuczmWvjc3vlSkc2C/iXl/ptOiWGJH ctBy48L1GpjzZt7/2XMQ0b01UIZ2J1UwKG7qAICQ4dLEi33K/orscmIAeRzstvQHF4TXG6 HI7k+oVGuO7kJccMnwNGJQoBn5EU43eK7syHIP8VSuhgn5moFppcFdkUUUEbkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737412928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4EVGgSfJrXYEJjWMBdevhoKKYo9z9tCdNwBn2Qxboo=; b=MbZy3DvbHD7A5U48jwvvuXYxlJI1YmHC0El8o5baHAHSPwLtFmPJI7h3MX3mqOGj3lfCKK onnJkB0NdIvfbmNvPoIN93wMwWDAJFDxTvs67HGzvvMYoR5ZVbJA2gTS26hvFKMntk9Pdm C7xnwe3mN2e29RNNazXzNwSFwUCgQjTmUlOnmMcbYpxxZg6S8jskUYsfv03RQsx/mlaF+s FKbwD5F8lx4KsoVwWtEQT2A5iJsKQ9raHxjFL9jBhsPmzUVZwLa2iC4f1K0UnOpTUtwjv0 FZ4qJ6XzHZ0kqE6zJ6hpc/ewnY/DXW4F0MVcmq4014cjmWTf+bHX4j18rF6Pnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737412928; a=rsa-sha256; cv=none; b=n/D0Oc1pU96/a5obweksQsGJldLX2TlS0ixST1jarWVYtZLRVmgtVXHOIgfWCt6NwoqB9f dAZnZkDMmOvniwVY1ZQP85oY/M9hU/9i5wz3yDNZ9Slvmpk8iKkjTIjF/8IL9cnV0m1fGb qGfZvFylZuCfIu/IO2MKsRUfD7PMrQga7rqD0OKc7/hQ1Qdu3bWRwOHET3M98vV/elVzfP TX6P6Ba/sfDn98zvSNP6Fu8vvYuXPcWbnEQdDqiUOY5c3YvYg5ZWOhVW3NGGiYmajvr26z km4AZrAK217Zg4GIjtoFDbDsmEI17S/thA/OpSA0RKcTkm4NRmc5UwdmOuqkPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcQM463bhzgXV; Mon, 20 Jan 2025 22:42:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KMg8TZ022069; Mon, 20 Jan 2025 22:42:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KMg8lX022066; Mon, 20 Jan 2025 22:42:08 GMT (envelope-from git) Date: Mon, 20 Jan 2025 22:42:08 GMT Message-Id: <202501202242.50KMg8lX022066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 1486bb0bfcac - stable/13 - Fix lib/libc/nss/getgr_test with large numbers of groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 commit 1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2 Author: Alan Somers AuthorDate: 2024-12-31 20:41:01 +0000 Commit: Alan Somers CommitDate: 2025-01-20 22:41:52 +0000 Fix lib/libc/nss/getgr_test with large numbers of groups These tests create a linked list with one entry for every group on the running system. On a system with about 30,000 groups, the test took 69 seconds to run, and crashed Kyua with the below error: kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db). Fix the test by limiting it to operating on the first 1024 groups. Apply the same change to getpw_test and getserv_test too, which are vulnerable to the same problem. Sponsored by: ConnectWise Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48275 (cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd) --- lib/libc/tests/nss/getgr_test.c | 4 ++++ lib/libc/tests/nss/getpw_test.c | 4 ++++ lib/libc/tests/nss/getserv_test.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 28c5e2e98028..f3aef0e1abd1 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -294,6 +294,8 @@ group_fill_test_data(struct group_test_data *td, int (*cb)(struct group *, void *)) { struct group *grp; + const int limit = 1024; + int count = 0; setgroupent(1); while ((grp = getgrent()) != NULL) { @@ -304,6 +306,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 7525cd28b962..94b8b9373272 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -241,6 +241,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -251,6 +253,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index d74feb113a69..d7fce475d70d 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -284,6 +284,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -291,6 +293,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent(); From nobody Mon Jan 20 23:47:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcRpf5mGrz5l8SS; Mon, 20 Jan 2025 23:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcRpf4rPvz3GfQ; Mon, 20 Jan 2025 23:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVup1r7b/fcWwG9Td+8a/46eodCLgXMimZf6mggKx8M=; b=YFybtysp3Yw5jxvZ+txcSkF/jQmp/2La0E+lwkktDllWd3r0f08Ri49jLTkMEaZD4o1z9b o0Q5uMEcoyRZUqQGYz+smPNN+uDEaC4hCKcEnYsAZloASrlGXXb+PITnTogx4LLamxxwpY ENfYg+pyHHqGBrfD7YDby4F+CJqkGkTb5KEPMA5iYcQ2z441Bja+hSDTYxNFjMC5Jb0qEx K60Qx/9wa16AW0EavA3ogZaKOuxXdb0mdJOxVxb12RHX7jkMQMw4NqFWGfHMRAnkIMZgMf B2bfC34j+xQSocgeGDk0k0NKmIFvqmF9b4eg5MNMXvixQGQQwbBW0P+pAFJBbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVup1r7b/fcWwG9Td+8a/46eodCLgXMimZf6mggKx8M=; b=btzSbTYLoRIXpGCgeJCmXnGazzYxkxr0oAlPosQKmkoBR6v+Ruqdr6Q/bkDcTgO3KoJLSK KbwPkHLgN4YRGFHVApsoyF873Q3Ep8QGNyMS4WYOURpKmpbnjOMgl6tFKPlbpJIapwduYQ 7ocpNgclrEwzAakbwyAJcgdjjUCXXMAUZMvc1JYV16EUOXeWYvnCv8XO/YfZqMS4jY3+Zq ipb3EfbDJSt0M5YbxXAkpMV/KrBdFDUS9KZh8R7+5tVEHzVkj1a4epRS68e+TPMW97Apzx yfjhdrcKZinYYtoovDOTSRkKSQz9rKjvXJoL/xMYIgJfTTS+OcYeBcxsOTXG7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737416858; a=rsa-sha256; cv=none; b=wM2y8yFxy+hu9tiNQ3hmjlI5MPutZTZCI7/mD6RVwf92YcxtnvHDvAfIpc9o/xGBXcmQH9 6KAAkZDFJWPB9za1KvJIH1bcLDJISqaNfb8GgZ5jZGJCZoBnv/89+rypF+kNJW/Y02ay4e 2RNmPHDQWgJSApyRi99V0NtkY7LYL7BNyKr2k0e4XJfmW5LeYom8sHW1F1Kj1J0PxArJl7 2tMgPVVe+2vwy3D7crvfLL7lpwnaKiWzOO8shsQ3EeLGlqSSALe8WJpTArwqRr8gq3cfhB zZEk4/q4V87YsJb26pHruAsGTkzunBLGHYJscjKCgIr8ldGw1TYXq/HF+/yBkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcRpf43QVzj48; Mon, 20 Jan 2025 23:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KNlcj9038488; Mon, 20 Jan 2025 23:47:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KNlcNP038485; Mon, 20 Jan 2025 23:47:38 GMT (envelope-from git) Date: Mon, 20 Jan 2025 23:47:38 GMT Message-Id: <202501202347.50KNlcNP038485@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: 86bfbaf1002c - main - sys: add MBIM (mobile broadband interface module) interface type. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 86bfbaf1002c88b5c1a6d3ed261becedb533490b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=86bfbaf1002c88b5c1a6d3ed261becedb533490b commit 86bfbaf1002c88b5c1a6d3ed261becedb533490b Author: Adrian Chadd AuthorDate: 2025-01-20 23:39:17 +0000 Commit: Adrian Chadd CommitDate: 2025-01-20 23:39:17 +0000 sys: add MBIM (mobile broadband interface module) interface type. This is part of the upcoming USB umb(4) work. Differential Revision: https://reviews.freebsd.org/D48167 Approved by: adrian, zlei Sponsored by: FreeBSD Foundation PR: kern/263783 Submitted by: Pierre Pronchery --- sys/net/if_types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_types.h b/sys/net/if_types.h index b0692af69308..1d17e5c09813 100644 --- a/sys/net/if_types.h +++ b/sys/net/if_types.h @@ -254,6 +254,7 @@ typedef enum { IFT_PFLOG = 0xf6, /* PF packet filter logging */ IFT_PFSYNC = 0xf7, /* PF packet filter synchronization */ IFT_WIREGUARD = 0xf8, /* WireGuard tunnel */ + IFT_MBIM = 0xf9, /* Mobile Broadband Interface Model */ } ifType; /* From nobody Mon Jan 20 23:47:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcRpg6HgJz5l869; Mon, 20 Jan 2025 23:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcRpg4MKqz3GcF; Mon, 20 Jan 2025 23:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSYVB41Y4MDJO/CmBvGIMU+KjL8V3qRI4Y721E2KVs4=; b=IPH4uN5XeSEbuOBIpbhEExYtLNnq54xWRrDYWolwkeunLMt9ZcUsu/exXdSHgsv0B9vyRn P8mpV6Jk4YASdN3+tNFdHT0Ux0hcMS6rDm7gmXUCOS6gMmRB/OR476cgNx/3TStTQDtXU3 W5PjCaY+cpH1MOYq2a3UWmZ8IK7WyZ+4MpUOC2rktNhnbhDlLGZMv13yimVeA+l7upZCty K0yY/cTOq4iHhlk2nlIK4A4HIvphaKpoQB+YB/3WudwKInONV5qlmNFfTNirQGUtfzECPk HPr6q6HMxaQQGqs7kiW7bqGBR7Gaj8+SDOlbFDu3nzh1ryEWQXU8pzbjh/5ToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qSYVB41Y4MDJO/CmBvGIMU+KjL8V3qRI4Y721E2KVs4=; b=DuSfM+glXScsrgSZbzsh+ajqheKntZ/lySo1mN80pUGCdg6ygyvQkeXvegv4LhVy0CHZI0 +f/Gdtjb9sztMBsJnhA+n2IuE3dxgIiLcsvncRief8ZY31CLqsqV8+kXnE1QKsyiYTyUc/ TXznSAjaTU4/7SHsTpQGV+McWdzhxcH9TS5ylHeaD5ViiKnp+k7CeEl5FBQbYFvsDiJAT7 Gz4DlFU4ZBNa2jaApRxraOg3VKvAOLu7UayH8l0KC7WDA89EOhhtWf+UCAUJbE/P1jUGFD MX70c1vWIuaYBNPHRMJOyL9uvMfW9WgDwJhO6vCOH1Uh1pFcHfSCyX/JWAobAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737416859; a=rsa-sha256; cv=none; b=i5VXNFji/YZes77fexmIXUnkCXN3KKeHttwLgWA6ElRIrRDj/QNo4kzvnMT7Lim8TW8Ni8 1uXHDPlLFETm9gqrotN+4qDT8Su6EuJ74yoT36HnG4IRX12h2FzBx+0hLXGMzQgP2274Vk 8ijQoiAyN/68eL8EWx742ENo8xhlnaLQBNrusVzNZsip5GsmH5364ANiiu9zF2y7quxgW1 qjoJK3vPB0riFOIrqO6C18cuRcexFxxLNY0IkFw4tOEFhRVe7nhoYyEsqUYPOmKo8FxE5F 0wObHy8oud6iKd2j/KdafGeSY4QKVC5BSzzJ2oWnz7YZcnmZUCr0IEdt9bq7lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcRpg3wrszhwF; Mon, 20 Jan 2025 23:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KNldta038529; Mon, 20 Jan 2025 23:47:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KNldbq038526; Mon, 20 Jan 2025 23:47:39 GMT (envelope-from git) Date: Mon, 20 Jan 2025 23:47:39 GMT Message-Id: <202501202347.50KNldbq038526@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: e5f3620a3e12 - main - sys: add MBM device ioctl() values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: e5f3620a3e12c0febab7e4125da526c59a5a195b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=e5f3620a3e12c0febab7e4125da526c59a5a195b commit e5f3620a3e12c0febab7e4125da526c59a5a195b Author: Adrian Chadd AuthorDate: 2025-01-20 23:44:03 +0000 Commit: Adrian Chadd CommitDate: 2025-01-20 23:44:03 +0000 sys: add MBM device ioctl() values This is part of the upcoming USB umb(4) work. It implements the control ioctl(4)s that MBM devices will need to implement. Differential Revision: https://reviews.freebsd.org/D48167 Approved by: adrian, zlei Sponsored by: FreeBSD Foundation PR: kern/263783 Submitted by: Pierre Pronchery --- sys/sys/sockio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/sockio.h b/sys/sys/sockio.h index 824b77e57a17..cf612079c2f3 100644 --- a/sys/sys/sockio.h +++ b/sys/sys/sockio.h @@ -147,4 +147,8 @@ #define SIOCSIFCAPNV _IOW('i', 155, struct ifreq) /* set IF features */ #define SIOCGIFCAPNV _IOWR('i', 156, struct ifreq) /* get IF features */ +#define SIOCGUMBINFO _IOWR('i', 157, struct ifreq) /* get MBIM info */ +#define SIOCSUMBPARAM _IOW('i', 158, struct ifreq) /* set MBIM param */ +#define SIOCGUMBPARAM _IOWR('i', 159, struct ifreq) /* get MBIM param */ + #endif /* !_SYS_SOCKIO_H_ */ From nobody Mon Jan 20 23:47:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcRpj2XKBz5l8Lb; Mon, 20 Jan 2025 23:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcRph5Pbdz3Gfc; Mon, 20 Jan 2025 23:47:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnSFL8tPQyfo72Gb2pIsEDzlTKW2jvx1zson7MAxwG8=; b=Zm6Q8co1jzctASbCcgVkdl/ZzQvgwQ/IEI59O6aq1SQEW4B10Augi3K7QDOI8so5veZ1zt 2BeKZuZ73TsoV5XgnbuBM6kLBQkTAMq02E5YlHbmTvpMYmaQlzxUFw3cmGZTSPUtT051ZX lnufApmhsmtHLpq1vuaCFsSzAqG/mqtYBMTwjp2wjnB9UsEWkeCUUVxS2Ak/h3N9fLukXS 4+/ZpBFpaePFAODzO3FKmQE7gguUR/lqHi8vmue+PjrW67gTaUvBpFuHWyMgQDqvSeleUF /6HMcHvCBAquPvXS9qbw7QatVtUcd87CbD+Ye8e3i9Ush1tMmYANDW1wwahRAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737416860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qnSFL8tPQyfo72Gb2pIsEDzlTKW2jvx1zson7MAxwG8=; b=DudJ58pW58ks/ShusUlwdJEcKi47Djv6/rA5F8CuXfaghdAcnWvfiYzB1M+7LgxCzwmbWE tfUIps2puMfsSCgYzXTSf26DwxSz7KLfyfxInI22q1FJAG5/iQlaJDNvUVm71C5MhKLTWC z8r1fx5GEQoZ1O7hY6SZN6UEqp7mvPznPwS4hma7/RBRcqF6anlBaesbU0Ej1ZsF0PQUtF 8zWn1XeZCQ4ZLFTGAR93f9MyeZZ9EGOoN+CgHjMIdi05VKSKOqrh/MmyA8kEcOSZcjZFtV R/kIHh/Z0hWBHBMNXBIRxUjwcO1B5Bfk1UoJWqkYh7f9Oi41XOek+gAsWHQT5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737416860; a=rsa-sha256; cv=none; b=Hg13GyNzLkD152b7IqHSJuyeH58Ce6eiCZHBUuAm4hKYnBKJ4YJB/Z8a8sBTwcXYy4rPHw rr3ve7JFMCR+Jt23NlurDYZfRgjkYC2xzVdMJsV/Z7Jp6+hvBSYG3TzdQbT9uHX1w+QKhZ N27lIfJgzuGTj5OPQldzTvxsw0YRr2rS8dsSFVCNo5tr8/+N+wSiAd35heYMEcCZfyR+q9 wDkzs6EeII94zNwQ7Vqs7UDab5VVV1hVAW6hvQe+GhMAJgZQFbkqAEfQokLXrHOr00CXAy 4NGjXmzpqkXyduV/Ub/woCDZRHV74GF5SxC2hlHem4j4e1xE2yZOHXN5HTGk7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcRph4tPmzjPn; Mon, 20 Jan 2025 23:47:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50KNletG038563; Mon, 20 Jan 2025 23:47:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50KNleC1038560; Mon, 20 Jan 2025 23:47:40 GMT (envelope-from git) Date: Mon, 20 Jan 2025 23:47:40 GMT Message-Id: <202501202347.50KNleC1038560@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: 0f1bf1c22a0c - main - umb: Introduce the USB umb(4) network driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 0f1bf1c22a0c97e84a4db19197a75952487aa20b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=0f1bf1c22a0c97e84a4db19197a75952487aa20b commit 0f1bf1c22a0c97e84a4db19197a75952487aa20b Author: Adrian Chadd AuthorDate: 2025-01-20 23:46:15 +0000 Commit: Adrian Chadd CommitDate: 2025-01-20 23:46:15 +0000 umb: Introduce the USB umb(4) network driver This includes the port of a driver originally from OpenBSD, later ported to NetBSD by the author: * The umb(4) kernel driver * The umbctl(8) companion tool This driver supports USB network devices implementing the Mobile Broadband Interface Model (MBIM), often found in modern (internal) USB models for 4G/LTE mobile broadband access. It is currently limited to IPv4. umbctl has to be used to display or set MBIM cellular modem interface parameters (4G/LTE). Differential Revision: https://reviews.freebsd.org/D48167 Approved by: adrian, zlei Sponsored by: FreeBSD Foundation PR: kern/263783 Submitted by: Pierre Pronchery --- sbin/Makefile | 1 + sbin/umbctl/Makefile | 8 + sbin/umbctl/umbctl.8 | 161 +++ sbin/umbctl/umbctl.c | 557 ++++++++ share/man/man4/Makefile | 1 + share/man/man4/umb.4 | 119 ++ sys/conf/files | 1 + sys/dev/usb/net/if_umb.c | 2930 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/usb/net/if_umbreg.h | 443 +++++++ sys/dev/usb/net/mbim.h | 727 +++++++++++ sys/modules/usb/Makefile | 2 +- sys/modules/usb/umb/Makefile | 33 + 12 files changed, 4982 insertions(+), 1 deletion(-) diff --git a/sbin/Makefile b/sbin/Makefile index 790112b05f6f..5e5a8943c67a 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -63,6 +63,7 @@ SUBDIR=adjkerntz \ swapon \ sysctl \ tunefs \ + umbctl \ umount .if ${MK_INET} != "no" || ${MK_INET6} != "no" diff --git a/sbin/umbctl/Makefile b/sbin/umbctl/Makefile new file mode 100644 index 000000000000..35afb1bcfd4b --- /dev/null +++ b/sbin/umbctl/Makefile @@ -0,0 +1,8 @@ +CFLAGS+= -I${SRCTOP}/sys/dev/usb/net + +PROG= umbctl +MAN= umbctl.8 + +BINDIR= /sbin + +.include diff --git a/sbin/umbctl/umbctl.8 b/sbin/umbctl/umbctl.8 new file mode 100644 index 000000000000..55f8e315fabc --- /dev/null +++ b/sbin/umbctl/umbctl.8 @@ -0,0 +1,161 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2018 by Pierre Pronchery +.\" +.\" 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(S) ``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(S) 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. +.\" +.\" From: pppoectl.8,v 1.30 2016/09/12 05:35:20 sevan Exp $ +.\" +.\" $NetBSD: umbctl.8,v 1.3 2020/03/22 07:45:02 khorben Exp $ +.\" +.\" last edit-date: [Fri Dec 20 18:20:00 2024] +.\" +.Dd December 20, 2024 +.Dt UMBCTL 8 +.Os +.Sh NAME +.Nm umbctl +.Nd display or set MBIM cellular modem interface parameters (4G/LTE) +.Sh SYNOPSIS +.Nm +.Op Fl v +.Ar ifname +.Op Ar parameter Op Ar value +.Ar ... +.Nm +.Op Fl v +.Fl f Ar config-file +.Ar ifname +.Sh DESCRIPTION +.Nm +supports the following options: +.Bl -tag -width "-f config_file" +.It Fl f Ar config-file +Parse +.Ar config-file +for +.Ar parameter Ns Op \&= Ns Ar value +pairs, one per line, as if they had been specified on the command line. +This allows the password or PIN codes to be not passed as command line +arguments. +Comments starting with # to the end of the current line are ignored. +.It Fl v +Enables verbose mode. +.El +.Pp +The +.Xr umb 4 +driver may require a number of additional arguments or optional +parameters besides the settings that can be adjusted with +.Xr ifconfig 8 . +These may be credentials or other tunable connectivity variables. +The +.Nm +utility can be used to display the current settings, or to adjust these +parameters as required. +.Pp +For whatever intent +.Nm +is being called, at least the parameter +.Ar ifname +needs to be specified, naming the interface for which the settings +are to be performed or displayed. +Use +.Xr ifconfig 8 +or +.Xr netstat 1 +to see which interfaces are available. +.Pp +If no other parameter is given, +.Nm +will just list the current status for +.Ar ifname +and exit. +.Pp +If any additional parameter is supplied, superuser privileges are +required, and the command works in +.Ql set +mode. +This is normally done quietly, unless the option +.Fl v +is also enabled, which will cause a final printout of the status as +described above once all other actions have been taken. +.Pp +The parameters currently supported include: +.Bl -tag -width "username=username" +.It Ar apn Ns \&= Ns Em access-point +Set the APN to +.Em access-point . +.It Ar username Ns \&= Ns Em username +Set the username to +.Em username . +.It Ar password Ns \&= Ns Em password +Set the password to +.Em password . +.It Ar pin Ns \&= Ns Em pin-code +Enter the PIN +.Em pin-code . +.It Ar puk Ns \&= Ns Em puk-code +Enter the PUK +.Em puk-code . +.It Ar roaming +Allow data connections when roaming. +.It Ar -roaming +Deny data connections when roaming. +.El +.Sh EXAMPLES +Display the settings for umb0: +.Bd -literal +# umbctl umb0 +umb0: state up, mode automatic, registration home network + provider "BSD-Net", dataclass LTE, signal good + phone number "+15554242", roaming "" (denied) + APN "", TX 50000000, RX 100000000 + firmware "MBIM_FW_V1.0", hardware "MBIM_HW_V1.0" +.Ed +.Pp +Configure the connection parameters for umb0 from the command line: +.Bd -literal +# umbctl umb0 apn operator.internet username mobile password mobile +.Ed +.Pp +Configure the connection parameters for umb0 from a file: +.Bd -literal +# umbctl -f /dev/stdin umb0 << EOF +pin=1234 +EOF +.Ed +.Sh SEE ALSO +.Xr netstat 1 , +.Xr umb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Nx 9.0 , +and +.Fx 15.0 . +.Sh AUTHORS +The program was written by +.An Pierre Pronchery . diff --git a/sbin/umbctl/umbctl.c b/sbin/umbctl/umbctl.c new file mode 100644 index 000000000000..3d57b486ad80 --- /dev/null +++ b/sbin/umbctl/umbctl.c @@ -0,0 +1,557 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Original copyright (c) 2018 Pierre Pronchery (for the + * NetBSD Project) + * + * 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright (c) 2022 ADISTA SAS (FreeBSD updates) + * + * Updates for FreeBSD by Pierre Pronchery + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: umbctl.c,v 1.4 2020/05/13 21:44:30 khorben Exp $ + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mbim.h" +#include "if_umbreg.h" + +/* constants */ +static const struct umb_valdescr _umb_actstate[] = + MBIM_ACTIVATION_STATE_DESCRIPTIONS; + +static const struct umb_valdescr _umb_simstate[] = + MBIM_SIMSTATE_DESCRIPTIONS; + +static const struct umb_valdescr _umb_regstate[] = + MBIM_REGSTATE_DESCRIPTIONS; + +static const struct umb_valdescr _umb_pktstate[] = + MBIM_PKTSRV_STATE_DESCRIPTIONS; + +static const struct umb_valdescr _umb_dataclass[] = + MBIM_DATACLASS_DESCRIPTIONS; + +static const struct umb_valdescr _umb_state[] = + UMB_INTERNAL_STATE_DESCRIPTIONS; + +static const struct umb_valdescr _umb_pin_state[] = +{ + { UMB_PIN_REQUIRED, "PIN required"}, + { UMB_PIN_UNLOCKED, "PIN unlocked"}, + { UMB_PUK_REQUIRED, "PUK required"}, + { 0, NULL } +}; + +static const struct umb_valdescr _umb_regmode[] = +{ + { MBIM_REGMODE_UNKNOWN, "unknown" }, + { MBIM_REGMODE_AUTOMATIC, "automatic" }, + { MBIM_REGMODE_MANUAL, "manual" }, + { 0, NULL } +}; + +static const struct umb_valdescr _umb_ber[] = +{ + { UMB_BER_EXCELLENT, "excellent" }, + { UMB_BER_VERYGOOD, "very good" }, + { UMB_BER_GOOD, "good" }, + { UMB_BER_OK, "ok" }, + { UMB_BER_MEDIUM, "medium" }, + { UMB_BER_BAD, "bad" }, + { UMB_BER_VERYBAD, "very bad" }, + { UMB_BER_EXTREMELYBAD, "extremely bad" }, + { 0, NULL } +}; + + +/* prototypes */ +static int _char_to_utf16(const char * in, uint16_t * out, size_t outlen); +static int _error(int ret, char const * format, ...); +static int _umbctl(char const * ifname, int verbose, int argc, char * argv[]); +static int _umbctl_file(char const * ifname, char const * filename, + int verbose); +static void _umbctl_info(char const * ifname, struct umb_info * umbi); +static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request, + struct ifreq * ifr); +static int _umbctl_set(char const * ifname, struct umb_parameter * umbp, + int argc, char * argv[]); +static int _umbctl_socket(void); +static int _usage(void); +static void _utf16_to_char(uint16_t * in, int inlen, char * out, size_t outlen); + + +/* functions */ +/* char_to_utf16 */ +/* this function is from OpenBSD's ifconfig(8) */ +static int _char_to_utf16(const char * in, uint16_t * out, size_t outlen) +{ + int n = 0; + uint16_t c; + + for (;;) { + c = *in++; + + if (c == '\0') { + /* + * NUL termination is not required, but zero out the + * residual buffer + */ + memset(out, 0, outlen); + return n; + } + if (outlen < sizeof(*out)) + return -1; + + *out++ = htole16(c); + n += sizeof(*out); + outlen -= sizeof(*out); + } +} + + +/* error */ +static int _error(int ret, char const * format, ...) +{ + va_list ap; + + fputs("umbctl: ", stderr); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + fputs("\n", stderr); + return ret; +} + + +/* umbctl */ +static int _umbctl(char const * ifname, int verbose, int argc, char * argv[]) +{ + int fd; + struct ifreq ifr; + struct umb_info umbi; + struct umb_parameter umbp; + + if((fd = _umbctl_socket()) < 0) + return 2; + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + if(argc != 0) + { + memset(&umbp, 0, sizeof(umbp)); + ifr.ifr_data = (caddr_t)&umbp; + if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0 + || _umbctl_set(ifname, &umbp, argc, argv) != 0 + || _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM, + &ifr) != 0) + { + close(fd); + return 2; + } + } + if(argc == 0 || verbose > 0) + { + ifr.ifr_data = (caddr_t)&umbi; + if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0) + { + close(fd); + return 3; + } + _umbctl_info(ifname, &umbi); + } + if(close(fd) != 0) + return _error(2, "%s: %s", ifname, strerror(errno)); + return 0; +} + + +/* umbctl_file */ +static int _file_parse(char const * ifname, struct umb_parameter * umbp, + char const * filename); + +static int _umbctl_file(char const * ifname, char const * filename, int verbose) +{ + int fd; + struct ifreq ifr; + struct umb_parameter umbp; + struct umb_info umbi; + + if((fd = _umbctl_socket()) < 0) + return 2; + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); + ifr.ifr_data = (caddr_t)&umbp; + memset(&umbp, 0, sizeof(umbp)); + if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, &ifr) != 0 + || _file_parse(ifname, &umbp, filename) != 0 + || _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM, &ifr) != 0) + { + close(fd); + return 2; + } + if(verbose > 0) + { + ifr.ifr_data = (caddr_t)&umbi; + if(_umbctl_ioctl(ifname, fd, SIOCGUMBINFO, &ifr) != 0) + { + close(fd); + return 3; + } + _umbctl_info(ifname, &umbi); + } + if(close(fd) != 0) + return _error(2, "%s: %s", ifname, strerror(errno)); + return 0; +} + +static int _file_parse(char const * ifname, struct umb_parameter * umbp, + char const * filename) +{ + int ret = 0; + FILE * fp; + char buf[512]; + size_t len; + int i; + int eof; + char * tokens[3] = { buf, NULL, NULL }; + char * p; + + if((fp = fopen(filename, "r")) == NULL) + return _error(2, "%s: %s", filename, strerror(errno)); + while(fgets(buf, sizeof(buf), fp) != NULL) + { + if(buf[0] == '#') + continue; + buf[sizeof(buf) - 1] = '\0'; + if((len = strlen(buf)) > 0) + { + if(buf[len - 1] != '\n') + { + ret = _error(2, "%s: %s", filename, + "Line too long"); + while((i = fgetc(fp)) != EOF && i != '\n'); + continue; + } + buf[len - 1] = '\0'; + } + if((p = strchr(buf, '=')) != NULL) + { + tokens[1] = p + 1; + *p = '\0'; + } else + tokens[1] = NULL; + ret |= _umbctl_set(ifname, umbp, (p != NULL) ? 2 : 1, tokens) + ? 2 : 0; + } + eof = feof(fp); + if(fclose(fp) != 0 || !eof) + return _error(2, "%s: %s", filename, strerror(errno)); + return ret; +} + + +/* umbctl_info */ +static void _umbctl_info(char const * ifname, struct umb_info * umbi) +{ + char provider[UMB_PROVIDERNAME_MAXLEN + 1]; + char pn[UMB_PHONENR_MAXLEN + 1]; + char roaming[UMB_ROAMINGTEXT_MAXLEN + 1]; + char apn[UMB_APN_MAXLEN + 1]; + char fwinfo[UMB_FWINFO_MAXLEN + 1]; + char hwinfo[UMB_HWINFO_MAXLEN + 1]; + + _utf16_to_char(umbi->provider, UMB_PROVIDERNAME_MAXLEN, + provider, sizeof(provider)); + _utf16_to_char(umbi->pn, UMB_PHONENR_MAXLEN, pn, sizeof(pn)); + _utf16_to_char(umbi->roamingtxt, UMB_ROAMINGTEXT_MAXLEN, + roaming, sizeof(roaming)); + _utf16_to_char(umbi->apn, UMB_APN_MAXLEN, apn, sizeof(apn)); + _utf16_to_char(umbi->fwinfo, UMB_FWINFO_MAXLEN, fwinfo, sizeof(fwinfo)); + _utf16_to_char(umbi->hwinfo, UMB_HWINFO_MAXLEN, hwinfo, sizeof(hwinfo)); + printf("%s: state %s, mode %s, registration %s\n" + "\tprovider \"%s\", dataclass %s, signal %s\n" + "\tphone number \"%s\", roaming \"%s\" (%s)\n" + "\tAPN \"%s\", TX %" PRIu64 ", RX %" PRIu64 "\n" + "\tfirmware \"%s\", hardware \"%s\"\n", + ifname, umb_val2descr(_umb_state, umbi->state), + umb_val2descr(_umb_regmode, umbi->regmode), + umb_val2descr(_umb_regstate, umbi->regstate), provider, + umb_val2descr(_umb_dataclass, umbi->cellclass), + umb_val2descr(_umb_ber, umbi->ber), pn, roaming, + umbi->enable_roaming ? "allowed" : "denied", + apn, umbi->uplink_speed, umbi->downlink_speed, + fwinfo, hwinfo); +} + + +/* umbctl_ioctl */ +static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request, + struct ifreq * ifr) +{ + if(ioctl(fd, request, ifr) != 0) + return _error(-1, "%s: %s", ifname, strerror(errno)); + return 0; +} + + +/* umbctl_set */ +/* callbacks */ +static int _set_apn(char const *, struct umb_parameter *, char const *); +static int _set_username(char const *, struct umb_parameter *, char const *); +static int _set_password(char const *, struct umb_parameter *, char const *); +static int _set_pin(char const *, struct umb_parameter *, char const *); +static int _set_puk(char const *, struct umb_parameter *, char const *); +static int _set_roaming_allow(char const *, struct umb_parameter *, + char const *); +static int _set_roaming_deny(char const *, struct umb_parameter *, + char const *); + +static int _umbctl_set(char const * ifname, struct umb_parameter * umbp, + int argc, char * argv[]) +{ + struct + { + char const * name; + int (*callback)(char const *, + struct umb_parameter *, char const *); + int parameter; + } callbacks[] = + { + { "apn", _set_apn, 1 }, + { "username", _set_username, 1 }, + { "password", _set_password, 1 }, + { "pin", _set_pin, 1 }, + { "puk", _set_puk, 1 }, + { "roaming", _set_roaming_allow, 0 }, + { "-roaming", _set_roaming_deny, 0 }, + }; + int i; + size_t j; + + for(i = 0; i < argc; i++) + { + for(j = 0; j < sizeof(callbacks) / sizeof(*callbacks); j++) + if(strcmp(argv[i], callbacks[j].name) == 0) + { + if(callbacks[j].parameter && i + 1 == argc) + return _error(-1, "%s: Incomplete" + " parameter", argv[i]); + if(callbacks[j].callback(ifname, umbp, + callbacks[j].parameter + ? argv[i + 1] : NULL)) + return -1; + if(callbacks[j].parameter) + i++; + break; + } + if(j == sizeof(callbacks) / sizeof(*callbacks)) + return _error(-1, "%s: Unknown parameter", argv[i]); + } + return 0; +} + +static int _set_apn(char const * ifname, struct umb_parameter * umbp, + char const * apn) +{ + umbp->apnlen = _char_to_utf16(apn, umbp->apn, sizeof(umbp->apn)); + if(umbp->apnlen < 0 || (size_t)umbp->apnlen > sizeof(umbp->apn)) + return _error(-1, "%s: %s", ifname, "APN too long"); + return 0; +} + +static int _set_username(char const * ifname, struct umb_parameter * umbp, + char const * username) +{ + umbp->usernamelen = _char_to_utf16(username, umbp->username, + sizeof(umbp->username)); + if(umbp->usernamelen < 0 + || (size_t)umbp->usernamelen > sizeof(umbp->username)) + return _error(-1, "%s: %s", ifname, "Username too long"); + return 0; +} + +static int _set_password(char const * ifname, struct umb_parameter * umbp, + char const * password) +{ + umbp->passwordlen = _char_to_utf16(password, umbp->password, + sizeof(umbp->password)); + if(umbp->passwordlen < 0 + || (size_t)umbp->passwordlen > sizeof(umbp->password)) + return _error(-1, "%s: %s", ifname, "Password too long"); + return 0; +} + +static int _set_pin(char const * ifname, struct umb_parameter * umbp, + char const * pin) +{ + umbp->is_puk = 0; + umbp->op = MBIM_PIN_OP_ENTER; + umbp->pinlen = _char_to_utf16(pin, umbp->pin, sizeof(umbp->pin)); + if(umbp->pinlen < 0 || (size_t)umbp->pinlen + > sizeof(umbp->pin)) + return _error(-1, "%s: %s", ifname, "PIN code too long"); + return 0; +} + +static int _set_puk(char const * ifname, struct umb_parameter * umbp, + char const * puk) +{ + umbp->is_puk = 1; + umbp->op = MBIM_PIN_OP_ENTER; + umbp->pinlen = _char_to_utf16(puk, umbp->pin, sizeof(umbp->pin)); + if(umbp->pinlen < 0 || (size_t)umbp->pinlen > sizeof(umbp->pin)) + return _error(-1, "%s: %s", ifname, "PUK code too long"); + return 0; +} + +static int _set_roaming_allow(char const * ifname, struct umb_parameter * umbp, + char const * unused) +{ + (void) ifname; + (void) unused; + + umbp->roaming = 1; + return 0; +} + +static int _set_roaming_deny(char const * ifname, struct umb_parameter * umbp, + char const * unused) +{ + (void) ifname; + (void) unused; + + umbp->roaming = 0; + return 0; +} + + +/* umbctl_socket */ +static int _umbctl_socket(void) +{ + int fd; + + if((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + return _error(-1, "socket: %s", strerror(errno)); + return fd; +} + + +/* usage */ +static int _usage(void) +{ + fputs("Usage: umbctl [-v] ifname [parameter [value]] [...]\n" +" umbctl -f config-file ifname\n", + stderr); + return 1; +} + + +/* utf16_to_char */ +static void _utf16_to_char(uint16_t * in, int inlen, char * out, size_t outlen) +{ + uint16_t c; + + while (outlen > 0) { + c = inlen > 0 ? htole16(*in) : 0; + if (c == 0 || --outlen == 0) { + /* always NUL terminate result */ + *out = '\0'; + break; + } + *out++ = isascii(c) ? (char)c : '?'; + in++; + inlen--; + } +} + + +/* main */ +int main(int argc, char * argv[]) +{ + int o; + char const * filename = NULL; + int verbose = 0; + + while((o = getopt(argc, argv, "f:gv")) != -1) + switch(o) + { + case 'f': + filename = optarg; + break; + case 'v': + verbose++; + break; + default: + return _usage(); + } + if(optind == argc) + return _usage(); + if(filename != NULL) + { + if(optind + 1 != argc) + return _usage(); + return _umbctl_file(argv[optind], filename, verbose); + } + return _umbctl(argv[optind], verbose, argc - optind - 1, + &argv[optind + 1]); +} diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index c03ba63c349f..9dc1c7f9bc12 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1041,6 +1041,7 @@ MAN+= \ uled.4 \ ulpt.4 \ umass.4 \ + umb.4 \ umcs.4 \ umct.4 \ umodem.4 \ diff --git a/share/man/man4/umb.4 b/share/man/man4/umb.4 new file mode 100644 index 000000000000..b0d517095933 --- /dev/null +++ b/share/man/man4/umb.4 @@ -0,0 +1,119 @@ +.\"- +.\" SPDX-License-Identifier: 0BSD +.\" +.\" Copyright (c) 2016 genua mbH +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $NetBSD: umb.4,v 1.4 2019/08/30 09:22:17 wiz Exp $ +.\" +.Dd August 24, 2019 +.Dt UMB 4 +.Os +.Sh NAME +.Nm umb +.Nd USB Mobile Broadband Interface Model (MBIM) +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb" +.Cd "device umb" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +umb_load="YES" +.Ed +.Pp +If neither of the above is done, the driver will automatically be loaded +by devd(8) when the device is connected. +.Sh DESCRIPTION +The +.Nm +driver provides support for USB MBIM devices. +.Pp +MBIM devices establish connections via cellular networks such as +GPRS, UMTS, and LTE. +They appear as a regular point-to-point network interface, +transporting raw IP frames. +.Pp +Required configuration parameters like PIN and APN have to be set +with +.Xr umbctl 8 . +Once the SIM card has been unlocked with the correct PIN, it +will remain in this state until the MBIM device is power-cycled. +In case the device is connected to an "always-on" USB port, +it may be possible to connect to a provider without entering the +PIN again even if the system was rebooted. +.Sh HARDWARE +The +.Nm +driver should support any USB device implementing MBIM, including +the following cellular modems: +.Pp +.Bl -bullet -compact +.It +Ericsson H5321gw and N5321gw +.It +Fibocom L831-EAU +.It +Medion Mobile S4222 (MediaTek OEM) +.It +Sierra Wireless EM7345 +.It +Sierra Wireless EM7455 +.It +Sierra Wireless EM8805 +.It +Sierra Wireless MC8305 +.El +.Sh SEE ALSO +.Xr intro 4 , +.Xr netintro 4 , +.Xr usb 4 , +.Xr ifconfig 8 , +.Xr umbctl 8 +.Rs +.%T "Universal Serial Bus Communications Class Subclass Specification for Mobile Broadband Interface Model" +.%U http://www.usb.org/developers/docs/devclass_docs/MBIM10Errata1_073013.zip +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Ox 6.0 , +.Nx 9.0 , +and +.Fx 15.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Gerhard Roth Aq Mt gerhard@openbsd.org +and ported from +.Ox +by +.An Pierre Pronchery Aq Mt khorben@defora.org . +.Sh CAVEATS +The +.Nm +driver does not support IPv6. +.Pp +Devices which fail to provide a conforming MBIM implementation will +probably be attached as some other driver, such as +.Xr u3g 4 . diff --git a/sys/conf/files b/sys/conf/files index a02174f3d954..5fd7b887581a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3293,6 +3293,7 @@ dev/usb/net/if_muge.c optional muge dev/usb/net/if_rue.c optional rue dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav +dev/usb/net/if_umb.c optional umb dev/usb/net/if_ure.c optional ure dev/usb/net/if_usie.c optional usie dev/usb/net/if_urndis.c optional urndis diff --git a/sys/dev/usb/net/if_umb.c b/sys/dev/usb/net/if_umb.c new file mode 100644 index 000000000000..9b2b504cfa6b --- /dev/null +++ b/sys/dev/usb/net/if_umb.c @@ -0,0 +1,2930 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Original copyright (c) 2016 genua mbH (OpenBSD version) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Copyright (c) 2022 ADISTA SAS (re-write for FreeBSD) + * + * Re-write for FreeBSD by Pierre Pronchery + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation *** 4136 LINES SKIPPED *** From nobody Tue Jan 21 00:26:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgh2gGNz5lC2v; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgg4wW8z3Md3; Tue, 21 Jan 2025 00:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxV12yVPxgTZVPdvjb3DqUOuWSNQKE5uWjEY1DpLy/4=; b=R4RWA1pixO6HDu38b7XMla4x3Vj1csx6WE63G8ruwyLEZmyEbrSGrL3NF1PMgzY+UZMfhM 7rIUa0qQAJlofAYgpRcQuKG0/11pV2I/3ZP3QSWaaJfk7gO+v8nKHtj3lJ2z9fByyiT+tF AVgZBSQr3u7/hppKJpN6OU7498tb7yyO0ncoGLwaTzOzIkLXugFMExJK3hlFHDa9eW8Dcb DNzD69saMrKNUKH64yTejP3qMBwX/DU6vA8PCvzYt7PdTRNjLG7b9rXfPfiED9HNYWqtz3 +QjEyMKjexVo4h1cYXkKUZvxDY976fPlp38DeFDjtSX2Hd22Dw0TrJSTOJGAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxV12yVPxgTZVPdvjb3DqUOuWSNQKE5uWjEY1DpLy/4=; b=CDef6xkpbUzpWgZv9hUn50KtAZJqUIc29Ygi8f0dmwljP9XiZEtDH2XaSpEQPcJjFywUhZ qxFXjO8G13gYJ2/m58VomYZgnsQj37BHK6hqdzIHxZ113HSQE3QVxwBL1DW0nDW3htwXgX 6yU7WjarcxVC+e/8LyLKi41++0oKmhn7NWGCZQweCdqAdcs4GAk5apsHSp6H4VxSoTr2ZA nScMbdLZikJulUTY/zEEk91blVZ+Z9wJOihi7wV2VlrJdLAEbztSf4wwY2/oG0OPvlhYCH +6AILYbJI1lgpYIv5MlP1g0eRrwlyYlJlysxOeGRmkMnCIUauWcRaVyv2mJOoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419199; a=rsa-sha256; cv=none; b=tmy2yN/kZspCfvLmPQCod9RBlIKiDkBQqBG2uPFlQIhND5j87rLcJsmm9x2V4mWTmGiLNW qp1WKIP9cDNTDx1GVdj17O1NW3jmjVdexSAsQ7XHurTOqV6XMeDLEALb02i+47+DD/AMyp Bfnc+KVAbE0U9WVDYYwhQ8LnyqqfHoq3XqRyD2JjNcp+e1/LHg0C+XRNl+Y1jnBg/6JNX4 P3LHgae9Nuhge+uqf7nA3XmYBi+TuKCwS8UIQ39fNj3ZTaTCH92u12KJov5sKCfyyUnQSh 6Qr9ycl29guFpZ6iL830o6nmP0g1EfdzSasm5UCAEncpojJax2ivM3JU7JD5Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgg43YwzkSt; Tue, 21 Jan 2025 00:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QduV013177; Tue, 21 Jan 2025 00:26:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qdta013174; Tue, 21 Jan 2025 00:26:39 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:39 GMT Message-Id: <202501210026.50L0Qdta013174@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: 0961e16b3668 - stable/14 - libthr: use atomic_add_int() instead of atomic_fetchadd_int() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 0961e16b36684d4755ad16d789c9f4cb509c8f39 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0961e16b36684d4755ad16d789c9f4cb509c8f39 commit 0961e16b36684d4755ad16d789c9f4cb509c8f39 Author: Konstantin Belousov AuthorDate: 2025-01-13 19:18:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libthr: use atomic_add_int() instead of atomic_fetchadd_int() (cherry picked from commit 4804cb433dbec2555695dc2bf391f286f2172621) --- lib/libthr/thread/thr_list.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index 72018d94f496..d13cead7e588 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -150,16 +150,16 @@ _thr_alloc(struct pthread *curthread) if (thread == NULL) { if (total_threads > MAX_THREADS) return (NULL); - atomic_fetchadd_int(&total_threads, 1); + atomic_add_int(&total_threads, 1); thread = calloc(1, sizeof(struct pthread)); if (thread == NULL) { - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } if ((thread->sleepqueue = _sleepq_alloc()) == NULL || (thread->wake_addr = _thr_alloc_wake_addr()) == NULL) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } } else { @@ -177,7 +177,7 @@ _thr_alloc(struct pthread *curthread) thread->tcb = tcb; } else { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); thread = NULL; } return (thread); @@ -203,7 +203,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread) thread->tcb = NULL; if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); } else { /* * Add the thread to the free thread list, this also avoids From nobody Tue Jan 21 00:26:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgj2WDYz5lBxC; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgh5Ppwz3Mg2; Tue, 21 Jan 2025 00:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aem3n4a8fcWC739lIDyBYOW0GtEfFjcEpP4kpT62Obc=; b=TaCuJtxRkldiMgXl2Lrsqt0CGhYYX3z2C+kKGrMJ0UKwjfPa9sZP85+4GVIdDI44c3I3+7 WGuZMmm7NKSxn9Acrzixmok5a1R6oVeerPZyps6EEXEb0MDmHtG8uIthhA75FMlbcpr/m/ L7ywzgBR6x5md0n9xq2mEl8th+p+Nb/dS0JXIgSVdN3wetqvarekxB4wt+AOZZ/695b7W0 Cyw/xq4caEJPtDDCHs768BOSp31M8eTmePVVoTx6oiXqPdF/1s+D/mq1+xiDhknpnVTZU+ bhHYneZmIhzm26gxgv8gvTgw4Cjy3gENFUSOwC7KYwye3iHC39zC7dQK/mdFsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Aem3n4a8fcWC739lIDyBYOW0GtEfFjcEpP4kpT62Obc=; b=BMKoVocTYqTY8dLl+xKYn9XAdbsBEiKfHCDGP5woMhfyeAa5pYCnZ/D63+DvEdFhoBMar7 pGG4ijuyXD0x3EftQA2z9I05XF6TYClGPVl7OCBR8aQSnVv4N7EVXGyiT0WOuXaFOhOOeC Rkyx1TLp7DgPRc6FruClPPuTnmrITYlLG3mc1SPzRqOj3itT6T8gKvVrJx7QgsVdndlH0n hz9LJ6X0JR11W/X08tv822jeWJ3NNUaIVzsfrbvAnsdHPAGprJCXZHW9iHCQo2ljoWBBEn +atOJYPETmVtDtEgWy4Ns7yUvFl/Ojhr59mEHrOLjGVBzDxIsiivw+BkcOSDvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419200; a=rsa-sha256; cv=none; b=xCL2mi0fFEETSYCbKuJ0NhY1bhxcSxU/K9Kv5G6XONVYQC2NAdhT0IlB5vASvRp+KqAuqW 7aGVjPG2OzicrNswJIrnSUwXjJkZAQf69HCz70LcKUZidYVl8bEG8lhesXfcuMmSk/IWcF rHeX3dnkocqaN3kYmsYD0cBPXFh6AWvp5mqacMUKGe/f4mvZqOZaWIWmSidRuO8IQf9vd7 i4izOK7hwWaGbTmaU4YPCEP3x4dY/tm08Q07AN5syOjgcT9eeQryI+Wm7VZ6v+EzWQg2h4 eGETdBB7uaBy5TAQMPzaDwO6aR19MoKs5A/avGQ7wJDLPrQHKcLHB3w+YnDRfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgh4zBvzkSv; Tue, 21 Jan 2025 00:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qemh013213; Tue, 21 Jan 2025 00:26:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QeDW013210; Tue, 21 Jan 2025 00:26:40 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:40 GMT Message-Id: <202501210026.50L0QeDW013210@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: d6a896c3c83b - stable/14 - pthread_mutex_trylock(): init libthr if needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 commit d6a896c3c83b1a0f473563dad5fc3f0427ee6f64 Author: Konstantin Belousov AuthorDate: 2025-01-12 11:28:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 pthread_mutex_trylock(): init libthr if needed (cherry picked from commit 9718f18471f700b271eb898c764e02b7fcd3766f) --- lib/libthr/thread/thr_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index ca8971cc720a..32bdc4afe65f 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -619,6 +619,7 @@ __Tthr_mutex_trylock(pthread_mutex_t *mutex) uint32_t id; int ret, robust; + _thr_check_init(); ret = check_and_init_mutex(mutex, &m); if (ret != 0) return (ret); From nobody Tue Jan 21 00:26:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgl3H5Qz5lBxJ; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgk6Mq5z3Mb8; Tue, 21 Jan 2025 00:26:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9HERNyk/V5CTV1WLwo2KqOvY1gVInPW0i1Y8U8lJc8=; b=CW9vZKFsfCRbrBMY9E2dd1S1tAg5qOeb32kDhyEOqB0Qs+I3p1NZN7ULOsOw4UI5yraxMl 62PR0h9wMFxwNdrhE1QsWBcz6O33o5hdSYP3UisJRcNkzurw1WysjTfyHYLLDNQ0x+HlZu r+yfIUyAKzSVJQhwrT6Dg2AzPCt6WvvxzYsI5Vjclt5C8nfacNyL6tcw4JAqn0tUJpvW+e 5Mei4dH8swDe41qHflDPwKQCoh3CkZ8yD9sWnZ4OZomM1wVybhkKizx0vHoGFyeer70vUX BQ2ZWlsQunJv45Rfa/Vn4kjzyRyIPX2KFjxizp3IhLKV7LTOaIM62db/XLFf2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9HERNyk/V5CTV1WLwo2KqOvY1gVInPW0i1Y8U8lJc8=; b=VjHroQz9FltQQbbUdA3Eo5vBVjYdX6Hocj6qbms+qa/a55GzY8MXNqMV1xPRaR+1LHjmPh wNXDhjYvqX+10MHcCT/CuXwGPlppS25gMLN2mzoU8+vN0N+rKdB49wFRNQiPqgRdgc8/eK rlDlqJF2ySD5dCfCAb2e4iXJeQxwez/Iz1/up7qAx9IxkR6HSlACr1a3dwkX66sxkq5xJe SwdnMIKf0ApNPpr+RLKjumzYnt9FBF0QNOfs/byYP0/ReKCPdH9WHMcfYr4b70EmFS/8yL nfbHR6/klL5Vl86ffm7bIFMazOJB4KKbaFkVVsJnRj1oELPg8uImv6DLsY3JrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419202; a=rsa-sha256; cv=none; b=yUosP3H3fxmzlRE/d75Ruxq3zdYcknZ4HPKoQQH8vk+1TTEUTZSXFXiyuOSwn0g2hjtNNd GYYdrJuwJ1tk/euGlJbNUaD6MwzKcHD+IFkdniMzy291MnalMODc79vSxFPyvn+8E/rQ+d jduDfNkXSrq0DvnLRHd13GNWj+mQmr6UdDN67K8aVPpqWOPjJTOJEpKdZoF0dvh4C7XKaM bmXOPUeT+8/bZllkgXwTE7tfd3qVqGx1Yl0HLu3JOQfKc96uu6pn2OeebYhns50x61sdXj kWUF0GgGe+aexzSlQpD/CYgbozFWM80nbH6ZoIHKFyrcjGY/uMaoQXb983csxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgk5s66zk3Y; Tue, 21 Jan 2025 00:26:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QgA1013289; Tue, 21 Jan 2025 00:26:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QgEY013286; Tue, 21 Jan 2025 00:26:42 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:42 GMT Message-Id: <202501210026.50L0QgEY013286@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: e2268518dff0 - stable/14 - libpthread_init(): ensure curthread == NULL until set explicitly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: e2268518dff082d32b8399ccdac37ce3c597f178 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e2268518dff082d32b8399ccdac37ce3c597f178 commit e2268518dff082d32b8399ccdac37ce3c597f178 Author: Konstantin Belousov AuthorDate: 2025-01-14 22:11:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libpthread_init(): ensure curthread == NULL until set explicitly (cherry picked from commit 676be27133fa3296f3d9083732d8837a3eaa5ea4) --- lib/libthr/thread/thr_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index ff59288d919e..80f7c05ee5ce 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -332,6 +332,8 @@ _libpthread_init(struct pthread *curthread) /* Set the initial thread. */ if (curthread == NULL) { first = 1; + /* Force _get_curthread() return NULL until set. */ + _tcb_get()->tcb_thread = NULL; /* Create and initialize the initial thread. */ curthread = _thr_alloc(NULL); if (curthread == NULL) From nobody Tue Jan 21 00:26:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgk72mqz5lC2x; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgj6Fryz3Mg7; Tue, 21 Jan 2025 00:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gx9nfkAfVd1yG8CfQTjD+9N/uO4jBFqKcun3t+PgMk=; b=KP7HgWwT9WB7Cb56T1owRr6cSKOwRv9Nf9NOxct0UoEnpKas8UJZMAeA7Ait5dxAyV/Edq lO/tY8rQxw1j4ynKSED2h+afbgGMaoXDuNsgvOKgvJqL17zk14plWQkEUxqN8mhlwaLwBT 3oPT0kpXkljO8NVY1SeucLnHYoxbCyekiZL6GGuouNKDQTq16j82IpLOxwwQQ06+fU9Sv7 c3ZYIYUamVk/4WQsVqyQdIP5bcij+1rmfTT/+NtdD+QFtgoKuVyCHHuSpi0Fd0HIf4hFt1 tDMSK0WdwfDu24d/tT8FFhhosR7o2Y/yLsiANLGkfTZ5nYTm8zQPggUrwS1q8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gx9nfkAfVd1yG8CfQTjD+9N/uO4jBFqKcun3t+PgMk=; b=Bct4P2Awcahh+8CZhxLZwfPnTDzKZUU7PM7tgXPJWgNAdN+ubeEYw6BPjtVLE2wP4Xkrt5 aWZvuoUUqd43AOs1k9BpuFYK5L9CBl4YncBg+2xNZupAD+u65vI3eNdxibMkH8CZGO2VwV Ly+gETMcU0ym3t66C2wMI5I0Vh3Zi9CoKUgO50OQhx5XMPi2ZwyecZsYxUHV8QXHI4aB1L YmSza8JlAoOa1OmdlF99qbyAVD35t6rGhuoVceGqgV/T3A/3ZP2ds+NsReJ2ohezY88iLo Xxf1ZAwz6cGRXbK33PLuYqrfCcL0eumhEtPk248JkQyOpYRKlK2KkyGYRkhaKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419201; a=rsa-sha256; cv=none; b=Jp7HhfgsgGcKbaP2Sr/eD8MY/rakf36zPw3dFCbMveTS7e7dwZlM/DXQrNGe9WDTWJWKvs 3SPNQDay4D0pDpGwYjhb+v1uEx7yxw1EWurbZGEqgXvxFHlst3VaCeGsg8iPSnkkCumhCN Tb5OwlCx2M00y58aKwsmai18B5G89+Qenyo3Qt59wmHdaCba53WYfqgdDc+AoCJu6IbgiY waDOG8JKC+E0XJEbN2W3ZkyJEQtsBIEgxyfRPcBQlsCJwqVwS5CxBbTYbQ+CERE0J1hyth TAz0mfjjLyfh5gGR7JKU2/2/Eyv3UL9rIkTx0tW+5R5ZG/REy4s/IrMRqr24HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgj5f9wzkSw; Tue, 21 Jan 2025 00:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qfbk013247; Tue, 21 Jan 2025 00:26:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qf7N013244; Tue, 21 Jan 2025 00:26:41 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:41 GMT Message-Id: <202501210026.50L0Qf7N013244@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: 205043060940 - stable/14 - libthr: switch thread and sleepq memory allocator to crt from libc malloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 2050430609400237e4120e099c1aabd4e77e1c1e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2050430609400237e4120e099c1aabd4e77e1c1e commit 2050430609400237e4120e099c1aabd4e77e1c1e Author: Konstantin Belousov AuthorDate: 2025-01-14 09:06:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 libthr: switch thread and sleepq memory allocator to crt from libc malloc (cherry picked from commit 9a2ae72421cd75c741984f63b8c9ee89346a188d) --- lib/libthr/thread/thr_list.c | 4 ++-- lib/libthr/thread/thr_sleepq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index d13cead7e588..6b41951aaf59 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -151,7 +151,7 @@ _thr_alloc(struct pthread *curthread) if (total_threads > MAX_THREADS) return (NULL); atomic_add_int(&total_threads, 1); - thread = calloc(1, sizeof(struct pthread)); + thread = __thr_calloc(1, sizeof(struct pthread)); if (thread == NULL) { atomic_add_int(&total_threads, -1); return (NULL); @@ -223,7 +223,7 @@ thr_destroy(struct pthread *curthread __unused, struct pthread *thread) _sleepq_free(thread->sleepqueue); if (thread->wake_addr != NULL) _thr_release_wake_addr(thread->wake_addr); - free(thread); + __thr_free(thread); } /* diff --git a/lib/libthr/thread/thr_sleepq.c b/lib/libthr/thread/thr_sleepq.c index d7de9ab4e25a..9c680acd0ac0 100644 --- a/lib/libthr/thread/thr_sleepq.c +++ b/lib/libthr/thread/thr_sleepq.c @@ -62,7 +62,7 @@ _sleepq_alloc(void) { struct sleepqueue *sq; - sq = calloc(1, sizeof(struct sleepqueue)); + sq = __thr_calloc(1, sizeof(struct sleepqueue)); TAILQ_INIT(&sq->sq_blocked); SLIST_INIT(&sq->sq_freeq); return (sq); @@ -71,7 +71,7 @@ _sleepq_alloc(void) void _sleepq_free(struct sleepqueue *sq) { - free(sq); + __thr_free(sq); } void From nobody Tue Jan 21 00:26:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgm50CKz5lCD4; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgm0chyz3MSB; Tue, 21 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+qrGsoaVxUnaTwrUZU/Z33NUkG7PMlD8yf1ioRf3Ts=; b=lfImpb3FwzSnkxBxL/dksvAMIwwQMi1x3f+BwzOhHAnhoGLbVlXp1/eDcTc5o7eCBCexm2 +XuSrTgCw+IwLkzoeDu6Mz8usZKHeHMi9OfpQaO4fXNdk8uk2MsedGgkLIZOsz8hFDs9DP FCChwm4Tiol4+frp7LMW0aeuOophlvCLkj2BeDzcm2cDvy1HZBkGWiBo+5IKReycRJ61IL eZ5LGR9XaEFtFGEIpRfYWQzbxVIE8wUs8BmbH39JFtSIuhihHOaZVPjdjI3rBAVrbb77PI E9OYIC8zwST48ex7/zKAw9Ll5ODBwcfRTGcbbUUxRK+EpL9lxWCpWUw3B1JbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I+qrGsoaVxUnaTwrUZU/Z33NUkG7PMlD8yf1ioRf3Ts=; b=O83KDaxzpkJxeM+jxDJrAXprKU5akTJBaneCoXrptGvmOKkRLG7mwuJiWXqq8RrY2A0xxJ 8lL4sEYIOd/4d6R1w3MDbNHm7CXD0kwjbmIQxxRm2hwM08GfEor32C1SpbPKUCrSh2eOAZ RRjZ9NnpOhjsdzAa/u0Hzuu9emILGqPIY3eM+zj95OY1yimq0wa+Fc2XtPNvAjfAGkbHQv wtMahKVqomcuzyx1pTyGvCza6TPlTVDkzxfakPJrReoVQKO7jWCg1Gbrh1u8iBi+6Lrwdb U5d3mti+OyNxPWLZtlcIGvj15bgSPsMN5JyniutVOrHDhq4O72CyBl9Pqq6jcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419204; a=rsa-sha256; cv=none; b=XpO9DMq2xQsM4EircAcu13rLWdE/6apF286HwTtRY73GPq2uJKR+eZ3tftLSyvu3p5JBVz YMUW09LT3tPbWYB16FZ49UihbNpGAfPebt96xoVkXNwD9eS8L4B65Ogwk/xEYB+Jq+Pnuc MCScAIhjfxxJbEBJPzzsPyh+lxvDW2pSNl7yDh7TSERII2l/pxS7i4BuV5WAlXPlXrQTT/ mOrot1RAlYR0LYBD/aQ3/2h0M1cwGlVLYKTsuq65awmpeY42IvIOpLGNvfrE3lnvPOSfHN O6UvWL2IYRWXxMMIdD043Qq23UKkXCz9PucV9Sofy8jLANTprpIDyX7VjV5tzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgm04CmzkWK; Tue, 21 Jan 2025 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qh8r013327; Tue, 21 Jan 2025 00:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0Qh0f013324; Tue, 21 Jan 2025 00:26:43 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:43 GMT Message-Id: <202501210026.50L0Qh0f013324@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: 1a085ee97343 - stable/14 - pthread_create(): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 1a085ee97343c3938a12a7813421cec05768945b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1a085ee97343c3938a12a7813421cec05768945b commit 1a085ee97343c3938a12a7813421cec05768945b Author: Konstantin Belousov AuthorDate: 2025-01-14 23:32:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:24:55 +0000 pthread_create(): style (cherry picked from commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d) --- lib/libthr/thread/thr_create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 4de9bd84ca5b..2ae7cf0cd7b2 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -146,7 +146,7 @@ _pthread_create(pthread_t * __restrict thread, _thr_stack_fix_protection(new_thread); /* Return thread pointer eariler so that new thread can use it. */ - (*thread) = new_thread; + *thread = new_thread; if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { THR_THREAD_LOCK(curthread, new_thread); locked = 1; @@ -226,8 +226,8 @@ _pthread_create(pthread_t * __restrict thread, THR_THREAD_UNLOCK(curthread, new_thread); } out: - if (ret) - (*thread) = 0; + if (ret != 0) + *thread = NULL; return (ret); } From nobody Tue Jan 21 00:26:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgn5N1Xz5lBvS; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgn1H4Hz3MgZ; Tue, 21 Jan 2025 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hAUO9iBWVyt2Z1R9Ly4HNIttnybPPOG1k5SHUhUqQDQ=; b=pkMeEUDqI9/nUKCB4LT2c6zEKjGd1pOLe3ePeL1f9Agf/03jBInq7mb4ItNp4Ibev76XjI DjA+WsuoT2Zh4tFeC8UVWNgOOQ8WAHI6J9r4PS+I1JCJ6PCJoyzDmDfeEKWOew/Kuk2pbd R6lLxrs1SFVl3XYtJqOagpLzaQop4RraRqX0zTk7eQibCoUPKvZPLmHSdBo0n+tEumstZR x6jhc0OnBo2CuvXLHKJOp28VxdMg5qxJUBY6T7DRYzyzdQfEZfCWzBwNm5DQgWS1h1xBkU 3Ux5+ihJBD7oFH63PUNeqdYfk7qM5bR1E7Ce1nGuen8I3a2B72FoNjLdwdfCsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hAUO9iBWVyt2Z1R9Ly4HNIttnybPPOG1k5SHUhUqQDQ=; b=Pk/dw22r1UeFyIoxRrz7G+wqGa2FwkLrik+XSZY5ppSoc7y/l4Sa39e9kv7m8bJuBjWP/4 gCehx+9cdmXkqlIU7dSxxhQJmCaa2b3MZ/qQGCTac7tEIw+iubpecVMRQ6i8KOacf+9fae ruK2JyJH5Hqi2l0chBE309p9tRnCb5cLKGw+X468hMuyv8oQL317ISdbmT3tqrDROTVEJf u1vjjIwlHp6nKaWqB7JLT7h/4YlDQZdhwO21PBJa61L428dt9P4rkamJJMIKxxwkxXMcma q6HlC0vho1VGBx9anGoi1PG4AeVFGV1PSewpJ0ijUFmqXJ7stcDQv5GFfO+e/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419205; a=rsa-sha256; cv=none; b=L+4e8WSSC1dM/lFDTNQEAasydRjbC5lnSVq3Hff0PsRDyNoODyac3a2bNgekZMDF2jfsLt 91BoHRbu//2n0E7QZpHdzwJV9LB8rND1AXZr/pC81fb6HR9odxCeNatYZoEVPNWJFkjs2q DmxwaDj3MxL7FquIDoiPGY7eqdmlbHDWqawfFGXLij1O7n0x1CFI60iIhwYUcG7vbET9pv UNyoOWQmoO12SowkXuytdabFOogjuB7dF/KvbRdQElVLDkcBW45yHY6npcWviNBv7vdwGx uYNypW8ptq/zk9SBTmT/Gt2pmwTocwTSe4RcZASe/kPgv2nEvAdHuCb2h+Z+LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgn0tnMzkSx; Tue, 21 Jan 2025 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0QjcC013362; Tue, 21 Jan 2025 00:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QjeE013359; Tue, 21 Jan 2025 00:26:45 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:45 GMT Message-Id: <202501210026.50L0QjeE013359@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: 2c0e00dc0147 - stable/14 - kill.1: mention special PID 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 commit 2c0e00dc0147bdf3a6a84d0a16174aa521cbd262 Author: artembunichev AuthorDate: 2025-01-19 12:49:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:25:59 +0000 kill.1: mention special PID 0 PR: 284158 (cherry picked from commit f5cf173de0dc62dbf47a8bbdcae28aac947d90a6) --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index f3f0d27bb89b..0d3754626ee6 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -81,6 +81,9 @@ of the default .Pp The following PIDs have special meanings: .Bl -tag -width indent +.It 0 +The signal is sent to all processes whose group ID is equal to the process +group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. From nobody Tue Jan 21 00:26:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcSgp6Jpvz5lC7G; Tue, 21 Jan 2025 00:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcSgp2J76z3Mgh; Tue, 21 Jan 2025 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X8TVtqG3KCUPup3dQiPkvebrqBuynvK3oHjf8Nv/gu4=; b=D+tSvHsacoaLurflyrwJzb6pKz1SGsr4L1IiDuN8A4BgwdrR4Du1UGICVxG4kaZU3lLX3s sWIAJXLVA1yeH/N0gNSK4B1PLbbpEmC6b9AErQLDhL0CUrZQHbuallLH+LykyRYkfdCOAT XM7q+n3wSolyPME6qd9Hnu412LujrNEHO0ySDayn9RLB7DOkvKXySLhY6Pg2Yhp7IudxAi YVx/r244EbIqPws23WfqYHRNbYCD0RLGkdTsWNGFKXB7c668Pnn83zpVEYefmMVB6rSN5p LKI4U+AX3y0PxpsNF/pYARng+fVZc7RpJ/Tvh6XqQv6QzuK80gaSV74j1+5mDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737419206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X8TVtqG3KCUPup3dQiPkvebrqBuynvK3oHjf8Nv/gu4=; b=CIwzPUsPJumsxD5KjInKBpQCQHfLsQdpPMOr9wBtFlzYnPcjtCCtfAph1eL1nCRVazjkfW MCLjEoaxjEbVaAPZn/q8uydYRUYJDqpxFOla6z3DzzytLMKuwXj0HicXKDSInqK5ChM2X+ z52LFeKkywn5tWPJP093j9XcrGRp8VAEU8AEGM29FUzwtP9VpkXNSd8YNHxzLr+Y586KQP E1K/eNZDlvMKW0Ji3SZdvwS6eRoVhAdbzHA/AZt3AyALlLlfuyAyz7haB3ML5/BPtQkiF/ rqs2C/RgvlDu8kvL0CRockVNbq1bimdAgl5j0hJzTtNKO6g3gg5NIDMKBoPi/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737419206; a=rsa-sha256; cv=none; b=VXgS2oVSsNtwdkwUJGJESOVMzzTWKoMvDAm8FRRRISSBGH+RNQvujSrT39zG5PL9HzrAQz hnl2xHxDb55aAgPCUsb1O6cP1vaKnd2u+wceGubtM+8THnfVjrIj15YWwl6pTjABFxNxaQ JVB8tuOJxmHL5yh/1UiA7c7LWoBTJ0+H5xMIrdx/lqORAcHqz0WB4iSEvNz5v3QFM/cfrs F8n4rPRq9gT+LKMu/T3bm8TvlmrGeE/gUDCOtoQHu2hSs0l/4mw636hhw7Tl0Fw/CU60pm Sk8hjqJsMdBMziQGX3tNdJudRCWwrXFudycQJSBNsItIFz+pIiAsMqlBFcRc5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcSgp1RK2zkG3; Tue, 21 Jan 2025 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L0Qkmq013398; Tue, 21 Jan 2025 00:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L0QkBX013395; Tue, 21 Jan 2025 00:26:46 GMT (envelope-from git) Date: Tue, 21 Jan 2025 00:26:46 GMT Message-Id: <202501210026.50L0QkBX013395@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: fe74df3f9db8 - stable/14 - kill.1: mention special meaning of PGID as a PID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: fe74df3f9db830194ba7b91d4d703dddee2a60c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fe74df3f9db830194ba7b91d4d703dddee2a60c7 commit fe74df3f9db830194ba7b91d4d703dddee2a60c7 Author: artembunichev AuthorDate: 2025-01-19 12:58:55 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 00:25:59 +0000 kill.1: mention special meaning of PGID as a PID PR: 284158 (cherry picked from commit d6c2d4fe975c70975bdc6bec76d044408f6dcb8c) --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index 0d3754626ee6..b977e7899ab9 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -87,6 +87,9 @@ group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. +.It - Ns Ar PGID +The signal is sent to all processes that belong to the specified +process group ID (PGID). .El .Pp Some of the more commonly used signals: From nobody Tue Jan 21 01:50:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVXz5yTyz5lJPC; Tue, 21 Jan 2025 01:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVXz3MVtz3c9F; Tue, 21 Jan 2025 01:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+f9N2m8ovKDQ/Q41MCrsr02trDasdNy2h7LnSeztS/Q=; b=nJJbOej0aSU0Zav98oROA2OOXjbeBSK1lpy4XsLEs552Vk/bXzKPfy9OiDhUWNEob2PjKe dnUaDpQc3S/WqYhFcxk3n+4q78Uz5turInVGz5YrQW/McFCXATxQkvsuLb5vTvZ7Aox5k5 cTil1SLqou1TE0yXJTcH0sTjP4qqlK5AMy6Pw3LLpvM+bfPtDQleVpoGlKY2wdyHr3quKj 8rpPKPZcz5eeBAPgFermneACxfilZLfncGzA4wRvTfe9a/0YJhO1YQBPfTrS/+/QAbBKTN 7qYMjWR2AuCWi/GHq1xZOxLSUwiamyFJTBMcFmnTj5HaC4zfhar1rywbGTo90A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+f9N2m8ovKDQ/Q41MCrsr02trDasdNy2h7LnSeztS/Q=; b=UcBNcjlYRqvZI8x0gzL7a84wQoC/dqJYQnTy2uQzZ40OPqh1CMIOzeHcDMGrSyuAkK6Buq /RX+vS8d605qD9K0cb0qKwWmQmXD6FvIM3JnGNq+uTfs4xvl2jdXD9ZuQ/n5fGJsKmcTci hBE9m52Cp6Lln9rmxCubHH0Tdb0I5wXsCrQrLmR9sO0QhqHp7I8FLsREFVn3j5RSb4em9J F7B4ZC3iOVwG4aIpz9BsSTF6+gvC+EO1AVXtAGXWW36KgkTct97LUpSxEAdLJp4yoegFZe X3VuAf76H3mo/tqnYtJQ5zDmVDDVeGqOuVyf4b4HM3FF3CGj7pKnakVzxdtWVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424259; a=rsa-sha256; cv=none; b=Li/NDznKPONSC5MDvSBR2n3sL4OM17lVhz0lTWGfW5aXnHL+s+U9Wm6/dTYIOb3AsTum09 I9wEg97S/RSqxyZlthS9VouGvwd7WdumD9sYAXvynthADN4rkmUx18fKYv9qZoR3lkKV/m KkG8RCUBqIXQCvfzOEkquPbHHXejoJNrzA9Obe6A44VXkE8/XLR020ez9sFDJsZ0zRUlpx ASlCIIoRd8ATfk1CJIAYsOQ6whIrjwccqVt9UBj7NEc5XCSGigueRYA3ffQVQlge8Ox6jB NRz8lh1PiuAc0tzgFHmDdVXYo4YCWfUnUTrVin88yJmPlzp2F30D7m7CYBC6Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVXz2wdJzlqK; Tue, 21 Jan 2025 01:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1ox4F074068; Tue, 21 Jan 2025 01:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1oxvM074065; Tue, 21 Jan 2025 01:50:59 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:50:59 GMT Message-Id: <202501210150.50L1oxvM074065@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: dd1d72961b8d - main - rtld-elf/rtld.c: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: dd1d72961b8d343b29480b74afcfe4292fd166af Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dd1d72961b8d343b29480b74afcfe4292fd166af commit dd1d72961b8d343b29480b74afcfe4292fd166af Author: Konstantin Belousov AuthorDate: 2025-01-18 06:33:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:43:54 +0000 rtld-elf/rtld.c: fix typo in comment Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7dc9d93dac26..70230a8e0199 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5301,7 +5301,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) maxalign = MAX(tcbalign, tls_static_max_align); tls_init_align = MAX(obj_main->tlsalign, 1); - /* Compute fragmets sizes. */ + /* Compute fragments sizes. */ extra_size = tcbsize - TLS_TCB_SIZE; post_size = calculate_tls_post_size(tls_init_align); tls_block_size = tcbsize + post_size; From nobody Tue Jan 21 01:51:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY069ZGz5lJ0F; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY04F33z3cLL; Tue, 21 Jan 2025 01:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ZNAnYAmYwuMBjcvWWsXKWG6/dfVMHU3qioh+YrCjc4=; b=d7pHxzLwoNfh1yVAkHUhRHhLGBnA1XI7FDdFUIOJ+Kf7g66wsC1SnRhnUDZz7IZdwzwiM/ 1+fZq44O58VXfv52SN+FRSLU309s4zLyoGLJYXEOCc6ZkPzEFPlYBIkvzleZscwDT6ImYP Td4Tv1Y8sZ028FhRD6/6xEj0QqaUT23R6auLCMyptE7pSFyBl3N8gwPMOT6p2JGzlA4ZDi 111VtIiyRr7AH+apPccuArL+RQUNcAg6El0GKJYyJDr8d5v9SI/DcacLhpliBM+z9Ef+sA J18W8XpMNKjhvUE4UDTKGgi5mC1qwldhVI9z4xJOUvUt2OTtNani44FYTYK9AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ZNAnYAmYwuMBjcvWWsXKWG6/dfVMHU3qioh+YrCjc4=; b=ZqwVCfNBw4uVcsK1v50RMZpioiXiWtHeZwL2IOBuiRZgPYzP9o3uOY8qiOa2m/wIkLHOoL p8C6FyNWwa4o/QTeqVUzsZCxKfF+aqEhgNUpuvhyF3sDGx1tZ3TDAAhbxv0vD2peqC9SpB TpG73d94NqVRApk0gHwFZ0VNdXT/rx8t0lzGeihpEDb4SDpohfNontf/TMFey5WFmlZdMv Q7aDp6pj3i+vMdI5hY662/oB4xfZfmWqgjkGf+Rddd+xk4q+QCh8Ja0unZha318MPsPwdj ETt6aVelxMtcYwb5SWoG6amGojBFcf4FY91jBuUjHyJLchfsWEQu+r3aWaUcBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424260; a=rsa-sha256; cv=none; b=Pb1akKn4WVhmZAyrYkuckVewmHmp4UOtGyePxuBzh+MfSHcBrwZyOHPQhvG9rI0cmlviLa 969v5AWGKzndwI2TYQ9uvxjx44l0OTl+SCD67gj9aya1TD1Ar+5hzajEOqtHaxO18Xfsbq FPTDS+0ox7lcvlQoU3o8WoeiEVu9mGfMpTwmEvOi+5RqABzHPd3g/HwysaGJ3ZpB2C8lbI hYrRRmLdAVzLQs9GRCrPsPjDEl7UJ06VH5vYeLlLwXcURPZJM+BTMbxQN7iRpKr2MAfhid Eqb4dx8gifXaz5g+dKSVic3ymqrSYBEXridsv+toRJNeZRdm7MPg6U2lxdKwqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY03crZzlt3; Tue, 21 Jan 2025 01:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p0kF074109; Tue, 21 Jan 2025 01:51:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p0cN074106; Tue, 21 Jan 2025 01:51:00 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:00 GMT Message-Id: <202501210151.50L1p0cN074106@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: 7e2f38311e62 - main - rtld-elf/rtld.c: apply clang-format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 7e2f38311e62b1a3ba4a023042f2dc36e27cdd06 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7e2f38311e62b1a3ba4a023042f2dc36e27cdd06 commit 7e2f38311e62b1a3ba4a023042f2dc36e27cdd06 Author: Konstantin Belousov AuthorDate: 2025-01-18 02:26:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:12 +0000 rtld-elf/rtld.c: apply clang-format Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/rtld.c | 5914 ++++++++++++++++++++++++----------------------- 1 file changed, 2993 insertions(+), 2921 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 70230a8e0199..8ec883227908 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -39,13 +39,13 @@ */ #include -#include +#include #include +#include #include #include #include #include -#include #include #include @@ -58,20 +58,19 @@ #include #include "debug.h" -#include "rtld.h" #include "libmap.h" +#include "notes.h" +#include "rtld.h" +#include "rtld_libc.h" +#include "rtld_malloc.h" #include "rtld_paths.h" -#include "rtld_tls.h" #include "rtld_printf.h" -#include "rtld_malloc.h" +#include "rtld_tls.h" #include "rtld_utrace.h" -#include "notes.h" -#include "rtld_libc.h" /* Types. */ typedef void (*func_ptr_type)(void); -typedef void * (*path_enum_proc) (const char *path, size_t len, void *arg); - +typedef void *(*path_enum_proc)(const char *path, size_t len, void *arg); /* Variables that cannot be static: */ extern struct r_debug r_debug; /* For GDB */ @@ -138,7 +137,7 @@ static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *); static void objlist_remove(Objlist *, Obj_Entry *); static int open_binary_fd(const char *argv0, bool search_in_path, const char **binpath_res); -static int parse_args(char* argv[], int argc, bool *use_pathp, int *fdp, +static int parse_args(char *argv[], int argc, bool *use_pathp, int *fdp, const char **argv0, bool *dir_ignore); static int parse_integer(const char *); static void *path_enumerate(const char *, path_enum_proc, const char *, void *); @@ -174,15 +173,15 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *, RtldLockState *lockstate); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static char *origin_subst_one(Obj_Entry *, char *, const char *, - const char *, bool); +static char *origin_subst_one(Obj_Entry *, char *, const char *, const char *, + bool); static char *origin_subst(Obj_Entry *, const char *); static bool obj_resolve_origin(Obj_Entry *obj); static void preinit_main(void); -static int rtld_verify_versions(const Objlist *); -static int rtld_verify_object_versions(Obj_Entry *); +static int rtld_verify_versions(const Objlist *); +static int rtld_verify_object_versions(Obj_Entry *); static void object_add_name(Obj_Entry *, const char *); -static int object_match_name(const Obj_Entry *, const char *); +static int object_match_name(const Obj_Entry *, const char *); static void ld_utrace_log(int, void *, void *, size_t, int, const char *); static void rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info); @@ -198,45 +197,49 @@ int __sys_openat(int, const char *, int, ...); /* * Data declarations. */ -struct r_debug r_debug __exported; /* for GDB; */ -static bool libmap_disable; /* Disable libmap */ -static bool ld_loadfltr; /* Immediate filters processing */ -static const char *libmap_override;/* Maps to use in addition to libmap.conf */ -static bool trust; /* False for setuid and setgid programs */ -static bool dangerous_ld_env; /* True if environment variables have been - used to affect the libraries loaded */ -bool ld_bind_not; /* Disable PLT update */ -static const char *ld_bind_now; /* Environment variable for immediate binding */ +struct r_debug r_debug __exported; /* for GDB; */ +static bool libmap_disable; /* Disable libmap */ +static bool ld_loadfltr; /* Immediate filters processing */ +static const char *libmap_override; /* Maps to use in addition to libmap.conf */ +static bool trust; /* False for setuid and setgid programs */ +static bool dangerous_ld_env; /* True if environment variables have been + used to affect the libraries loaded */ +bool ld_bind_not; /* Disable PLT update */ +static const char *ld_bind_now; /* Environment variable for immediate binding */ static const char *ld_debug; /* Environment variable for debugging */ static bool ld_dynamic_weak = true; /* True if non-weak definition overrides weak definition */ -static const char *ld_library_path;/* Environment variable for search path */ -static const char *ld_library_dirs;/* Environment variable for library descriptors */ -static const char *ld_preload; /* Environment variable for libraries to - load first */ -static const char *ld_preload_fds;/* Environment variable for libraries represented by - descriptors */ -static const char *ld_elf_hints_path; /* Environment variable for alternative hints path */ -static const char *ld_tracing; /* Called from ldd to print libs */ -static const char *ld_utrace; /* Use utrace() to log events. */ -static struct obj_entry_q obj_list; /* Queue of all loaded objects */ -static Obj_Entry *obj_main; /* The main program shared object */ -static Obj_Entry obj_rtld; /* The dynamic linker shared object */ -static unsigned int obj_count; /* Number of objects in obj_list */ -static unsigned int obj_loads; /* Number of loads of objects (gen count) */ -size_t ld_static_tls_extra = /* Static TLS extra space (bytes) */ - RTLD_STATIC_TLS_EXTRA; - -static Objlist list_global = /* Objects dlopened with RTLD_GLOBAL */ - STAILQ_HEAD_INITIALIZER(list_global); -static Objlist list_main = /* Objects loaded at program startup */ - STAILQ_HEAD_INITIALIZER(list_main); -static Objlist list_fini = /* Objects needing fini() calls */ - STAILQ_HEAD_INITIALIZER(list_fini); - -Elf_Sym sym_zero; /* For resolving undefined weak refs. */ - -#define GDB_STATE(s,m) r_debug.r_state = s; r_debug_state(&r_debug,m); +static const char *ld_library_path; /* Environment variable for search path */ +static const char + *ld_library_dirs; /* Environment variable for library descriptors */ +static const char *ld_preload; /* Environment variable for libraries to + load first */ +static const char *ld_preload_fds; /* Environment variable for libraries + represented by descriptors */ +static const char + *ld_elf_hints_path; /* Environment variable for alternative hints path */ +static const char *ld_tracing; /* Called from ldd to print libs */ +static const char *ld_utrace; /* Use utrace() to log events. */ +static struct obj_entry_q obj_list; /* Queue of all loaded objects */ +static Obj_Entry *obj_main; /* The main program shared object */ +static Obj_Entry obj_rtld; /* The dynamic linker shared object */ +static unsigned int obj_count; /* Number of objects in obj_list */ +static unsigned int obj_loads; /* Number of loads of objects (gen count) */ +size_t ld_static_tls_extra = /* Static TLS extra space (bytes) */ + RTLD_STATIC_TLS_EXTRA; + +static Objlist list_global = /* Objects dlopened with RTLD_GLOBAL */ + STAILQ_HEAD_INITIALIZER(list_global); +static Objlist list_main = /* Objects loaded at program startup */ + STAILQ_HEAD_INITIALIZER(list_main); +static Objlist list_fini = /* Objects needing fini() calls */ + STAILQ_HEAD_INITIALIZER(list_fini); + +Elf_Sym sym_zero; /* For resolving undefined weak refs. */ + +#define GDB_STATE(s, m) \ + r_debug.r_state = s; \ + r_debug_state(&r_debug, m); extern Elf_Dyn _DYNAMIC; #pragma weak _DYNAMIC @@ -251,7 +254,7 @@ void *dlvsym(void *, const char *, const char *) __exported; int dladdr(const void *, Dl_info *) __exported; void dllockinit(void *, void *(*)(void *), void (*)(void *), void (*)(void *), void (*)(void *), void (*)(void *), void (*)(void *)) __exported; -int dlinfo(void *, int , void *) __exported; +int dlinfo(void *, int, void *) __exported; int _dl_iterate_phdr_locked(__dl_iterate_hdr_callback, void *) __exported; int dl_iterate_phdr(__dl_iterate_hdr_callback, void *) __exported; int _rtld_addr_phdr(const void *, struct dl_phdr_info *) __exported; @@ -290,12 +293,12 @@ char **main_argv; /* * Globals to control TLS allocation. */ -size_t tls_last_offset; /* Static TLS offset of last module */ -size_t tls_last_size; /* Static TLS size of last module */ -size_t tls_static_space; /* Static TLS space allocated */ +size_t tls_last_offset; /* Static TLS offset of last module */ +size_t tls_last_size; /* Static TLS size of last module */ +size_t tls_static_space; /* Static TLS space allocated */ static size_t tls_static_max_align; -Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ -int tls_max_index = 1; /* Largest module index allocated */ +Elf_Addr tls_dtv_generation = 1; /* Used to detect when dtv size changes */ +int tls_max_index = 1; /* Largest module index allocated */ static bool ld_library_path_rpath = false; bool ld_fast_sigblock = false; @@ -316,16 +319,16 @@ static void (*rtld_exit_ptr)(void); * the currently-loaded objects. Keep this as a macro since it calls * alloca and we want that to occur within the scope of the caller. */ -#define donelist_init(dlp) \ - ((dlp)->objs = alloca(obj_count * sizeof (dlp)->objs[0]), \ - assert((dlp)->objs != NULL), \ - (dlp)->num_alloc = obj_count, \ - (dlp)->num_used = 0) +#define donelist_init(dlp) \ + ((dlp)->objs = alloca(obj_count * sizeof(dlp)->objs[0]), \ + assert((dlp)->objs != NULL), (dlp)->num_alloc = obj_count, \ + (dlp)->num_used = 0) -#define LD_UTRACE(e, h, mb, ms, r, n) do { \ - if (ld_utrace != NULL) \ - ld_utrace_log(e, h, mb, ms, r, n); \ -} while (0) +#define LD_UTRACE(e, h, mb, ms, r, n) \ + do { \ + if (ld_utrace != NULL) \ + ld_utrace_log(e, h, mb, ms, r, n); \ + } while (0) static void ld_utrace_log(int event, void *handle, void *mapbase, size_t mapsize, @@ -347,19 +350,15 @@ ld_utrace_log(int event, void *handle, void *mapbase, size_t mapsize, } struct ld_env_var_desc { - const char * const n; + const char *const n; const char *val; - const bool unsecure:1; - const bool can_update:1; - const bool debug:1; - bool owned:1; + const bool unsecure : 1; + const bool can_update : 1; + const bool debug : 1; + bool owned : 1; }; -#define LD_ENV_DESC(var, unsec, ...) \ - [LD_##var] = { \ - .n = #var, \ - .unsecure = unsec, \ - __VA_ARGS__ \ - } +#define LD_ENV_DESC(var, unsec, ...) \ + [LD_##var] = { .n = #var, .unsecure = unsec, __VA_ARGS__ } static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(BIND_NOW, false), @@ -494,506 +493,524 @@ rtld_trunc_page(uintptr_t x) func_ptr_type _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) { - Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT]; - Objlist_Entry *entry; - Obj_Entry *last_interposer, *obj, *preload_tail; - const Elf_Phdr *phdr; - Objlist initlist; - RtldLockState lockstate; - struct stat st; - Elf_Addr *argcp; - char **argv, **env, **envp, *kexecpath; - const char *argv0, *binpath, *library_path_rpath, *static_tls_extra; - struct ld_env_var_desc *lvd; - caddr_t imgentry; - char buf[MAXPATHLEN]; - int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; - size_t sz; + Elf_Auxinfo *aux, *auxp, *auxpf, *aux_info[AT_COUNT]; + Objlist_Entry *entry; + Obj_Entry *last_interposer, *obj, *preload_tail; + const Elf_Phdr *phdr; + Objlist initlist; + RtldLockState lockstate; + struct stat st; + Elf_Addr *argcp; + char **argv, **env, **envp, *kexecpath; + const char *argv0, *binpath, *library_path_rpath, *static_tls_extra; + struct ld_env_var_desc *lvd; + caddr_t imgentry; + char buf[MAXPATHLEN]; + int argc, fd, i, mib[4], old_osrel, osrel, phnum, rtld_argc; + size_t sz; #ifdef __powerpc__ - int old_auxv_format = 1; + int old_auxv_format = 1; #endif - bool dir_enable, dir_ignore, direct_exec, explicit_fd, search_in_path; - - /* - * On entry, the dynamic linker itself has not been relocated yet. - * Be very careful not to reference any global data until after - * init_rtld has returned. It is OK to reference file-scope statics - * and string constants, and to call static and global functions. - */ - - /* Find the auxiliary vector on the stack. */ - argcp = sp; - argc = *sp++; - argv = (char **) sp; - sp += argc + 1; /* Skip over arguments and NULL terminator */ - env = (char **) sp; - while (*sp++ != 0) /* Skip over environment, and NULL terminator */ - ; - aux = (Elf_Auxinfo *) sp; - - /* Digest the auxiliary vector. */ - for (i = 0; i < AT_COUNT; i++) - aux_info[i] = NULL; - for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { - if (auxp->a_type < AT_COUNT) - aux_info[auxp->a_type] = auxp; + bool dir_enable, dir_ignore, direct_exec, explicit_fd, search_in_path; + + /* + * On entry, the dynamic linker itself has not been relocated yet. + * Be very careful not to reference any global data until after + * init_rtld has returned. It is OK to reference file-scope statics + * and string constants, and to call static and global functions. + */ + + /* Find the auxiliary vector on the stack. */ + argcp = sp; + argc = *sp++; + argv = (char **)sp; + sp += argc + 1; /* Skip over arguments and NULL terminator */ + env = (char **)sp; + while (*sp++ != 0) /* Skip over environment, and NULL terminator */ + ; + aux = (Elf_Auxinfo *)sp; + + /* Digest the auxiliary vector. */ + for (i = 0; i < AT_COUNT; i++) + aux_info[i] = NULL; + for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { + if (auxp->a_type < AT_COUNT) + aux_info[auxp->a_type] = auxp; #ifdef __powerpc__ - if (auxp->a_type == 23) /* AT_STACKPROT */ - old_auxv_format = 0; + if (auxp->a_type == 23) /* AT_STACKPROT */ + old_auxv_format = 0; #endif - } + } #ifdef __powerpc__ - if (old_auxv_format) { - /* Remap from old-style auxv numbers. */ - aux_info[23] = aux_info[21]; /* AT_STACKPROT */ - aux_info[21] = aux_info[19]; /* AT_PAGESIZESLEN */ - aux_info[19] = aux_info[17]; /* AT_NCPUS */ - aux_info[17] = aux_info[15]; /* AT_CANARYLEN */ - aux_info[15] = aux_info[13]; /* AT_EXECPATH */ - aux_info[13] = NULL; /* AT_GID */ - - aux_info[20] = aux_info[18]; /* AT_PAGESIZES */ - aux_info[18] = aux_info[16]; /* AT_OSRELDATE */ - aux_info[16] = aux_info[14]; /* AT_CANARY */ - aux_info[14] = NULL; /* AT_EGID */ - } + if (old_auxv_format) { + /* Remap from old-style auxv numbers. */ + aux_info[23] = aux_info[21]; /* AT_STACKPROT */ + aux_info[21] = aux_info[19]; /* AT_PAGESIZESLEN */ + aux_info[19] = aux_info[17]; /* AT_NCPUS */ + aux_info[17] = aux_info[15]; /* AT_CANARYLEN */ + aux_info[15] = aux_info[13]; /* AT_EXECPATH */ + aux_info[13] = NULL; /* AT_GID */ + + aux_info[20] = aux_info[18]; /* AT_PAGESIZES */ + aux_info[18] = aux_info[16]; /* AT_OSRELDATE */ + aux_info[16] = aux_info[14]; /* AT_CANARY */ + aux_info[14] = NULL; /* AT_EGID */ + } #endif - /* Initialize and relocate ourselves. */ - 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; - main_argc = argc; - main_argv = argv; - - if (aux_info[AT_BSDFLAGS] != NULL && - (aux_info[AT_BSDFLAGS]->a_un.a_val & ELF_BSDF_SIGFASTBLK) != 0) - ld_fast_sigblock = true; - - trust = !issetugid(); - direct_exec = false; - - md_abi_variant_hook(aux_info); - rtld_init_env_vars(env); - - fd = -1; - if (aux_info[AT_EXECFD] != NULL) { - fd = aux_info[AT_EXECFD]->a_un.a_val; - } else { - assert(aux_info[AT_PHDR] != NULL); - phdr = (const Elf_Phdr *)aux_info[AT_PHDR]->a_un.a_ptr; - if (phdr == obj_rtld.phdr) { - if (!trust) { - _rtld_error("Tainted process refusing to run binary %s", - argv0); - rtld_die(); - } - direct_exec = true; - - dbg("opening main program in direct exec mode"); - if (argc >= 2) { - rtld_argc = parse_args(argv, argc, &search_in_path, &fd, - &argv0, &dir_ignore); - explicit_fd = (fd != -1); - binpath = NULL; - if (!explicit_fd) - fd = open_binary_fd(argv0, search_in_path, &binpath); - if (fstat(fd, &st) == -1) { - _rtld_error("Failed to fstat FD %d (%s): %s", fd, - explicit_fd ? "user-provided descriptor" : argv0, - rtld_strerror(errno)); - rtld_die(); - } + /* Initialize and relocate ourselves. */ + assert(aux_info[AT_BASE] != NULL); + init_rtld((caddr_t)aux_info[AT_BASE]->a_un.a_ptr, aux_info); - /* - * Rough emulation of the permission checks done by - * execve(2), only Unix DACs are checked, ACLs are - * ignored. Preserve the semantic of disabling owner - * to execute if owner x bit is cleared, even if - * others x bit is enabled. - * mmap(2) does not allow to mmap with PROT_EXEC if - * binary' file comes from noexec mount. We cannot - * set a text reference on the binary. - */ - dir_enable = false; - if (st.st_uid == geteuid()) { - if ((st.st_mode & S_IXUSR) != 0) - dir_enable = true; - } else if (st.st_gid == getegid()) { - if ((st.st_mode & S_IXGRP) != 0) - dir_enable = true; - } else if ((st.st_mode & S_IXOTH) != 0) { - dir_enable = true; - } - if (!dir_enable && !dir_ignore) { - _rtld_error("No execute permission for binary %s", - argv0); - rtld_die(); - } + dlerror_dflt_init(); - /* - * For direct exec mode, argv[0] is the interpreter - * name, we must remove it and shift arguments left - * before invoking binary main. Since stack layout - * places environment pointers and aux vectors right - * after the terminating NULL, we must shift - * environment and aux as well. - */ - main_argc = argc - rtld_argc; - for (i = 0; i <= main_argc; i++) - argv[i] = argv[i + rtld_argc]; - *argcp -= rtld_argc; - environ = env = envp = argv + main_argc + 1; - dbg("move env from %p to %p", envp + rtld_argc, envp); - do { - *envp = *(envp + rtld_argc); - } while (*envp++ != NULL); - aux = auxp = (Elf_Auxinfo *)envp; - auxpf = (Elf_Auxinfo *)(envp + rtld_argc); - dbg("move aux from %p to %p", auxpf, aux); - /* XXXKIB insert place for AT_EXECPATH if not present */ - for (;; auxp++, auxpf++) { - *auxp = *auxpf; - if (auxp->a_type == AT_NULL) - break; - } - /* Since the auxiliary vector has moved, redigest it. */ - for (i = 0; i < AT_COUNT; i++) - aux_info[i] = NULL; - for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { - if (auxp->a_type < AT_COUNT) - aux_info[auxp->a_type] = auxp; + __progname = obj_rtld.path; + argv0 = argv[0] != NULL ? argv[0] : "(null)"; + environ = env; + main_argc = argc; + main_argv = argv; + + if (aux_info[AT_BSDFLAGS] != NULL && + (aux_info[AT_BSDFLAGS]->a_un.a_val & ELF_BSDF_SIGFASTBLK) != 0) + ld_fast_sigblock = true; + + trust = !issetugid(); + direct_exec = false; + + md_abi_variant_hook(aux_info); + rtld_init_env_vars(env); + + fd = -1; + if (aux_info[AT_EXECFD] != NULL) { + fd = aux_info[AT_EXECFD]->a_un.a_val; + } else { + assert(aux_info[AT_PHDR] != NULL); + phdr = (const Elf_Phdr *)aux_info[AT_PHDR]->a_un.a_ptr; + if (phdr == obj_rtld.phdr) { + if (!trust) { + _rtld_error( + "Tainted process refusing to run binary %s", + argv0); + rtld_die(); + } + direct_exec = true; + + dbg("opening main program in direct exec mode"); + if (argc >= 2) { + rtld_argc = parse_args(argv, argc, + &search_in_path, &fd, &argv0, &dir_ignore); + explicit_fd = (fd != -1); + binpath = NULL; + if (!explicit_fd) + fd = open_binary_fd(argv0, + search_in_path, &binpath); + if (fstat(fd, &st) == -1) { + _rtld_error( + "Failed to fstat FD %d (%s): %s", + fd, + explicit_fd ? + "user-provided descriptor" : + argv0, + rtld_strerror(errno)); + rtld_die(); + } + + /* + * Rough emulation of the permission checks done + * by execve(2), only Unix DACs are checked, + * ACLs are ignored. Preserve the semantic of + * disabling owner to execute if owner x bit is + * cleared, even if others x bit is enabled. + * mmap(2) does not allow to mmap with PROT_EXEC + * if binary' file comes from noexec mount. We + * cannot set a text reference on the binary. + */ + dir_enable = false; + if (st.st_uid == geteuid()) { + if ((st.st_mode & S_IXUSR) != 0) + dir_enable = true; + } else if (st.st_gid == getegid()) { + if ((st.st_mode & S_IXGRP) != 0) + dir_enable = true; + } else if ((st.st_mode & S_IXOTH) != 0) { + dir_enable = true; + } + if (!dir_enable && !dir_ignore) { + _rtld_error( + "No execute permission for binary %s", + argv0); + rtld_die(); + } + + /* + * For direct exec mode, argv[0] is the + * interpreter name, we must remove it and shift + * arguments left before invoking binary main. + * Since stack layout places environment + * pointers and aux vectors right after the + * terminating NULL, we must shift environment + * and aux as well. + */ + main_argc = argc - rtld_argc; + for (i = 0; i <= main_argc; i++) + argv[i] = argv[i + rtld_argc]; + *argcp -= rtld_argc; + environ = env = envp = argv + main_argc + 1; + dbg("move env from %p to %p", envp + rtld_argc, + envp); + do { + *envp = *(envp + rtld_argc); + } while (*envp++ != NULL); + aux = auxp = (Elf_Auxinfo *)envp; + auxpf = (Elf_Auxinfo *)(envp + rtld_argc); + dbg("move aux from %p to %p", auxpf, aux); + /* XXXKIB insert place for AT_EXECPATH if not + * present */ + for (;; auxp++, auxpf++) { + *auxp = *auxpf; + if (auxp->a_type == AT_NULL) + break; + } + /* Since the auxiliary vector has moved, + * redigest it. */ + for (i = 0; i < AT_COUNT; i++) + aux_info[i] = NULL; + for (auxp = aux; auxp->a_type != AT_NULL; + auxp++) { + if (auxp->a_type < AT_COUNT) + aux_info[auxp->a_type] = auxp; + } + + /* Point AT_EXECPATH auxv and aux_info to the + * binary path. */ + if (binpath == NULL) { + aux_info[AT_EXECPATH] = NULL; + } else { + if (aux_info[AT_EXECPATH] == NULL) { + aux_info[AT_EXECPATH] = xmalloc( + sizeof(Elf_Auxinfo)); + aux_info[AT_EXECPATH]->a_type = + AT_EXECPATH; + } + aux_info[AT_EXECPATH]->a_un.a_ptr = + __DECONST(void *, binpath); + } + } else { + _rtld_error("No binary"); + rtld_die(); + } } + } - /* Point AT_EXECPATH auxv and aux_info to the binary path. */ - if (binpath == NULL) { - aux_info[AT_EXECPATH] = NULL; - } else { - if (aux_info[AT_EXECPATH] == NULL) { - aux_info[AT_EXECPATH] = xmalloc(sizeof(Elf_Auxinfo)); - aux_info[AT_EXECPATH]->a_type = AT_EXECPATH; - } - aux_info[AT_EXECPATH]->a_un.a_ptr = __DECONST(void *, - binpath); + ld_bind_now = ld_get_env_var(LD_BIND_NOW); + + /* + * If the process is tainted, then we un-set the dangerous environment + * variables. The process will be marked as tainted until setuid(2) + * is called. If any child process calls setuid(2) we do not want any + * future processes to honor the potentially un-safe variables. + */ + if (!trust) { + for (i = 0; i < (int)nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + if (lvd->unsecure) + lvd->val = NULL; } - } else { - _rtld_error("No binary"); - rtld_die(); - } - } - } - - ld_bind_now = ld_get_env_var(LD_BIND_NOW); - - /* - * If the process is tainted, then we un-set the dangerous environment - * variables. The process will be marked as tainted until setuid(2) - * is called. If any child process calls setuid(2) we do not want any - * future processes to honor the potentially un-safe variables. - */ - if (!trust) { - for (i = 0; i < (int)nitems(ld_env_vars); i++) { - lvd = &ld_env_vars[i]; - if (lvd->unsecure) - lvd->val = NULL; - } - } - - ld_debug = ld_get_env_var(LD_DEBUG); - if (ld_bind_now == NULL) - ld_bind_not = ld_get_env_var(LD_BIND_NOT) != NULL; - ld_dynamic_weak = ld_get_env_var(LD_DYNAMIC_WEAK) == NULL; - libmap_disable = ld_get_env_var(LD_LIBMAP_DISABLE) != NULL; - libmap_override = ld_get_env_var(LD_LIBMAP); - ld_library_path = ld_get_env_var(LD_LIBRARY_PATH); - ld_library_dirs = ld_get_env_var(LD_LIBRARY_PATH_FDS); - ld_preload = ld_get_env_var(LD_PRELOAD); - ld_preload_fds = ld_get_env_var(LD_PRELOAD_FDS); - ld_elf_hints_path = ld_get_env_var(LD_ELF_HINTS_PATH); - ld_loadfltr = ld_get_env_var(LD_LOADFLTR) != NULL; - library_path_rpath = ld_get_env_var(LD_LIBRARY_PATH_RPATH); - if (library_path_rpath != NULL) { - if (library_path_rpath[0] == 'y' || - library_path_rpath[0] == 'Y' || - library_path_rpath[0] == '1') - ld_library_path_rpath = true; - else - ld_library_path_rpath = false; - } - static_tls_extra = ld_get_env_var(LD_STATIC_TLS_EXTRA); - if (static_tls_extra != NULL && static_tls_extra[0] != '\0') { - sz = parse_integer(static_tls_extra); - if (sz >= RTLD_STATIC_TLS_EXTRA && sz <= SIZE_T_MAX) - ld_static_tls_extra = sz; - } - dangerous_ld_env = libmap_disable || libmap_override != NULL || - ld_library_path != NULL || ld_preload != NULL || - ld_elf_hints_path != NULL || ld_loadfltr || !ld_dynamic_weak || - static_tls_extra != NULL; - ld_tracing = ld_get_env_var(LD_TRACE_LOADED_OBJECTS); - ld_utrace = ld_get_env_var(LD_UTRACE); - - set_ld_elf_hints_path(); - if (ld_debug != NULL && *ld_debug != '\0') - debug = 1; - dbg("%s is initialized, base address = %p", __progname, - (caddr_t) aux_info[AT_BASE]->a_un.a_ptr); - dbg("RTLD dynamic = %p", obj_rtld.dynamic); - dbg("RTLD pltgot = %p", obj_rtld.pltgot); - - dbg("initializing thread locks"); - lockdflt_init(); - - /* - * Load the main program, or process its program header if it is - * already loaded. - */ - if (fd != -1) { /* Load the main program. */ - dbg("loading main program"); - obj_main = map_object(fd, argv0, NULL); - close(fd); - if (obj_main == NULL) - rtld_die(); - max_stack_flags = obj_main->stack_flags; - } else { /* Main program already loaded. */ - dbg("processing main program's program header"); - assert(aux_info[AT_PHDR] != NULL); - phdr = (const Elf_Phdr *) aux_info[AT_PHDR]->a_un.a_ptr; - assert(aux_info[AT_PHNUM] != NULL); - phnum = aux_info[AT_PHNUM]->a_un.a_val; - assert(aux_info[AT_PHENT] != NULL); - assert(aux_info[AT_PHENT]->a_un.a_val == sizeof(Elf_Phdr)); - assert(aux_info[AT_ENTRY] != NULL); - imgentry = (caddr_t) aux_info[AT_ENTRY]->a_un.a_ptr; - if ((obj_main = digest_phdr(phdr, phnum, imgentry, argv0)) == NULL) - rtld_die(); - } - - if (aux_info[AT_EXECPATH] != NULL && fd == -1) { - kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr; - dbg("AT_EXECPATH %p %s", kexecpath, kexecpath); - if (kexecpath[0] == '/') - obj_main->path = kexecpath; - else if (getcwd(buf, sizeof(buf)) == NULL || - strlcat(buf, "/", sizeof(buf)) >= sizeof(buf) || - strlcat(buf, kexecpath, sizeof(buf)) >= sizeof(buf)) - obj_main->path = xstrdup(argv0); - else - obj_main->path = xstrdup(buf); - } else { - dbg("No AT_EXECPATH or direct exec"); - obj_main->path = xstrdup(argv0); - } - dbg("obj_main path %s", obj_main->path); - obj_main->mainprog = true; - - if (aux_info[AT_STACKPROT] != NULL && - aux_info[AT_STACKPROT]->a_un.a_val != 0) - stack_prot = aux_info[AT_STACKPROT]->a_un.a_val; + } + + ld_debug = ld_get_env_var(LD_DEBUG); + if (ld_bind_now == NULL) + ld_bind_not = ld_get_env_var(LD_BIND_NOT) != NULL; + ld_dynamic_weak = ld_get_env_var(LD_DYNAMIC_WEAK) == NULL; + libmap_disable = ld_get_env_var(LD_LIBMAP_DISABLE) != NULL; + libmap_override = ld_get_env_var(LD_LIBMAP); + ld_library_path = ld_get_env_var(LD_LIBRARY_PATH); + ld_library_dirs = ld_get_env_var(LD_LIBRARY_PATH_FDS); + ld_preload = ld_get_env_var(LD_PRELOAD); + ld_preload_fds = ld_get_env_var(LD_PRELOAD_FDS); + ld_elf_hints_path = ld_get_env_var(LD_ELF_HINTS_PATH); + ld_loadfltr = ld_get_env_var(LD_LOADFLTR) != NULL; + library_path_rpath = ld_get_env_var(LD_LIBRARY_PATH_RPATH); + if (library_path_rpath != NULL) { + if (library_path_rpath[0] == 'y' || + library_path_rpath[0] == 'Y' || + library_path_rpath[0] == '1') + ld_library_path_rpath = true; + else + ld_library_path_rpath = false; + } + static_tls_extra = ld_get_env_var(LD_STATIC_TLS_EXTRA); + if (static_tls_extra != NULL && static_tls_extra[0] != '\0') { + sz = parse_integer(static_tls_extra); + if (sz >= RTLD_STATIC_TLS_EXTRA && sz <= SIZE_T_MAX) + ld_static_tls_extra = sz; + } + dangerous_ld_env = libmap_disable || libmap_override != NULL || + ld_library_path != NULL || ld_preload != NULL || + ld_elf_hints_path != NULL || ld_loadfltr || !ld_dynamic_weak || + static_tls_extra != NULL; + ld_tracing = ld_get_env_var(LD_TRACE_LOADED_OBJECTS); + ld_utrace = ld_get_env_var(LD_UTRACE); + + set_ld_elf_hints_path(); + if (ld_debug != NULL && *ld_debug != '\0') + debug = 1; + dbg("%s is initialized, base address = %p", __progname, + (caddr_t)aux_info[AT_BASE]->a_un.a_ptr); + dbg("RTLD dynamic = %p", obj_rtld.dynamic); + dbg("RTLD pltgot = %p", obj_rtld.pltgot); + + dbg("initializing thread locks"); + lockdflt_init(); + + /* + * Load the main program, or process its program header if it is + * already loaded. + */ + if (fd != -1) { /* Load the main program. */ + dbg("loading main program"); + obj_main = map_object(fd, argv0, NULL); + close(fd); + if (obj_main == NULL) + rtld_die(); + max_stack_flags = obj_main->stack_flags; + } else { /* Main program already loaded. */ + dbg("processing main program's program header"); + assert(aux_info[AT_PHDR] != NULL); + phdr = (const Elf_Phdr *)aux_info[AT_PHDR]->a_un.a_ptr; + assert(aux_info[AT_PHNUM] != NULL); + phnum = aux_info[AT_PHNUM]->a_un.a_val; + assert(aux_info[AT_PHENT] != NULL); + assert(aux_info[AT_PHENT]->a_un.a_val == sizeof(Elf_Phdr)); + assert(aux_info[AT_ENTRY] != NULL); + imgentry = (caddr_t)aux_info[AT_ENTRY]->a_un.a_ptr; + if ((obj_main = digest_phdr(phdr, phnum, imgentry, argv0)) == + NULL) + rtld_die(); + } + + if (aux_info[AT_EXECPATH] != NULL && fd == -1) { + kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr; + dbg("AT_EXECPATH %p %s", kexecpath, kexecpath); + if (kexecpath[0] == '/') + obj_main->path = kexecpath; + else if (getcwd(buf, sizeof(buf)) == NULL || + strlcat(buf, "/", sizeof(buf)) >= sizeof(buf) || + strlcat(buf, kexecpath, sizeof(buf)) >= sizeof(buf)) + obj_main->path = xstrdup(argv0); + else + obj_main->path = xstrdup(buf); + } else { + dbg("No AT_EXECPATH or direct exec"); + obj_main->path = xstrdup(argv0); + } + dbg("obj_main path %s", obj_main->path); + obj_main->mainprog = true; + + if (aux_info[AT_STACKPROT] != NULL && + aux_info[AT_STACKPROT]->a_un.a_val != 0) + stack_prot = aux_info[AT_STACKPROT]->a_un.a_val; #ifndef COMPAT_libcompat - /* - * Get the actual dynamic linker pathname from the executable if - * possible. (It should always be possible.) That ensures that - * gdb will find the right dynamic linker even if a non-standard - * one is being used. - */ - if (obj_main->interp != NULL && - strcmp(obj_main->interp, obj_rtld.path) != 0) { - free(obj_rtld.path); - obj_rtld.path = xstrdup(obj_main->interp); - __progname = obj_rtld.path; - } + /* + * Get the actual dynamic linker pathname from the executable if + * possible. (It should always be possible.) That ensures that + * gdb will find the right dynamic linker even if a non-standard + * one is being used. + */ + if (obj_main->interp != NULL && + strcmp(obj_main->interp, obj_rtld.path) != 0) { + free(obj_rtld.path); + obj_rtld.path = xstrdup(obj_main->interp); + __progname = obj_rtld.path; + } #endif - if (!digest_dynamic(obj_main, 0)) - rtld_die(); - dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", - obj_main->path, obj_main->valid_hash_sysv, obj_main->valid_hash_gnu, - obj_main->dynsymcount); - - linkmap_add(obj_main); - linkmap_add(&obj_rtld); - - /* Link the main program into the list of objects. */ - TAILQ_INSERT_HEAD(&obj_list, obj_main, next); - obj_count++; - obj_loads++; - - /* Initialize a fake symbol for resolving undefined weak references. */ - sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); - sym_zero.st_shndx = SHN_UNDEF; - sym_zero.st_value = -(uintptr_t)obj_main->relocbase; - - if (!libmap_disable) - libmap_disable = (bool)lm_init(libmap_override); - - if (aux_info[AT_KPRELOAD] != NULL && - aux_info[AT_KPRELOAD]->a_un.a_ptr != NULL) { - dbg("loading kernel vdso"); - if (load_kpreload(aux_info[AT_KPRELOAD]->a_un.a_ptr) == -1) - rtld_die(); - } - - dbg("loading LD_PRELOAD_FDS libraries"); - if (load_preload_objects(ld_preload_fds, true) == -1) - rtld_die(); + if (!digest_dynamic(obj_main, 0)) + rtld_die(); + dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", + obj_main->path, obj_main->valid_hash_sysv, obj_main->valid_hash_gnu, + obj_main->dynsymcount); - dbg("loading LD_PRELOAD libraries"); - if (load_preload_objects(ld_preload, false) == -1) - rtld_die(); - preload_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); + linkmap_add(obj_main); + linkmap_add(&obj_rtld); - dbg("loading needed objects"); - if (load_needed_objects(obj_main, ld_tracing != NULL ? RTLD_LO_TRACE : - 0) == -1) - rtld_die(); + /* Link the main program into the list of objects. */ + TAILQ_INSERT_HEAD(&obj_list, obj_main, next); + obj_count++; + obj_loads++; - /* Make a list of all objects loaded at startup. */ - last_interposer = obj_main; - TAILQ_FOREACH(obj, &obj_list, next) { - if (obj->marker) - continue; - if (obj->z_interpose && obj != obj_main) { - objlist_put_after(&list_main, last_interposer, obj); - last_interposer = obj; - } else { - objlist_push_tail(&list_main, obj); + /* Initialize a fake symbol for resolving undefined weak references. */ + sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); + sym_zero.st_shndx = SHN_UNDEF; + sym_zero.st_value = -(uintptr_t)obj_main->relocbase; + + if (!libmap_disable) + libmap_disable = (bool)lm_init(libmap_override); + + if (aux_info[AT_KPRELOAD] != NULL && + aux_info[AT_KPRELOAD]->a_un.a_ptr != NULL) { + dbg("loading kernel vdso"); + if (load_kpreload(aux_info[AT_KPRELOAD]->a_un.a_ptr) == -1) + rtld_die(); } - obj->refcount++; - } - dbg("checking for required versions"); - if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) - rtld_die(); + dbg("loading LD_PRELOAD_FDS libraries"); + if (load_preload_objects(ld_preload_fds, true) == -1) *** 6242 LINES SKIPPED *** From nobody Tue Jan 21 01:51:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY21kWpz5lJct; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY15Bvsz3cCg; Tue, 21 Jan 2025 01:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9YAh+cgaVbz+1gPYklrfF95WDL+fnKa54BVv/1yNZ4=; b=cpLUwKzwEBOYoYfA0RWY+z4CWKrJljhD8I4u82E6Ys8B42rxfkBNokZJIItNNF0scIlyY+ AkaQO4L9yxqoliLx4w2pLmibrxa+mHqbnA/oDxsRhdadciLiv8929k4A98zEjcIbHX52YC KiCaOPGwzcwLuJMksNZn9hgptS3YHXeJpPmcnF/MN8yBQqSoD4VOCUU69KI1n9m348HFLT ulbrwpGP4IsUqOtQ4uHTxr5oYkshA3ElhZRGA/ZkKEehzdRR9hcTOkG3XDWQndWSv40T/s PEDc9SDdkNZ/OLLEEGzwYWvB5aGVjRduHLIq8aFdf0HwX+MYmcNr8gC4LHKfqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9YAh+cgaVbz+1gPYklrfF95WDL+fnKa54BVv/1yNZ4=; b=LPphGY+rmrzP95ReuNzEqr1CCIjl7htUQKciR89eHvxPjVEvq51HnbM660zTXI/tHwfakm L/w7QBBUTa9fs+d9Ahv2LvtNLByVRU74eO75N0nvGsa1KhaLS+gJ8IwdDqbCakdNu3AUtb ttUDOehknrKsEbj1lIl5FaSDCYYDWFQHoJDD00hf6OSgCSOkAgvuCu4LD4H+twydXNdRAB zIALEkE/3POFK2ONJogwi4bmFnq94h/EeVFxF7FAyf6esKLEYSw3pCwwK7bOOE05wjsH9A Is6SeH4teHZE9vnX3wNTP1EnGXZF3tn1b1QQrMmqUDa/UmvbX4OubT81lGcH2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424261; a=rsa-sha256; cv=none; b=BruwLn3DGga7OisZsElz1T3fQnJsHzOeU/aDRFdIksvOd6/3/nBiggkcMviOyFwDgR+6bT k+nngNYX+lHYGdjOfhOiwgwmTaAJzq6Y4Z9MMSS+/Aj0O6/YaWjWITr/l2Ccu9HofvlwHO B2yrLvGHNgj7cGAGgvns5oJ3QeS/HEbSj9pOwll8Dc9tewgzSMKcYKTsVKv+vxzx8sz+3i IzLZ/jqLPpS1iTsqUnz41R9cN85q5zmW0P9/DAFp6pMtt7aivhe5DZ78KZJCNe35MePD/I fcJ1UJukT3CskqE/Rn8VdzCcvgB2tWbYa0zajSBSpOw5Ke9CfXnYwcREoswhjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY14Yrtzlt4; Tue, 21 Jan 2025 01:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p1S3074143; Tue, 21 Jan 2025 01:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p17X074140; Tue, 21 Jan 2025 01:51:01 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:01 GMT Message-Id: <202501210151.50L1p17X074140@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: bf3fbf74d12c - main - rtld obj_remap_relro(): unindent the loop body List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: bf3fbf74d12cc6dff54ed17acf4a680cc0c9cdee Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf3fbf74d12cc6dff54ed17acf4a680cc0c9cdee commit bf3fbf74d12cc6dff54ed17acf4a680cc0c9cdee Author: Konstantin Belousov AuthorDate: 2025-01-18 23:23:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:22 +0000 rtld obj_remap_relro(): unindent the loop body Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/rtld.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 8ec883227908..169ec0200ea5 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5987,20 +5987,18 @@ obj_remap_relro(Obj_Entry *obj, int prot) for (ph = obj->phdr; (const char *)ph < (const char *)obj->phdr + obj->phsize; ph++) { - switch (ph->p_type) { - case PT_GNU_RELRO: - relro_page = obj->relocbase + - rtld_trunc_page(ph->p_vaddr); - relro_size = rtld_round_page(ph->p_vaddr + - ph->p_memsz) - rtld_trunc_page(ph->p_vaddr); - if (mprotect(relro_page, relro_size, prot) == -1) { - _rtld_error( + if (ph->p_type != PT_GNU_RELRO) + continue; + relro_page = obj->relocbase + rtld_trunc_page(ph->p_vaddr); + relro_size = rtld_round_page(ph->p_vaddr + ph->p_memsz) - + rtld_trunc_page(ph->p_vaddr); + if (mprotect(relro_page, relro_size, prot) == -1) { + _rtld_error( "%s: Cannot set relro protection to %#x: %s", - obj->path, prot, rtld_strerror(errno)); - return (-1); - } - break; + obj->path, prot, rtld_strerror(errno)); + return (-1); } + break; } return (0); } From nobody Tue Jan 21 01:51:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY31T4tz5lJJp; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY25cBkz3cJN; Tue, 21 Jan 2025 01:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AnYizZl9gpO+RQwZQHlR5eBhQ+bZ5lb5qDAbeD163uA=; b=X6x80LmdKdUBPtcRJiav6EN/QnTmYSVVn+3ZSTZ7QEWTZGfqt+9Re4JdK/eZr4WWLrJWN3 2azubQmPEZV1VcDG5Uz0VXLRj55xYrmdGEKxu7vTRsXYKa5ffUHe7mD6sicgxpo5msvDd3 pbgn96/6EJrVSunJSaGtZifaxtJ+gs+M4u1/oplQBWSoHPfQnylk+z5nufWqLG4v53zdSi ABvvq6FGIOfzm+thzB9CMHrPEu6OGI5Qbol3SQjukRmyh8s/Qb2Eo0D9eF0C89xqjKS7J6 7Tbg+4TvAUxNswaxrbbZNf8e9BIVv8e0epwYTwRhWEMvV3FQsRbwn9hqPrtVOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AnYizZl9gpO+RQwZQHlR5eBhQ+bZ5lb5qDAbeD163uA=; b=UGMLMORIRqSAplklV+dEirROw2JVLNL0UYCMdfNYDfEbEX/DI0zbS7zgJxQvVw5Xgc8nCj 9yUsxjTCTNyKHr6v6vJJj0X4HUoGVdk2psiJulaSFcxqClreHTlgN4dzD6nyMnRYrR7oOq mmmjL+wj3/X+2I0Wz1oBbvo5FKdUHyztAeOyyZ4f9IF7wTOjxMEfkVFQ2n1lgfXAso731e PORTgXwdqemhIBWzLKMFqFCtts7kOC7vaGlR/mGhJkOMOA6h/XVWfkVcUxqATS/wGBI3Pl oPg44vtk3DswrCQGI/nABjIHBk33TQz5FMfGEwUgyvFK29tg1u249q4sbtkMvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424262; a=rsa-sha256; cv=none; b=YH3RIr5FqscQYmc5plQiAtG/2frmwLh6mFdED6nLlfQevHF6zl7kZvac2ws0emmju5tx0g lfw0ivQNVq2t23zsjqJ/xXrgJWgEmZpRXXBjRjMkAhc6lsYDhGT+H05MbxrWaWZWAyprOX u25E9xH+qGBQr9otqHSv+P6ghpHLEmJL6QaPmkOH9pYQsZwd2anLQBcRVdLiV1Y1uLyGTP LogWWAICGUHbqeC6EjN+rZGRYN20Lt8X4O00CksGQpPN5CzVA9O+eD3z577H4bBg1MxfvX YR50h6ip0XMghdbt9K9V3B4PDq81qlN6cgWmZu9jkglFSwcnw0TnN37Ayb0pBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY25BxDzlt5; Tue, 21 Jan 2025 01:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p2G3074177; Tue, 21 Jan 2025 01:51:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p2lw074174; Tue, 21 Jan 2025 01:51:02 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:02 GMT Message-Id: <202501210151.50L1p2lw074174@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: 986c96b54b9e - main - rtld-elf/map_object.c: apply clang-format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 986c96b54b9ec1118d285b723f53c7451a4c0772 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=986c96b54b9ec1118d285b723f53c7451a4c0772 commit 986c96b54b9ec1118d285b723f53c7451a4c0772 Author: Konstantin Belousov AuthorDate: 2025-01-18 02:45:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:35 +0000 rtld-elf/map_object.c: apply clang-format Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/map_object.c | 653 ++++++++++++++++++++++-------------------- 1 file changed, 339 insertions(+), 314 deletions(-) diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 7dbab26f2c63..148b6dc4ca6e 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -62,274 +62,296 @@ phdr_in_zero_page(const Elf_Ehdr *hdr) Obj_Entry * map_object(int fd, const char *path, const struct stat *sb) { - Obj_Entry *obj; - Elf_Ehdr *hdr; - int i; - Elf_Phdr *phdr; - Elf_Phdr *phlimit; - Elf_Phdr **segs; - int nsegs; - Elf_Phdr *phdyn; - Elf_Phdr *phinterp; - Elf_Phdr *phtls; - caddr_t mapbase; - size_t mapsize; - Elf_Addr base_vaddr; - Elf_Addr base_vlimit; - caddr_t base_addr; - int base_flags; - Elf_Off data_offset; - Elf_Addr data_vaddr; - Elf_Addr data_vlimit; - caddr_t data_addr; - int data_prot; - int data_flags; - Elf_Addr clear_vaddr; - caddr_t clear_addr; - caddr_t clear_page; - Elf_Addr phdr_vaddr; - size_t nclear, phsize; - Elf_Addr bss_vaddr; - Elf_Addr bss_vlimit; - caddr_t bss_addr; - Elf_Word stack_flags; - Elf_Addr note_start; - Elf_Addr note_end; - char *note_map; - size_t note_map_len; - Elf_Addr text_end; - - hdr = get_elf_header(fd, path, sb, &phdr); - if (hdr == NULL) - return (NULL); + Obj_Entry *obj; + Elf_Ehdr *hdr; + int i; + Elf_Phdr *phdr; + Elf_Phdr *phlimit; + Elf_Phdr **segs; + int nsegs; + Elf_Phdr *phdyn; + Elf_Phdr *phinterp; + Elf_Phdr *phtls; + caddr_t mapbase; + size_t mapsize; + Elf_Addr base_vaddr; + Elf_Addr base_vlimit; + caddr_t base_addr; + int base_flags; + Elf_Off data_offset; + Elf_Addr data_vaddr; + Elf_Addr data_vlimit; + caddr_t data_addr; + int data_prot; + int data_flags; + Elf_Addr clear_vaddr; + caddr_t clear_addr; + caddr_t clear_page; + Elf_Addr phdr_vaddr; + size_t nclear, phsize; + Elf_Addr bss_vaddr; + Elf_Addr bss_vlimit; + caddr_t bss_addr; + Elf_Word stack_flags; + Elf_Addr note_start; + Elf_Addr note_end; + char *note_map; + size_t note_map_len; + Elf_Addr text_end; + + hdr = get_elf_header(fd, path, sb, &phdr); + if (hdr == NULL) + return (NULL); - /* - * Scan the program header entries, and save key information. - * We expect that the loadable segments are ordered by load address. - */ - phsize = hdr->e_phnum * sizeof(phdr[0]); - phlimit = phdr + hdr->e_phnum; - nsegs = -1; - phdyn = phinterp = phtls = NULL; - phdr_vaddr = 0; - note_start = 0; - note_end = 0; - note_map = NULL; - note_map_len = 0; - segs = alloca(sizeof(segs[0]) * hdr->e_phnum); - stack_flags = PF_X | PF_R | PF_W; - text_end = 0; - while (phdr < phlimit) { - switch (phdr->p_type) { - - case PT_INTERP: - phinterp = phdr; - break; - - case PT_LOAD: - segs[++nsegs] = phdr; - if ((segs[nsegs]->p_align & (page_size - 1)) != 0) { - _rtld_error("%s: PT_LOAD segment %d not page-aligned", - path, nsegs); - goto error; - } - if ((segs[nsegs]->p_flags & PF_X) == PF_X) { - text_end = MAX(text_end, - rtld_round_page(segs[nsegs]->p_vaddr + - segs[nsegs]->p_memsz)); - } - break; - - case PT_PHDR: - phdr_vaddr = phdr->p_vaddr; - phsize = phdr->p_memsz; - break; - - case PT_DYNAMIC: - phdyn = phdr; - break; - - case PT_TLS: - phtls = phdr; - break; - - case PT_GNU_STACK: - stack_flags = phdr->p_flags; - break; - - case PT_NOTE: - if (phdr->p_offset > page_size || - phdr->p_offset + phdr->p_filesz > page_size) { - note_map_len = rtld_round_page(phdr->p_offset + - phdr->p_filesz) - rtld_trunc_page(phdr->p_offset); - note_map = mmap(NULL, note_map_len, PROT_READ, - MAP_PRIVATE, fd, rtld_trunc_page(phdr->p_offset)); - if (note_map == MAP_FAILED) { - _rtld_error("%s: error mapping PT_NOTE (%d)", path, errno); - goto error; + /* + * Scan the program header entries, and save key information. + * We expect that the loadable segments are ordered by load address. + */ + phsize = hdr->e_phnum * sizeof(phdr[0]); + phlimit = phdr + hdr->e_phnum; + nsegs = -1; + phdyn = phinterp = phtls = NULL; + phdr_vaddr = 0; + note_start = 0; + note_end = 0; + note_map = NULL; + note_map_len = 0; + segs = alloca(sizeof(segs[0]) * hdr->e_phnum); + stack_flags = PF_X | PF_R | PF_W; + text_end = 0; + while (phdr < phlimit) { + switch (phdr->p_type) { + case PT_INTERP: + phinterp = phdr; + break; + + case PT_LOAD: + segs[++nsegs] = phdr; + if ((segs[nsegs]->p_align & (page_size - 1)) != 0) { + _rtld_error( + "%s: PT_LOAD segment %d not page-aligned", + path, nsegs); + goto error; + } + if ((segs[nsegs]->p_flags & PF_X) == PF_X) { + text_end = MAX(text_end, + rtld_round_page(segs[nsegs]->p_vaddr + + segs[nsegs]->p_memsz)); + } + break; + + case PT_PHDR: + phdr_vaddr = phdr->p_vaddr; + phsize = phdr->p_memsz; + break; + + case PT_DYNAMIC: + phdyn = phdr; + break; + + case PT_TLS: + phtls = phdr; + break; + + case PT_GNU_STACK: + stack_flags = phdr->p_flags; + break; + + case PT_NOTE: + if (phdr->p_offset > page_size || + phdr->p_offset + phdr->p_filesz > page_size) { + note_map_len = rtld_round_page(phdr->p_offset + + phdr->p_filesz) - + rtld_trunc_page(phdr->p_offset); + note_map = mmap(NULL, note_map_len, PROT_READ, + MAP_PRIVATE, fd, + rtld_trunc_page(phdr->p_offset)); + if (note_map == MAP_FAILED) { + _rtld_error( + "%s: error mapping PT_NOTE (%d)", + path, errno); + goto error; + } + note_start = (Elf_Addr)(note_map + + phdr->p_offset - + rtld_trunc_page(phdr->p_offset)); + } else { + note_start = (Elf_Addr)(char *)hdr + + phdr->p_offset; + } + note_end = note_start + phdr->p_filesz; + break; } - note_start = (Elf_Addr)(note_map + phdr->p_offset - - rtld_trunc_page(phdr->p_offset)); - } else { - note_start = (Elf_Addr)(char *)hdr + phdr->p_offset; - } - note_end = note_start + phdr->p_filesz; - break; - } - ++phdr; - } - if (phdyn == NULL) { - _rtld_error("%s: object is not dynamically-linked", path); - goto error; - } - - if (nsegs < 0) { - _rtld_error("%s: too few PT_LOAD segments", path); - goto error; - } - - /* - * Map the entire address space of the object, to stake out our - * contiguous region, and to establish the base address for relocation. - */ - base_vaddr = rtld_trunc_page(segs[0]->p_vaddr); - base_vlimit = rtld_round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); - mapsize = base_vlimit - base_vaddr; - base_addr = (caddr_t) base_vaddr; - base_flags = __getosreldate() >= P_OSREL_MAP_GUARD ? MAP_GUARD : - MAP_PRIVATE | MAP_ANON | MAP_NOCORE; - if (npagesizes > 1 && rtld_round_page(segs[0]->p_filesz) >= pagesizes[1]) - base_flags |= MAP_ALIGNED_SUPER; - if (base_vaddr != 0) - base_flags |= MAP_FIXED | MAP_EXCL; - - mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); - if (mapbase == MAP_FAILED) { - _rtld_error("%s: mmap of entire address space failed: %s", - path, rtld_strerror(errno)); - goto error; - } - if (base_addr != NULL && mapbase != base_addr) { - _rtld_error("%s: mmap returned wrong address: wanted %p, got %p", - path, base_addr, mapbase); - goto error1; - } - - for (i = 0; i <= nsegs; i++) { - /* Overlay the segment onto the proper region. */ - data_offset = rtld_trunc_page(segs[i]->p_offset); - data_vaddr = rtld_trunc_page(segs[i]->p_vaddr); - data_vlimit = rtld_round_page(segs[i]->p_vaddr + segs[i]->p_filesz); - data_addr = mapbase + (data_vaddr - base_vaddr); - data_prot = convert_prot(segs[i]->p_flags); - data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; - if (data_vlimit != data_vaddr && - mmap(data_addr, data_vlimit - data_vaddr, data_prot, - data_flags | MAP_PREFAULT_READ, fd, data_offset) == MAP_FAILED) { - _rtld_error("%s: mmap of data failed: %s", path, - rtld_strerror(errno)); - goto error1; + ++phdr; + } + if (phdyn == NULL) { + _rtld_error("%s: object is not dynamically-linked", path); + goto error; } - /* Do BSS setup */ - if (segs[i]->p_filesz != segs[i]->p_memsz) { + if (nsegs < 0) { + _rtld_error("%s: too few PT_LOAD segments", path); + goto error; + } - /* Clear any BSS in the last page of the segment. */ - clear_vaddr = segs[i]->p_vaddr + segs[i]->p_filesz; - clear_addr = mapbase + (clear_vaddr - base_vaddr); - clear_page = mapbase + (rtld_trunc_page(clear_vaddr) - base_vaddr); + /* + * Map the entire address space of the object, to stake out our + * contiguous region, and to establish the base address for relocation. + */ + base_vaddr = rtld_trunc_page(segs[0]->p_vaddr); + base_vlimit = rtld_round_page(segs[nsegs]->p_vaddr + + segs[nsegs]->p_memsz); + mapsize = base_vlimit - base_vaddr; + base_addr = (caddr_t)base_vaddr; + base_flags = __getosreldate() >= P_OSREL_MAP_GUARD ? + MAP_GUARD : MAP_PRIVATE | MAP_ANON | MAP_NOCORE; + if (npagesizes > 1 && rtld_round_page(segs[0]->p_filesz) >= + pagesizes[1]) + base_flags |= MAP_ALIGNED_SUPER; + if (base_vaddr != 0) + base_flags |= MAP_FIXED | MAP_EXCL; + + mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); + if (mapbase == MAP_FAILED) { + _rtld_error("%s: mmap of entire address space failed: %s", + path, rtld_strerror(errno)); + goto error; + } + if (base_addr != NULL && mapbase != base_addr) { + _rtld_error( + "%s: mmap returned wrong address: wanted %p, got %p", + path, base_addr, mapbase); + goto error1; + } - if ((nclear = data_vlimit - clear_vaddr) > 0) { - /* Make sure the end of the segment is writable */ - if ((data_prot & PROT_WRITE) == 0 && -1 == - mprotect(clear_page, page_size, data_prot|PROT_WRITE)) { - _rtld_error("%s: mprotect failed: %s", path, - rtld_strerror(errno)); + for (i = 0; i <= nsegs; i++) { + /* Overlay the segment onto the proper region. */ + data_offset = rtld_trunc_page(segs[i]->p_offset); + data_vaddr = rtld_trunc_page(segs[i]->p_vaddr); + data_vlimit = rtld_round_page(segs[i]->p_vaddr + + segs[i]->p_filesz); + data_addr = mapbase + (data_vaddr - base_vaddr); + data_prot = convert_prot(segs[i]->p_flags); + data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; + if (data_vlimit != data_vaddr && mmap(data_addr, + data_vlimit - data_vaddr, data_prot, data_flags | + MAP_PREFAULT_READ, fd, data_offset) == MAP_FAILED) { + _rtld_error("%s: mmap of data failed: %s", + path, rtld_strerror(errno)); goto error1; } - memset(clear_addr, 0, nclear); - - /* Reset the data protection back */ - if ((data_prot & PROT_WRITE) == 0) - mprotect(clear_page, page_size, data_prot); - } - - /* Overlay the BSS segment onto the proper region. */ - bss_vaddr = data_vlimit; - bss_vlimit = rtld_round_page(segs[i]->p_vaddr + segs[i]->p_memsz); - bss_addr = mapbase + (bss_vaddr - base_vaddr); - if (bss_vlimit > bss_vaddr) { /* There is something to do */ - if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot, - data_flags | MAP_ANON, -1, 0) == MAP_FAILED) { - _rtld_error("%s: mmap of bss failed: %s", path, - rtld_strerror(errno)); - goto error1; + /* Do BSS setup */ + if (segs[i]->p_filesz != segs[i]->p_memsz) { + /* Clear any BSS in the last page of the segment. */ + clear_vaddr = segs[i]->p_vaddr + segs[i]->p_filesz; + clear_addr = mapbase + (clear_vaddr - base_vaddr); + clear_page = mapbase + (rtld_trunc_page(clear_vaddr) - + base_vaddr); + + if ((nclear = data_vlimit - clear_vaddr) > 0) { + /* + * Make sure the end of the segment is + * writable. + */ + if ((data_prot & PROT_WRITE) == 0 && + mprotect(clear_page, page_size, + data_prot | PROT_WRITE) == -1) { + _rtld_error("%s: mprotect failed: %s", + path, rtld_strerror(errno)); + goto error1; + } + + memset(clear_addr, 0, nclear); + + /* Reset the data protection back */ + if ((data_prot & PROT_WRITE) == 0) + mprotect(clear_page, page_size, + data_prot); + } + + /* Overlay the BSS segment onto the proper region. */ + bss_vaddr = data_vlimit; + bss_vlimit = rtld_round_page(segs[i]->p_vaddr + + segs[i]->p_memsz); + bss_addr = mapbase + (bss_vaddr - base_vaddr); + if (bss_vlimit > bss_vaddr) { + /* There is something to do */ + if (mmap(bss_addr, bss_vlimit - bss_vaddr, + data_prot, data_flags | MAP_ANON, -1, + 0) == MAP_FAILED) { + _rtld_error( + "%s: mmap of bss failed: %s", + path, rtld_strerror(errno)); + goto error1; + } + } + } + + if (phdr_vaddr == 0 && data_offset <= hdr->e_phoff && + data_vlimit - data_vaddr + data_offset >= + hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr)) { + phdr_vaddr = data_vaddr + hdr->e_phoff - data_offset; } - } } - if (phdr_vaddr == 0 && data_offset <= hdr->e_phoff && - (data_vlimit - data_vaddr + data_offset) >= - (hdr->e_phoff + hdr->e_phnum * sizeof (Elf_Phdr))) { - phdr_vaddr = data_vaddr + hdr->e_phoff - data_offset; + obj = obj_new(); + if (sb != NULL) { + obj->dev = sb->st_dev; + obj->ino = sb->st_ino; + } + obj->mapbase = mapbase; + obj->mapsize = mapsize; + obj->vaddrbase = base_vaddr; + obj->relocbase = mapbase - base_vaddr; + obj->dynamic = (const Elf_Dyn *)(obj->relocbase + phdyn->p_vaddr); + if (hdr->e_entry != 0) + obj->entry = (caddr_t)(obj->relocbase + hdr->e_entry); + if (phdr_vaddr != 0) { + obj->phdr = (const Elf_Phdr *)(obj->relocbase + phdr_vaddr); + } else { + obj->phdr = malloc(phsize); + if (obj->phdr == NULL) { + obj_free(obj); + _rtld_error("%s: cannot allocate program header", + path); + goto error1; + } + memcpy(__DECONST(char *, obj->phdr), (char *)hdr + hdr->e_phoff, + phsize); + obj->phdr_alloc = true; } - } - - obj = obj_new(); - if (sb != NULL) { - obj->dev = sb->st_dev; - obj->ino = sb->st_ino; - } - obj->mapbase = mapbase; - obj->mapsize = mapsize; - obj->vaddrbase = base_vaddr; - obj->relocbase = mapbase - base_vaddr; - obj->dynamic = (const Elf_Dyn *)(obj->relocbase + phdyn->p_vaddr); - if (hdr->e_entry != 0) - obj->entry = (caddr_t)(obj->relocbase + hdr->e_entry); - if (phdr_vaddr != 0) { - obj->phdr = (const Elf_Phdr *)(obj->relocbase + phdr_vaddr); - } else { - obj->phdr = malloc(phsize); - if (obj->phdr == NULL) { - obj_free(obj); - _rtld_error("%s: cannot allocate program header", path); - goto error1; + obj->phsize = phsize; + if (phinterp != NULL) + obj->interp = (const char *)(obj->relocbase + + phinterp->p_vaddr); + if (phtls != NULL) { + tls_dtv_generation++; + obj->tlsindex = ++tls_max_index; + obj->tlssize = phtls->p_memsz; + obj->tlsalign = phtls->p_align; + obj->tlspoffset = phtls->p_offset; + obj->tlsinitsize = phtls->p_filesz; + obj->tlsinit = mapbase + phtls->p_vaddr; } - memcpy(__DECONST(char *, obj->phdr), (char *)hdr + hdr->e_phoff, phsize); - obj->phdr_alloc = true; - } - obj->phsize = phsize; - if (phinterp != NULL) - obj->interp = (const char *)(obj->relocbase + phinterp->p_vaddr); - if (phtls != NULL) { - tls_dtv_generation++; - obj->tlsindex = ++tls_max_index; - obj->tlssize = phtls->p_memsz; - obj->tlsalign = phtls->p_align; - obj->tlspoffset = phtls->p_offset; - obj->tlsinitsize = phtls->p_filesz; - obj->tlsinit = mapbase + phtls->p_vaddr; - } - obj->stack_flags = stack_flags; - if (note_start < note_end) - digest_notes(obj, note_start, note_end); - if (note_map != NULL) - munmap(note_map, note_map_len); - munmap(hdr, page_size); - return (obj); + obj->stack_flags = stack_flags; + if (note_start < note_end) + digest_notes(obj, note_start, note_end); + if (note_map != NULL) + munmap(note_map, note_map_len); + munmap(hdr, page_size); + return (obj); error1: - munmap(mapbase, mapsize); + munmap(mapbase, mapsize); error: - if (note_map != NULL && note_map != MAP_FAILED) - munmap(note_map, note_map_len); - if (!phdr_in_zero_page(hdr)) - munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); - munmap(hdr, page_size); - return (NULL); + if (note_map != NULL && note_map != MAP_FAILED) + munmap(note_map, note_map_len); + if (!phdr_in_zero_page(hdr)) + munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); + munmap(hdr, page_size); + return (NULL); } bool @@ -359,7 +381,8 @@ check_elf_headers(const Elf_Ehdr *hdr, const char *path) } if (hdr->e_phentsize != sizeof(Elf_Phdr)) { _rtld_error( - "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); + "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", + path); return (false); } return (true); @@ -397,9 +420,8 @@ get_elf_header(int fd, const char *path, const struct stat *sbp, if (phdr_in_zero_page(hdr)) { phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); } else { - phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), - PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, - hdr->e_phoff); + phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), PROT_READ, + MAP_PRIVATE | MAP_PREFAULT_READ, fd, hdr->e_phoff); if (phdr == MAP_FAILED) { _rtld_error("%s: error mapping phdr: %s", path, rtld_strerror(errno)); @@ -417,55 +439,57 @@ error: void obj_free(Obj_Entry *obj) { - Objlist_Entry *elm; - - if (obj->tls_static) - free_tls_offset(obj); - while (obj->needed != NULL) { - Needed_Entry *needed = obj->needed; - obj->needed = needed->next; - free(needed); - } - while (!STAILQ_EMPTY(&obj->names)) { - Name_Entry *entry = STAILQ_FIRST(&obj->names); - STAILQ_REMOVE_HEAD(&obj->names, link); - free(entry); - } - while (!STAILQ_EMPTY(&obj->dldags)) { - elm = STAILQ_FIRST(&obj->dldags); - STAILQ_REMOVE_HEAD(&obj->dldags, link); - free(elm); - } - while (!STAILQ_EMPTY(&obj->dagmembers)) { - elm = STAILQ_FIRST(&obj->dagmembers); - STAILQ_REMOVE_HEAD(&obj->dagmembers, link); - free(elm); - } - if (obj->vertab) - free(obj->vertab); - if (obj->origin_path) - free(obj->origin_path); - if (obj->z_origin) - free(__DECONST(void*, obj->rpath)); - if (obj->priv) - free(obj->priv); - if (obj->path) - free(obj->path); - if (obj->phdr_alloc) - free(__DECONST(void *, obj->phdr)); - free(obj); + Objlist_Entry *elm; + + if (obj->tls_static) + free_tls_offset(obj); + while (obj->needed != NULL) { + Needed_Entry *needed = obj->needed; + + obj->needed = needed->next; + free(needed); + } + while (!STAILQ_EMPTY(&obj->names)) { + Name_Entry *entry = STAILQ_FIRST(&obj->names); + + STAILQ_REMOVE_HEAD(&obj->names, link); + free(entry); + } + while (!STAILQ_EMPTY(&obj->dldags)) { + elm = STAILQ_FIRST(&obj->dldags); + STAILQ_REMOVE_HEAD(&obj->dldags, link); + free(elm); + } + while (!STAILQ_EMPTY(&obj->dagmembers)) { + elm = STAILQ_FIRST(&obj->dagmembers); + STAILQ_REMOVE_HEAD(&obj->dagmembers, link); + free(elm); + } + if (obj->vertab) + free(obj->vertab); + if (obj->origin_path) + free(obj->origin_path); + if (obj->z_origin) + free(__DECONST(void *, obj->rpath)); + if (obj->priv) + free(obj->priv); + if (obj->path) + free(obj->path); + if (obj->phdr_alloc) + free(__DECONST(void *, obj->phdr)); + free(obj); } Obj_Entry * obj_new(void) { - Obj_Entry *obj; + Obj_Entry *obj; - obj = CNEW(Obj_Entry); - STAILQ_INIT(&obj->dldags); - STAILQ_INIT(&obj->dagmembers); - STAILQ_INIT(&obj->names); - return obj; + obj = CNEW(Obj_Entry); + STAILQ_INIT(&obj->dldags); + STAILQ_INIT(&obj->dagmembers); + STAILQ_INIT(&obj->names); + return (obj); } /* @@ -475,26 +499,27 @@ obj_new(void) int convert_prot(int elfflags) { - int prot = 0; - if (elfflags & PF_R) - prot |= PROT_READ; - if (elfflags & PF_W) - prot |= PROT_WRITE; - if (elfflags & PF_X) - prot |= PROT_EXEC; - return prot; + int prot = 0; + + if ((elfflags & PF_R) != 0) + prot |= PROT_READ; + if ((elfflags & PF_W) != 0) + prot |= PROT_WRITE; + if ((elfflags & PF_X) != 0) + prot |= PROT_EXEC; + return (prot); } static int convert_flags(int elfflags) { - int flags = MAP_PRIVATE; /* All mappings are private */ - - /* - * Readonly mappings are marked "MAP_NOCORE", because they can be - * reconstructed by a debugger. - */ - if (!(elfflags & PF_W)) - flags |= MAP_NOCORE; - return flags; + int flags = MAP_PRIVATE; /* All mappings are private */ + + /* + * Readonly mappings are marked "MAP_NOCORE", because they can be + * reconstructed by a debugger. + */ + if ((elfflags & PF_W) == 0) + flags |= MAP_NOCORE; + return (flags); } From nobody Tue Jan 21 01:51:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY44pFtz5lJLt; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY36HMcz3cMs; Tue, 21 Jan 2025 01:51:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXK0FeAi7KfWenxfzqBhEYgwS3FoTNYVBi/CuPN2gHE=; b=T4yxuLMOa++SG9ZldY69etVUt7G6JI3tjHIFJ+VrTkSC9hTLofg6LrquHvQu7Opo4npEEK pv7qrYoxMeiIJUswhMGfBP0i7TQE4+7+W1DC3VkhHt8+VYBuCslZe6YV01/1SUlMrOX6+J Sb7iRX0NTXPIL8AIqKdm21JieuTRGhBTp0boB44ivHYJEUQuZPAdzk9SnIv7ohuEmXKt9O Itq2Q9tUqQhHWUqyEnsR4+siclq4Z8iloKujg5w8xptum6/zpT4Ex8EIGa0Px0uMdi/yTV /AcZVuLN8Y3j41jZTuLMeVkrUNJhrmyIiNDkXz5GV6KpcTzHzDwPgW2kdvt6nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXK0FeAi7KfWenxfzqBhEYgwS3FoTNYVBi/CuPN2gHE=; b=ebRwHFd/qiNGIgjQf7DCAuElnqDWA1vDhPo1HGvsSYtkE+PId8hR8BmrzIowmBnJvpgsPF dIczRYKp8lbo5n28HiBiQ+WS2ZorCs3TI5KC9AFHYDO0sOciHUwawAIO8XumQPSMi7rtc8 h3Vlow/ziUFjHTVrXEtQZ+9MiVncIVoqIY+Hn1m11nUicaqC8d8ufDkvsauovD1tSsvZUQ Ce3UNInEhPes2W07KQWYqjpmG7H9GJYVfMGUuxDYADjtacg0prnxl5t6/h77JRhVScmtKy vn2gTIaf9XkGxhMlcs0y/EOWJN4mFv4l1WB+vz29xABIsYRb/ETKMf9xb69gDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424263; a=rsa-sha256; cv=none; b=mhOg3eDHHCCH4bnAYO7s3oGUAB/lPGxBExL16iiob4brnns+Y8nwzgJhREEfZq5FD2QyzE rk0VyC79Ok4LriP9VnsG+lz8E69TdB+UtIMt4DblArnNa7SniQEfZBcs2im+InL8Yab68S HV0KitEFE87Oogf+wAAXMe/3YXWl8p+Jok4c0VhzjuApqQ9yVq13pY8UbyFMwZcp8ifVD7 d5GtRuGhPapYu7adP9lGgphnhJBvtncjGBjtJUvXeQ7Fxv5VrIK77aRayl6JWZHGpGg7Rk FWrjYCB8+L57WBO+XP8FdpkK8rRK+Iyit11Z3Q+H0P2M0++Vm1Kf0Xx3IfC3DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY35sdyzmDB; Tue, 21 Jan 2025 01:51:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p33h074211; Tue, 21 Jan 2025 01:51:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p3rS074208; Tue, 21 Jan 2025 01:51:03 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:03 GMT Message-Id: <202501210151.50L1p3rS074208@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: e3035c52f253 - main - rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: e3035c52f25356299abc8e08be9221032967554d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e3035c52f25356299abc8e08be9221032967554d commit e3035c52f25356299abc8e08be9221032967554d Author: Konstantin Belousov AuthorDate: 2025-01-18 03:07:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:42 +0000 rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/amd64/reloc.c | 2 -- libexec/rtld-elf/i386/reloc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 2e24d6287ea3..8183a306f7d2 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -405,9 +405,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index c91239eb3989..24c754865504 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -358,9 +358,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *obj __unused, const Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); From nobody Tue Jan 21 01:51:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY63ZVkz5lJRx; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY60VQmz3cM2; Tue, 21 Jan 2025 01:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9j+1UdRryTlhXZiB3CrlLA9HJxSunobOLaGC8LXbqLA=; b=DHLyfzNSL6qW+EaZXJQf0BjtjGXteHea/GsI5BVtf8PEGveLDLLXACZAGftikDcAA4mSed cwAkA1MfgRWkfYtkwidBlFGzKBY32mFHKt3HjwayFiCHVj3HMdv6tP3ksdqIYDBbyXbTky tr5BiXSTU/CTLLBojZ2kF/cQfKSxWHHnU5vAITt+n90EHiJyHkSklR6f+1VwAmxLb9lsie 0trkgqCQKEEGP+WfmP2Ka4sgJrPsFE+de1pDEYknSbMyw4Tc/VLfaaTCbHwLE35onXbH10 43C9KiG/xFudD0XiZs0qWtLAM4D+7aCztQKOTgfSyuounPeZKeFc8c36EQ275A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9j+1UdRryTlhXZiB3CrlLA9HJxSunobOLaGC8LXbqLA=; b=kkDVyLumecLNOuuv92uvbWWTmfducpZkoWi8K3L2esO01cNurjFljXh3xG0PtORr8+o1zg 4UtK0Q/RM/Io8xSjM/kUrYHC5eFggxQdxR8xREi4Gj026LdYkoH/Yv59GZjH4hnXJVqtra gkHIvxEIG8uHyCeBR1/Hoz+u0+FAGuOzakwbewDH0hq0odsj36FdOqXMSWA0KsxEpv/76T 0nSG4SJiklpjOScY7UbJwq2BE3zd0mW19f1Hq/PjNh7wuOownGnODCVZTNH47EbaNYPVBy JGXDgThAunrSgVB8mXLn9Ao6s14rC5AyQhQrq0pryTd+Rp14NAk0qmhqZEUCJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424266; a=rsa-sha256; cv=none; b=jkQYRWTMNROmRVB8W0J/0+WVvrcFUpThjV24BHytt8bW2z3PFMoHgSY2XffxmqVpzozuSl Tx3Qq+9ZSUROonw1rN6dAuuMpcYrWarMjxEHp2ULBI+PXD67PPDBXuMPhipI8qhYbgM0tv Zg0jPlRMMSOkzBJ9F9qKX4IDIYFBpACU/aswbVKoVBRVZwGnGqDixM+Mw0OLKFgMnqlV50 bLYMoAvVWVsZUruKv2+QbReeCEHDFM1GLtE+hBKMtJbSjMRAwtOEmdrKB4/0yyYvOJTGcG yz6uAY5xdyj+GozYHi/QwnAOq7A3OW8NRUaICTA9Iuvx1Re1sxfsOZHyE/G0qA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY600p9zlt6; Tue, 21 Jan 2025 01:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p5ZH075341; Tue, 21 Jan 2025 01:51:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p5Pu075338; Tue, 21 Jan 2025 01:51:05 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:05 GMT Message-Id: <202501210151.50L1p5Pu075338@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: 78b5dadb58e2 - main - rtld-elf/i386/reloc.c: apply clang-format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 78b5dadb58e201e51a3a2eda5cf8cab6d31e0b62 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=78b5dadb58e201e51a3a2eda5cf8cab6d31e0b62 commit 78b5dadb58e201e51a3a2eda5cf8cab6d31e0b62 Author: Konstantin Belousov AuthorDate: 2025-01-18 02:58:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:58 +0000 rtld-elf/i386/reloc.c: apply clang-format Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/i386/reloc.c | 367 +++++++++++++++++++++--------------------- 1 file changed, 186 insertions(+), 181 deletions(-) diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 24c754865504..3d724bcacb6f 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -33,6 +33,7 @@ #include #include + #include #include @@ -60,64 +61,68 @@ int do_copy_relocations(Obj_Entry *dstobj) { - const Elf_Rel *rellim; - const Elf_Rel *rel; - - assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ - - rellim = (const Elf_Rel *)((const char *)dstobj->rel + dstobj->relsize); - for (rel = dstobj->rel; rel < rellim; rel++) { - if (ELF_R_TYPE(rel->r_info) == R_386_COPY) { - void *dstaddr; - const Elf_Sym *dstsym; - const char *name; - size_t size; - const void *srcaddr; - const Elf_Sym *srcsym; - const Obj_Entry *srcobj, *defobj; - SymLook req; - int res; - - dstaddr = (void *)(dstobj->relocbase + rel->r_offset); - dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); - name = dstobj->strtab + dstsym->st_name; - size = dstsym->st_size; - symlook_init(&req, name); - req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rel->r_info)); - req.flags = SYMLOOK_EARLY; - - for (srcobj = globallist_next(dstobj); srcobj != NULL; - srcobj = globallist_next(srcobj)) { - res = symlook_obj(&req, srcobj); - if (res == 0) { - srcsym = req.sym_out; - defobj = req.defobj_out; - break; - } - } + const Elf_Rel *rellim; + const Elf_Rel *rel; + + assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ + + rellim = (const Elf_Rel *)((const char *)dstobj->rel + dstobj->relsize); + for (rel = dstobj->rel; rel < rellim; rel++) { + if (ELF_R_TYPE(rel->r_info) == R_386_COPY) { + void *dstaddr; + const Elf_Sym *dstsym; + const char *name; + size_t size; + const void *srcaddr; + const Elf_Sym *srcsym; + const Obj_Entry *srcobj, *defobj; + SymLook req; + int res; + + dstaddr = (void *)(dstobj->relocbase + rel->r_offset); + dstsym = dstobj->symtab + ELF_R_SYM(rel->r_info); + name = dstobj->strtab + dstsym->st_name; + size = dstsym->st_size; + symlook_init(&req, name); + req.ventry = fetch_ventry(dstobj, + ELF_R_SYM(rel->r_info)); + req.flags = SYMLOOK_EARLY; + + for (srcobj = globallist_next(dstobj); srcobj != NULL; + srcobj = globallist_next(srcobj)) { + res = symlook_obj(&req, srcobj); + if (res == 0) { + srcsym = req.sym_out; + defobj = req.defobj_out; + break; + } + } - if (srcobj == NULL) { - _rtld_error("Undefined symbol \"%s\" referenced from COPY" - " relocation in %s", name, dstobj->path); - return -1; - } + if (srcobj == NULL) { + _rtld_error( + "Undefined symbol \"%s\" referenced from COPY" + " relocation in %s", + name, dstobj->path); + return (-1); + } - srcaddr = (const void *)(defobj->relocbase + srcsym->st_value); - memcpy(dstaddr, srcaddr, size); + srcaddr = (const void *)(defobj->relocbase + + srcsym->st_value); + memcpy(dstaddr, srcaddr, size); + } } - } - return 0; + return (0); } /* Initialize the special GOT entries. */ void init_pltgot(Obj_Entry *obj) { - if (obj->pltgot != NULL) { - obj->pltgot[1] = (Elf_Addr) obj; - obj->pltgot[2] = (Elf_Addr) &_rtld_bind_start; - } + if (obj->pltgot != NULL) { + obj->pltgot[1] = (Elf_Addr)obj; + obj->pltgot[2] = (Elf_Addr)&_rtld_bind_start; + } } /* Process the non-PLT relocations. */ @@ -141,15 +146,16 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (obj != obj_rtld) { cache = calloc(obj->dynsymcount, sizeof(SymCache)); /* No need to check for NULL here */ - } else + } else { cache = NULL; + } /* Appease some compilers. */ symval = 0; def = NULL; rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); - for (rel = obj->rel; rel < rellim; rel++) { + for (rel = obj->rel; rel < rellim; rel++) { switch (ELF_R_TYPE(rel->r_info)) { case R_386_32: case R_386_PC32: @@ -171,8 +177,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, obj->non_plt_gnu_ifunc = true; continue; } - symval = (Elf_Addr)rtld_resolve_ifunc( - defobj, def); + symval = (Elf_Addr) + rtld_resolve_ifunc(defobj, def); break; case R_386_TLS_TPOFF: case R_386_TLS_TPOFF32: @@ -203,13 +209,13 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, *where += symval; break; case R_386_PC32: - /* - * I don't think the dynamic linker should ever - * see this type of relocation. But the - * binutils-2.6 tools sometimes generate it. - */ - *where += symval - (Elf_Addr)where; - break; + /* + * I don't think the dynamic linker should ever + * see this type of relocation. But the + * binutils-2.6 tools sometimes generate it. + */ + *where += symval - (Elf_Addr)where; + break; case R_386_COPY: /* * These are deferred until all other @@ -219,8 +225,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * only in executable files. */ if (!obj->mainprog) { - _rtld_error("%s: Unexpected R_386_COPY " - "relocation in shared library", obj->path); + _rtld_error( + "%s: Unexpected R_386_COPY relocation in shared library", + obj->path); goto done; } break; @@ -243,8 +250,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { - _rtld_error("%s: No space available " - "for static Thread Local Storage", + _rtld_error( + "%s: No space available for static Thread Local Storage", obj->path); goto done; } @@ -259,15 +266,15 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, *where += (Elf_Addr)defobj->tlsindex; break; case R_386_TLS_DTPOFF32: - *where += (Elf_Addr) def->st_value; + *where += (Elf_Addr)def->st_value; break; case R_386_IRELATIVE: obj->irelative_nonplt = true; break; default: - _rtld_error("%s: Unsupported relocation type %d" - " in non-PLT relocations\n", obj->path, - ELF_R_TYPE(rel->r_info)); + _rtld_error( + "%s: Unsupported relocation type %d in non-PLT relocations", + obj->path, ELF_R_TYPE(rel->r_info)); goto done; } } @@ -281,82 +288,81 @@ done: int reloc_plt(Obj_Entry *obj, int flags __unused, RtldLockState *lockstate __unused) { - const Elf_Rel *rellim; - const Elf_Rel *rel; - - rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); - for (rel = obj->pltrel; rel < rellim; rel++) { - Elf_Addr *where/*, val*/; - - switch (ELF_R_TYPE(rel->r_info)) { - case R_386_JMP_SLOT: - /* Relocate the GOT slot pointing into the PLT. */ - where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - *where += (Elf_Addr)obj->relocbase; - break; - - case R_386_IRELATIVE: - obj->irelative = true; - break; - - default: - _rtld_error("Unknown relocation type %x in PLT", - ELF_R_TYPE(rel->r_info)); - return (-1); + const Elf_Rel *rellim; + const Elf_Rel *rel; + + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); + for (rel = obj->pltrel; rel < rellim; rel++) { + Elf_Addr *where; + + switch (ELF_R_TYPE(rel->r_info)) { + case R_386_JMP_SLOT: + /* Relocate the GOT slot pointing into the PLT. */ + where = (Elf_Addr *)(obj->relocbase + rel->r_offset); + *where += (Elf_Addr)obj->relocbase; + break; + + case R_386_IRELATIVE: + obj->irelative = true; + break; + + default: + _rtld_error("Unknown relocation type %x in PLT", + ELF_R_TYPE(rel->r_info)); + return (-1); + } } - } - return 0; + return (0); } /* Relocate the jump slots in an object. */ int reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { - const Elf_Rel *rellim; - const Elf_Rel *rel; + const Elf_Rel *rellim; + const Elf_Rel *rel; - if (obj->jmpslots_done) - return 0; - rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); - for (rel = obj->pltrel; rel < rellim; rel++) { - Elf_Addr *where, target; - const Elf_Sym *def; - const Obj_Entry *defobj; + if (obj->jmpslots_done) + return (0); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); + for (rel = obj->pltrel; rel < rellim; rel++) { + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; + + switch (ELF_R_TYPE(rel->r_info)) { + case R_386_JMP_SLOT: + where = (Elf_Addr *)(obj->relocbase + rel->r_offset); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + obj->gnu_ifunc = true; + continue; + } + target = (Elf_Addr)(defobj->relocbase + def->st_value); + reloc_jmpslot(where, target, defobj, obj, rel); + break; - switch (ELF_R_TYPE(rel->r_info)) { - case R_386_JMP_SLOT: - where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - SYMLOOK_IN_PLT | flags, NULL, lockstate); - if (def == NULL) - return (-1); - if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { - obj->gnu_ifunc = true; - continue; - } - target = (Elf_Addr)(defobj->relocbase + def->st_value); - reloc_jmpslot(where, target, defobj, obj, rel); - break; - - case R_386_IRELATIVE: - break; - - default: - _rtld_error("Unknown relocation type %x in PLT", - ELF_R_TYPE(rel->r_info)); - return (-1); + case R_386_IRELATIVE: + break; + + default: + _rtld_error("Unknown relocation type %x in PLT", + ELF_R_TYPE(rel->r_info)); + return (-1); + } } - } - obj->jmpslots_done = true; - return 0; + obj->jmpslots_done = true; + return (0); } /* Fixup the jump slot at "where" to transfer control to "target". */ Elf_Addr -reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const Obj_Entry *obj __unused, const Obj_Entry *refobj __unused, - const Elf_Rel *rel __unused) +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *obj __unused, + const Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { dbg("reloc_jmpslot: *%p = %p", where, (void *)target); if (!ld_bind_not) @@ -365,8 +371,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, } static void -reloc_iresolve_one(Obj_Entry *obj, const Elf_Rel *rel, - RtldLockState *lockstate) +reloc_iresolve_one(Obj_Entry *obj, const Elf_Rel *rel, RtldLockState *lockstate) { Elf_Addr *where, target; @@ -387,7 +392,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate) return (0); obj->irelative = false; rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); - for (rel = obj->pltrel; rel < rellim; rel++) { + for (rel = obj->pltrel; rel < rellim; rel++) { if (ELF_R_TYPE(rel->r_info) == R_386_IRELATIVE) reloc_iresolve_one(obj, rel, lockstate); } @@ -404,7 +409,7 @@ reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate) return (0); obj->irelative_nonplt = false; rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize); - for (rel = obj->rel; rel < rellim; rel++) { + for (rel = obj->rel; rel < rellim; rel++) { if (ELF_R_TYPE(rel->r_info) == R_386_IRELATIVE) reloc_iresolve_one(obj, rel, lockstate); } @@ -414,36 +419,36 @@ reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate) int reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) { - const Elf_Rel *rellim; - const Elf_Rel *rel; + const Elf_Rel *rellim; + const Elf_Rel *rel; - if (!obj->gnu_ifunc) - return (0); - rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); - for (rel = obj->pltrel; rel < rellim; rel++) { - Elf_Addr *where, target; - const Elf_Sym *def; - const Obj_Entry *defobj; + if (!obj->gnu_ifunc) + return (0); + rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize); + for (rel = obj->pltrel; rel < rellim; rel++) { + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; - switch (ELF_R_TYPE(rel->r_info)) { - case R_386_JMP_SLOT: - where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, - SYMLOOK_IN_PLT | flags, NULL, lockstate); - if (def == NULL) - return (-1); - if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) - continue; - lock_release(rtld_bind_lock, lockstate); - target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); - wlock_acquire(rtld_bind_lock, lockstate); - reloc_jmpslot(where, target, defobj, obj, rel); - break; + switch (ELF_R_TYPE(rel->r_info)) { + case R_386_JMP_SLOT: + where = (Elf_Addr *)(obj->relocbase + rel->r_offset); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) + continue; + lock_release(rtld_bind_lock, lockstate); + target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); + reloc_jmpslot(where, target, defobj, obj, rel); + break; + } } - } - obj->gnu_ifunc = false; - return (0); + obj->gnu_ifunc = false; + return (0); } uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; @@ -451,14 +456,13 @@ uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; static void rtld_cpuid_count(int idx, int cnt, u_int *p) { - __asm __volatile( " pushl %%ebx\n" " cpuid\n" " movl %%ebx,%1\n" " popl %%ebx\n" - : "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (idx), "2" (cnt)); + : "=a"(p[0]), "=r"(p[1]), "=c"(p[2]), "=d"(p[3]) + : "0"(idx), "2"(cnt)); } void @@ -482,7 +486,9 @@ ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) " jmp 2f\n" "1: movl $0,%0\n" "2:\n" - : "=r" (cpuid_supported) : : "eax", "ecx"); + : "=r"(cpuid_supported) + : + : "eax", "ecx"); if (!cpuid_supported) return; @@ -501,21 +507,20 @@ ifunc_init(Elf_Auxinfo *aux_info[__min_size(AT_COUNT)] __unused) void allocate_initial_tls(Obj_Entry *objs) { - void* tls; - - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + ld_static_tls_extra; - tls = allocate_tls(objs, NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); - _tcb_set(tls); + void *tls; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + tls_static_space = tls_last_offset + ld_static_tls_extra; + tls = allocate_tls(objs, NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); + _tcb_set(tls); } /* GNU ABI */ -__attribute__((__regparm__(1))) -void * +__attribute__((__regparm__(1))) void * ___tls_get_addr(tls_index *ti) { uintptr_t **dtvp; @@ -535,18 +540,18 @@ __tls_get_addr(tls_index *ti) } size_t -calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, - size_t size, size_t align, size_t offset) +calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, size_t size, + size_t align, size_t offset) { size_t res; - /* + /* * res is the smallest integer satisfying res - prev_offset >= size - * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). + * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). */ - res = prev_offset + size + align - 1; - res -= (res + offset) & (align - 1); - return (res); + res = prev_offset + size + align - 1; + res -= (res + offset) & (align - 1); + return (res); } size_t From nobody Tue Jan 21 01:51:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVY549D4z5lJZd; Tue, 21 Jan 2025 01:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVY46x8hz3cZ2; Tue, 21 Jan 2025 01:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KomR65yIQuKXtsid3RqeaoS3a4mu/EGwRt0vbY3mnrM=; b=PE0agOTlTb9PuhPuYzAtTOIbMELBuWF+CoW/mC4Fg7ac0oeRhK9IG5/mL9KtvOADuasSIO b7+yoIgm1BiZRu+kl8nKrqDxwtESxDLFiwetMAYL3RsiUEYbyBLBIWMgAmQJ+7vSVu0fMs s4KpjYbsK7Xo4xX4g6eHDP6/6ky+Gnj/5r/tXA7uAY9IC32PwCs0e68Z2swkfUAEZNkfbZ 4nMdXRI7RpgVjPjbm3yh+C2qf9tNv4X6vZ2cC5zG8ZN9xgr8w4Su8885X/07xTlcCWsw0V GhXSbZxoMFniYlKL9I4u2b5SMRegzJblKmM3L1WFydNhdUpE/0LqJIJ7XzQ/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KomR65yIQuKXtsid3RqeaoS3a4mu/EGwRt0vbY3mnrM=; b=rqkYP/zSaIXlYXgzgzUE/hDK3dX/JDWFCXpmufhJs4gQ6tzZiOhoCJuQaAntvVQB70/miU lQ4P16cIbFegzgwQx8VfcuABMHuLZTt2X+laWGo+lE6IG96lNxg1wf7JLdlQAb3MVweTiK XY4SdHq1zjQEGK69s4vKecRko/SKKGlO2lzvARPdvwqvLEsKYSL6JobWALJDpe6+qimrNX KfeFUJtRWVPYn6fKbCntEZK36a6hHnnwMoQVqYzdVTdkwWjU3aMc20hcgwItOtrIERBAMF mGqYjxMICfxE9KjzV3qJRGAV4kjh6aSIbJbeTdBS4G851qRsQBW4iTYVXgshUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424264; a=rsa-sha256; cv=none; b=g+RpRaCHrYAua/UHu8YoyKI9YNuZj+9YZRlZFDCPHVkWeUT99UklIa1mXXxnE/R0bl7gJW jIh5HJMszpNfHdZ+d3Q6ZDw90m/DoqQrG7g4DiJHI0lXx0wce7DjNbmRWgXXWORgLv7avq K+x0LnWlTX3lvVHtC2nimclXO6fxeSQPF37ymR1Koq7o2B4bjKrsbtE0FJvlhUeo1xjx9R M9384LRQ/pw5HRcNwhF+5CUe67XlO0RpyzxNksGzF1/PWydSKsXpqDnlOSkQYmLf3EUEx4 /dFOSv6CUfsibEM3gZc9cMSIxUwFbf7SvsF4xOuIznModWoWGDx3drMY16cBaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVY46QglzmDC; Tue, 21 Jan 2025 01:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1p4lI075122; Tue, 21 Jan 2025 01:51:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1p4L5075109; Tue, 21 Jan 2025 01:51:04 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:51:04 GMT Message-Id: <202501210151.50L1p4L5075109@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: 3a85aa6a1d89 - main - rtld-elf/amd64/reloc.c: apply clang-format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3a85aa6a1d8916082155867ce0545a07185e8924 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a85aa6a1d8916082155867ce0545a07185e8924 commit 3a85aa6a1d8916082155867ce0545a07185e8924 Author: Konstantin Belousov AuthorDate: 2025-01-18 02:53:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:44:49 +0000 rtld-elf/amd64/reloc.c: apply clang-format Discussed with: emaste, imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D48509 --- libexec/rtld-elf/amd64/reloc.c | 347 +++++++++++++++++++++-------------------- 1 file changed, 180 insertions(+), 167 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 8183a306f7d2..b5750ac746b2 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -34,6 +34,7 @@ #define _WANT_P_OSREL #include #include + #include #include #include @@ -62,64 +63,68 @@ int do_copy_relocations(Obj_Entry *dstobj) { - const Elf_Rela *relalim; - const Elf_Rela *rela; - - assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ - - relalim = (const Elf_Rela *)((const char *) dstobj->rela + dstobj->relasize); - for (rela = dstobj->rela; rela < relalim; rela++) { - if (ELF_R_TYPE(rela->r_info) == R_X86_64_COPY) { - void *dstaddr; - const Elf_Sym *dstsym; - const char *name; - size_t size; - const void *srcaddr; - const Elf_Sym *srcsym; - const Obj_Entry *srcobj, *defobj; - SymLook req; - int res; - - dstaddr = (void *)(dstobj->relocbase + rela->r_offset); - dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); - name = dstobj->strtab + dstsym->st_name; - size = dstsym->st_size; - symlook_init(&req, name); - req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); - req.flags = SYMLOOK_EARLY; - - for (srcobj = globallist_next(dstobj); srcobj != NULL; - srcobj = globallist_next(srcobj)) { - res = symlook_obj(&req, srcobj); - if (res == 0) { - srcsym = req.sym_out; - defobj = req.defobj_out; - break; - } - } + const Elf_Rela *relalim; + const Elf_Rela *rela; - if (srcobj == NULL) { - _rtld_error("Undefined symbol \"%s\" referenced from COPY" - " relocation in %s", name, dstobj->path); - return -1; - } + assert(dstobj->mainprog); /* COPY relocations are invalid elsewhere */ + + relalim = (const Elf_Rela *)((const char *)dstobj->rela + + dstobj->relasize); + for (rela = dstobj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) == R_X86_64_COPY) { + void *dstaddr; + const Elf_Sym *dstsym; + const char *name; + size_t size; + const void *srcaddr; + const Elf_Sym *srcsym; + const Obj_Entry *srcobj, *defobj; + SymLook req; + int res; + + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); + dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); + name = dstobj->strtab + dstsym->st_name; + size = dstsym->st_size; + symlook_init(&req, name); + req.ventry = fetch_ventry(dstobj, + ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; + + for (srcobj = globallist_next(dstobj); srcobj != NULL; + srcobj = globallist_next(srcobj)) { + res = symlook_obj(&req, srcobj); + if (res == 0) { + srcsym = req.sym_out; + defobj = req.defobj_out; + break; + } + } + + if (srcobj == NULL) { + _rtld_error( + "Undefined symbol \"%s\" referenced from COPY relocation in %s", + name, dstobj->path); + return (-1); + } - srcaddr = (const void *)(defobj->relocbase + srcsym->st_value); - memcpy(dstaddr, srcaddr, size); + srcaddr = (const void *)(defobj->relocbase + + srcsym->st_value); + memcpy(dstaddr, srcaddr, size); + } } - } - return 0; + return (0); } /* Initialize the special GOT entries. */ void init_pltgot(Obj_Entry *obj) { - if (obj->pltgot != NULL) { - obj->pltgot[1] = (Elf_Addr) obj; - obj->pltgot[2] = (Elf_Addr) &_rtld_bind_start; - } + if (obj->pltgot != NULL) { + obj->pltgot[1] = (Elf_Addr)obj; + obj->pltgot[2] = (Elf_Addr)&_rtld_bind_start; + } } /* Process the non-PLT relocations. */ @@ -150,8 +155,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, } else cache = NULL; - relalim = (const Elf_Rela *)((const char*)obj->rela + obj->relasize); - for (rela = obj->rela; rela < relalim; rela++) { + relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); + for (rela = obj->rela; rela < relalim; rela++) { /* * First, resolve symbol for relocations which * reference symbols. @@ -165,10 +170,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, case R_X86_64_DTPMOD64: case R_X86_64_DTPOFF64: case R_X86_64_DTPOFF32: - def = find_symdef(ELF_R_SYM(rela->r_info), obj, - &defobj, flags, cache, lockstate); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + flags, cache, lockstate); if (def == NULL) goto done; + /* * If symbol is IFUNC, only perform relocation * when caller allowed it by passing @@ -228,19 +234,21 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * binutils-2.6 tools sometimes generate it. */ *where32 = (Elf32_Addr)(unsigned long)(symval + - rela->r_addend - (Elf_Addr)where); + rela->r_addend - (Elf_Addr)where); break; /* missing: R_X86_64_GOT32 R_X86_64_PLT32 */ case R_X86_64_COPY: /* - * These are deferred until all other relocations have - * been done. All we do here is make sure that the COPY - * relocation is not in a shared library. They are - * allowed only in executable files. + * These are deferred until all other + * relocations have been done. All we do here + * is make sure that the COPY relocation is + * not in a shared library. They are allowed + * only in executable files. */ if (!obj->mainprog) { - _rtld_error("%s: Unexpected R_X86_64_COPY " - "relocation in shared library", obj->path); + _rtld_error( + "%s: Unexpected R_X86_64_COPY relocation in shared library", + obj->path); goto done; } break; @@ -257,10 +265,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * of space, we generate an error. */ if (!defobj->tls_static) { - if (!allocate_tls_offset( - __DECONST(Obj_Entry *, defobj))) { - _rtld_error("%s: No space available " - "for static Thread Local Storage", + if (!allocate_tls_offset(__DECONST(Obj_Entry *, + defobj))) { + _rtld_error( + "%s: No space available for static Thread Local Storage", obj->path); goto done; } @@ -278,10 +286,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * of space, we generate an error. */ if (!defobj->tls_static) { - if (!allocate_tls_offset( - __DECONST(Obj_Entry *, defobj))) { - _rtld_error("%s: No space available " - "for static Thread Local Storage", + if (!allocate_tls_offset(__DECONST(Obj_Entry *, + defobj))) { + _rtld_error( + "%s: No space available for static Thread Local Storage", obj->path); goto done; } @@ -312,9 +320,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * R_X86_64_PC16, R_X86_64_8, R_X86_64_PC8 */ default: - _rtld_error("%s: Unsupported relocation type %u" - " in non-PLT relocations\n", obj->path, - (unsigned int)ELF_R_TYPE(rela->r_info)); + _rtld_error( + "%s: Unsupported relocation type %u in non-PLT relocations", + obj->path, (unsigned int)ELF_R_TYPE(rela->r_info)); goto done; } } @@ -328,82 +336,85 @@ done: int reloc_plt(Obj_Entry *obj, int flags __unused, RtldLockState *lockstate __unused) { - const Elf_Rela *relalim; - const Elf_Rela *rela; - - relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); - for (rela = obj->pltrela; rela < relalim; rela++) { - Elf_Addr *where; - - switch(ELF_R_TYPE(rela->r_info)) { - case R_X86_64_JMP_SLOT: - /* Relocate the GOT slot pointing into the PLT. */ - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - *where += (Elf_Addr)obj->relocbase; - break; - - case R_X86_64_IRELATIVE: - obj->irelative = true; - break; - - default: - _rtld_error("Unknown relocation type %x in PLT", - (unsigned int)ELF_R_TYPE(rela->r_info)); - return (-1); + const Elf_Rela *relalim; + const Elf_Rela *rela; + + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where; + + switch (ELF_R_TYPE(rela->r_info)) { + case R_X86_64_JMP_SLOT: + /* Relocate the GOT slot pointing into the PLT. */ + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + *where += (Elf_Addr)obj->relocbase; + break; + + case R_X86_64_IRELATIVE: + obj->irelative = true; + break; + + default: + _rtld_error("Unknown relocation type %x in PLT", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } } - } - return 0; + return (0); } /* Relocate the jump slots in an object. */ int reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) { - const Elf_Rela *relalim; - const Elf_Rela *rela; - - if (obj->jmpslots_done) - return 0; - relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); - for (rela = obj->pltrela; rela < relalim; rela++) { - Elf_Addr *where, target; - const Elf_Sym *def; - const Obj_Entry *defobj; + const Elf_Rela *relalim; + const Elf_Rela *rela; - switch (ELF_R_TYPE(rela->r_info)) { - case R_X86_64_JMP_SLOT: - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - SYMLOOK_IN_PLT | flags, NULL, lockstate); - if (def == NULL) - return (-1); - if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { - obj->gnu_ifunc = true; - continue; - } - target = (Elf_Addr)(defobj->relocbase + def->st_value + rela->r_addend); - reloc_jmpslot(where, target, defobj, obj, (const Elf_Rel *)rela); - break; - - case R_X86_64_IRELATIVE: - break; - - default: - _rtld_error("Unknown relocation type %x in PLT", - (unsigned int)ELF_R_TYPE(rela->r_info)); - return (-1); + if (obj->jmpslots_done) + return (0); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; + + switch (ELF_R_TYPE(rela->r_info)) { + case R_X86_64_JMP_SLOT: + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, + &defobj, SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) { + obj->gnu_ifunc = true; + continue; + } + target = (Elf_Addr)(defobj->relocbase + def->st_value + + rela->r_addend); + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *)rela); + break; + + case R_X86_64_IRELATIVE: + break; + + default: + _rtld_error("Unknown relocation type %x in PLT", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } } - } - obj->jmpslots_done = true; - return 0; + obj->jmpslots_done = true; + return (0); } /* Fixup the jump slot at "where" to transfer control to "target". */ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, - const struct Struct_Obj_Entry *obj __unused, - const struct Struct_Obj_Entry *refobj __unused, - const Elf_Rel *rel __unused) + const struct Struct_Obj_Entry *obj __unused, + const struct Struct_Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { dbg("reloc_jmpslot: *%p = %p", where, (void *)target); if (!ld_bind_not) @@ -436,7 +447,7 @@ reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate) obj->irelative = false; relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); - for (rela = obj->pltrela; rela < relalim; rela++) { + for (rela = obj->pltrela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) == R_X86_64_IRELATIVE) reloc_iresolve_one(obj, rela, lockstate); } @@ -453,7 +464,7 @@ reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate) return (0); obj->irelative_nonplt = false; relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize); - for (rela = obj->rela; rela < relalim; rela++) { + for (rela = obj->rela; rela < relalim; rela++) { if (ELF_R_TYPE(rela->r_info) == R_X86_64_IRELATIVE) reloc_iresolve_one(obj, rela, lockstate); } @@ -463,35 +474,37 @@ reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate) int reloc_gnu_ifunc(Obj_Entry *obj, int flags, RtldLockState *lockstate) { - const Elf_Rela *relalim; - const Elf_Rela *rela; + const Elf_Rela *relalim; + const Elf_Rela *rela; - if (!obj->gnu_ifunc) - return (0); - relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize); - for (rela = obj->pltrela; rela < relalim; rela++) { - Elf_Addr *where, target; - const Elf_Sym *def; - const Obj_Entry *defobj; + if (!obj->gnu_ifunc) + return (0); + relalim = (const Elf_Rela *)((const char *)obj->pltrela + + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where, target; + const Elf_Sym *def; + const Obj_Entry *defobj; - switch (ELF_R_TYPE(rela->r_info)) { - case R_X86_64_JMP_SLOT: - where = (Elf_Addr *)(obj->relocbase + rela->r_offset); - def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - SYMLOOK_IN_PLT | flags, NULL, lockstate); - if (def == NULL) - return (-1); - if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) - continue; - lock_release(rtld_bind_lock, lockstate); - target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); - wlock_acquire(rtld_bind_lock, lockstate); - reloc_jmpslot(where, target, defobj, obj, (const Elf_Rel *)rela); - break; + switch (ELF_R_TYPE(rela->r_info)) { + case R_X86_64_JMP_SLOT: + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, + SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) + return (-1); + if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) + continue; + lock_release(rtld_bind_lock, lockstate); + target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); + reloc_jmpslot(where, target, defobj, obj, + (const Elf_Rel *)rela); + break; + } } - } - obj->gnu_ifunc = false; - return (0); + obj->gnu_ifunc = false; + return (0); } uint32_t cpu_feature, cpu_feature2, cpu_stdext_feature, cpu_stdext_feature2; @@ -550,18 +563,18 @@ __tls_get_addr(tls_index *ti) } size_t -calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, - size_t size, size_t align, size_t offset) +calculate_tls_offset(size_t prev_offset, size_t prev_size __unused, size_t size, + size_t align, size_t offset) { size_t res; - /* + /* * res is the smallest integer satisfying res - prev_offset >= size - * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). + * and (-res) % p_align = p_vaddr % p_align (= p_offset % p_align). */ - res = prev_offset + size + align - 1; - res -= (res + offset) & (align - 1); - return (res); + res = prev_offset + size + align - 1; + res -= (res + offset) & (align - 1); + return (res); } size_t From nobody Tue Jan 21 01:58:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcVj641CFz5lJvq; Tue, 21 Jan 2025 01:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcVj63L92z3fx4; Tue, 21 Jan 2025 01:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAzsnMNYimhdbC0o5Q/97keE7bfftelv6BPRrYPX/7U=; b=AFblWa9+e+25AqRdCLJ2iln7PO8Jqmc/Nos8EX4OXfpKAiVugIdbM3PBNaunyKXvMbvuMw 0qoG17Vl7KSM+m/r8I3vYivExxIq7CajeaKexZxpW0zeAtyeoUrB6VMsi3ec7ZDmkXKM3z nWOB1YYcdHxPgHwTp0QEsH0IDIkmqTIAxmgaeQ0ikdEsgfgO2vqn2L+ZPdCsT52yR86IyX RnvVvP2sBw8RHjYBX7Zd2QcD5vbAx1EcjzybtWV3v9auXK4nAmV9H2BxI9tXBfRnoSoPrB kilFB5A4I/wVVH/WhZnW1VedDGvyQPATjjXfg4kkyvKWRVCOQUu0saB+yIhSWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737424682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAzsnMNYimhdbC0o5Q/97keE7bfftelv6BPRrYPX/7U=; b=POwBdLqCKzXR1Dk+L1RE+dZbFpy4zpCE9tdJ+31LXqPi+YiSA2FfW9RAHhGtod1ASeG4e/ nEwXqy3zdHcBT9ld8g3d0EH4E2QpRV27k4t6juFZvlmZnxzhzsgY6WEtok0viGfS/cPJlc Ys34kIt+BOlTJ8iXB+uYLEF59xdP3XkNEE8BPRO8Fvh5oOQvHArcUASVzea8X762BSMCs2 zST7cN35dXUS/xn4wcK/iZZ+yrNLDzK2m/EfjH4vnNTHGnwyfCYapKLdT/DIq9ySiFqJl1 W6s0tHrc0U6+lgFuCUraCOAzI/IeBxGpR1dqbpgEkhnS0ewkHEX/I9qOuPlVdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737424682; a=rsa-sha256; cv=none; b=djGZUNvG/vBIUVI8qPAN/XG7InGzxONJ8PNJXCQimEuL7f3bTlUcv3rg/U2vLFFyrjo4CB NDxtFZ+XoaWwYGYV5tAXzaRP5Xe1tIvqcOeUgE4HQ7k9adRfiTlLMdzk166xKczY6l9EwH TJcAqGpmRj/xxeXy2gmVOxDLd9KysgmhnA6fpnH8s3V5XNUv0GUeZ9+uwyBk2QsxCCqsah 0/sly/yIgfDSryO6jtXhpz8fWVkpVnYWd5jdsb2JVoPG7tW5EjhwhUKd/nwNKC+fVeV1sa EzrQ7G7Sxrn6movvEBQdqgaIavvP1BZCU9kClQ2Dkxl/8aqPNalM1egoqAiKLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcVj62rWRzmhl; Tue, 21 Jan 2025 01:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L1w2bY082321; Tue, 21 Jan 2025 01:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L1w2Q8082318; Tue, 21 Jan 2025 01:58:02 GMT (envelope-from git) Date: Tue, 21 Jan 2025 01:58:02 GMT Message-Id: <202501210158.50L1w2Q8082318@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: eaede4e41376 - main - git-blame-ignore-revs: list rtld-elf reformatting List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: eaede4e413769310d394955c2646c62c0c09b877 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eaede4e413769310d394955c2646c62c0c09b877 commit eaede4e413769310d394955c2646c62c0c09b877 Author: Konstantin Belousov AuthorDate: 2025-01-21 01:57:21 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-21 01:57:21 +0000 git-blame-ignore-revs: list rtld-elf reformatting Sponsored by: The FreeBSD Foundation --- .git-blame-ignore-revs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 10738c9c633b..7a8f6bbe90b7 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,6 +8,11 @@ # # This file is sorted in git log order (newest commits first). +# reformat libexec/rtld-elf +7e2f38311e62b1a3ba4a023042f2dc36e27cdd06 +986c96b54b9ec1118d285b723f53c7451a4c0772 +3a85aa6a1d8916082155867ce0545a07185e8924 +78b5dadb58e201e51a3a2eda5cf8cab6d31e0b62 # whitespace fixes for sys/sys/kernel.h 5c623697d6011de63bc762560a648c09379e06d2 # style fixes for iflib From nobody Tue Jan 21 02:50:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcWsP6JyWz5lN38 for ; Tue, 21 Jan 2025 02:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcWsP5K9Tz3kMQ; Tue, 21 Jan 2025 02:50:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737427817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g9YIPbbSMcOk6ehVfJJpYaviNOL5G6nM12t5VqWTZ5A=; b=X5wAnyFSejsKQZTj/EYf0KCOrAJ3DsflDbTuZU8wUfBmWWQoe9EqMQfTktDibs4N5OzKu/ BbfFAFxvLHKrBappnrjnIi3Ymluir3WGR4SClKa29uXf3sS7+R0uPhiLikzEct6NIZBFEk Ic+553/iRpgI/KtSR3i26UmGKZ4ovB02JF9+2G52FGlORAdrPzSm++wFaDn2IETOE4qFdx qx/3qX24G57i4tkGwSw8VDeBRI3ZajfTMmQzSeEM2sjAc6JGyuzfYEvHc1dUoIKm+bCXkh pqdNxScg46ruTYvHQVx2k/ZEPiZqrbfET/WQXxH+VdqH0Ox50vSL6rTt1RRcmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737427817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g9YIPbbSMcOk6ehVfJJpYaviNOL5G6nM12t5VqWTZ5A=; b=jif2KMZRMBqjpmQLFdxsYRpslQ4pvtsD23VktV3gWClTqZiqWIBFUFafsq75OIIyn3dZ2t wQc6JVziUXLoTeJWwU0V7zAi7VSUNKFS9VQmY0f+aF49/7JyESCekMKbGpEcx6rhYHQsc+ g/3aHg8bKNd39aLSScVdUIco3UN6NPGFxmQn4uhYN268akc6dtElY8rjquZMda03+tXGXL F0QcUhL7wThw4stBnEA2trRK79bfp7BHF/Bo2tcjFnN2KN50uw/nq+wKwi0NfYTwMHa0Rm uu42abbvJBtZWRacfdF/v2AtrjNugTY5e5en+hCiwhj8pjwx7TLfmnIi/f5lLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737427817; a=rsa-sha256; cv=none; b=DNjlvXBWAgzlnY86h7JwJ47BRrbTVxVrvHmfV03liweCFT4mTnXkntBj6GGRt0azjtr8jH xqQIrT6v4getr8ZzSLspeTHtA9ANYa9QBrD87/Rwz76FGnj9N+gG0hSmiKy2kjI4KrezUB uKweFd1splXTA1dctf3R8++IiJFGlGG0EClUClQLQHe7GvIEC99OCHyuLyhXlun9y56GRU Ck8lsdvtRREwSL44NNX2ukr9Tcm3dol3YPmxGPafLlhiWn4a4N+ssF5ml6MjftTyvmJBjg ZsWMq9WPCdvSz/xEHmnYCslhzC7xDJb12iB4a3nFY/P/+/iToCzUCg4RK/MbPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcWsP4qzhzntS; Tue, 21 Jan 2025 02:50:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L2oHnS085304; Tue, 21 Jan 2025 02:50:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L2oHM6085300; Tue, 21 Jan 2025 02:50:17 GMT (envelope-from git) Date: Tue, 21 Jan 2025 02:50:17 GMT Message-Id: <202501210250.50L2oHM6085300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: d5941a4f5fda - Create tag vendor/spleen/2.1.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/tags/vendor/spleen/2.1.0 X-Git-Reftype: annotated tag X-Git-Commit: d5941a4f5fda7400e8962294b4edf0340a64ca7f Auto-Submitted: auto-generated The annotated tag vendor/spleen/2.1.0 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/spleen/2.1.0 tag vendor/spleen/2.1.0 Tagger: Ed Maste TaggerDate: 2025-01-21 02:49:36 +0000 Tag Spleen font 2.1.0 commit e364562a4012d6d9cb334795b97e929cfa2a5dff Author: Eygene Ryabinkin AuthorDate: 2025-01-05 19:32:40 +0000 Commit: Ed Maste CommitDate: 2025-01-21 02:46:00 +0000 Vendor import of Spleen font 2.1.0 From nobody Tue Jan 21 02:50:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcWsn5Wxxz5lN5T for ; Tue, 21 Jan 2025 02:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcWsn2pd9z3kxn; Tue, 21 Jan 2025 02:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737427837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XEiODEpzDYTrGh68LLSzDvzl8P0xYRYauwsykA3i+fA=; b=sFBULNGV+VPhLTe9/eghyK389m8MtcVruhc+DZ7t+KBVempBBIlwFA5zAcQGlYe0M90Arj PWN5CDRt/9VqVGvjdq/w1vlLwtNfi5QQIX4gQVM7nIuzRu04XPvYCmIRr+H2c4WPPLzg1k OrQzUS4MUAg0trH8AFu6NbetSfk+a1GZjD0FMRCJPepLeehmONpQi5elSL4EhlWbf3sEBz WDLUKn2F0Eu+2HwHTkczfVe6s4UcDbZt/EYf1bnYAMnn1EgIgGAQn/HidIlhNbZfuuGcu9 eZh3kC5oA9vpOccb9Ic8ItwDm4vBQpIkVGSxHfCx1CosC72dT1SjWDadX0qUmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737427837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XEiODEpzDYTrGh68LLSzDvzl8P0xYRYauwsykA3i+fA=; b=Nh7AvNmsuBjCKhqaGHjPj5nhcJ1KMkToUIZ1OBjwbT01Lcr6mzJrfgzd6paf1W7PQxHM1B 5EJEUbXBAIOLzomaXQH+3WEHyDiTmZ7rKdN5v/PR5BeBa7ZZrmfKGadTI6ntqSQjk+6JRy HHFiyNEaCBqHx3mcBffMrQZWVvqKje9Te8joHHKie0tKlz61rGQKwV24u2Xah9zaB7aEuk Zwzak6NFx7BXZV7ZQKeAnA2IgIBfkGavKgrWQot2Zi3icEcoLx7dzefOL+FAoxWu0fkGGg cKEF4lTgHkkWcrrIaQVvk6giC3z4CRqqd9Bvd1LzLhXBbpAzrFZ0YV6eABxytg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737427837; a=rsa-sha256; cv=none; b=I8fo76xei1s4vinJAOM9MFabd80p4nuvtb3Xx3agmcrLbkYwQTkgSs12+EoLMllutPP1U3 DUOOmiMbz+KxjpZRhah0qyXGWhShVcnv+LMZ3QstNL1XnKAJocVdTkwdTjPY7tcS4pB8ad PXQwOS48KXgFeFlI4sch0ITOrj/5oXlmldGyX2pgUXj0WC6MW1/1NJ3rhw4vXg54MLlIj8 Q+FaPNi0rgiizd03AmqEX7dPlJiamKOy+nzYBBIgMYBUgXjZBb7JEptr6YiE6wUqq8ofBw 25oBKBpT6vWO9N5V9kFBtiK95d/BEg2cVLF/ylxL0BV1Ac0Z81NgjG1Ig77iCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcWsn1lYbzpGK; Tue, 21 Jan 2025 02:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L2obqD086630; Tue, 21 Jan 2025 02:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L2obEP086629; Tue, 21 Jan 2025 02:50:37 GMT (envelope-from git) Date: Tue, 21 Jan 2025 02:50:37 GMT Message-Id: <202501210250.50L2obEP086629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 533de2d7a987..e364562a4012 - vendor/spleen - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/spleen X-Git-Reftype: branch X-Git-Commit: e364562a4012d6d9cb334795b97e929cfa2a5dff X-Git-Oldrev: 533de2d7a9875ff652be477a3f6c817d66a3d3d9 X-Git-Newrev: e364562a4012d6d9cb334795b97e929cfa2a5dff Auto-Submitted: auto-generated The branch vendor/spleen has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=533de2d7a987..e364562a4012 e364562a4012 Vendor import of Spleen font 2.1.0 From nobody Tue Jan 21 02:56:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcX0F367Fz5lN8n; Tue, 21 Jan 2025 02:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcX0F2PkKz3lX3; Tue, 21 Jan 2025 02:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737428173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=58r7ZvMhFJqdopLf4UBEjog3mMOcPgOaAIihj7arZ3s=; b=YDqfbneLcm9eE8ObfnAU+11vhCS+f/fb5N5OUx3/FmWjcwARwBct2TLRya/jezuaTyJyyV srEtidkZv9kNbtpdZSdFg9l+b89PrN7z117qJw2uHN7J6qgBrFy0GHQZ/skAACmMEm8HT2 4no1rhB8ibjpFSRs7HdDiFks5mhuzl5ZPedhkbaVEMnKujSebChm9jxtm4wvneSS0h4afT Z/8I0yg6I0vvN2s3DUELToKo0nzfHdEMrRPDm5+peAnpthcNgut/7+bJMztRoriH/bhdHB jkQmQnfhdPKg8OE26K6JOUccgjPH4lGsJDZzyPXe5wvB6r1RKrziajD31b3YMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737428173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=58r7ZvMhFJqdopLf4UBEjog3mMOcPgOaAIihj7arZ3s=; b=MI0uBknj8yQ9Y5X2KtW/OoQW6A+zMiwJVjIhCkqPnKMbq+v/FzPnbQx2TjNQrnoq0BHNd8 rMh5ofqbOuhHy7AMPmTZBwXfuiRMIOykbU/PBPw4YrMoUkEEVbK6YKPklaXkdciY1LO6NQ 6tacw1H7oScCNcv9zfKG0bpfcm3FiSk6NHequ/ueg0MBIIZYxzUjaoKogqZVzaPWDUWASb ivAOb0Z+ggAV7ZhjaX5n4mQsJX5snn225KareaOJe0zr4egmJlMC3KONTQl1GOo0aPToxo 5rKHG1cO34CQLjIQxHQ8woytzr4/QcXH3zTClXWRixy4FW7MJDQf6dSqnrOE2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737428173; a=rsa-sha256; cv=none; b=GWOGVuiMcYoKrV7cuVtX4MrT+oUVx0NPoobWDRJqTwhR1H/s6yHDJJ6lkeOLcBK1xcfVX9 +zSPmMvgws1wkswlBuTd/splGt+a4ppryA5iUFyBqcOdA3uiwpv43WVOFtgwqdHqATKYoO jSoMVQ0GwX9rZJO3+CuPqalRzveAFzmljS0Exf6ZCj86UQtCAsUmljp2iPfR4sT52QBWZC +p4rmw++PNHjwZcVcTpQ31Qs5TuZ6L3u3YTKQFSeP0QD+COmBR/ruuR6q5qa7H3DYFqiKF d4H6zZrTjAlQlZG0ZnJNUbWuZFvq3q+EjvXjymf1pQdAmxfm118STBWYE6hgtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcX0F1z1QzpN1; Tue, 21 Jan 2025 02:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50L2uDT0094202; Tue, 21 Jan 2025 02:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50L2uC2F094195; Tue, 21 Jan 2025 02:56:12 GMT (envelope-from git) Date: Tue, 21 Jan 2025 02:56:12 GMT Message-Id: <202501210256.50L2uC2F094195@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: 18270a76e24e - main - contrib/spleen: Update to Spleen 2.1.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 18270a76e24e7f17f533a7a683eed3327a3c135a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=18270a76e24e7f17f533a7a683eed3327a3c135a commit 18270a76e24e7f17f533a7a683eed3327a3c135a Merge: eaede4e41376 e364562a4012 Author: Ed Maste AuthorDate: 2025-01-21 02:55:47 +0000 Commit: Ed Maste CommitDate: 2025-01-21 02:55:47 +0000 contrib/spleen: Update to Spleen 2.1.0 Merge commit 'e364562a4012d6d9cb334795b97e929cfa2a5dff' contrib/spleen/ChangeLog | 31 + contrib/spleen/LICENSE | 2 +- contrib/spleen/README.md | 69 +- contrib/spleen/spleen-12x24.bdf | 2368 ++- contrib/spleen/spleen-16x32.bdf | 19138 +++++++++++--------- contrib/spleen/spleen-32x64.bdf | 36002 +++++++++++++++++++++----------------- contrib/spleen/spleen-5x8.bdf | 8 +- contrib/spleen/spleen-6x12.bdf | 1456 +- contrib/spleen/spleen-8x16.bdf | 10156 ++++++----- 9 files changed, 39463 insertions(+), 29767 deletions(-) diff --cc contrib/spleen/README.md index ce2e6addc305,000000000000..a80773ec8420 mode 100644,000000..100644 --- a/contrib/spleen/README.md +++ b/contrib/spleen/README.md @@@ -1,257 -1,0 +1,270 @@@ +``` + + :::::::::::::::::::: + ::: ::: + _____ _______ __. ________ ________ ________. ::: + _) _//__ __/ __ / |.\ __ /.\ __ /.\ _. | ::: + .\____ /.\ )/ / || )/ | )/ | \| | ::: + | )/ | __/| \ _____| _____| | |_ ::: + |____ |_____| |_____/____\\ |____\\ | |____/ ::: + - -- -- \_____| -H7--------------------------- `----' ----- ::: - - + ::: ::: + :::::::::::::::::::: + +``` + +# Spleen + +Spleen is a monospaced bitmap font available in 6 sizes: + +- 5x8 +- 6x12 +- 8x16 +- 12x24 +- 16x32 +- 32x64 + +Each size is provided in the Glyph Bitmap Distribution Format (BDF), and +release tarballs contain the fonts in the following formats: `PCF`, `PSF` +(for the Linux console), `OTB`, `OTF`, `.dfont` for macOS users, and `FON` +for Windows users. + +All font sizes contain all ISO/IEC 8859-1 characters (Basic Latin and Latin-1 +Supplement Unicode block), Latin Extended-A characters, as well as Box Drawing, +Block Elements, and Braille Patterns Unicode blocks, except for the 5x8 and the +6x12 versions. + +Due to character size constraints, the 5x8 version only contains printable +ASCII characters, the Braille Patterns Unicode block, and light Box Drawing +characters. Please also note that there is no OpenType version for this size. + +As of Spleen 1.8.0, there is now a 6x12 version containing the same Unicode +blocks as the 5x8 version and the Latin-1 Supplement Unicode block. + +As of Spleen 2.0.0, the 8x16, 16x32 and 32x64 versions have full support for +Code page 437 (IBM PC). + +Spleen also has support for Powerline symbols out of the box. + +The font name is a reference to Baudelaire. + +## Screenshots + +The following screenshots show Spleen 16x32 displaying code and prose. + +![Spleen - Hello][1] + +![Spleen - L'etranger][2] + +ASCII characters for all sizes: + +Spleen 5x8: + +![Spleen - ASCII characters - 5x8][3] + +Spleen 6x12: + +![Spleen - ASCII characters - 6x12][4] + +Spleen 8x16: + +![Spleen - ASCII characters - 8x16][5] + +Spleen 12x24: + +![Spleen - ASCII characters - 12x24][6] + +Spleen 16x32: +![Spleen - ASCII characters - 16x32][7] + +Spleen 32x64: +![Spleen - ASCII characters - 32x64][8] + +## XLFD font names + +``` +-misc-spleen-medium-r-normal--8-80-72-72-c-50-iso10646-1 +-misc-spleen-medium-r-normal--12-120-72-72-c-60-iso10646-1 +-misc-spleen-medium-r-normal--16-160-72-72-c-80-iso10646-1 +-misc-spleen-medium-r-normal--24-240-72-72-c-120-iso10646-1 +-misc-spleen-medium-r-normal--32-320-72-72-c-160-iso10646-1 +-misc-spleen-medium-r-normal--64-640-72-72-c-320-iso10646-1 +``` + +## Packages + +Spleen packages are available for: + +- [OpenBSD][9] +- [NetBSD][10] +- [FreeBSD][11] +- [Arch Linux][12] +- [Void Linux][13] +- [Nix][14] +- [Debian][15] +- [Ubuntu][16] +- [MacPorts][17] ++- [Guix][18] ++- [Gentoo][19] ++- [Alpine Linux][20] + +## Manual installation + +### *BSD and Linux + +Clone the repository, convert the files to the Portable Compiled Format +(PCF) using **bdftopcf** and run **mkfontdir** in the directory. + +Alternatively, release tarballs provide PCF files for each size. + ++OTB versions are also available. ++ +### macOS + +macOS users should use the `.dfont` files provided in the release tarballs. + +### DOS + +DOS users should run the **SPLEEN.COM** executable provided in the release +tarballs to enable the font. + +This has been tested in DOSBox and FreeDOS on real hardware. + +### Windows + +Windows users should use the `.fon` or `.otf` files provided in the release +tarballs. + +## Usage + +### *BSD and Linux + +Update the font path to include **Spleen**: + + xset +fp /usr/local/share/fonts/spleen/ + +Update **.Xdefaults** and add one of the following directives: + + xterm*faceName: spleen:pixelsize=8:antialias=false + xterm*faceName: spleen:pixelsize=12:antialias=false + xterm*faceName: spleen:pixelsize=16:antialias=false + xterm*faceName: spleen:pixelsize=24:antialias=false + xterm*faceName: spleen:pixelsize=32:antialias=false + xterm*faceName: spleen:pixelsize=64:antialias=false + +Launch **xterm**. + +Ubuntu has bitmap fonts support disabled by default, instructions to enable - it are available [here][18]. ++it are available [here][21]. + +### Linux console + +Release tarballs provide PSF files for each size, `setfont` can be used +to load and set the desired font. + +### NetBSD console + +NetBSD has .fnt files for each size which can be loaded using wsfontload(8). + +For example, to load Spleen 16x32: + + wsfontload -N spleen-16x32 -w 16 -h 32 /usr/share/wscons/fonts/spleen-16x32.fnt + wsconsctl -dw font=spleen-16x32 + +### FreeBSD console + +The FreeBSD package contains .fnt files which can be loaded using +vidcontrol(1). + +For example, to load Spleen 16x32: + + vidcontrol -f /usr/local/share/fonts/spleen/spleen-16x32.fnt + +### OpenType versions + +Spleen release tarballs now contains OTF versions generated automatically - from the BDF files, using [bdf2sfd][19]. Each font has a different name, ++from the BDF files, using [bdf2sfd][22]. Each font has a different name, +allowing them to be installed alongside. + ++Please note that OTF versions should be used as last resort, always prefer ++bitmap versions if they are supported on your platform. ++ +They should be used in the exact size specified below, with anti-aliasing +disabled. + +- Spleen 6x12: 9 Pt (12 pixels) +- Spleen 8x16: 12 Pt (16 pixels) +- Spleen 12x24: 18 Pt (24 pixels) +- Spleen 16x32: 24 Pt (32 pixels) +- Spleen 32x64: 48 Pt (64 pixels) + +## License + +Spleen is released under the BSD 2-Clause license. See `LICENSE` file for +details. + +## Author + +Spleen is developed by Frederic Cambus. + +- Site: https://www.cambus.net + +## Resources + - - [Spleen - Monospaced bitmap fonts][20] (2018) - - [New console font Spleen made default][21] (2019) - - [NetBSD, CTWM, and Spleen][22] (2021) ++- [Spleen - Monospaced bitmap fonts][23] (2018) ++- [New console font Spleen made default][24] (2019) ++- [NetBSD, CTWM, and Spleen][25] (2021) ++- [Spleen 2.0.0 released with full CP437 support][26] (2023) + +GitHub: https://github.com/fcambus/spleen + +## Trivia + - - Spleen was imported in the OpenBSD src tree in [September 2018][23] - - Spleen is the default font for OpenBSD consoles since [January 2019][24] - - Spleen was imported in the NetBSD src tree in [March 2019][25] - - Spleen 12x24 was used in the Haiku [kernel debugger][26] (on high resolution ++- Spleen was imported in the OpenBSD src tree in [September 2018][27] ++- Spleen is the default font for OpenBSD consoles since [January 2019][28] ++- Spleen was imported in the NetBSD src tree in [March 2019][29] ++- Spleen 12x24 was used in the Haiku [kernel debugger][30] (on high resolution + displays) from May 2021 to June 2022 - - Spleen was imported in the FreeBSD base system in [May 2023][27] - - [msTERM][28], a Terminal program for MailStation devices uses Spleen 5x8 - - [FBInk][29], a library to print text & images to an eInk Linux framebuffer ++- Spleen was imported in the FreeBSD base system in [May 2023][31] ++- [msTERM][32], a Terminal program for MailStation devices uses Spleen 5x8 ++- [FBInk][33], a library to print text & images to an eInk Linux framebuffer + embeds Spleen 16x32 - - [U8g2][30], a monochrome graphics library for embedded devices includes ++- [U8g2][34], a monochrome graphics library for embedded devices includes + all Spleen sizes - - [Ansilove][31], an ANSI and ASCII art to PNG converter includes Spleen ++- [Ansilove][35], an ANSI and ASCII art to PNG converter includes Spleen + +[1]: https://www.cambus.net/content/2018/09/spleen-hello.png +[2]: https://www.cambus.net/content/2018/09/spleen-etranger.png +[3]: https://www.cambus.net/files/spleen/spleen-5x8.png +[4]: https://www.cambus.net/files/spleen/spleen-6x12.png +[5]: https://www.cambus.net/files/spleen/spleen-8x16.png +[6]: https://www.cambus.net/files/spleen/spleen-12x24.png +[7]: https://www.cambus.net/files/spleen/spleen-16x32.png +[8]: https://www.cambus.net/files/spleen/spleen-32x64.png +[9]: https://openports.pl/path/fonts/spleen +[10]: https://pkgsrc.se/fonts/spleen +[11]: https://www.freshports.org/x11-fonts/spleen/ +[12]: https://aur.archlinux.org/packages/spleen-font/ +[13]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/font-spleen +[14]: https://github.com/NixOS/nixpkgs/tree/master/pkgs/data/fonts/spleen +[15]: https://packages.debian.org/search?keywords=spleen +[16]: https://packages.ubuntu.com/search?keywords=spleen +[17]: https://ports.macports.org/port/font-spleen/ - [18]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts - [19]: https://github.com/fcambus/bdf2sfd - [20]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ - [21]: https://undeadly.org/cgi?action=article;sid=20190110064857 - [22]: https://www.cambus.net/netbsd-ctwm-and-spleen/ - [23]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H - [24]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm - [25]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB - [26]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 - [27]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 - [28]: https://github.com/jcs/msTERM - [29]: https://github.com/NiLuJe/FBInk - [30]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen - [31]: https://www.ansilove.org ++[18]: https://packages.guix.gnu.org/packages/font-spleen/ ++[19]: https://packages.gentoo.org/packages/media-fonts/spleen ++[20]: https://pkgs.alpinelinux.org/packages?name=font-spleen ++[21]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts ++[22]: https://github.com/fcambus/bdf2sfd ++[23]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ ++[24]: https://undeadly.org/cgi?action=article;sid=20190110064857 ++[25]: https://www.cambus.net/netbsd-ctwm-and-spleen/ ++[26]: https://www.cambus.net/spleen-2.0.0-released-with-full-cp437-support/ ++[27]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H ++[28]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm ++[29]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB ++[30]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 ++[31]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 ++[32]: https://github.com/jcs/msTERM ++[33]: https://github.com/NiLuJe/FBInk ++[34]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen ++[35]: https://www.ansilove.org From nobody Tue Jan 21 10:35:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YckBX5bjzz5ktjS; Tue, 21 Jan 2025 10:35: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YckBX5Lhtz3X1J; Tue, 21 Jan 2025 10:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737455748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mVEJ7qdt/MQPOkRHTcVtTewKCgjottrTxa/Y7uL8oc0=; b=aNS5SDlfJBO11VOrbUE9h6rIIV6QpWGEcUtlAmFTi7atWi8LbdVFMZQZDyf0qPAsDyovtT +JGyTvHxfWctdFb4bKE/rvQHsQeF1d3MApr3tfIEtfJWjzwd/+a81DWVEftpvx17Pe79sh FPhAgrVZYOlzSxu4bZtVb1E7R4jAqAEdhhyfSKQd2Mxnt/FhH/VjjOGB7t2TBJ9k5atxkF aspQI6VTSNfMa6Ll9a2xLsxxI3nKLJihTg01dMRv6a+syoF60nXANxGNPh87DCkwZJ8vzH SfN70RMWLcwx36VTXtn90+pwpY46JWGrbUjxdvpHu4x8jJUyP8CL0gmesuVRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737455748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mVEJ7qdt/MQPOkRHTcVtTewKCgjottrTxa/Y7uL8oc0=; b=tojjjoEStOhBovfDxnFbJcpPLIQmRvvfzQHuAkmWYViYIhEzTV4plM3URyQyFqOpMhCsn3 A5P852zYtPDLQ6UlKnoAANM3yhU7qS7MkLZ0uLsT5e8zB1chSUfNuZbOnQezzf6SIzyqCy rDPeEorFqypuvvahZmmuy82VImkrI7WOTZn3rqhkSQ+aIn+lfAz8TSdbS7MROD5U6yk2fH /M4UWTYAj1SPAwkA55CB2kFwc99eTqu3jlmmODJophBuESMTNtIjXWhedabARn8qLZdTFd IpbKs3wGMCoSrB6s3KhQsAmIzMwSdRIjPecYHIb5PwX0uQdM6jCBk5dA9Q8HxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737455748; a=rsa-sha256; cv=none; b=JGRq3NP9ACSgAZLecb/t6b5m1yuCz2Bf6TU91PqOr4g8LfYjn+hyxS0QUQ/L32uvL1NYCz D0hDiKgZTg32Z/jdUzHm4M8/PTmQbD9xJeupcqn1+g0ldvUz0KlymBKWBfhRCJiwpzW75r B3vqxyx7z099GaS9f2lQzYqUPHtxZyc6hq1tdblJX8YaHS+fS04YM+MvIDGUAX7Z4HsEr1 F6j0NLeWGAluJGyGbRqwRqkZdND0LExw156bEPP6++a/7ujsvqxeLtIfxWdAb5k4xb6AKE wUEVVdQ923TiQ8oBdE5bipXxBtDehlZSPbw/pEAFyPjbeEzJHsHjdWos1USfjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YckBX4kV6z12lg; Tue, 21 Jan 2025 10:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LAZmxJ054836; Tue, 21 Jan 2025 10:35:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LAZmoH054833; Tue, 21 Jan 2025 10:35:48 GMT (envelope-from git) Date: Tue, 21 Jan 2025 10:35:48 GMT Message-Id: <202501211035.50LAZmoH054833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 8f6b66a9d3f2 - main - riscv vmm: implement SBI RFNC extension. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f6b66a9d3f20d9f32259a7a83fbfb4364c4fafa Auto-Submitted: auto-generated The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=8f6b66a9d3f20d9f32259a7a83fbfb4364c4fafa commit 8f6b66a9d3f20d9f32259a7a83fbfb4364c4fafa Author: Ruslan Bukin AuthorDate: 2025-01-21 10:15:43 +0000 Commit: Ruslan Bukin CommitDate: 2025-01-21 10:35:19 +0000 riscv vmm: implement SBI RFNC extension. The RISC-V SBI (Supervisor Binary Interface) RFNC (fence) extension is used to provide a standardized mechanism for enforcing memory and I/O ordering between different execution contexts or cores in a system. Specifically, it allows supervisors (such as an operating system kernel) to request certain synchronization operations across CPUs or harts (hardware threads) via the SBI. Differential Revision: https://reviews.freebsd.org/D48441 --- sys/conf/files.riscv | 1 + sys/riscv/include/cpufunc.h | 15 ++++ sys/riscv/vmm/riscv.h | 22 +++++ sys/riscv/vmm/vmm_fence.c | 208 ++++++++++++++++++++++++++++++++++++++++++++ sys/riscv/vmm/vmm_fence.h | 43 +++++++++ sys/riscv/vmm/vmm_riscv.c | 9 ++ sys/riscv/vmm/vmm_sbi.c | 54 +++++++++--- 7 files changed, 339 insertions(+), 13 deletions(-) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 36eea03f29a1..e84f1367680f 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -86,6 +86,7 @@ riscv/riscv/vm_machdep.c standard riscv/vmm/vmm.c optional vmm riscv/vmm/vmm_aplic.c optional vmm riscv/vmm/vmm_dev_machdep.c optional vmm +riscv/vmm/vmm_fence.c optional vmm riscv/vmm/vmm_instruction_emul.c optional vmm riscv/vmm/vmm_riscv.c optional vmm riscv/vmm/vmm_sbi.c optional vmm diff --git a/sys/riscv/include/cpufunc.h b/sys/riscv/include/cpufunc.h index 8f5b87d24ce3..75b22632c546 100644 --- a/sys/riscv/include/cpufunc.h +++ b/sys/riscv/include/cpufunc.h @@ -104,6 +104,21 @@ sfence_vma_page(uintptr_t addr) __asm __volatile("sfence.vma %0" :: "r" (addr) : "memory"); } +static __inline void +sfence_vma_asid(uint64_t asid) +{ + + __asm __volatile("sfence.vma x0, %0" :: "r" (asid) : "memory"); +} + +static __inline void +sfence_vma_asid_page(uint64_t asid, uintptr_t addr) +{ + + __asm __volatile("sfence.vma %0, %1" :: "r" (addr), "r" (asid) + : "memory"); +} + #define rdcycle() csr_read64(cycle) #define rdtime() csr_read64(time) #define rdinstret() csr_read64(instret) diff --git a/sys/riscv/vmm/riscv.h b/sys/riscv/vmm/riscv.h index f3665d33a386..793c61534cee 100644 --- a/sys/riscv/vmm/riscv.h +++ b/sys/riscv/vmm/riscv.h @@ -67,6 +67,20 @@ struct hypcsr { uint64_t senvcfg; }; +enum vmm_fence_type { + VMM_RISCV_FENCE_INVALID = 0, + VMM_RISCV_FENCE_I, + VMM_RISCV_FENCE_VMA, + VMM_RISCV_FENCE_VMA_ASID, +}; + +struct vmm_fence { + enum vmm_fence_type type; + size_t start; + size_t size; + uint64_t asid; +}; + struct hypctx { struct hypregs host_regs; struct hypregs guest_regs; @@ -82,6 +96,14 @@ struct hypctx { int ipi_pending; int interrupts_pending; struct vtimer vtimer; + + struct vmm_fence *fence_queue; + struct mtx fence_queue_mtx; + int fence_queue_head; + int fence_queue_tail; +#define FENCE_REQ_I (1 << 0) +#define FENCE_REQ_VMA (1 << 1) + int fence_req; }; struct hyp { diff --git a/sys/riscv/vmm/vmm_fence.c b/sys/riscv/vmm/vmm_fence.c new file mode 100644 index 000000000000..6bba3f4b5dfe --- /dev/null +++ b/sys/riscv/vmm/vmm_fence.c @@ -0,0 +1,208 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Ruslan Bukin + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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 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 +#include +#include +#include +#include +#include +#include +#include + +#include "riscv.h" +#include "vmm_fence.h" + +static bool +vmm_fence_dequeue(struct hypctx *hypctx, struct vmm_fence *new_fence) +{ + struct vmm_fence *queue; + struct vmm_fence *fence; + + mtx_lock_spin(&hypctx->fence_queue_mtx); + queue = hypctx->fence_queue; + fence = &queue[hypctx->fence_queue_head]; + if (fence->type != VMM_RISCV_FENCE_INVALID) { + *new_fence = *fence; + fence->type = VMM_RISCV_FENCE_INVALID; + hypctx->fence_queue_head = + (hypctx->fence_queue_head + 1) % VMM_FENCE_QUEUE_SIZE; + } else { + mtx_unlock_spin(&hypctx->fence_queue_mtx); + return (false); + } + mtx_unlock_spin(&hypctx->fence_queue_mtx); + + return (true); +} + +static bool +vmm_fence_enqueue(struct hypctx *hypctx, struct vmm_fence *new_fence) +{ + struct vmm_fence *queue; + struct vmm_fence *fence; + + mtx_lock_spin(&hypctx->fence_queue_mtx); + queue = hypctx->fence_queue; + fence = &queue[hypctx->fence_queue_tail]; + if (fence->type == VMM_RISCV_FENCE_INVALID) { + *fence = *new_fence; + hypctx->fence_queue_tail = + (hypctx->fence_queue_tail + 1) % VMM_FENCE_QUEUE_SIZE; + } else { + mtx_unlock_spin(&hypctx->fence_queue_mtx); + return (false); + } + mtx_unlock_spin(&hypctx->fence_queue_mtx); + + return (true); +} + +static void +vmm_fence_process_one(struct vmm_fence *fence) +{ + uint64_t va; + + KASSERT(fence->type == VMM_RISCV_FENCE_VMA || + fence->type == VMM_RISCV_FENCE_VMA_ASID, + ("%s: wrong fence type %d", __func__, fence->type)); + + switch (fence->type) { + case VMM_RISCV_FENCE_VMA: + for (va = fence->start; va < fence->start + fence->size; + va += PAGE_SIZE) + sfence_vma_page(va); + break; + case VMM_RISCV_FENCE_VMA_ASID: + if (fence->start == 0 && fence->size == 0) + sfence_vma_asid(fence->asid); + else + for (va = fence->start; va < fence->start + fence->size; + va += PAGE_SIZE) + sfence_vma_asid_page(fence->asid, va); + break; + default: + break; + } +} + +void +vmm_fence_process(struct hypctx *hypctx) +{ + struct vmm_fence fence; + int pending; + + pending = atomic_readandclear_32(&hypctx->fence_req); + + KASSERT((pending & ~(FENCE_REQ_I | FENCE_REQ_VMA)) == 0, + ("wrong fence bit mask")); + + if (pending & FENCE_REQ_I) + fence_i(); + + if (pending & FENCE_REQ_VMA) + sfence_vma(); + + while (vmm_fence_dequeue(hypctx, &fence) == true) + vmm_fence_process_one(&fence); +} + +void +vmm_fence_add(struct vm *vm, cpuset_t *cpus, struct vmm_fence *fence) +{ + struct hypctx *hypctx; + cpuset_t running_cpus; + struct vcpu *vcpu; + uint16_t maxcpus; + int hostcpu; + int state; + bool enq; + int i; + + CPU_ZERO(&running_cpus); + + maxcpus = vm_get_maxcpus(vm); + for (i = 0; i < maxcpus; i++) { + if (!CPU_ISSET(i, cpus)) + continue; + vcpu = vm_vcpu(vm, i); + hypctx = vcpu_get_cookie(vcpu); + + enq = false; + + /* No need to enqueue fences i and vma global. */ + switch (fence->type) { + case VMM_RISCV_FENCE_I: + atomic_set_32(&hypctx->fence_req, FENCE_REQ_I); + break; + case VMM_RISCV_FENCE_VMA: + if (fence->start == 0 && fence->size == 0) + atomic_set_32(&hypctx->fence_req, + FENCE_REQ_VMA); + else + enq = true; + break; + case VMM_RISCV_FENCE_VMA_ASID: + enq = true; + break; + default: + KASSERT(0, ("%s: wrong fence type %d", __func__, + fence->type)); + break; + } + + /* + * Try to enqueue. In case of failure use more conservative + * request. + */ + if (enq) + if (vmm_fence_enqueue(hypctx, fence) == false) + atomic_set_32(&hypctx->fence_req, + FENCE_REQ_VMA); + + mb(); + + state = vcpu_get_state(vcpu, &hostcpu); + if (state == VCPU_RUNNING) + CPU_SET(hostcpu, &running_cpus); + } + + /* + * Interrupt other cores. On reception of IPI they will leave guest. + * On entry back to the guest they will process fence request. + * + * If vcpu migrates to another cpu right here, it should process + * all fences on entry to the guest as well. + */ + if (!CPU_EMPTY(&running_cpus)) + smp_rendezvous_cpus(running_cpus, NULL, NULL, NULL, NULL); +} diff --git a/sys/riscv/vmm/vmm_fence.h b/sys/riscv/vmm/vmm_fence.h new file mode 100644 index 000000000000..05d4466fd634 --- /dev/null +++ b/sys/riscv/vmm/vmm_fence.h @@ -0,0 +1,43 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Ruslan Bukin + * + * This software was developed by the University of Cambridge Computer + * Laboratory (Department of Computer Science and Technology) under Innovate + * UK project 105694, "Digital Security by Design (DSbD) Technology Platform + * Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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 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. + */ + +#ifndef _VMM_FENCE_H_ +#define _VMM_FENCE_H_ + +struct hypctx; + +#define VMM_FENCE_QUEUE_SIZE 128 + +void vmm_fence_process(struct hypctx *hypctx); +void vmm_fence_add(struct vm *vm, cpuset_t *cpus, struct vmm_fence *fence); + +#endif /* !_VMM_FENCE_H_ */ diff --git a/sys/riscv/vmm/vmm_riscv.c b/sys/riscv/vmm/vmm_riscv.c index 6ac945dfa1d0..78250ae7c440 100644 --- a/sys/riscv/vmm/vmm_riscv.c +++ b/sys/riscv/vmm/vmm_riscv.c @@ -68,6 +68,7 @@ #include "riscv.h" #include "vmm_aplic.h" +#include "vmm_fence.h" #include "vmm_stat.h" MALLOC_DEFINE(M_HYP, "RISC-V VMM HYP", "RISC-V VMM HYP"); @@ -212,6 +213,11 @@ vmmops_vcpu_init(void *vmi, struct vcpu *vcpu1, int vcpuid) hypctx->vcpu = vcpu1; hypctx->guest_scounteren = HCOUNTEREN_CY | HCOUNTEREN_TM; + /* Fence queue. */ + hypctx->fence_queue = mallocarray(VMM_FENCE_QUEUE_SIZE, + sizeof(struct vmm_fence), M_HYP, M_WAITOK | M_ZERO); + mtx_init(&hypctx->fence_queue_mtx, "fence queue", NULL, MTX_SPIN); + /* sstatus */ hypctx->guest_regs.hyp_sstatus = SSTATUS_SPP | SSTATUS_SPIE; hypctx->guest_regs.hyp_sstatus |= SSTATUS_FS_INITIAL; @@ -659,6 +665,7 @@ vmmops_run(void *vcpui, register_t pc, pmap_t pmap, struct vm_eventinfo *evinfo) riscv_set_active_vcpu(hypctx); aplic_flush_hwstate(hypctx); riscv_sync_interrupts(hypctx); + vmm_fence_process(hypctx); dprintf("%s: Entering guest VM, vsatp %lx, ss %lx hs %lx\n", __func__, csr_read(vsatp), hypctx->guest_regs.hyp_sstatus, @@ -740,6 +747,8 @@ vmmops_vcpu_cleanup(void *vcpui) aplic_cpucleanup(hypctx); + mtx_destroy(&hypctx->fence_queue_mtx); + free(hypctx->fence_queue, M_HYP); free(hypctx, M_HYP); } diff --git a/sys/riscv/vmm/vmm_sbi.c b/sys/riscv/vmm/vmm_sbi.c index 63dcf9b4a7ae..586eb7c4d41c 100644 --- a/sys/riscv/vmm/vmm_sbi.c +++ b/sys/riscv/vmm/vmm_sbi.c @@ -58,39 +58,65 @@ #include #include "riscv.h" +#include "vmm_fence.h" static int vmm_sbi_handle_rfnc(struct vcpu *vcpu, struct hypctx *hypctx) { - uint64_t hart_mask __unused; - uint64_t start __unused; - uint64_t size __unused; - uint64_t asid __unused; + struct vmm_fence fence; + uint64_t hart_mask; + uint64_t hart_mask_base; uint64_t func_id; + struct hyp *hyp; + uint16_t maxcpus; + cpuset_t cpus; + int vcpu_id; + int i; func_id = hypctx->guest_regs.hyp_a[6]; hart_mask = hypctx->guest_regs.hyp_a[0]; - start = hypctx->guest_regs.hyp_a[2]; - size = hypctx->guest_regs.hyp_a[3]; - asid = hypctx->guest_regs.hyp_a[4]; + hart_mask_base = hypctx->guest_regs.hyp_a[1]; - dprintf("%s: %ld hart_mask %lx start %lx size %lx\n", __func__, - func_id, hart_mask, start, size); + /* Construct vma_fence. */ - /* TODO: implement remote sfence. */ + fence.start = hypctx->guest_regs.hyp_a[2]; + fence.size = hypctx->guest_regs.hyp_a[3]; + fence.asid = hypctx->guest_regs.hyp_a[4]; switch (func_id) { case SBI_RFNC_REMOTE_FENCE_I: + fence.type = VMM_RISCV_FENCE_I; break; case SBI_RFNC_REMOTE_SFENCE_VMA: + fence.type = VMM_RISCV_FENCE_VMA; break; case SBI_RFNC_REMOTE_SFENCE_VMA_ASID: + fence.type = VMM_RISCV_FENCE_VMA_ASID; break; default: - break; + return (-1); + } + + /* Construct cpuset_t from the mask supplied. */ + + CPU_ZERO(&cpus); + hyp = hypctx->hyp; + maxcpus = vm_get_maxcpus(hyp->vm); + for (i = 0; i < maxcpus; i++) { + vcpu = vm_vcpu(hyp->vm, i); + if (vcpu == NULL) + continue; + vcpu_id = vcpu_vcpuid(vcpu); + if (hart_mask_base != -1UL) { + if (vcpu_id < hart_mask_base) + continue; + if (!(hart_mask & (1UL << (vcpu_id - hart_mask_base)))) + continue; + } + CPU_SET(i, &cpus); } - hypctx->guest_regs.hyp_a[0] = 0; + vmm_fence_add(hyp->vm, &cpus, &fence); return (0); } @@ -172,6 +198,7 @@ vmm_sbi_ecall(struct vcpu *vcpu, bool *retu) { int sbi_extension_id __unused; struct hypctx *hypctx; + int error; hypctx = riscv_get_active_vcpu(); sbi_extension_id = hypctx->guest_regs.hyp_a[7]; @@ -188,7 +215,8 @@ vmm_sbi_ecall(struct vcpu *vcpu, bool *retu) switch (sbi_extension_id) { case SBI_EXT_ID_RFNC: - vmm_sbi_handle_rfnc(vcpu, hypctx); + error = vmm_sbi_handle_rfnc(vcpu, hypctx); + hypctx->guest_regs.hyp_a[0] = error; break; case SBI_EXT_ID_TIME: vmm_sbi_handle_time(vcpu, hypctx); From nobody Tue Jan 21 11:37:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YclYC4TNBz5kyDr; Tue, 21 Jan 2025 11:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclYC3WLbz3cpj; Tue, 21 Jan 2025 11:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8kWY2Tte4611QMfjlzn70XtQgqLgw0rwJWSDouqRy8=; b=SvRbHFmINTg1w9QfZnkA63PrhMrrDOQTdW57IDrle/PZ6vJxbwPIfIFXwVjcEI7PWq6gZt B/KyFLac+MBvP5CwOwkg1trpZ1iJs6D86ifAjeNm4vdcc3IWxrgDcBSzYjVV9BKNxfIF24 8Nz2sGfVrQDRl/LmKdHETTyZy1InhZk034WMLBmZ4O3fnvQedVKRaPKqhr5xvZc4I2uXgI yOH4oLmRYNZFAYo9AnEHFBSXC4uQyBEFpkwEiBcAjbyLCxFJ0HUHmokMkvAcPPDeNi9stM LX1rNTPzIUivRCC9EoVvRYkAQ7nCdn3l87UH94adECPP1OlRkpPOsu6dRoPObw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8kWY2Tte4611QMfjlzn70XtQgqLgw0rwJWSDouqRy8=; b=V7Hb/NBGKGRPoyXL6894fv8zHErKJtlA513VqY0wZdHHqyoff6tYuPpOHd6fYuYKxtCdGL wOlIRtIm/r1j6NPWG83FfrsO0tkpM+IE1aQhHVpg8RmIpju+qhtycZ/EfRLKyYZbc79bQ8 FYKO/qlq8oCcuBUIQVX/ktxbr+BEDTxg6rr/zUqG+WLDRbrrEQTVdCGI0uF7GGXO0jq3XZ oYwoyu25gsjyHf3zFynfuWFLGxkCbI4qjrtAnhBGhu3JfMa7R+inr+hHU76Zdg/SXgojNR O0Aetfa3ImiS7zFQg8VMRhJY1sjd1iqvVrDrk/iytBD/27sFTegUmZww4eNWqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459423; a=rsa-sha256; cv=none; b=nZUR0kW24sq4TzgPm10wxrV5vPp1YwW6lbw0r/kV/fBWX9XjhoQvYx5G6BbqGydF8103ns /PIQWVq2mFypqI8KvqajgTXbQIcH8mmoGFOqHe811UMqBtPV5wRkFA6zzVj+jkJZgNFHej 2155uMBMQsUt7kQkUtMVWEKqm4ePLrl4k5oWxOKEPw0iBLtAHSyq50FyHXD4YmNp9YCWZX Dj+ZWaqQB835PoiTbniblL29s387CzvXB4zfAFuex1RDJWxXb3ouIGpHEPaf9Vg/lpIRpL c5QzK28C4YtnrwV2l+pW2CiQSPcA4gSexUlZOzsqyvR2SR3LwEtHvJcPCgPUwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclYC30Tsz14sN; Tue, 21 Jan 2025 11:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBb3Uw067012; Tue, 21 Jan 2025 11:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBb3Z5067009; Tue, 21 Jan 2025 11:37:03 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:37:03 GMT Message-Id: <202501211137.50LBb3Z5067009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 7dc48056c87b - stable/14 - ipfw: use only needed TCP flags for state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7dc48056c87b2100f2841d48dbb45a46ffdae934 Auto-Submitted: auto-generated The branch stable/14 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=7dc48056c87b2100f2841d48dbb45a46ffdae934 commit 7dc48056c87b2100f2841d48dbb45a46ffdae934 Author: Andrey V. Elsukov AuthorDate: 2024-12-12 12:57:45 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:35:40 +0000 ipfw: use only needed TCP flags for state tracking This fixes stateful firewall failures after adding TH_AE flag into TH_FLAGS. Reported by: ronald Fixes: 347dd05 (cherry picked from commit 9ea8d692f4cb552902b9e8394260d7f3cf4aefb0) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 283032048845..d26e05e5d159 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -920,7 +920,8 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, int dyn_type, #define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) -#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define BOTH_RST (TH_RST | (TH_RST << 8)) +#define TCP_FLAGS (BOTH_SYN | BOTH_FIN | BOTH_RST) #define ACK_FWD 0x00010000 /* fwd ack seen */ #define ACK_REV 0x00020000 /* rev ack seen */ #define ACK_BOTH (ACK_FWD | ACK_REV) From nobody Tue Jan 21 11:38:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yclb7270Kz5kyFH; Tue, 21 Jan 2025 11:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yclb71Qlcz3d9x; Tue, 21 Jan 2025 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nO9N3m0r7p4iGFCgGT2bXDN7yhWUleX0OflabtuUV28=; b=KjSIH+SIYnhGDvayKS4XKDvcABr7KUqaKEl9UNMb6S3uOAKXap3dGxHjD3bXlYor3pBJav XYbuEdxCenCdXM0O7QB76I/bDWG+0W3lzbZDR6VqpyEAsXelGMA+w9kNos+UR8eHVSSyWR Kbi9zrliIKYL/UDw2gfgKVbu5/bePE6SarjSFlItFqcoWSRfxCumDzJePbYxcGKTv0fOeK Mq7ZMjB4397/F7ELAbbRqnpKCrDvGI4VXXE39hUcT85YtDsLlKTFY/vxdau3dX97iM0Thh EWJ2ljUloZaixIUE2oW8c82/tVILS43c+JV/qdQAiIGRT/aaESQBpDn0CpTVww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nO9N3m0r7p4iGFCgGT2bXDN7yhWUleX0OflabtuUV28=; b=Dm9HF1vsAZL3al6hyhf3Abhqu8Xpte1jQMOHtlZjUbsqaSRPDimU4CWuXfF0eRlYe5RIyF PApmROwpCn8Na5mSW1Af9VfdYaXFu095QmXoh8oXl/qw3hHqSCHl3gR8g9lZ2QVaYxk+oI YfBHn0u+71sgtTn2dZUmAxK+B6U3WPTnZembAppJMEXnn+F43b+BmHnpFh1n63rx5OlEiH JVMTNxMFqivXinbEMnJaUD7fuw3moB6IrHwefxzt0EL2qWWfPpND9NHw00t4+tJIUWoij0 9S5GIT9U/XmhVseVWl6C21y/jsJTe/wr6rmQ2MmHlM6jiCTr4nTpzlGoYwJ97w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459523; a=rsa-sha256; cv=none; b=fNfQrlyWuww1HwPT/YfOGeegq36Pim9KBX9nwzQw3P7o6Nd+UNlCkfMrIDon74sRwgVJsF P/1sSAu6DXhdeDVomiZqgQpuUMY6nW9YkGD46DGbkLnlF0z5t+QkFvz27mh8FrjQ3I1s9g BtCLNIk7TQ032tYWJlJvDPRYe/7XwMv2zIqTlhCxhYSjOeImFcaGFQErdunt31X3D6HLdy prYwFUDHUAUJ5emHWqSymBqU/v/snudb+Y2RvKaoUm6R9MYqS3TVyU5SZbu0mPTP3QRm4M FIr1kyixzrLkiUCot/ORwMPyCJK2wpXjeXt+pU4sR2UxgREBvWYdAhPhOw+0UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yclb71144z14sP; Tue, 21 Jan 2025 11:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBchcY067603; Tue, 21 Jan 2025 11:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBchlZ067600; Tue, 21 Jan 2025 11:38:43 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:38:43 GMT Message-Id: <202501211138.50LBchlZ067600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: e29ffd402d38 - stable/14 - netlink: restore the ability to delete PINNED routes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e29ffd402d38b32f9c37eea69f87361ad32b7534 Auto-Submitted: auto-generated The branch stable/14 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=e29ffd402d38b32f9c37eea69f87361ad32b7534 commit e29ffd402d38b32f9c37eea69f87361ad32b7534 Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:37:26 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius Differential Revision: https://reviews.freebsd.org/D46301 (cherry picked from commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c) --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 7379d49b96a9..679260e54322 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -1013,7 +1013,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error); From nobody Tue Jan 21 11:46:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YclmH5x2sz5kypH; Tue, 21 Jan 2025 11:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclmH57Y7z3dl3; Tue, 21 Jan 2025 11:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HeA7KqQUQ/Wg6v7WuGhSaN26OC5iRraNaFRehi6pXI=; b=j6s072FAFotWoeZe0muR01b/M4qhxWcuG8TZw9+5MUjDRtbF9eeyWdgczPoL0mx2mfrqKb wmPM5M0mxCiTu6JGahurK8jrT++mpcdhvK11e6Z5ADtkiQ/bkViO6WAOLG02uKb0Zzlc1E rItAoMUptc+pLlkowXnyZyGLUns5TmUwzEL0ftpio3m21wQnb0ONf8tdR/m34Q1dmmvpZk 3qQZys7MqAMlq8us/XuiLoo/hRoO4OfUZNGW7X8R88nT9ZCiXg28hWxfiinJrmWZskA2tN ZcuhOz+XtPVBgtyzScYIchMuLAf6wzpt83KfPv32rFeimUnpO/OGyyyjrzWOyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737459999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HeA7KqQUQ/Wg6v7WuGhSaN26OC5iRraNaFRehi6pXI=; b=fIx4ZZXDkN6Poz7H38hAJtzjFTO+O95E0jHipU5kizKl2OnTRtYYsJqIiJ1g+7xZS5rgFg 5iM2X27/ljPaOgXJYko/ZZoJQyXLtuvOvXABI9UGXBZX62ua4269gRrBevoKrjRABB8r3U VamFtmIyF4BLVbrbEkGNGwNWzc0dhpfr4wJRbAgM7A5j7CV+BhV0DMTtCJvgW2aXy7YKI7 0AC2UfScXy8t/jXhunm0k9QFLUsIhSfEyaXs4oIAjK1Uz5xc4bEW13VIj3qe3hdbERvylq OWCYc1VihM58IKvvQ6nIgTxeOdUHDWeorUVZnElyLyz7cly0H6rqQe+i//wjMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737459999; a=rsa-sha256; cv=none; b=psCMtEvwXqZLHLWfDiQeB9OpN0X2O9FcmgIW1yNe2oFLLg1/mKn4C2SorFC08v8YncOY0c z29mXOhCF7aUgx+u6WG0OqNqhjd7XRjU+8K9/9ZWpC75CZq5o2hXcz2dNM3HKsD/8acBHn t4HHMiVmDGAt3BW/jkdF1//tbw8gWY8PQVCP63bB6XIf2eI6Br3hHF3D34DOBJnfOiA2Cf VYtQgpjTji1SRsxlJTBXmdln2SgLOfMbcl7MkhZ+oT2cr0lQxGD84zwx9wRH6fCqqdgQXt thmq4cbXhKqMuzBwimzbhGdiOsbp+i9NVDavTSjpiKs1pC2IqU2VpPUN7R0+xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclmH46zMz14st; Tue, 21 Jan 2025 11:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBkdZ3085708; Tue, 21 Jan 2025 11:46:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBkdsa085705; Tue, 21 Jan 2025 11:46:39 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:46:39 GMT Message-Id: <202501211146.50LBkdsa085705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: e98f79cc71a3 - stable/13 - ipfw: use only needed TCP flags for state tracking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e98f79cc71a35c25a83788f8ac9ba3375baaf149 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=e98f79cc71a35c25a83788f8ac9ba3375baaf149 commit e98f79cc71a35c25a83788f8ac9ba3375baaf149 Author: Andrey V. Elsukov AuthorDate: 2024-12-12 12:57:45 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:45:09 +0000 ipfw: use only needed TCP flags for state tracking This fixes stateful firewall failures after adding TH_AE flag into TH_FLAGS. Reported by: ronald Fixes: 347dd05 (cherry picked from commit 9ea8d692f4cb552902b9e8394260d7f3cf4aefb0) --- sys/netpfil/ipfw/ip_fw_dynamic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 29ffe4f320ab..a100101f87d4 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -920,7 +920,8 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, int dyn_type, #define _SEQ_GE(a,b) ((int)((a)-(b)) >= 0) #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) -#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define BOTH_RST (TH_RST | (TH_RST << 8)) +#define TCP_FLAGS (BOTH_SYN | BOTH_FIN | BOTH_RST) #define ACK_FWD 0x00010000 /* fwd ack seen */ #define ACK_REV 0x00020000 /* rev ack seen */ #define ACK_BOTH (ACK_FWD | ACK_REV) From nobody Tue Jan 21 11:46:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YclmK27fFz5kykT; Tue, 21 Jan 2025 11:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YclmJ5Fdjz3dvT; Tue, 21 Jan 2025 11:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737460000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b13xbWH93mky+uPSBtG9VCRX2pGewJPnZtggi0zc4j0=; b=OwEiS7HPITmdoP/2benBMwYUlsiXVhp9IR00HPWmakCnPwIWMkPTjFAxY7yzubBqNW8w/8 W4PYNKNmT5Fq3rFA/dlkiTC+0Doprht6ndxT+kRQQXIZ8b4CbHF4CgMOgas368ugUEd81x kFMiL/VgjVYSXWtaK118mZHjhJgWLH6z6KQjPoO/fcWwLBvj9s9qWspkd+/lNmY+jKAtc6 q5uCsYlbkuQ4wp+xEjzBy7mFDAVQHEe2dzehHlXf8R967LV55m10B/BYeGAOP0eocewjFu fEBq4vg0V5BMOwV/iJvqHHrRSpOoDSTTQjyDORcmMNEI15kDp/6/gX1ncRL+3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737460000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b13xbWH93mky+uPSBtG9VCRX2pGewJPnZtggi0zc4j0=; b=OHhrR2fN4BuTepR1D8V2IQPriIUGJlhU/ukR1HirQUMy7Be03Aw1jewCyBMg0ONai52Ns7 /gTU9JLZpEVsQlbNh8zGJi/2br5QqLha4KrppNzxqE4YC5WVI4mlh53vDBXzF9W1pDXal+ BPDSXHdKH77/n8oE6DQSTHEOzmdUUMcwZYYrDAqore848wZ80NHC0vXHBHgUnKE1VfzxcG yNsXLVJs67yEsFMpPphDfLvV/Eo6o1PdgPYY4OA8dDY5oZiDV7apAOAPohsC7/AZWcu5ou FedS60cbbRq5RK+djK2WQB9YWJ+FPC/oIa7vo8f0u6tv4UEycJuaCniTpqnkOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737460000; a=rsa-sha256; cv=none; b=dpwM4VDBPnMymj1IF3lVSyA354M5onYGEusSQJYRYRUrh+EVqCtYlx5KpHr4pXrLMHnfil Qg1PvfM89QOfyzK36IpOV+gwVpKkfLXnmZuXWDaOAmcNKUvBEawPJoLjiBgWclkDb+INN4 bH1FJ0PDgNxmhjjdUoAgYdj4C8eYvU4E6WCw5cUiny/TaqSLF8UFfho/duYvreWqfV0KoJ 8uqKD3z8EZEgnbZOIofmQRNs2NR4i6idZbyRfEnBgwCOwG2YKhgHd6vF9fBKjO0rU1vShG HaOhLC6T6yQD168VHm1R5TM/6A3ZLaSNOB+YQLjSb1QsJUrF1UfZHnjuQ99Ahw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YclmJ4bpJz14Sq; Tue, 21 Jan 2025 11:46:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LBke8s085745; Tue, 21 Jan 2025 11:46:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LBkeY5085742; Tue, 21 Jan 2025 11:46:40 GMT (envelope-from git) Date: Tue, 21 Jan 2025 11:46:40 GMT Message-Id: <202501211146.50LBkeY5085742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: edc19f8d0fd0 - stable/13 - netlink: restore the ability to delete PINNED routes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 Auto-Submitted: auto-generated The branch stable/13 has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 commit edc19f8d0fd03c21cd24cbd0e2e004713bb112f6 Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-21 11:45:57 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius Differential Revision: https://reviews.freebsd.org/D46301 (cherry picked from commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c) --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 24d8c4c9d714..3eed4c4361cf 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -940,7 +940,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error); From nobody Tue Jan 21 12:03:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycm8F0drSz5l0wS; Tue, 21 Jan 2025 12:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycm8F0HVVz3g5Y; Tue, 21 Jan 2025 12:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDqMJ5CdBt8PUtb0phgtUySQ5WlgquXRjY4oGxIN0Kw=; b=lxQp7pkPNqu7TyxbO8iovDlGm9dTowP67s5ySaBSDnaFaZo8vT8GZs6lb2ha5UIgrK6pJJ 2jiexcKsY7zBS6eLoouexK+9EnnWSDg60qWEpJEUSoeXFcIJtSy6fgu54hxlHbuISxo8DP VLWN379yQW7f3H527US7JAufPaPcXOCcWPtdBT9c4/bF0Q5LVpB6fmphexcHbnW+r9kmuD eqJtcJdXdY3oBl/vor4uddfS814eXIlGFfqfeUfoqyA+Exq8Lew7xofm1yiIB6ZrT4ft2V SK0c9jDLvtNTlJyLqXkYqAxKF56paW0DhxSQz/jYSlCdLF3xV3tR1wi2Dp6F6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDqMJ5CdBt8PUtb0phgtUySQ5WlgquXRjY4oGxIN0Kw=; b=d7q5HHTZ2+il6GEYn9AwfV+9ZfLfZLxr2aSbeZPd/hSeSraBJaDuqPa2Iko7Hopp1uViex DqwFysVBAM2GzypAPXfGMNxHphHgcbRSJUeUIWIoUj2dNQemMFJlhdjm/n3EgrWZizf22S SG5D9lz7qqCnTlcRnQZSwf5Dm7tEKpcpYsM3ywNgwxmiCO/cEKY1JXmhh5CbH4s42C1+6n f/TD5N2GTBPhmfNHA4sQTjwSqu5fxQoCVfGdUQ1RVhfw3UFsPazhqHJfKdS1vk1hsub+Un C2eLAyuXDAP9MLFES1OKUKjSZD2KliXaAFwVEQNuKcTP7ghKJVdjJlvfcjdA3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737461037; a=rsa-sha256; cv=none; b=gIL3hB9OFA0GdxZF7b1oXhKQ14jhq27qZn3swsfrsGvS3IeC4d5f18cpCztKzRc/R51bQA Gh1e3H7H2c8pUj06niezDrfYI8LfybAkXGOEHvTNBtq22SFYsPQ7Ld/fsN3T8oWN2aaiKV g7frrG3yS3t3cNkWpuoB+4BI0VSrOlVOSk12rZFBJvBIbVZk4V7vp0FxM+7VBitqomCG7m J7q0Yqws5IwRJtRLc/lsezqpsEvnzbLjWFxfJQ8QOuRpS1Qgi++/Q+KGlCQXWzjFEqlZJ5 wj6E8PXKfXkd6dM3x7bcSqpVSyaMMYILLKMMeJqDtRsvZtupopcMCK3US7STDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycm8D6zlDz14wW; Tue, 21 Jan 2025 12:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LC3uDY023267; Tue, 21 Jan 2025 12:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LC3uWL023264; Tue, 21 Jan 2025 12:03:56 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:03:56 GMT Message-Id: <202501211203.50LC3uWL023264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 27ef5d48c729 - main - sound: Unit test the pcm sample read and write macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27ef5d48c729defb83a8822143dc71ab17f9d68b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=27ef5d48c729defb83a8822143dc71ab17f9d68b commit 27ef5d48c729defb83a8822143dc71ab17f9d68b Author: Florian Walpen AuthorDate: 2025-01-21 11:58:05 +0000 Commit: Christos Margiolis CommitDate: 2025-01-21 12:00:36 +0000 sound: Unit test the pcm sample read and write macros Main goal is to have a unit test, with sample test data that is verified against the current macro implementation of pcm sample read and write functions. With a test in place, we can proceed on a planned refactoring of the sample read and write code, and confidently check the new code for regressions. Implementation of the unit test itself has to avoid any cast or conversion affected by endianness, to make the tests compatible with all machine architectures. MFC after: 1 week Reviewed by: christos, markj Differential Revision: https://reviews.freebsd.org/D48330 --- sys/dev/sound/pcm/sound.h | 128 +++++----- tests/sys/sound/Makefile | 4 + tests/sys/sound/pcm_read_write.c | 509 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 577 insertions(+), 64 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index fe04898c17a5..019fe67ac892 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -147,70 +147,6 @@ struct snd_mixer; #define RANGE(var, low, high) (var) = \ (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) -/* make figuring out what a format is easier. got AFMT_STEREO already */ -#define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) -#define AFMT_24BIT (AFMT_S24_LE | AFMT_S24_BE | AFMT_U24_LE | AFMT_U24_BE) -#define AFMT_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) -#define AFMT_G711 (AFMT_MU_LAW | AFMT_A_LAW) -#define AFMT_8BIT (AFMT_G711 | AFMT_U8 | AFMT_S8) -#define AFMT_SIGNED (AFMT_S32_LE | AFMT_S32_BE | AFMT_S24_LE | AFMT_S24_BE | \ - AFMT_S16_LE | AFMT_S16_BE | AFMT_S8) -#define AFMT_BIGENDIAN (AFMT_S32_BE | AFMT_U32_BE | AFMT_S24_BE | AFMT_U24_BE | \ - AFMT_S16_BE | AFMT_U16_BE) - -#define AFMT_CONVERTIBLE (AFMT_8BIT | AFMT_16BIT | AFMT_24BIT | \ - AFMT_32BIT) - -/* Supported vchan mixing formats */ -#define AFMT_VCHAN (AFMT_CONVERTIBLE & ~AFMT_G711) - -#define AFMT_PASSTHROUGH AFMT_AC3 -#define AFMT_PASSTHROUGH_RATE 48000 -#define AFMT_PASSTHROUGH_CHANNEL 2 -#define AFMT_PASSTHROUGH_EXTCHANNEL 0 - -/* - * We're simply using unused, contiguous bits from various AFMT_ definitions. - * ~(0xb00ff7ff) - */ -#define AFMT_ENCODING_MASK 0xf00fffff -#define AFMT_CHANNEL_MASK 0x07f00000 -#define AFMT_CHANNEL_SHIFT 20 -#define AFMT_CHANNEL_MAX 0x7f -#define AFMT_EXTCHANNEL_MASK 0x08000000 -#define AFMT_EXTCHANNEL_SHIFT 27 -#define AFMT_EXTCHANNEL_MAX 1 - -#define AFMT_ENCODING(v) ((v) & AFMT_ENCODING_MASK) - -#define AFMT_EXTCHANNEL(v) (((v) & AFMT_EXTCHANNEL_MASK) >> \ - AFMT_EXTCHANNEL_SHIFT) - -#define AFMT_CHANNEL(v) (((v) & AFMT_CHANNEL_MASK) >> \ - AFMT_CHANNEL_SHIFT) - -#define AFMT_BIT(v) (((v) & AFMT_32BIT) ? 32 : \ - (((v) & AFMT_24BIT) ? 24 : \ - ((((v) & AFMT_16BIT) || \ - ((v) & AFMT_PASSTHROUGH)) ? 16 : 8))) - -#define AFMT_BPS(v) (AFMT_BIT(v) >> 3) -#define AFMT_ALIGN(v) (AFMT_BPS(v) * AFMT_CHANNEL(v)) - -#define SND_FORMAT(f, c, e) (AFMT_ENCODING(f) | \ - (((c) << AFMT_CHANNEL_SHIFT) & \ - AFMT_CHANNEL_MASK) | \ - (((e) << AFMT_EXTCHANNEL_SHIFT) & \ - AFMT_EXTCHANNEL_MASK)) - -#define AFMT_U8_NE AFMT_U8 -#define AFMT_S8_NE AFMT_S8 - -#define AFMT_SIGNED_NE (AFMT_S8_NE | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) - -#define AFMT_NE (AFMT_SIGNED_NE | AFMT_U8_NE | AFMT_U16_NE | \ - AFMT_U24_NE | AFMT_U32_NE) - enum { SND_DEV_CTL = 0, /* Control port /dev/mixer */ SND_DEV_SEQ, /* Sequencer /dev/sequencer */ @@ -508,4 +444,68 @@ int sound_oss_card_info(oss_card_info *); #endif /* _KERNEL */ +/* make figuring out what a format is easier. got AFMT_STEREO already */ +#define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) +#define AFMT_24BIT (AFMT_S24_LE | AFMT_S24_BE | AFMT_U24_LE | AFMT_U24_BE) +#define AFMT_16BIT (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) +#define AFMT_G711 (AFMT_MU_LAW | AFMT_A_LAW) +#define AFMT_8BIT (AFMT_G711 | AFMT_U8 | AFMT_S8) +#define AFMT_SIGNED (AFMT_S32_LE | AFMT_S32_BE | AFMT_S24_LE | AFMT_S24_BE | \ + AFMT_S16_LE | AFMT_S16_BE | AFMT_S8) +#define AFMT_BIGENDIAN (AFMT_S32_BE | AFMT_U32_BE | AFMT_S24_BE | AFMT_U24_BE | \ + AFMT_S16_BE | AFMT_U16_BE) + +#define AFMT_CONVERTIBLE (AFMT_8BIT | AFMT_16BIT | AFMT_24BIT | \ + AFMT_32BIT) + +/* Supported vchan mixing formats */ +#define AFMT_VCHAN (AFMT_CONVERTIBLE & ~AFMT_G711) + +#define AFMT_PASSTHROUGH AFMT_AC3 +#define AFMT_PASSTHROUGH_RATE 48000 +#define AFMT_PASSTHROUGH_CHANNEL 2 +#define AFMT_PASSTHROUGH_EXTCHANNEL 0 + +/* + * We're simply using unused, contiguous bits from various AFMT_ definitions. + * ~(0xb00ff7ff) + */ +#define AFMT_ENCODING_MASK 0xf00fffff +#define AFMT_CHANNEL_MASK 0x07f00000 +#define AFMT_CHANNEL_SHIFT 20 +#define AFMT_CHANNEL_MAX 0x7f +#define AFMT_EXTCHANNEL_MASK 0x08000000 +#define AFMT_EXTCHANNEL_SHIFT 27 +#define AFMT_EXTCHANNEL_MAX 1 + +#define AFMT_ENCODING(v) ((v) & AFMT_ENCODING_MASK) + +#define AFMT_EXTCHANNEL(v) (((v) & AFMT_EXTCHANNEL_MASK) >> \ + AFMT_EXTCHANNEL_SHIFT) + +#define AFMT_CHANNEL(v) (((v) & AFMT_CHANNEL_MASK) >> \ + AFMT_CHANNEL_SHIFT) + +#define AFMT_BIT(v) (((v) & AFMT_32BIT) ? 32 : \ + (((v) & AFMT_24BIT) ? 24 : \ + ((((v) & AFMT_16BIT) || \ + ((v) & AFMT_PASSTHROUGH)) ? 16 : 8))) + +#define AFMT_BPS(v) (AFMT_BIT(v) >> 3) +#define AFMT_ALIGN(v) (AFMT_BPS(v) * AFMT_CHANNEL(v)) + +#define SND_FORMAT(f, c, e) (AFMT_ENCODING(f) | \ + (((c) << AFMT_CHANNEL_SHIFT) & \ + AFMT_CHANNEL_MASK) | \ + (((e) << AFMT_EXTCHANNEL_SHIFT) & \ + AFMT_EXTCHANNEL_MASK)) + +#define AFMT_U8_NE AFMT_U8 +#define AFMT_S8_NE AFMT_S8 + +#define AFMT_SIGNED_NE (AFMT_S8_NE | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) + +#define AFMT_NE (AFMT_SIGNED_NE | AFMT_U8_NE | AFMT_U16_NE | \ + AFMT_U24_NE | AFMT_U32_NE) + #endif /* _OS_H_ */ diff --git a/tests/sys/sound/Makefile b/tests/sys/sound/Makefile index fb731fb8ab61..74a0765a0540 100644 --- a/tests/sys/sound/Makefile +++ b/tests/sys/sound/Makefile @@ -2,8 +2,12 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/sound +ATF_TESTS_C+= pcm_read_write ATF_TESTS_C+= sndstat +CFLAGS+= -I${SRCTOP}/sys LDFLAGS+= -lnv +CFLAGS.pcm_read_write.c+= -Wno-cast-align + .include diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c new file mode 100644 index 000000000000..6bdc578615b5 --- /dev/null +++ b/tests/sys/sound/pcm_read_write.c @@ -0,0 +1,509 @@ +/*- + * Copyright (c) 2025 Florian Walpen + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * These tests exercise conversion functions of the sound module, used to read + * pcm samples from a buffer, and write pcm samples to a buffer. The test cases + * are non-exhaustive, but should detect systematic errors in conversion of the + * various sample formats supported. In particular, the test cases establish + * correctness independent of the machine's endianness, making them suitable to + * check for architecture-specific problems. + */ + +#include +#include + +#include +#include +#include + +#include +#include +#include + +/* Generic test data, with buffer content matching the sample values. */ +struct afmt_test_data { + const char *label; + uint8_t buffer[4]; + size_t size; + int format; + intpcm_t value; + _Static_assert((sizeof(intpcm_t) == 4), + "Test data assumes 32bit, adjust negative values to new size."); +} static const afmt_tests[] = { + /* 8 bit sample formats. */ + {"s8_1", {0x01, 0x00, 0x00, 0x00}, 1, AFMT_S8, 0x00000001}, + {"s8_2", {0x81, 0x00, 0x00, 0x00}, 1, AFMT_S8, 0xffffff81}, + {"u8_1", {0x01, 0x00, 0x00, 0x00}, 1, AFMT_U8, 0xffffff81}, + {"u8_2", {0x81, 0x00, 0x00, 0x00}, 1, AFMT_U8, 0x00000001}, + + /* 16 bit sample formats. */ + {"s16le_1", {0x01, 0x02, 0x00, 0x00}, 2, AFMT_S16_LE, 0x00000201}, + {"s16le_2", {0x81, 0x82, 0x00, 0x00}, 2, AFMT_S16_LE, 0xffff8281}, + {"s16be_1", {0x01, 0x02, 0x00, 0x00}, 2, AFMT_S16_BE, 0x00000102}, + {"s16be_2", {0x81, 0x82, 0x00, 0x00}, 2, AFMT_S16_BE, 0xffff8182}, + {"u16le_1", {0x01, 0x02, 0x00, 0x00}, 2, AFMT_U16_LE, 0xffff8201}, + {"u16le_2", {0x81, 0x82, 0x00, 0x00}, 2, AFMT_U16_LE, 0x00000281}, + {"u16be_1", {0x01, 0x02, 0x00, 0x00}, 2, AFMT_U16_BE, 0xffff8102}, + {"u16be_2", {0x81, 0x82, 0x00, 0x00}, 2, AFMT_U16_BE, 0x00000182}, + + /* 24 bit sample formats. */ + {"s24le_1", {0x01, 0x02, 0x03, 0x00}, 3, AFMT_S24_LE, 0x00030201}, + {"s24le_2", {0x81, 0x82, 0x83, 0x00}, 3, AFMT_S24_LE, 0xff838281}, + {"s24be_1", {0x01, 0x02, 0x03, 0x00}, 3, AFMT_S24_BE, 0x00010203}, + {"s24be_2", {0x81, 0x82, 0x83, 0x00}, 3, AFMT_S24_BE, 0xff818283}, + {"u24le_1", {0x01, 0x02, 0x03, 0x00}, 3, AFMT_U24_LE, 0xff830201}, + {"u24le_2", {0x81, 0x82, 0x83, 0x00}, 3, AFMT_U24_LE, 0x00038281}, + {"u24be_1", {0x01, 0x02, 0x03, 0x00}, 3, AFMT_U24_BE, 0xff810203}, + {"u24be_2", {0x81, 0x82, 0x83, 0x00}, 3, AFMT_U24_BE, 0x00018283}, + + /* 32 bit sample formats. */ + {"s32le_1", {0x01, 0x02, 0x03, 0x04}, 4, AFMT_S32_LE, 0x04030201}, + {"s32le_2", {0x81, 0x82, 0x83, 0x84}, 4, AFMT_S32_LE, 0x84838281}, + {"s32be_1", {0x01, 0x02, 0x03, 0x04}, 4, AFMT_S32_BE, 0x01020304}, + {"s32be_2", {0x81, 0x82, 0x83, 0x84}, 4, AFMT_S32_BE, 0x81828384}, + {"u32le_1", {0x01, 0x02, 0x03, 0x04}, 4, AFMT_U32_LE, 0x84030201}, + {"u32le_2", {0x81, 0x82, 0x83, 0x84}, 4, AFMT_U32_LE, 0x04838281}, + {"u32be_1", {0x01, 0x02, 0x03, 0x04}, 4, AFMT_U32_BE, 0x81020304}, + {"u32be_2", {0x81, 0x82, 0x83, 0x84}, 4, AFMT_U32_BE, 0x01828384}, + + /* u-law and A-law sample formats. */ + {"mulaw_1", {0x01, 0x00, 0x00, 0x00}, 1, AFMT_MU_LAW, 0xffffff87}, + {"mulaw_2", {0x81, 0x00, 0x00, 0x00}, 1, AFMT_MU_LAW, 0x00000079}, + {"alaw_1", {0x2a, 0x00, 0x00, 0x00}, 1, AFMT_A_LAW, 0xffffff83}, + {"alaw_2", {0xab, 0x00, 0x00, 0x00}, 1, AFMT_A_LAW, 0x00000079} +}; + +/* Normalize sample values in strictly correct (but slow) c. */ +static intpcm_t +local_normalize(intpcm_t value, int val_bits, int norm_bits) +{ + /* Avoid undefined or implementation defined behavior. */ + if (val_bits < norm_bits) + /* Multiply instead of left shift (value may be negative). */ + return (value * (1 << (norm_bits - val_bits))); + else if (val_bits > norm_bits) + /* Divide instead of right shift (value may be negative). */ + return (value / (1 << (val_bits - norm_bits))); + return value; +} + +/* Restrict magnitude of sample value to 24bit for 32bit calculations. */ +static intpcm_t +local_calc_limit(intpcm_t value, int val_bits) +{ + /* Avoid implementation defined behavior. */ + if (sizeof(intpcm32_t) == 32 && val_bits == 32) + /* Divide instead of right shift (value may be negative). */ + return (value / (1 << 8)); + return value; +} + +/* Lookup tables to read u-law and A-law sample formats. */ +static const uint8_t ulaw_to_u8[G711_TABLE_SIZE] = ULAW_TO_U8; +static const uint8_t alaw_to_u8[G711_TABLE_SIZE] = ALAW_TO_U8; + +/* Helper function to read one sample value from a buffer. */ +static intpcm_t +local_pcm_read(uint8_t *src, uint32_t format) +{ + intpcm_t value; + + switch (format) { + case AFMT_S8: + value = _PCM_READ_S8_NE(src); + break; + case AFMT_U8: + value = _PCM_READ_U8_NE(src); + break; + case AFMT_S16_LE: + value = _PCM_READ_S16_LE(src); + break; + case AFMT_S16_BE: + value = _PCM_READ_S16_BE(src); + break; + case AFMT_U16_LE: + value = _PCM_READ_U16_LE(src); + break; + case AFMT_U16_BE: + value = _PCM_READ_U16_BE(src); + break; + case AFMT_S24_LE: + value = _PCM_READ_S24_LE(src); + break; + case AFMT_S24_BE: + value = _PCM_READ_S24_BE(src); + break; + case AFMT_U24_LE: + value = _PCM_READ_U24_LE(src); + break; + case AFMT_U24_BE: + value = _PCM_READ_U24_BE(src); + break; + case AFMT_S32_LE: + value = _PCM_READ_S32_LE(src); + break; + case AFMT_S32_BE: + value = _PCM_READ_S32_BE(src); + break; + case AFMT_U32_LE: + value = _PCM_READ_U32_LE(src); + break; + case AFMT_U32_BE: + value = _PCM_READ_U32_BE(src); + break; + case AFMT_MU_LAW: + value = _G711_TO_INTPCM(ulaw_to_u8, *src); + break; + case AFMT_A_LAW: + value = _G711_TO_INTPCM(alaw_to_u8, *src); + break; + default: + value = 0; + } + + return (value); +} + +/* Helper function to read one sample value from a buffer for calculations. */ +static intpcm_t +local_pcm_read_calc(uint8_t *src, uint32_t format) +{ + intpcm_t value; + + switch (format) { + case AFMT_S8: + value = PCM_READ_S8_NE(src); + break; + case AFMT_U8: + value = PCM_READ_U8_NE(src); + break; + case AFMT_S16_LE: + value = PCM_READ_S16_LE(src); + break; + case AFMT_S16_BE: + value = PCM_READ_S16_BE(src); + break; + case AFMT_U16_LE: + value = PCM_READ_U16_LE(src); + break; + case AFMT_U16_BE: + value = PCM_READ_U16_BE(src); + break; + case AFMT_S24_LE: + value = PCM_READ_S24_LE(src); + break; + case AFMT_S24_BE: + value = PCM_READ_S24_BE(src); + break; + case AFMT_U24_LE: + value = PCM_READ_U24_LE(src); + break; + case AFMT_U24_BE: + value = PCM_READ_U24_BE(src); + break; + case AFMT_S32_LE: + value = PCM_READ_S32_LE(src); + break; + case AFMT_S32_BE: + value = PCM_READ_S32_BE(src); + break; + case AFMT_U32_LE: + value = PCM_READ_U32_LE(src); + break; + case AFMT_U32_BE: + value = PCM_READ_U32_BE(src); + break; + case AFMT_MU_LAW: + value = _G711_TO_INTPCM(ulaw_to_u8, *src); + break; + case AFMT_A_LAW: + value = _G711_TO_INTPCM(alaw_to_u8, *src); + break; + default: + value = 0; + } + + return (value); +} + +/* Helper function to read one normalized sample from a buffer. */ +static intpcm_t +local_pcm_read_norm(uint8_t *src, uint32_t format) +{ + intpcm_t value; + + value = local_pcm_read(src, format); + value <<= (32 - AFMT_BIT(format)); + return (value); +} + +/* Lookup tables to write u-law and A-law sample formats. */ +static const uint8_t u8_to_ulaw[G711_TABLE_SIZE] = U8_TO_ULAW; +static const uint8_t u8_to_alaw[G711_TABLE_SIZE] = U8_TO_ALAW; + +/* Helper function to write one sample value to a buffer. */ +static void +local_pcm_write(uint8_t *dst, intpcm_t value, uint32_t format) +{ + switch (format) { + case AFMT_S8: + _PCM_WRITE_S8_NE(dst, value); + break; + case AFMT_U8: + _PCM_WRITE_U8_NE(dst, value); + break; + case AFMT_S16_LE: + _PCM_WRITE_S16_LE(dst, value); + break; + case AFMT_S16_BE: + _PCM_WRITE_S16_BE(dst, value); + break; + case AFMT_U16_LE: + _PCM_WRITE_U16_LE(dst, value); + break; + case AFMT_U16_BE: + _PCM_WRITE_U16_BE(dst, value); + break; + case AFMT_S24_LE: + _PCM_WRITE_S24_LE(dst, value); + break; + case AFMT_S24_BE: + _PCM_WRITE_S24_BE(dst, value); + break; + case AFMT_U24_LE: + _PCM_WRITE_U24_LE(dst, value); + break; + case AFMT_U24_BE: + _PCM_WRITE_U24_BE(dst, value); + break; + case AFMT_S32_LE: + _PCM_WRITE_S32_LE(dst, value); + break; + case AFMT_S32_BE: + _PCM_WRITE_S32_BE(dst, value); + break; + case AFMT_U32_LE: + _PCM_WRITE_U32_LE(dst, value); + break; + case AFMT_U32_BE: + _PCM_WRITE_U32_BE(dst, value); + break; + case AFMT_MU_LAW: + *dst = _INTPCM_TO_G711(u8_to_ulaw, value); + break; + case AFMT_A_LAW: + *dst = _INTPCM_TO_G711(u8_to_alaw, value); + break; + default: + value = 0; + } +} + +/* Helper function to write one calculation sample value to a buffer. */ +static void +local_pcm_write_calc(uint8_t *dst, intpcm_t value, uint32_t format) +{ + switch (format) { + case AFMT_S8: + PCM_WRITE_S8_NE(dst, value); + break; + case AFMT_U8: + PCM_WRITE_U8_NE(dst, value); + break; + case AFMT_S16_LE: + PCM_WRITE_S16_LE(dst, value); + break; + case AFMT_S16_BE: + PCM_WRITE_S16_BE(dst, value); + break; + case AFMT_U16_LE: + PCM_WRITE_U16_LE(dst, value); + break; + case AFMT_U16_BE: + PCM_WRITE_U16_BE(dst, value); + break; + case AFMT_S24_LE: + PCM_WRITE_S24_LE(dst, value); + break; + case AFMT_S24_BE: + PCM_WRITE_S24_BE(dst, value); + break; + case AFMT_U24_LE: + PCM_WRITE_U24_LE(dst, value); + break; + case AFMT_U24_BE: + PCM_WRITE_U24_BE(dst, value); + break; + case AFMT_S32_LE: + PCM_WRITE_S32_LE(dst, value); + break; + case AFMT_S32_BE: + PCM_WRITE_S32_BE(dst, value); + break; + case AFMT_U32_LE: + PCM_WRITE_U32_LE(dst, value); + break; + case AFMT_U32_BE: + PCM_WRITE_U32_BE(dst, value); + break; + case AFMT_MU_LAW: + *dst = _INTPCM_TO_G711(u8_to_ulaw, value); + break; + case AFMT_A_LAW: + *dst = _INTPCM_TO_G711(u8_to_alaw, value); + break; + default: + value = 0; + } +} + +/* Helper function to write one normalized sample to a buffer. */ +static void +local_pcm_write_norm(uint8_t *dst, intpcm_t value, uint32_t format) +{ + local_pcm_write(dst, value >> (32 - AFMT_BIT(format)), format); +} + +ATF_TC(pcm_read); +ATF_TC_HEAD(pcm_read, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Read and verify different pcm sample formats."); +} +ATF_TC_BODY(pcm_read, tc) +{ + const struct afmt_test_data *test; + uint8_t src[4]; + intpcm_t expected, result; + size_t i; + + for (i = 0; i < nitems(afmt_tests); i++) { + test = &afmt_tests[i]; + + /* Copy byte representation, fill with distinctive pattern. */ + memset(src, 0x66, sizeof(src)); + memcpy(src, test->buffer, test->size); + + /* Read sample at format magnitude. */ + expected = test->value; + result = local_pcm_read(src, test->format); + ATF_CHECK_MSG(result == expected, + "pcm_read[\"%s\"].value: expected=0x%08x, result=0x%08x", + test->label, expected, result); + + /* Read sample at format magnitude, for calculations. */ + expected = local_calc_limit(test->value, test->size * 8); + result = local_pcm_read_calc(src, test->format); + ATF_CHECK_MSG(result == expected, + "pcm_read[\"%s\"].calc: expected=0x%08x, result=0x%08x", + test->label, expected, result); + + /* Read sample at full 32 bit magnitude. */ + expected = local_normalize(test->value, test->size * 8, 32); + result = local_pcm_read_norm(src, test->format); + ATF_CHECK_MSG(result == expected, + "pcm_read[\"%s\"].norm: expected=0x%08x, result=0x%08x", + test->label, expected, result); + } +} + +ATF_TC(pcm_write); +ATF_TC_HEAD(pcm_write, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Write and verify different pcm sample formats."); +} +ATF_TC_BODY(pcm_write, tc) +{ + const struct afmt_test_data *test; + uint8_t expected[4]; + uint8_t dst[4]; + intpcm_t value; + size_t i; + + for (i = 0; i < nitems(afmt_tests); i++) { + test = &afmt_tests[i]; + + /* Write sample of format specific magnitude. */ + memcpy(expected, test->buffer, sizeof(expected)); + memset(dst, 0x00, sizeof(dst)); + value = test->value; + local_pcm_write(dst, value, test->format); + ATF_CHECK_MSG(memcmp(dst, expected, sizeof(dst)) == 0, + "pcm_write[\"%s\"].value: " + "expected={0x%02x, 0x%02x, 0x%02x, 0x%02x}, " + "result={0x%02x, 0x%02x, 0x%02x, 0x%02x}, ", test->label, + expected[0], expected[1], expected[2], expected[3], + dst[0], dst[1], dst[2], dst[3]); + + /* Write sample of format specific, calculation magnitude. */ + memcpy(expected, test->buffer, sizeof(expected)); + memset(dst, 0x00, sizeof(dst)); + value = local_calc_limit(test->value, test->size * 8); + if (value != test->value) { + /* + * 32 bit sample was reduced to 24 bit resolution + * for calculation, least significant byte is lost. + */ + if (test->format & AFMT_BIGENDIAN) + expected[3] = 0x00; + else + expected[0] = 0x00; + } + local_pcm_write_calc(dst, value, test->format); + ATF_CHECK_MSG(memcmp(dst, expected, sizeof(dst)) == 0, + "pcm_write[\"%s\"].value: " + "expected={0x%02x, 0x%02x, 0x%02x, 0x%02x}, " + "result={0x%02x, 0x%02x, 0x%02x, 0x%02x}, ", test->label, + expected[0], expected[1], expected[2], expected[3], + dst[0], dst[1], dst[2], dst[3]); + + /* Write normalized sample of full 32 bit magnitude. */ + memcpy(expected, test->buffer, sizeof(expected)); + memset(dst, 0x00, sizeof(dst)); + value = local_normalize(test->value, test->size * 8, 32); + local_pcm_write_norm(dst, value, test->format); + ATF_CHECK_MSG(memcmp(dst, expected, sizeof(dst)) == 0, + "pcm_write[\"%s\"].norm: " + "expected={0x%02x, 0x%02x, 0x%02x, 0x%02x}, " + "result={0x%02x, 0x%02x, 0x%02x, 0x%02x}, ", test->label, + expected[0], expected[1], expected[2], expected[3], + dst[0], dst[1], dst[2], dst[3]); + } +} + +ATF_TC(pcm_format_bits); +ATF_TC_HEAD(pcm_format_bits, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify bit width of different pcm sample formats."); +} +ATF_TC_BODY(pcm_format_bits, tc) +{ + const struct afmt_test_data *test; + size_t bits; + size_t i; + + for (i = 0; i < nitems(afmt_tests); i++) { + test = &afmt_tests[i]; + + /* Check bit width determined for given sample format. */ + bits = AFMT_BIT(test->format); + ATF_CHECK_MSG(bits == test->size * 8, + "format_bits[%zu].size: expected=%zu, result=%zu", + i, test->size * 8, bits); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, pcm_read); + ATF_TP_ADD_TC(tp, pcm_write); + ATF_TP_ADD_TC(tp, pcm_format_bits); + + return atf_no_error(); +} From nobody Tue Jan 21 12:03:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycm8G20fwz5l0YJ; Tue, 21 Jan 2025 12: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycm8G1HLCz3fnn; Tue, 21 Jan 2025 12:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBv2/ylwt8Qoim/ayOUu9i2p39U94BQ2bZG+hab0LDw=; b=r08r8o7dWwcxUwysn23dhDB5fOm+QBmnYaD1d2LSnYb4VEo2PBrxZYO5m/BEH3XgbBFGsO Cp3TO1Bxz11eImhdqgWDjP5YxAUZh+RkPIHebfGdsnUpZ6lu3Sau0YtXlzpIXBazGM3BlD vstw95n1Ke2QK2IsBHCKTzgkmzd6tqZkT4aIJ5IxKshiGsHkSdsVRp3GY0Kb9QvSjmw6Qd iRdoxtZlCCFIl6fAAUJY9kTyNapGvMqIzbtx4Vq3hh8D/It/J4U10ykMuOZbOLQxufv12+ 6GuR+AGmtcOtNG03k8fEH8PqnYj7L1vAs456dKe8MUG+ZzsMAIKaYA759LDPvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBv2/ylwt8Qoim/ayOUu9i2p39U94BQ2bZG+hab0LDw=; b=xS1fbFLzPyNcPBbjhHGAneVCWSmrepJdLmqz/QeQdLMaczQQ8qiAoPdxi7QDY4Gb6ZPgFu 1wCfiOMW8FwjDS7kivGI9Db6NcHyc46e9W5grRmAIpBtI/3wGRYIttWwh3DOIH4i2W4U65 VHuPMibbOIc1olhoHfncjg875dF3YHLZVU6fasFojfVkgXpsfS8pY6ex3/mXIgSUGcp0JI 0odS4du6dKqxJeqUDhe1MPudcEbq2pKckfFFyQBarVTKl5gsEiQQ1ZB2DFFrtg3KW9Nbcz NUvOsFui8H7FyTuq5jejsANFAJVm/YPPLoxr20tKXwTLnxckj8N2y/NCafEvkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737461038; a=rsa-sha256; cv=none; b=U4RIi2zej4YXLpq4yV3jGGwgto44F+509kGPHdU4+e69WpynBw0zuf9aL6fdb9OvuKfDC1 ne/RIeVpHuw1wu/NVciszrfdlr24Ti3YaX6DpUVrvVwchlrUQNjGCl8o/uer47+xprLeHh DmSd+IiSfrEpHatQkfetG0rLHoHySGiKD//CXMHX+slTO12ZKnmq9T04ppnTEffy6Epozc KqwSqPkUQf7w8cE/fRvlFS91TfxJHfCCaXPIqEudOQzsBswlOGyl5I00SFVy7dP/XFpkW/ aJ/YbDaT7/czFCSHwSk6TNbanM0EbwCOXROBmMDXOeILnJP9HqQEQFJfuclxJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycm8G0qW6z15KJ; Tue, 21 Jan 2025 12:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LC3wT0023301; Tue, 21 Jan 2025 12:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LC3wux023298; Tue, 21 Jan 2025 12:03:58 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:03:58 GMT Message-Id: <202501211203.50LC3wux023298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 27b932e32fab - main - sound: Safely remove channel from list in one pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27b932e32faba1137ff307d05b787d837ccadda8 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=27b932e32faba1137ff307d05b787d837ccadda8 commit 27b932e32faba1137ff307d05b787d837ccadda8 Author: Florian Walpen AuthorDate: 2025-01-21 11:59:12 +0000 Commit: Christos Margiolis CommitDate: 2025-01-21 12:00:52 +0000 sound: Safely remove channel from list in one pass The CHN_REMOVE_SAFE() macro did two traversals of the channel list to remove a channel, one to check whether the channel is an element of the list, and a second traversal through SLIST_REMOVE(). Reduce this to one traversal, while still preventing a NULL dereference in case the channel in question is not present in the list. While here, rename the macro arguments to something more descriptive. MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D48207 --- sys/dev/sound/pcm/channel.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 67f5019f4727..58fedd284ecb 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -175,6 +175,7 @@ struct pcm_channel { #define CHN_LINK(y) y.link #define CHN_EMPTY(x, y) SLIST_EMPTY(CHN_HEAD(x, y)) #define CHN_FIRST(x, y) SLIST_FIRST(CHN_HEAD(x, y)) +#define CHN_NEXT(elm, list) SLIST_NEXT((elm), CHN_LINK(list)) #define CHN_FOREACH(x, y, z) \ SLIST_FOREACH(x, CHN_HEAD(y, z), CHN_LINK(z)) @@ -188,8 +189,8 @@ struct pcm_channel { #define CHN_INSERT_AFTER(x, y, z) \ SLIST_INSERT_AFTER(x, y, CHN_LINK(z)) -#define CHN_REMOVE(x, y, z) \ - SLIST_REMOVE(CHN_HEAD(x, z), y, pcm_channel, CHN_LINK(z)) +#define CHN_REMOVE(holder, elm, list) \ + SLIST_REMOVE(CHN_HEAD(holder, list), elm, pcm_channel, CHN_LINK(list)) #define CHN_INSERT_HEAD_SAFE(x, y, z) do { \ struct pcm_channel *t = NULL; \ @@ -211,14 +212,18 @@ struct pcm_channel { CHN_INSERT_AFTER(x, y, z); \ } while (0) -#define CHN_REMOVE_SAFE(x, y, z) do { \ - struct pcm_channel *t = NULL; \ - CHN_FOREACH(t, x, z) { \ - if (t == y) \ - break; \ - } \ - if (t == y) \ - CHN_REMOVE(x, y, z); \ +#define CHN_REMOVE_SAFE(holder, elm, list) do { \ + if (CHN_FIRST(holder, list) == (elm)) { \ + SLIST_REMOVE_HEAD(CHN_HEAD(holder, list), CHN_LINK(list)); \ + } else { \ + struct pcm_channel *t = NULL; \ + CHN_FOREACH(t, holder, list) { \ + if (CHN_NEXT(t, list) == (elm)) { \ + SLIST_REMOVE_AFTER(t, CHN_LINK(list)); \ + break; \ + } \ + } \ + } \ } while (0) #define CHN_INSERT_SORT(w, x, y, z) do { \ From nobody Tue Jan 21 12:03:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycm8J6s4vz5l0wT; Tue, 21 Jan 2025 12:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycm8J0tCHz3gBV; Tue, 21 Jan 2025 12:04:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2w2b3uIaBTWLoGwIScIF9CRB7pn4JGymsrgwNmCEC2E=; b=SlPXTaJ+Qa9i539URS5hKerk1/IZ4b38dIrWcWddJntsiUvoKaWmprekKqMQnV2smnZobQ qKyIogPhN/EpWUkVrUGhBoJvzGfARt1bodUNLolQck1wGgJYrTtB0bzBOoVr11iWheN0CK joYjpNwLSTa/e1vqGaztEcZFkorijMAYf1/jcVQekj2yB8mEyzQUTXW+ZNROdSGGFvlsAX 1vMTzDc5VS0dTLoUU5T1gCceBnYOcdRO8naPseS+tmE2LP+NT3qYs4vNEAeaBi+JSRYDsT Dc32Q6RlY9NePrFP3dIuotH0l2Ic0PH+v7YKmZi1a2rXOgK6bAFV/rmLXCXMew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737461040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2w2b3uIaBTWLoGwIScIF9CRB7pn4JGymsrgwNmCEC2E=; b=fNC37OFGk9MQsHnregfFXluTLKZhJb2xjPXMJHd6pe3hMfsWFVxQildFzMoTY3tUlUG1cq W5+RknGvBCJUWMZMP7dVBS7bG9Wql9nnp98spw4Te4W4aRIFCKP6huzwTT0sE5V0RklHAU fJoYFbkHdYRyyona4XMO0tlNNxAwfvGLATdzA4ckFlgNylkJbm169oic5sbUucJXJ0JO0m bz/rQu8XicxUhnNjlU4UkLU/5Z4nKUWfBAqabs/wjnB8moW1VLreKUIyQpX4VbRnKhBdrD /Crvgvf48pLPfmDm0XG2ATgQy+HTOafXd5JKzIKmxJ/GL9rwAsublLN0AJeQ4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737461040; a=rsa-sha256; cv=none; b=VFyvtvw91sWPdK1zXLQgQSlJNYuAfhSScN03OhUHHRfgiBkRAQjFQfqG2SOfAnraqqBzYq F//QbWOGpUILtV2vFsORf41edX64/ipvlz5Xy+Gxja/kzsV/wT6fHz1vjKUTm9yNaEYTaw zgUR8L8yBWAz3bjnG/2tjwd/eylYOBRlfbSMUqT8qzBkDcZGj7pMtYzq69PFuqgChMnhMn pPHd7OG9sXxVVb4vD+YOe9ttdm8dok7H7T8mTV5hzT2FmNQccZILEEktpgmV4UyxmWj753 xGrk13bDJznTkeUgPFM6hyK8GvQEIms2prWENgxyBXDWlk/g6cGRB5Yqslb7Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycm8H1S1Qz15KK; Tue, 21 Jan 2025 12:03:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LC3xVg023336; Tue, 21 Jan 2025 12:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LC3xJD023333; Tue, 21 Jan 2025 12:03:59 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:03:59 GMT Message-Id: <202501211203.50LC3xJD023333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ffcefe5310e0 - main - sound: Make CHN_REMOVE_SAFE() the default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffcefe5310e084415a2f292a00f4637d4059c40f Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ffcefe5310e084415a2f292a00f4637d4059c40f commit ffcefe5310e084415a2f292a00f4637d4059c40f Author: Christos Margiolis AuthorDate: 2025-01-21 12:00:17 +0000 Commit: Christos Margiolis CommitDate: 2025-01-21 12:02:55 +0000 sound: Make CHN_REMOVE_SAFE() the default Commit 27b932e32fab ("sound: Safely remove channel from list in one pass") optimized CHN_REMOVE_SAFE() to perform almost equally to CHN_REMOVE(), so we can turn CHN_REMOVE_SAFE() into CHN_REMOVE() without fears of performance regressions, while also being more robust. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48249 --- sys/dev/sound/pcm/channel.c | 2 +- sys/dev/sound/pcm/channel.h | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 925a82bb170f..4b0ca128391b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2291,7 +2291,7 @@ chn_trigger(struct pcm_channel *c, int go) break; case PCMTRIG_STOP: case PCMTRIG_ABORT: - CHN_REMOVE_SAFE(d, c, channels.pcm.busy); + CHN_REMOVE(d, c, channels.pcm.busy); PCM_UNLOCK(d); break; default: diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 58fedd284ecb..6eaad8cc2c0b 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -189,9 +189,6 @@ struct pcm_channel { #define CHN_INSERT_AFTER(x, y, z) \ SLIST_INSERT_AFTER(x, y, CHN_LINK(z)) -#define CHN_REMOVE(holder, elm, list) \ - SLIST_REMOVE(CHN_HEAD(holder, list), elm, pcm_channel, CHN_LINK(list)) - #define CHN_INSERT_HEAD_SAFE(x, y, z) do { \ struct pcm_channel *t = NULL; \ CHN_FOREACH(t, x, z) { \ @@ -212,7 +209,7 @@ struct pcm_channel { CHN_INSERT_AFTER(x, y, z); \ } while (0) -#define CHN_REMOVE_SAFE(holder, elm, list) do { \ +#define CHN_REMOVE(holder, elm, list) do { \ if (CHN_FIRST(holder, list) == (elm)) { \ SLIST_REMOVE_HEAD(CHN_HEAD(holder, list), CHN_LINK(list)); \ } else { \ From nobody Tue Jan 21 12:29:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycmjm6Kzxz5l20D; Tue, 21 Jan 2025 12:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycmjm5kMJz3krd; Tue, 21 Jan 2025 12:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vLQwazNbUlBhM7xOGWreTN4vF2mGd0fdd+zia/VmbB8=; b=Kd6K1WT23CvhCBtTBg2qrucVq7VTGKpCC0CoOr3IPCUh5b2BcFkw3fwoWGyAmz25uHqSUw d5IBoBytxgdzWvjZ29zEDhTFBy75Z1+2lQ6kiciJLNRwkn2Gx/vSW4C9OK2xfw40GYY814 6Dur2HfqwL48fseo+ru7p3fFpk9WJBPDl8wUFxwSZtsBZsvymKi4nbjfxCRawRAdSL/wTi Da8f3n2qB8JNQvQX+JKfotmKU04BUyT8YhwrjSJv8HJcfhvrLHpssA5PGtGWVid1viQGpb tKi1l/1Fnr8ApgyggkMzO6qBlZkgq2B9mwW04X6Jj/dM/EqynqhkAKajvLGTBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vLQwazNbUlBhM7xOGWreTN4vF2mGd0fdd+zia/VmbB8=; b=tMWjlneWYlKUPWfG0aCrnXLPgyJxl0WHUEX3RCrBPzcUNc2icgCWMlG2XaY4L19xbu3hvB rQ673tNZQ1hrgv2I9yhwdgHKNWk6WEqI0ZdbAMtw7MuFHde7QfKof1qoyhCmTJtOOIerS0 bPe86+kZfhPPEncrrudqwCC3kJjCpvyzcpyDzpb6ovVJO1QXe1r07kMb3Zvy2r9AzSSQvh KHyHwEHGTtGpivkltUHpuILg+5gs9eEOSX4bJq8HVZ7NeaN0Dkmtr+a3KpFhAK0dOfqpX0 0UwUF7jxcaRr6XYY4+XVG10QAxSTVD3hbvs1qQx/DRWQwl/PMDAt7BKeeZ+T8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737462572; a=rsa-sha256; cv=none; b=ZhzlyhEHoqnmppremQ01mmHsO+8wOoxenLmjaocexw3YE5OaHJ4fzqWkUF78f3ufBjbXWR JkHMoB8qmWyM0xP2Doo0wfw1YBoUOgIJ6dPPH/MhkF45XtdKnIkb63JELjWAAMsyL5Nxof xvV+BjNir/dIs4wHcCS/Esb8NYjVTLqw+D78zSNbP1/Rk1hc+LhqbX4GloXqyEFAUL1VYf fZSXM+3t5ClNd/KCcH7cq57fDD++ZfJblN9vOgriDScBxp+BKaxiCIxcovthXMUTBST0gc BzVK2ksEc3KPaVpdvHe8D42YktR0JNyVYfmngCI22MXFk9aE0+UmfqapRXIPmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycmjm56X4z15Pf; Tue, 21 Jan 2025 12:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LCTWLR061651; Tue, 21 Jan 2025 12:29:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LCTWFR061648; Tue, 21 Jan 2025 12:29:32 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:29:32 GMT Message-Id: <202501211229.50LCTWFR061648@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: 1dda3a6ed9c5 - stable/14 - hid: Correctly handle signed/unsigned quantities in kernel HID parser. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 1dda3a6ed9c51adc908fee4db5917b1232fa932c Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1dda3a6ed9c51adc908fee4db5917b1232fa932c commit 1dda3a6ed9c51adc908fee4db5917b1232fa932c Author: Vladimir Kondratyev AuthorDate: 2024-12-22 03:16:11 +0000 Commit: Ed Maste CommitDate: 2025-01-21 12:29:17 +0000 hid: Correctly handle signed/unsigned quantities in kernel HID parser. Wrong signedness of usage value results in inverted range check in hmt(4) driver that allows out of bound array access leading to panic. Reported by: many Sponsored by: Future Crew, LLC Obtained from: NetBSD NetBSD PR: kern/53605 PR: 274014, 282592 (cherry picked from commit 38b67578fb4bbf568f7012ca3921a4d15cfe7c5d) --- sys/dev/hid/hid.c | 91 +++++++++++++++++++++++++++++-------------------------- sys/dev/hid/hid.h | 32 +++++++++---------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 4b5d4a81b51e..453c37d806fc 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -69,7 +69,7 @@ hid_test_quirk_t *hid_test_quirk_p = &hid_test_quirk_w; #define MAXLOCCNT 2048 struct hid_pos_data { - int32_t rid; + uint32_t rid; uint32_t pos; }; @@ -79,9 +79,9 @@ struct hid_data { const uint8_t *p; struct hid_item cur[MAXPUSH]; struct hid_pos_data last_pos[MAXID]; - int32_t usages_min[MAXUSAGE]; - int32_t usages_max[MAXUSAGE]; - int32_t usage_last; /* last seen usage */ + uint32_t usages_min[MAXUSAGE]; + uint32_t usages_max[MAXUSAGE]; + uint32_t usage_last; /* last seen usage */ uint32_t loc_size; /* last seen size */ uint32_t loc_count; /* last seen count */ uint32_t ncount; /* end usage item count */ @@ -117,7 +117,7 @@ hid_clear_local(struct hid_item *c) } static void -hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) +hid_switch_rid(struct hid_data *s, struct hid_item *c, uint32_t next_rID) { uint8_t i; @@ -242,6 +242,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) uint32_t oldpos; int32_t mask; int32_t dval; + uint32_t uval; if (s == NULL) return (0); @@ -253,10 +254,10 @@ hid_get_item(struct hid_data *s, struct hid_item *h) if (s->icount < s->ncount) { /* get current usage */ if (s->iusage < s->nusage) { - dval = s->usages_min[s->iusage] + s->ousage; - c->usage = dval; - s->usage_last = dval; - if (dval == s->usages_max[s->iusage]) { + uval = s->usages_min[s->iusage] + s->ousage; + c->usage = uval; + s->usage_last = uval; + if (uval == s->usages_max[s->iusage]) { s->iusage ++; s->ousage = 0; } else { @@ -264,7 +265,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } } else { DPRINTFN(1, "Using last usage\n"); - dval = s->usage_last; + uval = s->usage_last; } c->nusages = 1; /* array type HID item may have multiple usages */ @@ -318,28 +319,32 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } switch (bSize) { case 0: - dval = 0; + uval = 0; + dval = uval; mask = 0; break; case 1: - dval = (int8_t)hid_get_byte(s, 1); + uval = hid_get_byte(s, 1); + dval = (int8_t)uval; mask = 0xFF; break; case 2: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval = (int16_t)dval; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + dval = (int16_t)uval; mask = 0xFFFF; break; case 4: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval |= hid_get_byte(s, 1) << 16; - dval |= hid_get_byte(s, 1) << 24; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + uval |= hid_get_byte(s, 1) << 16; + uval |= hid_get_byte(s, 1) << 24; + dval = uval; mask = 0xFFFFFFFF; break; default: - dval = hid_get_byte(s, bSize); + uval = hid_get_byte(s, bSize); + dval = uval; DPRINTFN(0, "bad length %u (data=0x%02x)\n", bSize, dval); continue; @@ -351,7 +356,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 8: /* Input */ c->kind = hid_input; ret: - c->flags = dval; + c->flags = uval; c->loc.count = s->loc_count; c->loc.size = s->loc_size; @@ -381,7 +386,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) goto ret; case 10: /* Collection */ c->kind = hid_collection; - c->collection = dval; + c->collection = uval; c->collevel++; c->usage = s->usage_last; c->nusages = 1; @@ -407,7 +412,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 1: /* Global */ switch (bTag) { case 0: - c->_usage_page = dval << 16; + c->_usage_page = uval << 16; break; case 1: c->logical_minimum = dval; @@ -422,21 +427,21 @@ hid_get_item(struct hid_data *s, struct hid_item *h) c->physical_maximum = dval; break; case 5: - c->unit_exponent = dval; + c->unit_exponent = uval; break; case 6: - c->unit = dval; + c->unit = uval; break; case 7: /* mask because value is unsigned */ - s->loc_size = dval & mask; + s->loc_size = uval & mask; break; case 8: - hid_switch_rid(s, c, dval & mask); + hid_switch_rid(s, c, uval & mask); break; case 9: /* mask because value is unsigned */ - s->loc_count = dval & mask; + s->loc_count = uval & mask; break; case 10: /* Push */ /* stop parsing, if invalid push level */ @@ -479,14 +484,14 @@ hid_get_item(struct hid_data *s, struct hid_item *h) switch (bTag) { case 0: if (bSize != 4) - dval = (dval & mask) | c->_usage_page; + uval = (uval & mask) | c->_usage_page; /* set last usage, in case of a collection */ - s->usage_last = dval; + s->usage_last = uval; if (s->nusage < MAXUSAGE) { - s->usages_min[s->nusage] = dval; - s->usages_max[s->nusage] = dval; + s->usages_min[s->nusage] = uval; + s->usages_max[s->nusage] = uval; s->nusage ++; } else { DPRINTFN(0, "max usage reached\n"); @@ -499,16 +504,16 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage |= 1; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_minimum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_minimum = uval; goto check_set; case 2: s->susage |= 2; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_maximum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_maximum = uval; check_set: if (s->susage != 3) @@ -529,25 +534,25 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage = 0; break; case 3: - c->designator_index = dval; + c->designator_index = uval; break; case 4: - c->designator_minimum = dval; + c->designator_minimum = uval; break; case 5: - c->designator_maximum = dval; + c->designator_maximum = uval; break; case 7: - c->string_index = dval; + c->string_index = uval; break; case 8: - c->string_minimum = dval; + c->string_minimum = uval; break; case 9: - c->string_maximum = dval; + c->string_maximum = uval; break; case 10: - c->set_delimiter = dval; + c->set_delimiter = uval; break; default: DPRINTFN(0, "Local bTag=%d\n", bTag); diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index 09fad96c9559..aeb0da98b181 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -233,31 +233,31 @@ struct hid_location { struct hid_item { /* Global */ - int32_t _usage_page; + uint32_t _usage_page; int32_t logical_minimum; int32_t logical_maximum; int32_t physical_minimum; int32_t physical_maximum; - int32_t unit_exponent; - int32_t unit; - int32_t report_ID; + uint32_t unit_exponent; + uint32_t unit; + uint32_t report_ID; /* Local */ int nusages; union { - int32_t usage; - int32_t usages[HID_ITEM_MAXUSAGE]; + uint32_t usage; + uint32_t usages[HID_ITEM_MAXUSAGE]; }; - int32_t usage_minimum; - int32_t usage_maximum; - int32_t designator_index; - int32_t designator_minimum; - int32_t designator_maximum; - int32_t string_index; - int32_t string_minimum; - int32_t string_maximum; - int32_t set_delimiter; + uint32_t usage_minimum; + uint32_t usage_maximum; + uint32_t designator_index; + uint32_t designator_minimum; + uint32_t designator_maximum; + uint32_t string_index; + uint32_t string_minimum; + uint32_t string_maximum; + uint32_t set_delimiter; /* Misc */ - int32_t collection; + uint32_t collection; int collevel; enum hid_kind kind; uint32_t flags; From nobody Tue Jan 21 12:34:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycmq66K9vz5l2rD; Tue, 21 Jan 2025 12:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycmq65Pwkz3lvt; Tue, 21 Jan 2025 12:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jZkUlyhPMDdcHCl9Y8oEsye1NjqhlJSPsaOdk28il0c=; b=YTMdZskViD9ZNxOVF/2WhelU//pkKolYlfFpyb1z2bPzPX2oBY/lj/IZKirBn92UM+6gzv kGVBN2WGXSXWi/NWslohbZs9K87IJwHx/ZtllVd5sxzwIpkAe6pslCQ+tL1nmg86BBc3nN LtItkvmUJGR6SM8PhOZsZQGqCWhQX2ZV86VgGNk34B8xdsCd31tJKRt56xs97WAfnUvkW0 7ozApbR28J1R6AmPX1fWjczuWwFMqcdAYC4tFXh7FJDbGDlxb3Y2WjubnX2oMGAZtx0+8e ASFTEK+1Mjef9IId2j1Oy3g9nsmhYFXriDLBTD+3HAwQrqp6lSNr3n7MS+GnRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737462850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jZkUlyhPMDdcHCl9Y8oEsye1NjqhlJSPsaOdk28il0c=; b=DJadxV9xgW4aCWAJ1RuQuYpvf+wyxiIgeJLvLCZWQ1XMkUM5ewi0zaxm1P0FY7dUPmToz6 29rqdsKMQgzpCFHjsFhQ4HMdz9sI49zoE8AhErQc8sLGm5N5cN/DZrHtzIqbPQDbhWIFQI jNbyXEVm5nbrx8+ZIed6sc8KeePLa546z0RCqlbcpdrQ9geMwzFNvBjultpz0QV76VEEIh DRffwrl1ms+ZACKf+X9HW43Hjz1AhTw+3ZW0+tTBwP2pxeE0wD2p1qAC4u1tsFSto4IZ3f bIknWsadrzZGLfjD46xa5Z9eLEjIKe4lVEo3MNeXOjmo8rUqxY2lUEt4mrxVNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737462850; a=rsa-sha256; cv=none; b=oU56vA7I+K304ABhxnzCm2HCXRTE4vghB2bVywB0mFEVRia4CZiPxrVfA/Y/Xm5igwTz4V ZRSqgGRhns9VoIczdaZmJ2QAKjedxo4Q1x8NSpIe7S3gmH7ZiIlCJn03S2J1Op7bkHd4dg y5WPiWCuIZVpP8uMjbNaJ9EptR/+VuY9OZgVJLcJ0wj4dlP2JRo+Wk3iVzpN4KjfZyOUDL TFy5WcNBuLveOCJizjkznj2UnOCcfmPVij1web3Xdogm3GK4lALqe+IAkEZqzPUGcWZJqY PGNSEKwfpD6ZzQbwKvjeUWAWIUzAwgfOjIK8FA8oKRAQEn4Yt1a29ilBv6Fd5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycmq64vYkz15jg; Tue, 21 Jan 2025 12:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LCYAaA079288; Tue, 21 Jan 2025 12:34:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LCYADb079285; Tue, 21 Jan 2025 12:34:10 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:34:10 GMT Message-Id: <202501211234.50LCYADb079285@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: ecf605de97b7 - stable/13 - hid: Correctly handle signed/unsigned quantities in kernel HID parser. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ecf605de97b702ef09c64ee51c5a70f427ae0bfa Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ecf605de97b702ef09c64ee51c5a70f427ae0bfa commit ecf605de97b702ef09c64ee51c5a70f427ae0bfa Author: Vladimir Kondratyev AuthorDate: 2024-12-22 03:16:11 +0000 Commit: Ed Maste CommitDate: 2025-01-21 12:33:47 +0000 hid: Correctly handle signed/unsigned quantities in kernel HID parser. Wrong signedness of usage value results in inverted range check in hmt(4) driver that allows out of bound array access leading to panic. Reported by: many Sponsored by: Future Crew, LLC Obtained from: NetBSD NetBSD PR: kern/53605 PR: 274014, 282592 (cherry picked from commit 38b67578fb4bbf568f7012ca3921a4d15cfe7c5d) (cherry picked from commit 1dda3a6ed9c51adc908fee4db5917b1232fa932c) --- sys/dev/hid/hid.c | 91 +++++++++++++++++++++++++++++-------------------------- sys/dev/hid/hid.h | 32 +++++++++---------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 5e6ad5bb7aef..b48fa01b31ec 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -73,7 +73,7 @@ hid_test_quirk_t *hid_test_quirk_p = &hid_test_quirk_w; #define MAXLOCCNT 2048 struct hid_pos_data { - int32_t rid; + uint32_t rid; uint32_t pos; }; @@ -83,9 +83,9 @@ struct hid_data { const uint8_t *p; struct hid_item cur[MAXPUSH]; struct hid_pos_data last_pos[MAXID]; - int32_t usages_min[MAXUSAGE]; - int32_t usages_max[MAXUSAGE]; - int32_t usage_last; /* last seen usage */ + uint32_t usages_min[MAXUSAGE]; + uint32_t usages_max[MAXUSAGE]; + uint32_t usage_last; /* last seen usage */ uint32_t loc_size; /* last seen size */ uint32_t loc_count; /* last seen count */ uint32_t ncount; /* end usage item count */ @@ -121,7 +121,7 @@ hid_clear_local(struct hid_item *c) } static void -hid_switch_rid(struct hid_data *s, struct hid_item *c, int32_t next_rID) +hid_switch_rid(struct hid_data *s, struct hid_item *c, uint32_t next_rID) { uint8_t i; @@ -246,6 +246,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) uint32_t oldpos; int32_t mask; int32_t dval; + uint32_t uval; if (s == NULL) return (0); @@ -257,10 +258,10 @@ hid_get_item(struct hid_data *s, struct hid_item *h) if (s->icount < s->ncount) { /* get current usage */ if (s->iusage < s->nusage) { - dval = s->usages_min[s->iusage] + s->ousage; - c->usage = dval; - s->usage_last = dval; - if (dval == s->usages_max[s->iusage]) { + uval = s->usages_min[s->iusage] + s->ousage; + c->usage = uval; + s->usage_last = uval; + if (uval == s->usages_max[s->iusage]) { s->iusage ++; s->ousage = 0; } else { @@ -268,7 +269,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } } else { DPRINTFN(1, "Using last usage\n"); - dval = s->usage_last; + uval = s->usage_last; } c->nusages = 1; /* array type HID item may have multiple usages */ @@ -322,28 +323,32 @@ hid_get_item(struct hid_data *s, struct hid_item *h) } switch (bSize) { case 0: - dval = 0; + uval = 0; + dval = uval; mask = 0; break; case 1: - dval = (int8_t)hid_get_byte(s, 1); + uval = hid_get_byte(s, 1); + dval = (int8_t)uval; mask = 0xFF; break; case 2: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval = (int16_t)dval; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + dval = (int16_t)uval; mask = 0xFFFF; break; case 4: - dval = hid_get_byte(s, 1); - dval |= hid_get_byte(s, 1) << 8; - dval |= hid_get_byte(s, 1) << 16; - dval |= hid_get_byte(s, 1) << 24; + uval = hid_get_byte(s, 1); + uval |= hid_get_byte(s, 1) << 8; + uval |= hid_get_byte(s, 1) << 16; + uval |= hid_get_byte(s, 1) << 24; + dval = uval; mask = 0xFFFFFFFF; break; default: - dval = hid_get_byte(s, bSize); + uval = hid_get_byte(s, bSize); + dval = uval; DPRINTFN(0, "bad length %u (data=0x%02x)\n", bSize, dval); continue; @@ -355,7 +360,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 8: /* Input */ c->kind = hid_input; ret: - c->flags = dval; + c->flags = uval; c->loc.count = s->loc_count; c->loc.size = s->loc_size; @@ -385,7 +390,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) goto ret; case 10: /* Collection */ c->kind = hid_collection; - c->collection = dval; + c->collection = uval; c->collevel++; c->usage = s->usage_last; c->nusages = 1; @@ -411,7 +416,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h) case 1: /* Global */ switch (bTag) { case 0: - c->_usage_page = dval << 16; + c->_usage_page = uval << 16; break; case 1: c->logical_minimum = dval; @@ -426,21 +431,21 @@ hid_get_item(struct hid_data *s, struct hid_item *h) c->physical_maximum = dval; break; case 5: - c->unit_exponent = dval; + c->unit_exponent = uval; break; case 6: - c->unit = dval; + c->unit = uval; break; case 7: /* mask because value is unsigned */ - s->loc_size = dval & mask; + s->loc_size = uval & mask; break; case 8: - hid_switch_rid(s, c, dval & mask); + hid_switch_rid(s, c, uval & mask); break; case 9: /* mask because value is unsigned */ - s->loc_count = dval & mask; + s->loc_count = uval & mask; break; case 10: /* Push */ /* stop parsing, if invalid push level */ @@ -483,14 +488,14 @@ hid_get_item(struct hid_data *s, struct hid_item *h) switch (bTag) { case 0: if (bSize != 4) - dval = (dval & mask) | c->_usage_page; + uval = (uval & mask) | c->_usage_page; /* set last usage, in case of a collection */ - s->usage_last = dval; + s->usage_last = uval; if (s->nusage < MAXUSAGE) { - s->usages_min[s->nusage] = dval; - s->usages_max[s->nusage] = dval; + s->usages_min[s->nusage] = uval; + s->usages_max[s->nusage] = uval; s->nusage ++; } else { DPRINTFN(0, "max usage reached\n"); @@ -503,16 +508,16 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage |= 1; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_minimum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_minimum = uval; goto check_set; case 2: s->susage |= 2; if (bSize != 4) - dval = (dval & mask) | c->_usage_page; - c->usage_maximum = dval; + uval = (uval & mask) | c->_usage_page; + c->usage_maximum = uval; check_set: if (s->susage != 3) @@ -533,25 +538,25 @@ hid_get_item(struct hid_data *s, struct hid_item *h) s->susage = 0; break; case 3: - c->designator_index = dval; + c->designator_index = uval; break; case 4: - c->designator_minimum = dval; + c->designator_minimum = uval; break; case 5: - c->designator_maximum = dval; + c->designator_maximum = uval; break; case 7: - c->string_index = dval; + c->string_index = uval; break; case 8: - c->string_minimum = dval; + c->string_minimum = uval; break; case 9: - c->string_maximum = dval; + c->string_maximum = uval; break; case 10: - c->set_delimiter = dval; + c->set_delimiter = uval; break; default: DPRINTFN(0, "Local bTag=%d\n", bTag); diff --git a/sys/dev/hid/hid.h b/sys/dev/hid/hid.h index 5840c189352c..b8e733cde13d 100644 --- a/sys/dev/hid/hid.h +++ b/sys/dev/hid/hid.h @@ -236,31 +236,31 @@ struct hid_location { struct hid_item { /* Global */ - int32_t _usage_page; + uint32_t _usage_page; int32_t logical_minimum; int32_t logical_maximum; int32_t physical_minimum; int32_t physical_maximum; - int32_t unit_exponent; - int32_t unit; - int32_t report_ID; + uint32_t unit_exponent; + uint32_t unit; + uint32_t report_ID; /* Local */ int nusages; union { - int32_t usage; - int32_t usages[HID_ITEM_MAXUSAGE]; + uint32_t usage; + uint32_t usages[HID_ITEM_MAXUSAGE]; }; - int32_t usage_minimum; - int32_t usage_maximum; - int32_t designator_index; - int32_t designator_minimum; - int32_t designator_maximum; - int32_t string_index; - int32_t string_minimum; - int32_t string_maximum; - int32_t set_delimiter; + uint32_t usage_minimum; + uint32_t usage_maximum; + uint32_t designator_index; + uint32_t designator_minimum; + uint32_t designator_maximum; + uint32_t string_index; + uint32_t string_minimum; + uint32_t string_maximum; + uint32_t set_delimiter; /* Misc */ - int32_t collection; + uint32_t collection; int collevel; enum hid_kind kind; uint32_t flags; From nobody Tue Jan 21 12:48:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycn780M4Qz5l3QF; Tue, 21 Jan 2025 12:48: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycn7752DSz3pln; Tue, 21 Jan 2025 12:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737463683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Od/28+kR07tX4bFPuKP3BabpWv/VkyL4M9Z/3nm5HG0=; b=WdHHAYl/BNilLGAwNh/mxgbxEeqkKkNbekKvQvr7J1M9cAnWSfo6fYHieHJgD1jDzMYTwo WpwWOy/JeYpKmEBGrHV6uqlvRCt7dCepIrFz9XCo0UxzbB6WxyV76z4qwxZ/crsD4/00Xw I0gCRGtfonv8B8jTPba8E/Ei7J0Q4vHahovrPG36Vc6J1qzAMfRA5u3NkFobBebhKHdbxX MxJ6nLg+rf5F7RBhrjdt3aHuf1aLaKDdPIJqn+l2pF7XdgpXdMnxzgOOycfvWzP9C7qIxO SkBDUlfqd5zDFcfjM4iHqSFEpyVqzgGeHCjFLwaYbSXTGQmkkNRpyWNDosJq+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737463683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Od/28+kR07tX4bFPuKP3BabpWv/VkyL4M9Z/3nm5HG0=; b=V1hDIFM+nP5PX+3CIQjBQcC1EFp0TUoQvjbuuQfr5YsmXu2qnlAAb85qwaMU6yBQxk98M4 grcTR+iyMAL36ntAXgERfhh8m+gOy/gnT7Tl+rm7kDvcvgmjXN4J4Ba4JXNiSVssSgl/Tw k1Ht42aUjNKaHjo7gb6jmMDFBqEY00W8NgfEByrv5Z3Al2qVZsGh49BnnDF+p8kwyeOY66 5SIDMc581bl83EsBky/YEP7MKDBpKqRyv+vdYbZKGgFq9z6uxb23uwF6o/YvA2ZjeRC953 rlCEqay930cqDZCleQEs5vCpJtn3+zlN/qNxL/+svThrmngn81N3UafS/SYgrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737463683; a=rsa-sha256; cv=none; b=iDBl/6fqbTxInkOgb1vS5wnmCHNvJaD2qINqsD8y5dcX5p9hzn5M/hPql4orwpqTWypTK8 k8gQBKhRwaSxy1ZytOuqGbazS35QktzI87rwHu5im64L8nTBbUehrdN5PZujkIWHmAojlU fRlUHmzxzIP4z/0vIDHD3S2Q9C1tm2fpNtXKsvK0904jtEg1ef3YPt4IlGARwBPQTv2VG9 UeqMmOHexUpDl9la3RwqOJagf+gLK5C6/GVoIoCiVIvUgPu1WYlm4R6fxcgkZcEpLPPih7 s61s9rmVerFNQJRj9mZSuB0mjjH/mq2zn9VbvHwGvCn0EoqAnL1TMSxcCiUmyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycn774clYz16Qw; Tue, 21 Jan 2025 12:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LCm3EY098511; Tue, 21 Jan 2025 12:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LCm3JW098508; Tue, 21 Jan 2025 12:48:03 GMT (envelope-from git) Date: Tue, 21 Jan 2025 12:48:03 GMT Message-Id: <202501211248.50LCm3JW098508@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: 4b04f5d7e8a2 - main - install: Fix METALOG ouptut for numeric -o and -g args List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f Author: Ed Maste AuthorDate: 2025-01-17 19:14:22 +0000 Commit: Ed Maste CommitDate: 2025-01-21 12:47:48 +0000 install: Fix METALOG ouptut for numeric -o and -g args install's -o and -g flags both accept a name or a numeric argument. In -U -M (non-root METALOG) mode it always emitted uname= and gname= in the METALOG, but these are not appropriate for numeric IDs. If the -o and/or -u arguments parse as an ID, emit uid= and/or gid= respectively. Note that if an argument is valid as both a name and numeric ID we will prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We don't want to require a passwd db in non-root mode, and entirely-numeric user or group names are a terrible idea so just accept this discrepancy. PR: 284119 Reviewed by: jlduran Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48504 --- usr.bin/xinstall/xinstall.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index d0fcda340034..02b3eeccf8a7 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1432,10 +1432,22 @@ metadata_log(const char *path, const char *type, struct timespec *ts, p = buf; /* Print details. */ fprintf(metafp, ".%s%s type=%s", *p ? "/" : "", p, type); - if (owner) - fprintf(metafp, " uname=%s", owner); - if (group) - fprintf(metafp, " gname=%s", group); + if (owner) { + id_t id; + + if (parseid(owner, &id)) + fprintf(metafp, " uid=%jd", (intmax_t)id); + else + fprintf(metafp, " uname=%s", owner); + } + if (group) { + id_t id; + + if (parseid(group, &id)) + fprintf(metafp, " gid=%jd", (intmax_t)id); + else + fprintf(metafp, " gname=%s", group); + } fprintf(metafp, " mode=%#o", mode); if (slink) { strsnvis(buf, buflen, slink, VIS_CSTYLE, extra); From nobody Tue Jan 21 14:08:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcpwT1FJnz5l8Jx; Tue, 21 Jan 2025 14:08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcpwT0TdRz41P7; Tue, 21 Jan 2025 14:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737468537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbV9kctG/guJPvh4gsi8bgxI+CqTCH47RPyMUTwJ88I=; b=Vdd6xPNptKVJUzMvWFYrPbcrnKVZb8+F7ZH5M9Z0wP3NWU3U5/66gfhGOQuGzScFYIgVwJ sMOTK99FfqwSKroEJr5LntGd2v4ZWnUW2JW70pC+aHSvFCIS59orrHM0rWP2EzvW4OtX7t MqIQ94OeqQEaHCO42veZB/jvrJc3nT7gd/0S/4EOH3TwhapZhD2ScXL9KByKY2hnK/oPyM AJVJO933ig20fG3IAC7hj5UDB5+xYn6/SKHA+wg/DVfdGj/i5XyQdPAomdMNCJZW0GC5Kf mr0WZjr2kb9bQnKXuhRViG38Av6y4a3d3mbsvUFYLrCGm77MpGjh7ydvyANepA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737468537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbV9kctG/guJPvh4gsi8bgxI+CqTCH47RPyMUTwJ88I=; b=T/d6jAnbvz1aik6WSpUZontgQqAFyK6gjjGXGBmGD7duiM3zbkeu7sECpwYZ6seinNLHFy JaRQpU2Hd46g9mfAL7Oc9hil1zNJSnAiyi+TlnE36LZrA2odyhnS2ss/eGg4HpP9W3Zlda oquBYru7riNqNGuS7w5ZGIVl6aIXWZy4fSC+YwwJG8wBoh5s6cf0xzwEC5WZLNs0gIZz6t 6L4O/D1Jp1pBuChUisqNAu8RE8wCM7/uTLLeUWmK2iW1wLYT3EMqwDenPkvN8LiBD77oOp Qr5a7RvS4bY2eCGkTQuFnklhN7v5O3N8+Cmvil9VRwMXKDhCqEKQFvseLB3o3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737468537; a=rsa-sha256; cv=none; b=Ey0QtX/79bw+Mc9NzR8mPyqD1KZFDXkgyYslZQ9ieYnD7R8hMaQX5fwIrLP/jLH0RQpXZ3 vWYBiXpxpPbihEHPpKsw3jkTwpCUemGF5Q3DCciMZ6ZrumDJbbb2dodqbaw6a4LvhBplhT 2T5QH1gCYmrBKA8/8ntXqziebg/10zoCmaO6E9w6Ea/0xRyAjaNxLXxtMt+T9LRYuPO6JN HhFmPXyj9YS+ov/vz+Vk26SLy7OQ69CnUKWzYHZuIgw+OI87vH/BlohcVW87EbHGjhS4y7 6w2wXHeHyTuCaiKycnNhiRDcO8A18TGNgL5N0KK2RmvAvFMGOPcv1wC74Fry+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcpwS6rhdz18kV; Tue, 21 Jan 2025 14:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LE8uj3049066; Tue, 21 Jan 2025 14:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LE8uSw049063; Tue, 21 Jan 2025 14:08:56 GMT (envelope-from git) Date: Tue, 21 Jan 2025 14:08:56 GMT Message-Id: <202501211408.50LE8uSw049063@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: 0ec93987e530 - stable/14 - makefs: Handle special file types when creating a zpool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 0ec93987e5302495f9512f8534a2375d7da4ee2a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ec93987e5302495f9512f8534a2375d7da4ee2a commit 0ec93987e5302495f9512f8534a2375d7da4ee2a Author: Mark Johnston AuthorDate: 2025-01-07 14:31:02 +0000 Commit: Mark Johnston CommitDate: 2025-01-21 14:08:40 +0000 makefs: Handle special file types when creating a zpool Previously, anything other than a regular file, directory or symlink would cause makefs to exit with an assertion failure. Make it a bit more resilient to user error: print a warning and skip the file. Add a regression test wherein we create an image from a devfs mount. PR: 283583 MFC after: 2 weeks (cherry picked from commit ce878284318e71217d8d8f43f7d590b6c338d3aa) --- usr.sbin/makefs/tests/makefs_zfs_tests.sh | 22 +++++++++++++++++ usr.sbin/makefs/zfs/fs.c | 39 +++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/usr.sbin/makefs/tests/makefs_zfs_tests.sh b/usr.sbin/makefs/tests/makefs_zfs_tests.sh index aeda889d9a5c..3d5819439a73 100644 --- a/usr.sbin/makefs/tests/makefs_zfs_tests.sh +++ b/usr.sbin/makefs/tests/makefs_zfs_tests.sh @@ -148,6 +148,27 @@ dataset_removal_cleanup() common_cleanup } +# +# Make sure that we can handle some special file types. Anything other than +# regular files, symlinks and directories are ignored. +# +atf_test_case devfs cleanup +devfs_body() +{ + atf_check mkdir dev + atf_check mount -t devfs none ./dev + + atf_check -e match:"skipping unhandled" $MAKEFS -s 1g -o rootpath=/ \ + -o poolname=$ZFS_POOL_NAME $TEST_IMAGE ./dev + + import_image +} +devfs_cleanup() +{ + common_cleanup + umount -f ./dev +} + # # Make sure that we can create and remove an empty directory. # @@ -842,6 +863,7 @@ atf_init_test_cases() atf_add_test_case autoexpand atf_add_test_case basic atf_add_test_case dataset_removal + atf_add_test_case devfs atf_add_test_case empty_dir atf_add_test_case empty_fs atf_add_test_case file_extend diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index 9413241da0c7..073dce3ce697 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -177,6 +177,13 @@ fsnode_isroot(const fsnode *cur) return (strcmp(cur->name, ".") == 0); } +static bool +fsnode_valid(const fsnode *cur) +{ + return (cur->type == S_IFREG || cur->type == S_IFDIR || + cur->type == S_IFLNK); +} + /* * Visit each node in a directory hierarchy, in pre-order depth-first order. */ @@ -186,9 +193,11 @@ fsnode_foreach(fsnode *root, int (*cb)(fsnode *, void *), void *arg) assert(root->type == S_IFDIR); for (fsnode *cur = root; cur != NULL; cur = cur->next) { - assert(cur->type == S_IFREG || cur->type == S_IFDIR || - cur->type == S_IFLNK); - + if (!fsnode_valid(cur)) { + warnx("skipping unhandled %s %s/%s", + inode_type(cur->type), cur->path, cur->name); + continue; + } if (cb(cur, arg) == 0) continue; if (cur->type == S_IFDIR && cur->child != NULL) @@ -381,9 +390,15 @@ fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur, */ for (fsnode *c = fsnode_isroot(cur) ? cur->next : cur->child; c != NULL; c = c->next) { - if (c->type == S_IFDIR) + switch (c->type) { + case S_IFDIR: links++; - objsize++; + /* FALLTHROUGH */ + case S_IFREG: + case S_IFLNK: + objsize++; + break; + } } /* The root directory is its own parent. */ @@ -652,6 +667,16 @@ fs_populate_symlink(fsnode *cur, struct fs_populate_arg *arg) fs_populate_sattrs(arg, cur, dnode); } +static fsnode * +fsnode_next(fsnode *cur) +{ + for (cur = cur->next; cur != NULL; cur = cur->next) { + if (fsnode_valid(cur)) + return (cur); + } + return (NULL); +} + static int fs_foreach_populate(fsnode *cur, void *_arg) { @@ -678,7 +703,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) ret = (cur->inode->flags & FI_ROOT) != 0 ? 0 : 1; - if (cur->next == NULL && + if (fsnode_next(cur) == NULL && (cur->child == NULL || (cur->inode->flags & FI_ROOT) != 0)) { /* * We reached a terminal node in a subtree. Walk back up and @@ -694,7 +719,7 @@ fs_foreach_populate(fsnode *cur, void *_arg) eclose(dir->dirfd); free(dir); cur = cur->parent; - } while (cur != NULL && cur->next == NULL && + } while (cur != NULL && fsnode_next(cur) == NULL && (cur->inode->flags & FI_ROOT) == 0); } From nobody Tue Jan 21 15:03:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycr6x6Clxz5lCsS; Tue, 21 Jan 2025 15:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycr6x5J2Fz47Lt; Tue, 21 Jan 2025 15:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737471785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SObyVv2tYMTyiC8PI//TTmwYZYbAgVgcTJcOwkebbMk=; b=cWvuUj0QOJhjNdRhMOqnqafFhH9adozsGzMFSveOPouWsk02bvoexj1VeGUg40yjLs02EI BB8f8yWJw9Kcmn65vao0J4uNolNpzlXf0QNFXj1Ph+94PTXZuUa8in/Qtx/ZbYaDCMMPRG CbsrQYG8HiEkcNxMr2fVTwFSEGLgCq4ymopOP2UQWL445Bkq63u1YYTTw8VZvhDRmuGjDA dy/q50YE+Q9JZnXBgIl62d7TXb1Agw65IZUbpxmjuKU2HqcVsbpYuwXTVUftbQ1ZvnC6G1 22ld/8YY8o/IO/gUNxzHxZ1x+HEivuLxf35tSLwY7FBMp8Ckq0rJjDTkCfmkew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737471785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SObyVv2tYMTyiC8PI//TTmwYZYbAgVgcTJcOwkebbMk=; b=wLaQsvw58jdsWxKFXv8qfu3dLKsgUjdG6CVEeOJardtbW1+WTD6J/QdLpDxhTZ24jPjZO4 8eicHjNLPdziZXvtODHomFilr0cTnbNiSSnjKipgsriSBBswXth37xPMEVAjUshlIKuzrP j1D+FJgoBgopiWQTNY/ENEQG2JADt1ZnV5ZxNKbkvjBa8hpu7u2ocdqp5tUfgeeY+t+rmn PTTSCNiTsH7sfeFRmZlNBjYlYfSmM9/3iZ9XD49S0wt4qH5Wj6e0gsW6grXrH+5XNScabv IHsg9F3+4BSA0/R3vhRWorWYYLvqbQfl4WbkTfTDlPP+vbb11NKklm3b4VZdRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737471785; a=rsa-sha256; cv=none; b=kIcawiUC8iiZLfHcgoNUqol7+I/2wSv+d+pEVjWjrbOCnq4rdT1sTYEIji2ynpV3g+hbl/ VrHPul2nQmbw1baxzoMkLGmnsfgaEHacx/ATd5L+Tk8oMgL5GfotmdZxANJuYpbj22gVDg qBP7ANR+XXU/E+2TbO/RKxqwDeq4ugARlJAIgFNOsfpgPLFu1kDR9ZVaBuMeA5EAt1bRD7 nULoqwh/3Xr7aZNeeF0iE+3kxtBI+6Kr3JZKaDUVF/Bz7Dt2ziw2NZk5Yt1X39vBy5cHhU nAH43vRiilby4EEGVG+sFwbDgISGvHw+PZlOtYYHKVXnB32pBuplKcnmjztN+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycr6x4bSFz19Y7; Tue, 21 Jan 2025 15:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LF35mb059089; Tue, 21 Jan 2025 15:03:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LF35JT059086; Tue, 21 Jan 2025 15:03:05 GMT (envelope-from git) Date: Tue, 21 Jan 2025 15:03:05 GMT Message-Id: <202501211503.50LF35JT059086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 960c5bb0f6bf - main - if_vxlan(4): Invoke vxlan_stop event handler only when the interface is configured List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2 commit 960c5bb0f6bf44aeb09fa14fd0f82c2e82ebe2e2 Author: Zhenlei Huang AuthorDate: 2025-01-21 15:02:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-21 15:02:13 +0000 if_vxlan(4): Invoke vxlan_stop event handler only when the interface is configured It is harmless but pointless to invoke vxlan_stop event handler when the interface was not previously configured. This change will also prevent an assert panic from t4_vxlan_stop_handler(). Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48494 --- sys/net/if_vxlan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index bb2de793550f..b7af304e3126 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1813,6 +1813,7 @@ vxlan_teardown_locked(struct vxlan_softc *sc) { struct ifnet *ifp; struct vxlan_socket *vso; + bool running; sx_assert(&vxlan_sx, SA_XLOCKED); VXLAN_LOCK_WASSERT(sc); @@ -1820,6 +1821,7 @@ vxlan_teardown_locked(struct vxlan_softc *sc) ifp = sc->vxl_ifp; ifp->if_flags &= ~IFF_UP; + running = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; callout_stop(&sc->vxl_callout); vso = sc->vxl_sock; @@ -1827,8 +1829,10 @@ vxlan_teardown_locked(struct vxlan_softc *sc) VXLAN_WUNLOCK(sc); if_link_state_change(ifp, LINK_STATE_DOWN); - EVENTHANDLER_INVOKE(vxlan_stop, ifp, sc->vxl_src_addr.in4.sin_family, - ntohs(sc->vxl_src_addr.in4.sin_port)); + if (running) + EVENTHANDLER_INVOKE(vxlan_stop, ifp, + sc->vxl_src_addr.in4.sin_family, + ntohs(sc->vxl_src_addr.in4.sin_port)); if (vso != NULL) { vxlan_socket_remove_softc(vso, sc); From nobody Tue Jan 21 15:41:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcrzS4fbtz5lFYj; Tue, 21 Jan 2025 15:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcrzS3nGFz3D2f; Tue, 21 Jan 2025 15:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737474100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTrmjbpwjb4FL1JBLXpgUOAcAOIPcrtiZbsES4xUjvs=; b=k1N48mX+ta/pyqyoZh2VOiw8RnN1w+DtjoxizByxxPk430KNqdoNGmREeXKalTUJCTEqux HAmb59mdG38TRyZJ/YrJ/aTOQxDNHSYJ2V5kb4amYJggJQff4zCtB7FQvGLtwrMgoZSZuo mfduAfEz1gqT8qos6RuOM+Ur78GM8tQDY55x87otginIZ5nZhoVOBN3lYBJIMJvRS8HAGi iA90Zi6rJmfdI094oETouNofGWWslyJnbUuiH6RTQm34Y3qah9Qmw8Pggg0k0DVCTRK5LW Ilvn6a2au92B5za0njz2DROJK0MDE1lDEeYIDZBQ1whu06xgr/6KLTRlDIdf2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737474100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTrmjbpwjb4FL1JBLXpgUOAcAOIPcrtiZbsES4xUjvs=; b=aMFbMS+SEw0MtUE92bBgTJLJOFC4ZVwcVuo4ZG43AsgumGYyXr1YbStGBpN7Kdew00+zIK yeSo5n7o2w+xw/WucvfFzO/BnJUbS+kbLOm5klxCimfxCb+FyS1zZDv/2oK5l9AXHjSr8J EgD4FehBd7Y8KH8aem8w4t1mj3TBRY5+ws6nEZItY6EXfucFkJn61TliivRhLTEGF40sU3 luhbse1ZI3y49hhiOC8tC+hMGLftKrEQyaIyrdpLOBf8OkPM2l+HBOp9bqCRNdYzzJ4bU3 lkZcNS/oeYjhzJ8EkSvW5ahwSZlVFUzyjffd52g1YjGTOHbhjnBnHbcLjfvSMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737474100; a=rsa-sha256; cv=none; b=Imc4Oa8UJ+dWfCVjtuc8pTojWECj25TEY1/vevapOoAfVtiTWI2K8YBteHjmYIjeFKAEqW I7VsTyLoODAkb+mMvbZcOUrGRc9bkb8EKuvb1+slKMU4N+m2H5hxNQtlbYfbwZEnsXyu6Z fnrIzJaxvzLzon3hy+/GiVDijUJxTN9NE4Dks8T4Ezn5gCyRyofNMkpAQSHA/WzVhUC5xA 6tidnsrkVjEKk5j7tglww/5WBbAArLJMgna8myxRrlM91c1pC5aYGxwt6W+/eOaTfHkffl FoniQ8YioMDOJ2Zg8KLfjPqyesPgscg0X0x7GRymwD7CQhZ/Kve1pkCgf6wfUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcrzS3Jfcz1Brb; Tue, 21 Jan 2025 15:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LFfeOq028829; Tue, 21 Jan 2025 15:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LFfe8b028826; Tue, 21 Jan 2025 15:41:40 GMT (envelope-from git) Date: Tue, 21 Jan 2025 15:41:40 GMT Message-Id: <202501211541.50LFfe8b028826@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: 010ee8215f5c - main - setfib.2: Note that the number of FIBs can be adjusted after boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 010ee8215f5c899e23250828402af5b7bb354328 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=010ee8215f5c899e23250828402af5b7bb354328 commit 010ee8215f5c899e23250828402af5b7bb354328 Author: Mark Johnston AuthorDate: 2025-01-21 15:39:50 +0000 Commit: Mark Johnston CommitDate: 2025-01-21 15:39:50 +0000 setfib.2: Note that the number of FIBs can be adjusted after boot Reviewed by: zlei, imp MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48545 --- lib/libsys/setfib.2 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/libsys/setfib.2 b/lib/libsys/setfib.2 index 32e2f64910cb..57e83c0d1adb 100644 --- a/lib/libsys/setfib.2 +++ b/lib/libsys/setfib.2 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 19, 2012 +.Dd January 10, 2025 .Dt SETFIB 2 .Os .Sh NAME @@ -55,15 +55,20 @@ The system maximum is set in the kernel configuration file with .Pp or in .Pa /boot/loader.conf +or +.Pa /etc/sysctl.conf with .Pp .Dl net.fibs= Ns Qq Em N .Pp where .Em N -is an integer. -This maximum is capped at 65536 due to the implementation storing -the fib number in a 16-bit field in the +is an integer smaller than 65536. +Note that the number of FIBs may be increased after booting, but cannot be +reduced. +.Pp +The maximum of 65536 is due to the implementation storing +the FIB number in a 16-bit field in the .Xr mbuf 9 packet header, however it is not suggested that one use such a large number as memory is allocated for every FIB regardless of whether it is used, and From nobody Tue Jan 21 16:03:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YcsSB2Rztz5lGn0; Tue, 21 Jan 2025 16:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YcsSB1r7Lz3H7r; Tue, 21 Jan 2025 16:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737475386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qi2GGd4Ayorf1PBBVAEupKMFRk3sbNzB9kN5300gxrI=; b=BeYE/3q8oFy5nvCaf8LRqtMabnxsH9+pOU1Yc0xyocEpFHUXATAvDtCcHaONmj2faHX0HY b0YYbJpPVhns6WgxCYQayEldsSHCY4W6YMkM7QBIRIFIWxEV96E/s2cF73GfmjCQCSWEd8 S4u+QdWXgiU0cw4CfB83ME4eFt9gbhK+ZubsVd/fe3BXQ4oLYGYRop/DySopNhRk3bJR4D yO26BQQYf7oKO33ZmwEaF2qEr06Ww2rQmHecqqX+hzVIuS+Uu9Mxqh7SGMrvsyivTfo5Yv KJkE7Bosnmgo2fbzn38NZaWGn/KTwNWYkvHYLRyeFVtB7cL9KJybv363BbM7FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737475386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qi2GGd4Ayorf1PBBVAEupKMFRk3sbNzB9kN5300gxrI=; b=OXVHVqk9dQTjhHRL9zayg6bD7nXPNPVLHVtRSTYbc+XXtV4Yjxt1sfjLrIKkoURgRIlEOL Dkg5YfiWKZ1MGLVy55stiLVzyxGHpo6dSvbNix/KY0ufP0q8UGUqfeDFrjGX9U8XFO62t0 XgIda+7dQdrLbGFVLFOR9Pw3rYpvQrs3WoU9nsVL9wMzbuchtPyTDCUBjN7WUcJJwxwTl1 I3jhChBBdt7A7/602Q6IacMP6TELC93yEXaE/roLdGFyPdXg3J9cwojA/e05a/SRzaDzYp NYmPwB8WcEBiRepcBLxMrQeV9XcUORYMXZT0o7M/Xi7It7go6lP5SjfPZgZLmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737475386; a=rsa-sha256; cv=none; b=nYpoc/k/OHdecW7i44T1vZmGIgvjZwj6Wdi2iSM1xRhMmpRoujyt6/IhQdOPXQZ+gJRnl8 Yi2tfsVHqbguilFY8rpKDWzjJhLKGKQ3KqeHc0kb7dNa3pKqTDUBawJtZ6sYvninrnc+oo 8XmoznbnnoqwqaEeXso0vzHQX4LIxRjz/edQ0D3Hh6OfmhC/8QOeQdTl2NKLrk4zK2V719 C6UyVCN5yKtt8mK7W8r5JvTAGlA40cN6Snd0aPK13gIxE9gvaUSb1WjAe+do00OKgPw1MD XILcjlYXECVEnxCRhyFZLazPuDMPPnySrInuxaVjAyNLWRKJjJwaq9oCfcjP5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YcsSB1HBkz1CXJ; Tue, 21 Jan 2025 16:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LG36LU071604; Tue, 21 Jan 2025 16:03:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LG36Di071601; Tue, 21 Jan 2025 16:03:06 GMT (envelope-from git) Date: Tue, 21 Jan 2025 16:03:06 GMT Message-Id: <202501211603.50LG36Di071601@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: c19f1ad1c252 - main - pci_host_generic: Use SYS_RES_MEMORY for the parent of I/O resource ranges List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: c19f1ad1c252f434146c7210155d805b2ed0ff95 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c19f1ad1c252f434146c7210155d805b2ed0ff95 commit c19f1ad1c252f434146c7210155d805b2ed0ff95 Author: John Baldwin AuthorDate: 2025-01-21 15:51:53 +0000 Commit: John Baldwin CommitDate: 2025-01-21 16:02:34 +0000 pci_host_generic: Use SYS_RES_MEMORY for the parent of I/O resource ranges When a SYS_RES_IOPORT resource crosses a pci_host_generic bridge, it is translated into a memory access for an associated range, so use SYS_RES_MEMORY for the resource allocated from the parent. Tested by: markj Differential Revision: https://reviews.freebsd.org/D44207 --- sys/dev/pci/pci_host_generic.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 884ab25548ce..49b131cd2299 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -91,7 +91,7 @@ pci_host_generic_core_attach(device_t dev) const char *range_descr; char buf[64]; int domain, error; - int flags, rid, tuple, type; + int flags, rid, tuple; sc = device_get_softc(dev); sc->dev = dev; @@ -187,19 +187,16 @@ pci_host_generic_core_attach(device_t dev) sc->has_pmem = true; range_descr = "prefetch"; flags = RF_PREFETCHABLE; - type = SYS_RES_MEMORY; rm = &sc->pmem_rman; break; case FLAG_TYPE_MEM: range_descr = "memory"; flags = 0; - type = SYS_RES_MEMORY; rm = &sc->mem_rman; break; case FLAG_TYPE_IO: range_descr = "I/O port"; flags = 0; - type = SYS_RES_IOPORT; rm = &sc->io_rman; break; default: @@ -209,7 +206,8 @@ pci_host_generic_core_attach(device_t dev) device_printf(dev, "PCI addr: 0x%jx, CPU addr: 0x%jx, Size: 0x%jx, Type: %s\n", pci_base, phys_base, size, range_descr); - error = bus_set_resource(dev, type, rid, phys_base, size); + error = bus_set_resource(dev, SYS_RES_MEMORY, rid, phys_base, + size); if (error != 0) { device_printf(dev, "failed to set resource for range %d: %d\n", tuple, @@ -217,8 +215,8 @@ pci_host_generic_core_attach(device_t dev) continue; } sc->ranges[tuple].rid = rid; - sc->ranges[tuple].res = bus_alloc_resource_any(dev, type, &rid, - RF_ACTIVE | RF_UNMAPPED | flags); + sc->ranges[tuple].res = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_UNMAPPED | flags); if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); @@ -253,7 +251,7 @@ int pci_host_generic_core_detach(device_t dev) { struct generic_pcie_core_softc *sc; - int error, rid, tuple, type; + int error, rid, tuple; sc = device_get_softc(dev); @@ -272,18 +270,15 @@ pci_host_generic_core_detach(device_t dev) switch (FLAG_TYPE(sc->ranges[tuple].flags)) { case FLAG_TYPE_PMEM: case FLAG_TYPE_MEM: - type = SYS_RES_MEMORY; - break; case FLAG_TYPE_IO: - type = SYS_RES_IOPORT; break; default: continue; } if (sc->ranges[tuple].res != NULL) - bus_release_resource(dev, type, rid, + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->ranges[tuple].res); - bus_delete_resource(dev, type, rid); + bus_delete_resource(dev, SYS_RES_MEMORY, rid); } rman_fini(&sc->io_rman); rman_fini(&sc->mem_rman); From nobody Tue Jan 21 19:27:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ycy0C00Z2z5lVPP; Tue, 21 Jan 2025 19:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ycy0B6FYrz3Zkd; Tue, 21 Jan 2025 19:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737487658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmuHlSt3+Th9gkjLZwncPYitYXnrbWmw4/c7Xhu9b20=; b=OzJIOkHq3vcQXff/5iRbgHGJHiihnULIPu2wMK749Upch/zEqbUyUOgCMyr7XBFSpwJo5X atJNCf8K75Pu0If1NmrGGL9EmdAro+u7IUKNY3E5TtZjC47sZuiY2lLGJp4Yi8ANBHgtbu YeR9Q4sewbT6sSKAM0DvvxNQSn8ZqJ0x+KvN3xhMmkrMskjWZNbQ1bP53aKMkrX2jegIgC 54AxR5DdTRehCeN0C2umf8sZ9jgDZXZ+opXSE/ihI4F83C9GJP0ujT7CjGpwUO5fVvMwac jkm6vTLAvsI0qrkfwNbqE/WPor37dwuSj4O8JCxtXL1aPykLT65SG7xOAI1wIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737487658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CmuHlSt3+Th9gkjLZwncPYitYXnrbWmw4/c7Xhu9b20=; b=rLphjs/o2e6+eH/wqu4j4k0kKkPAA9yToHJxTx292VhkbU4WyiJWoH7lEqS+a8/PGJUQ+K 4WHJ+XAK5M+KJVIXVANTjq2O01kyxCMxKXaQv2dP9mvSoBIKDN8Uii1XSK84CMxaihA+Uz GlqmI2sHt4DHZCjWoMPSn//+8kNTF/GgOtgdVz5e/UbYaoldkEtIpvXir9yTB5Gbgn7I7Q 5Wa4WN3R6JNCtrc3a/Y10N9qMPP+Obpnk4Jtg6S5skGgrthsy/dGerO/k9KnbU+3XG0+ow tuiygwGsHA8Mu3dr2+qVQuqZBz9UBDtCPR1wf39kAQci5179J+zA5Pp37n/YFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737487658; a=rsa-sha256; cv=none; b=QL+RsrhMtx7+2d9QJL6yQmrGwap5UWOiuzaL0mBj+Mz45G09HRIV3O2x5hqbpMnN/PjPxB +RHrRyKZf0tzHhK3GXIgTa6VO9OKNGrshtTsesK26Ow62F+O5nuGexBNfmimha6MFk/RKW zPlXdEnuFhTXts3v+mNbnlf2ZR9MwKwdykgz2WEyH4cd+X6G6k1mj5yAcnDOTG7zFGRBgZ nRps0QTad2o8y06y4wllXSPyJU0tBv7XV8woMsSLk5zy9DrcGTBFgbiTWva4iJPjciciG1 knWm9xbRExiAqHYrDG144eMw9utagvi+43UcV8dmyjDNdVFnC6fMQezo/8D7cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ycy0B5lxDz4vG; Tue, 21 Jan 2025 19:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LJRcL7045421; Tue, 21 Jan 2025 19:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LJRcOS045418; Tue, 21 Jan 2025 19:27:38 GMT (envelope-from git) Date: Tue, 21 Jan 2025 19:27:38 GMT Message-Id: <202501211927.50LJRcOS045418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 347eb42dbcb3 - main - bsdinstall/zfsboot: Remove unused global variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 347eb42dbcb352f3266e716a2101898fe054bdba Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=347eb42dbcb352f3266e716a2101898fe054bdba commit 347eb42dbcb352f3266e716a2101898fe054bdba Author: Alexander Ziaee AuthorDate: 2024-12-14 23:02:55 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-21 19:26:53 +0000 bsdinstall/zfsboot: Remove unused global variable In an AMA session on the FreeBSD Discord, it was revealed that no logic remains calling GPART_BOOTCODE_PARTONLY. It was removed in aa2a0e0fc311 for FreeBSD 12. git grep shows no other references. No functional change intended. MFC after: 2 weeks Fixes: aa2a0e0fc311 (Enable new UEFI+GELI support) Reported by: Antranig Vartanian Reviewed by: emaste, mhorne Approved by: emaste, mhorne (src) Approved by: mhorne, carlavilla (mentors) Differential Revision: https://reviews.freebsd.org/D48086 --- usr.sbin/bsdinstall/scripts/zfsboot | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 6f2244a918bc..bfb863f5e7c8 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -206,7 +206,6 @@ GPART_ADD_ALIGN_LABEL='gpart add %s -l %s -t %s "%s"' GPART_ADD_ALIGN_LABEL_WITH_SIZE='gpart add %s -l %s -t %s -s %s "%s"' GPART_BOOTCODE='gpart bootcode -b "%s" "%s"' GPART_BOOTCODE_PART='gpart bootcode -b "%s" -p "%s" -i %s "%s"' -GPART_BOOTCODE_PARTONLY='gpart bootcode -p "%s" -i %s "%s"' GPART_CREATE='gpart create -s %s "%s"' GPART_DESTROY_F='gpart destroy -F "%s"' GPART_SET_ACTIVE='gpart set -a active -i %s "%s"' From nobody Tue Jan 21 20:43:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YczgX3mTlz5lZM2; Tue, 21 Jan 2025 20:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YczgX2j4Hz3mlQ; Tue, 21 Jan 2025 20:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737492200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VVEq9vlSvQIOsg9OLWcT0ZCfLue7l6+yfeNiay8dDnQ=; b=CFvD8QRXX0IoUFB8OcEAYlhm78eXQOSn87/DJUiTQ4GAkj8lohbqO71TJO4efQBVw+MPKR Ul9CLWCfToDuHq6C1dzyAgOYDTldgfa8fda5+1CvnHEP6McJsrUsG/inHTsSXeIFqnAvFZ oVnge/I6m+fLG+3eSNNG/OvqJlR3RRw4otCQ19WSjuvPlN15uF3shtTNkPYO0glECNYlQ8 MfhIaxEcCDopnaci5YW2axepnUd5pu5IzG0yqFKt19jrX4N/OtHzHdD8GtcCWG4v5D6IhL bmun5U602+OSM8/5Xd+2NPyQDc/Jp/CFUPC7uCduYdd6RZBKQAqnWpFZFvzXGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737492200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VVEq9vlSvQIOsg9OLWcT0ZCfLue7l6+yfeNiay8dDnQ=; b=Qno1p4RhrPMm1BfdP51YD+zNLu8GMWGTXZ5pu94fdXy+L5scCSM4q+6jC3CCflxQk4sC0/ v1MauwIHxTq8plEemce9j+kunF0F9f1ajoH7shU6MDBy358mVOlQbxt7QrV1dOzBTCjfBo hnFWVlw2/4n0bDn53PgIS0W7kkR2/EbeJdI+9btqW+meRgrpe6CSdFLkd3SWH/z9F7xiOk hnuJXBrTsrf9cQT8iKtnpTbtCRCJOsHAUqWGoC17saP2OZu45C2PU9rfc3nWHU+tTe+tuG gAU3gpizhiSHsspeYYcENCgdun3JYcc8F63yNRAe1tAo/t70fvM2YQ20fueEvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737492200; a=rsa-sha256; cv=none; b=RwOk5X1krcUI98jn/dc6rA+MndZn/BHnlReSD5giyIq5TMgd5ZXjLydpcEgpxU+Tiel8AR 4xOWajf1UXeu+3Fox7jT8FmeNAaxGQ6TpPGdZDmXV/3CVElFaRgzOGG3ukC8bcp2mgh218 2LyoJIRSx+1OsXwwRIczbEcIfuFsK65IWk1ZmMgPk2+ykUp3l3LstsP4jPrdsQf+K0KAnG BHaQu0DKOLj8DSZAwMuegJr0mB/Dy01WPip96XXjkAaWEy8GHSLxFTPrBRSxImRxWV9IfD K6hv5EZ9hRZ1tZfKiHwECnrc1bBPp6EICXN3mk4T16VaZO8NnDaEr4EkFjOcEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YczgX24xyz6ty; Tue, 21 Jan 2025 20:43:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LKhKvk093307; Tue, 21 Jan 2025 20:43:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LKhKtD093304; Tue, 21 Jan 2025 20:43:20 GMT (envelope-from git) Date: Tue, 21 Jan 2025 20:43:20 GMT Message-Id: <202501212043.50LKhKtD093304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 8d5d97372361 - main - kldstat.8: Polish options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa commit 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa Author: Alexander Ziaee AuthorDate: 2025-01-21 19:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-21 19:55:27 +0000 kldstat.8: Polish options + Align and alphabetize options + -q: s/Only/Quietly/ for search + Tag SPDX MFC after: 3 days Reviewed by: gbe, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48325 --- sbin/kldstat/kldstat.8 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8 index f7e7552625e3..09094da3741d 100644 --- a/sbin/kldstat/kldstat.8 +++ b/sbin/kldstat/kldstat.8 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Doug Rabson .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 19, 2016 +.Dd January 4, 2025 .Dt KLDSTAT 8 .Os .Sh NAME @@ -48,22 +50,22 @@ utility displays the status of any files dynamically linked into the kernel. .Pp The following options are available: -.Bl -tag -width indentXX +.Bl -tag -width "-n filename" +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl h Display the size field in a human-readable form, using unit suffixes instead of hex values. -.It Fl v -Be more verbose. -.It Fl d -Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. +.It Fl m Ar modname +Display the status of only the module with this modname. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if file is loaded or compiled into the kernel. -.It Fl m Ar modname -Display the status of only the module with this modname. +Quietly check if file is loaded or compiled into the kernel. +.It Fl v +Be more verbose. .El .Sh EXIT STATUS .Ex -std From nobody Tue Jan 21 21:15:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd0Nh3rcYz5lcBt; Tue, 21 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd0Nh1c0Hz3qQn; Tue, 21 Jan 2025 21:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nex7ERAPsnqsJ5fY65h0aM4VsjcgjGQ1orxqKkEAhv0=; b=dGSkqNasWImJSC5FkAFCYiTzAVW5qCJkBT4D4IGANkvIlU/fuYyzfohObBXaWxi3c00QTD OGsbZKy9fcNdofDZcnnfu4X/9BcnMlMn0JDoQCMNXOrxLRH/yPs7qP2yotgVMgGmwq/X3C Am6QXy4QVvH3cvRcQtucdzeDPrud2f7iyzukBaoh7JwKFogNyPeeTiLDTiuMAfJ5t9GXZP 4L1huu5OFg+bLEUDDQ+CzTZFaVgO/X7QRz05usEMBM/T7jtrUAtvOE7C1blHw6XK3HUI0U WkzD3IB1l5D+AIIeXKjjJLlGA0hr1NQMvvbTRKqZctSjROvJWq3/kfh4Pf9FAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nex7ERAPsnqsJ5fY65h0aM4VsjcgjGQ1orxqKkEAhv0=; b=cSR5FjsZGbRFHJe4KYCX3Z3H9eBNkSrgyPzZs98SZ+tKh5vo5vbz2AB5p8vB1pcWW0KgDo cjqBUlQ9kXfD4h6CZ9ERcSWjIUHCswSzXLdN2Uhz59W4QebP6evBBFT4V02t8Ew77cQXcd SA8VXsub55wkEi+6QBdEH1d/oDYfqvShLmS41avQsiMqzsS7TM4YRpEFiQZ6PJC+Ecve/f yG/DUJ2qwvktAOANL7/ufKUqeFCZeSCqODM+Ed6aCtP60ck6c0sehKo/JKNyfZwM7ifzpN Bv8qez4dq6P2nFSj3NNZdauZ/PHOFOtAgCJp1PlsvJyI5kdkcmtr8d/mJvM5lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737494132; a=rsa-sha256; cv=none; b=a+uonwTTONSP75721uOdXWKI57bGidv7HmD3IBx9GjMxPNJzND7pw+paiTxiQgEp753XRt slYBTCQ1ufE4hsgZMpDv7/WmgvQ1nJpUeBbPrRgJGov6PLXCZF+E2oofNfMUTiP4ajsXAi jIJoqAmmySY+iiQtL/vqgkqk2Wz9YKd0CxDnEx+O4biBiHEO28r3UlBMcobWJXgQ1Ab9bI 5iAhoGQtbGx7bdQy0PW2P5DPgnZpt201RcSn0AyQXx5HlztUKPLjoJzAlw5k+aQbckwHFq HOr2qj4KXiB8WDYAamxCOUooCfErqy3AOOX/Gc1ON++L9MdqhPBD9/rYbizA9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd0Ng5gSlz7gJ; Tue, 21 Jan 2025 21:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LLFVAu051071; Tue, 21 Jan 2025 21:15:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LLFVft051068; Tue, 21 Jan 2025 21:15:31 GMT (envelope-from git) Date: Tue, 21 Jan 2025 21:15:31 GMT Message-Id: <202501212115.50LLFVft051068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Juraj Lutter Subject: git: c8b89c11a118 - main - periodic: set _localbase for periodic scripts from within periodic.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: otis X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8b89c11a1181e900acb638cfde7a55e92553175 Auto-Submitted: auto-generated The branch main has been updated by otis: URL: https://cgit.FreeBSD.org/src/commit/?id=c8b89c11a1181e900acb638cfde7a55e92553175 commit c8b89c11a1181e900acb638cfde7a55e92553175 Author: Juraj Lutter AuthorDate: 2024-11-08 13:38:19 +0000 Commit: Juraj Lutter CommitDate: 2025-01-21 21:14:41 +0000 periodic: set _localbase for periodic scripts from within periodic.conf Set _localbase variable from within /etc/defaults/periodic.conf for use by periodic scripts. This fixes e5d7100c09, no other functional changes intended. Reported by: gahr, otis Reviewed by: markj, gahr MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47486 --- usr.sbin/periodic/periodic.conf | 9 +++++++++ usr.sbin/periodic/periodic.sh | 12 ++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/usr.sbin/periodic/periodic.conf b/usr.sbin/periodic/periodic.conf index 3bb34d827564..7066c7b49fd1 100644 --- a/usr.sbin/periodic/periodic.conf +++ b/usr.sbin/periodic/periodic.conf @@ -15,6 +15,15 @@ # # +_set_localbase() { + _localbase=`/sbin/sysctl -n user.localbase 2> /dev/null` + # Set default value of _localbase if not previously set + : ${_localbase:="/usr/local"} +} + +# Set _localbase with fallback to /usr/local +_set_localbase + # What files override these defaults ? periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local ${_localbase}/etc/periodic.conf" diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index 09727a840eff..a310f04864da 100644 --- a/usr.sbin/periodic/periodic.sh +++ b/usr.sbin/periodic/periodic.sh @@ -29,14 +29,6 @@ if [ $# -lt 1 ] ; then usage fi -_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null` -# Set default value of _localbase if not previously set -: ${_localbase:="/usr/local"} - -# Use a deterministic path to match the preset from /etc/crontab in case -# periodic is run interactively. -export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin - # If possible, check the global system configuration file, # to see if there are additional dirs to check if [ -r /etc/defaults/periodic.conf ]; then @@ -44,6 +36,10 @@ if [ -r /etc/defaults/periodic.conf ]; then source_periodic_confs fi +# Use a deterministic path to match the preset from /etc/crontab in case +# periodic is run interactively. +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin + host=`hostname` export host From nobody Tue Jan 21 21:25:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd0cL5B7Xz5lcqN; Tue, 21 Jan 2025 21:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd0cL4Szhz3ryp; Tue, 21 Jan 2025 21:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AseAioaMigpkDnk1wu6YOhLqDLDuayvuoy6JzfQztxA=; b=Wer7qcqi8WwxtzLj23XS2webYRbii8PuuEl8+51sLiBY6dxg4b2g89njFSIsfpTlXsU6h+ CcK/2ExK8kI7XAPTJzIm3Fo8Pi0ln9ZRQ9MB1bwFeqffvnXh76TxWeN8bvdH7AZFI7/2Wu ACRxYJQKMNCOSXY/3T0of+JDYfTMd4pGiJzG3omq6DYsDMAXYj6ZJFnGqlcd+SODXmLY1Z aOHQ9o/Ac9x8w3H0uxNU2GI/YXVG1JAfC5eotN15WnUMfZKNHMArnwCCXzcq2PNSVS7lDF DBta/4MZrvtRpGG4GGdfIAZPnwrJ39XHa8TXV7mG+oFBllhaPHgpUk3OEl7OkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AseAioaMigpkDnk1wu6YOhLqDLDuayvuoy6JzfQztxA=; b=GP1VkjES8MZYjrAl3E4m3E8uzG/CufrbMs8lr+Gd/WBJJZC6QSRSa7pHwszfK9W+87W3mn f+tu6y3xixxm/2otWcwc0fERN43ZnCGr8m57v4lA55FoSX6QAPZT5ainSF16hqfg5jiowE iObIrZuT5iBXDk8X0OiJschFDQyoIptPha7ykxlslkrnrBktBMiMASpD/WP7hB61CC0Dz0 bigtkT1hbuWeceiksZj9j3z2bRHHaSr6hdubZXyF74y5e+RLrPck63CXdTkD2vRDkaArKn jwuRPlXaVWPc+jHoSvA6hwHi19zP0Z9IeaoUjWty+nFUsTSlUwz8bcUGYis/qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737494738; a=rsa-sha256; cv=none; b=D7Eri/SE0j/j9lFaY0N1zWB7ESMAV/weIW97A8uBXqdoVOjPLayBHb3/35Sdfi4999UEDb 2VkteNUyKkShsJ8mR/g14PV1o2aLtJZLxF2xDrWehKg91FJPY0XnB4YziyFarFbtBepCJD Q8ubNYFuaF5GJ4CyoKXPykNeVyKnO7d4DMN6XDaBUDGWEgj5CnQ3chIDW7aXTd7kbYNS1g 57j4pVVVpktkAYgCexcGpfB8akq3ZSfcZbNHrXtC9ZG+ezsU2ucJf/2snid7rr9r9An9oz oGz735dBpz0Y8zCr66ZPPRhi86Cm58w2jiOuDnzOExApKfhnY1lLGEBdBtGXyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd0cL3f98z82g; Tue, 21 Jan 2025 21:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LLPcSW070689; Tue, 21 Jan 2025 21:25:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LLPcfk070686; Tue, 21 Jan 2025 21:25:38 GMT (envelope-from git) Date: Tue, 21 Jan 2025 21:25:38 GMT Message-Id: <202501212125.50LLPcfk070686@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: 0fb33e049ac0 - main - bsd.cpu.mk: Add _CPUFLAGS to CXXFLAGS as well List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 0fb33e049ac01ebe85a0bc2af670d4ac82df59c8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0fb33e049ac01ebe85a0bc2af670d4ac82df59c8 commit 0fb33e049ac01ebe85a0bc2af670d4ac82df59c8 Author: Norikatsu Shigemura AuthorDate: 2025-01-20 20:53:19 +0000 Commit: Warner Losh CommitDate: 2025-01-21 21:24:10 +0000 bsd.cpu.mk: Add _CPUFLAGS to CXXFLAGS as well PR: 180365 Reviewed by: imp Sponsored by: Netflix --- share/mk/bsd.cpu.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 29eb4662dcdd..a2d4304f6245 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -350,6 +350,7 @@ CFLAGS += -march=rv64imafdc -mabi=lp64d .if !defined(NO_CPU_CFLAGS) CFLAGS += ${_CPUCFLAGS} +CXXFLAGS += ${_CPUCFLAGS} .endif # From nobody Tue Jan 21 21:25:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd0cM4jcmz5lcbS; Tue, 21 Jan 2025 21:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd0cM45PSz3s42; Tue, 21 Jan 2025 21:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTVsTOXUB7/WOIaRfL28/8JyFKNcOE6ypJcwHi3sjXg=; b=mGWiIQvOpDyEkcoqmpUJTAyLRettXMQk/IqGmAImkFHgaBtz9IkPFsNc5PdjL+jhaS1IOO fg44OzSOa9hKsnI+y+VxBVRHg/tNPIaeq9Y2nV7fFCINjY1GYEulZNgsmtKkwECVaopiqg hNTEtubEWUytkzFNLDl283CsJP7CT9/z4EUBhZusZYXrbQZvoDhq5sVxijZOYjxkwDXGn4 pQ/3S+nKKGrpz7dUzFqlzLmrOSrTLxXzavyRNiDo6YfRX4zPiY32GUC1xSgkQPdMMbhtte 1Xo8CTBlqfhmSXowl08ZYe5BrHsCzhByHMSXamtTLcxb6CFEqMp+WeUBX+fCrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737494739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GTVsTOXUB7/WOIaRfL28/8JyFKNcOE6ypJcwHi3sjXg=; b=d05xef4YjwSmAxkRDhOoNxwoVjC038JdsmQ54mWyrpXEllx3j926x4CWOFIOfyskjsyqYE fpvURloECgjCSJ6nrdMmNzDKgm6Gue4fewRJJDLsHD7k/+4dkF5SAL02DiYheer6X+bD/a 9mAQgqcW8mO2eDyEWFxwau/VsJsgsVgbnRWmhq+SOoo0MPKh9fMcxNbcTLLJ/c0p9kmYHV GPaQnukE5i6RFzCTGYd1mNvYZoBFisO+QVLaIell9syFl2oYq1cJYyz+ndHTHWB3HwgfzO Rz0Qv8YtUGHa7y8qnVjsppR8sFWqOlxLVDR6gLEKolMYRv5ZfpCztV1rQfG6Ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737494739; a=rsa-sha256; cv=none; b=k8P5nTK9Z66zfdDfVfpbtsAns+1mQ1GNwGMWw59Mxgm9nAg6pwdZQZrqTK74oIhRYs1730 VO04rXLG9PRans7/4AWvyn+9WuuA6LeXhCOxkGHjuFnyQCNjgj4QPsd7Cn5dCmxOX3rH6Z b8TVfU5XLa68Ft6l4abvlMbLKb8tjGYWyQlVoDk/hsvSMzFui/pTGiSOxgRGc0PU3QwcZN /SVzcSUX6D5ejQKXFYAU/Lvj15bistCPJUk9DPntYlTMsFCfwUKljKGStxVBYyGYcezvGe aafI0hpuZhz5Fbcs9xkPRKuMwIUvrc6sq2P4mvXJv8BrcOIgIPZEGhYHD65qog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd0cM3Yxqz86v; Tue, 21 Jan 2025 21:25:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LLPdMv070724; Tue, 21 Jan 2025 21:25:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LLPdxa070720; Tue, 21 Jan 2025 21:25:39 GMT (envelope-from git) Date: Tue, 21 Jan 2025 21:25:39 GMT Message-Id: <202501212125.50LLPdxa070720@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: cc6d72cfccf0 - main - bsd.cpu.mk: Remove xscale reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: cc6d72cfccf0ffe0dc16fce6442813184d77503c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cc6d72cfccf0ffe0dc16fce6442813184d77503c commit cc6d72cfccf0ffe0dc16fce6442813184d77503c Author: Warner Losh AuthorDate: 2025-01-20 20:56:55 +0000 Commit: Warner Losh CommitDate: 2025-01-21 21:24:10 +0000 bsd.cpu.mk: Remove xscale reference We've retired all the armv5te support, so we don't need this here anymore. Sponsored by: Netflix --- share/mk/bsd.cpu.mk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index a2d4304f6245..f6599a0ad802 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -98,11 +98,7 @@ _CPUCFLAGS = -march=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "amd64" _CPUCFLAGS = -march=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "arm" -. if ${CPUTYPE} == "xscale" -#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself -#_CPUCFLAGS = -mcpu=xscale -_CPUCFLAGS = -march=armv5te -D__XSCALE__ -. elif ${CPUTYPE:M*soft*} != "" +. if ${CPUTYPE:M*soft*} != "" _CPUCFLAGS = -mfloat-abi=softfp . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -mfpu=vfp From nobody Tue Jan 21 21:50:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd18X5sCtz5lf1s; Tue, 21 Jan 2025 21:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd18X53Tvz41Rq; Tue, 21 Jan 2025 21:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737496204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LAcbvx8p7DU0tZ6ijKPpFGTPM444KSNuawN2Tnn0ei0=; b=AEj7LBQvZ5elwdzOc7z9rfD9tw6R6rCQkvE6ABbkH7V/NmeQureLrRFZQzHtfMseiJtF23 22GW9Wx+mFCZVnMgvc5z0yc2NnZP38+B8d9QHtle6rp5cUuJF+R8c/8/DgzfJYeuctG4Dy kER3cDhc+6OlcE9p6lxeIZMbeTsoJzeYuF6H0jYEApKyle577wwOdA8tvgLD53V+sy+VtM jT6SZsILLI/bHkCujwScYk3dDJETrfTvSfoD9l2I3amM9knRXTZXGIEPsCIGOmVQBLvxhG DgauKaonsUMSIvVfZOIoE0KpchCqi4Sd7cKJJ9A2sB5YHynYK5y39LaovF9Opg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737496204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LAcbvx8p7DU0tZ6ijKPpFGTPM444KSNuawN2Tnn0ei0=; b=yziUcI4d8/ACteLwJtAQYjJDfnRxTkuaWu+9PoJpqg/TQxgvU739Zb9XG0092rxumSKIea DFNFa60iz4nI9DS2T7hZB02LaMtJ8bQAcsmrMGKAFLwDuhadCljRgXnrnkYcqpFy0bOtth aex+EPDtYSp2hoUFJtB6a91vrwAltW3TCh/0osZmuagrOju2YVmSn/H7RHzSWM1cHyhPEa Ymnl5YzhDOx4cZ2ABabIsDNKNEVKzS5FP9wp9MVbSnP4/L2iEe+EV8iM2jZzETMHIW3/KC lWSFAY1lMFYrpVJpFHdqXgqYW2gKtsq8496qq6y/UxVzHJio/VWPNYYw3dLb3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737496204; a=rsa-sha256; cv=none; b=bRzEn/VOLuuwj8aOSsNyIcENuVSnIVaduALZyI4XQDqgzqJ2V8Obiimqs6NqiE+tbL76N1 SkEc8e38C9L7Rl4+P7eGiBnusr78lSH0QWfkng8V2PISv3AZsiGrfy0HHMvu59X7oNvYR6 Bhsv3GrDEWyWR+HVGtnzJg9tFxvX4BiVvyHho8vMn1GXGCUzo7mN5sDi7AEq/oStiLcrnX WRianNAyyaCBrNz8QYBhVXWkAU0MItn6LDD2DxXzQXAJ//qN6N9PB4Ajm2Mc+6Bcln/HFY zQcwRjgCWfflY8JdQt6oXs7LV11ZU1hjTefKqToEPjJP1axq/4dKI2DIQ1JbSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd18X4GWJz8ln; Tue, 21 Jan 2025 21:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LLo479011193; Tue, 21 Jan 2025 21:50:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LLo4pt011189; Tue, 21 Jan 2025 21:50:04 GMT (envelope-from git) Date: Tue, 21 Jan 2025 21:50:04 GMT Message-Id: <202501212150.50LLo4pt011189@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: 81b076e43aa6 - main - fibs tests: Fix test failures and simplify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 81b076e43aa63ac255996093233ab3560a23977e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81b076e43aa63ac255996093233ab3560a23977e commit 81b076e43aa63ac255996093233ab3560a23977e Author: Mark Johnston AuthorDate: 2025-01-21 21:44:25 +0000 Commit: Mark Johnston CommitDate: 2025-01-21 21:44:25 +0000 fibs tests: Fix test failures and simplify The tests previously expected the invoker to pass a list of FIBs to use. However, they now run in separate VNET jails, so we can simply expand the FIB array as needed in each test. Modify each test to simply set net.fibs as needed and grab FIB numbers starting at 1. A number of tests were also broken by commit 9206c7996198 ("usr.bin/netstat: -n should not print symbolic names"), so fix those. Reviewed by: asomers Fixes: 9206c7996198 ("usr.bin/netstat: -n should not print symbolic names") MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48585 --- tests/sys/netinet/fibs_test.sh | 43 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/tests/sys/netinet/fibs_test.sh b/tests/sys/netinet/fibs_test.sh index 5c1a918abb2c..a57d999496fc 100644 --- a/tests/sys/netinet/fibs_test.sh +++ b/tests/sys/netinet/fibs_test.sh @@ -30,9 +30,6 @@ # Authors: Alan Somers (Spectra Logic Corporation) # -# All of the tests in this file requires the test-suite config variable "fibs" -# to be defined to a space-delimited list of FIBs that may be used for testing. - # arpresolve should check the interface fib for routes to a target when # creating an ARP table entry. This is a regression for kern/167947, where # arpresolve only checked the default route. @@ -48,7 +45,6 @@ arpresolve_checks_interface_fib_head() { atf_set "descr" "arpresolve should check the interface fib, not the default fib, for routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" atf_set "require.progs" "nping" } arpresolve_checks_interface_fib_body() @@ -100,7 +96,6 @@ loopback_and_network_routes_on_nondefault_fib_head() { atf_set "descr" "When creating and deleting loopback IPv4 routes, use the interface's fib" atf_set "require.user" "root" - atf_set "require.config" "fibs" } loopback_and_network_routes_on_nondefault_fib_body() @@ -157,7 +152,6 @@ loopback_and_network_routes_on_nondefault_fib_inet6_head() { atf_set "descr" "When creating and deleting loopback IPv6 routes, use the interface's fib" atf_set "require.user" "root" - atf_set "require.config" "fibs" } loopback_and_network_routes_on_nondefault_fib_inet6_body() @@ -216,7 +210,6 @@ default_route_with_multiple_fibs_on_same_subnet_head() { atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv4 routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" } default_route_with_multiple_fibs_on_same_subnet_body() @@ -247,9 +240,9 @@ default_route_with_multiple_fibs_on_same_subnet_body() # Verify that the default route exists for both fibs, with their # respective interfaces. - atf_check -o match:"^default.*${TAP0}$" \ + atf_check -o match:"^0\.0\.0\.0.*${TAP0}$" \ setfib ${FIB0} netstat -rn -f inet - atf_check -o match:"^default.*${TAP1}$" \ + atf_check -o match:"^0\.0\.0\.0.*${TAP1}$" \ setfib ${FIB1} netstat -rn -f inet } @@ -263,7 +256,6 @@ default_route_with_multiple_fibs_on_same_subnet_inet6_head() { atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv6 routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" } default_route_with_multiple_fibs_on_same_subnet_inet6_body() @@ -294,9 +286,9 @@ default_route_with_multiple_fibs_on_same_subnet_inet6_body() # Verify that the default route exists for both fibs, with their # respective interfaces. - atf_check -o match:"^default.*${TAP0}$" \ + atf_check -o match:"^::/0.*${TAP0}$" \ setfib ${FIB0} netstat -rn -f inet6 - atf_check -o match:"^default.*${TAP1}$" \ + atf_check -o match:"^::/0.*${TAP1}$" \ setfib ${FIB1} netstat -rn -f inet6 } @@ -315,7 +307,6 @@ same_ip_multiple_ifaces_fib0_head() { atf_set "descr" "Can remove an IPv4 alias from an interface when the same IPv4 is also assigned to another interface." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_fib0_body() { @@ -358,7 +349,6 @@ same_ip_multiple_ifaces_head() { atf_set "descr" "Can remove an IPv4 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_body() { @@ -404,7 +394,6 @@ same_ip_multiple_ifaces_inet6_head() { atf_set "descr" "Can remove an IPv6 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_inet6_body() { @@ -446,7 +435,7 @@ slaac_on_nondefault_fib6_head() { atf_set "descr" "SLAAC correctly installs routes on non-default FIBs" atf_set "require.user" "root" - atf_set "require.config" "fibs" "allow_sysctl_side_effects" + atf_set "require.config" "allow_sysctl_side_effects" } slaac_on_nondefault_fib6_body() { @@ -490,7 +479,7 @@ slaac_on_nondefault_fib6_body() atf_check -o match:"${SUBNET}:/${MASK}.*\.*$EPAIRB" \ netstat -rnf inet6 -F $FIB1 # Check default route - atf_check -o match:"default.*\.*$EPAIRB" \ + atf_check -o match:"^::/0.*\.*$EPAIRB" \ netstat -rnf inet6 -F $FIB1 # Check that none of the above routes appeared on other routes @@ -533,7 +522,6 @@ subnet_route_with_multiple_fibs_on_same_subnet_head() { atf_set "descr" "Multiple FIBs can have IPv4 subnet routes for the same subnet" atf_set "require.user" "root" - atf_set "require.config" "fibs" } subnet_route_with_multiple_fibs_on_same_subnet_body() @@ -570,7 +558,6 @@ subnet_route_with_multiple_fibs_on_same_subnet_inet6_head() { atf_set "descr" "Multiple FIBs can have IPv6 subnet routes for the same subnet" atf_set "require.user" "root" - atf_set "require.config" "fibs" } subnet_route_with_multiple_fibs_on_same_subnet_inet6_body() @@ -620,7 +607,6 @@ udp_dontroute_head() { atf_set "descr" "Source address selection for UDP packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" - atf_set "require.config" "fibs" } udp_dontroute_body() @@ -671,7 +657,6 @@ udp_dontroute6_head() { atf_set "descr" "Source address selection for UDP IPv6 packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" - atf_set "require.config" "fibs" } udp_dontroute6_body() @@ -748,15 +733,13 @@ get_fibs() { NUMFIBS=$1 net_fibs=`sysctl -n net.fibs` + if [ $net_fibs -lt $(($NUMFIBS + 1)) ]; then + atf_check -o ignore sysctl net.fibs=$(($NUMFIBS + 1)) + net_fibs=`sysctl -n net.fibs` + fi i=0 while [ $i -lt "$NUMFIBS" ]; do - fib=`atf_config_get "fibs" | \ - awk -v i=$(( i + 1 )) '{print $i}'` - echo "fib is ${fib}" - eval FIB${i}=${fib} - if [ "$fib" -ge "$net_fibs" ]; then - atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}" - fi + eval FIB${i}=$(($i + 1)) i=$(( $i + 1 )) done } @@ -816,9 +799,7 @@ setup_iface() local ADDR=$4 local MASK=$5 local FLAGS=$6 - echo setfib ${FIB} \ - ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS - setfib ${FIB} ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS + atf_check setfib ${FIB} ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS } # Create a tap(4) interface, configure it, and register it for cleanup. From nobody Tue Jan 21 22:05:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd1Tv1TW2z5lfZB; Tue, 21 Jan 2025 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd1Tv0ZFbz43df; Tue, 21 Jan 2025 22:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737497107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3fP2omkemoH+HkM1zeLt1WndhGxcpZHGbhJXSo6xjas=; b=RtUvYVzWvb7a5z1B6kf9GvVYhQ0/FCpOy0+25Ln5nlg4ctQpLMQqJPxdBqEEXfkJb4fqln INCyGrdlfge7KxNauao3FyikNgkETf/Quyxe6WW/vc/NZrW/aoWm8Z45tD4pvisrR508kL be0cuiIOo/debH9yPBzFogeXgwJv65BeNvis6os+iDFxr2KJjiJHwNbS5pYIdDnd7CGi44 2LfoZlku6qVJWaw/cCqmGJ/garPknoU6YWdACRuumcDZ1fZapqT6UFzyVmCd4vDPpZ3jpj sGEYHVaw8ITYzHRMw1QwTELnnN6MyDi2OFxBcykZozFJfNBfhuOZ4NIzFdA3Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737497107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3fP2omkemoH+HkM1zeLt1WndhGxcpZHGbhJXSo6xjas=; b=JZtEht6S+FL+cyrSB5FWeoNmY+z6OWSdivH4re6Mg5V5dTyxxyH1uF4G+Jhj4dAE7003jK U657Zi3GS2wkW/m+KJC6c+7C/Onezrd6oyW05rifuLl9OPWiuU0hoJfX0ZHlRR/cljn3wZ z+44pTTjyrfx6npdzjchQb/jkkNq8gP2h1auQrfMloeI77Sd0hrxIj94nVopLfqJ51PaAW C6t2eap7NkhlEJFFpZlesg1w/n8M6WOytq/ov5ilzmQl1sDHb2jsDMlhs5OyjIkxaQPeKG o0fXoWnZ+K8b7WTC+exl+GU/rljd/V4evgoWpQxw4lCpyKQ0dKmJqLgy/Ta94w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737497107; a=rsa-sha256; cv=none; b=m/gcsAaKg6FIyiOw/GKZ2cOpYjaYpiEMhla2aNeYEoY4GJXOyh28fe2hwqvuQ/RMtGdxLt GT6A07hj/wk3vvsS7WIhbU3iIfqZrEEJEU/kIVPBnHKUM5+8JAE9tKnY5OCia6bn3CCvP7 5H8FzkLQ3vH3sGsMvzA2kxak0aT3W/2L4N1xjCmP8tt+zy+uCtCmvjphD+Xha4I1sAzrai zWxj0T5fJuUXS00jLUGUoIlprRZgHA5ZEwDTd1AJKP55wP6OuFSBJpoXFO+3cmHVQ109kn 7noKfsbI+Eja9+iov6p8v1TfyBjPqIUDNY7Zy4gwv5rJSgTkEPhYDPlHIANDoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd1Tv07skz8sB; Tue, 21 Jan 2025 22:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LM56RC046769; Tue, 21 Jan 2025 22:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LM56Kj046766; Tue, 21 Jan 2025 22:05:06 GMT (envelope-from git) Date: Tue, 21 Jan 2025 22:05:06 GMT Message-Id: <202501212205.50LM56Kj046766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 6d48eafa334f - main - checkstyle9.pl: don't require Signed-off-by for committers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d48eafa334f102009dbca9d191c6bbf52855551 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=6d48eafa334f102009dbca9d191c6bbf52855551 commit 6d48eafa334f102009dbca9d191c6bbf52855551 Author: Brooks Davis AuthorDate: 2025-01-21 20:47:29 +0000 Commit: Brooks Davis CommitDate: 2025-01-21 22:02:56 +0000 checkstyle9.pl: don't require Signed-off-by for committers Silence the warning about Signed-off-by: lines if the Author: is using a FreeBSD.org address. We don't require the lines in direct FreeBSD commits so the warning is just noise in this case. Reviwed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1577 --- tools/build/checkstyle9.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index 50ff1e9bd680..5854cf613e01 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -1254,6 +1254,7 @@ sub process { my $in_header_lines = $file ? 0 : 1; my $in_commit_log = 0; #Scanning lines before patch my $has_sob = 0; + my $author_is_committer = 0; my $non_utf8_charset = 0; our @report = (); @@ -1454,6 +1455,10 @@ sub process { ERROR("Real email adress is needed\n" . $herecurr); } + if ($line =~ /^Author: .*[a-z-0-9]\@freebsd\.org/i) { + $author_is_committer = 1 + } + #check the patch for a signoff: if ($line =~ /^\s*signed-off-by:/i) { # This is a signoff, if ugly, so do not double report. @@ -2654,7 +2659,7 @@ sub process { } - if ($has_sob == 0) { + if ($has_sob == 0 && $author_is_committer == 0) { WARN("Missing Signed-off-by: line"); } From nobody Tue Jan 21 22:46:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd2PR253Kz5lj70; Tue, 21 Jan 2025 22:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd2PR1kSMz3DxQ; Tue, 21 Jan 2025 22:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737499579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GflHxWABUXxZt60/n+m7i3rFdBSnqhNFT4ossm2dcRA=; b=nyHOtVDS2isR8ke5uRWuxSXJOW36MBZxPsnp1S80HG3C99azU6b2sB94jQ6tiz+C49AkmG C92RiASvcQw8HJJhzbVg8X4/yazAT+GpJqYYATo9DSqqvCkU8hcq2BUpzxfYJG549WEx+O 7cnQbLOJXdwZt2it/Q3UZB6+KfkH/MSJteXviVy13J87vgVSdEIuld8emKGunqvSvywG36 OyAuhMqG8qO2d1KDXWGGgy0HyvIb1NU4MGpdZ9DSZzajECQ/6QO/BiJBPJd8h/CNM/oEfp ZcfqFjGAoshFuG09hrgx2GORYb9Lx8E5mp5L9ygNZl1Qw4AdO59Tfb+RzElRvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737499579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GflHxWABUXxZt60/n+m7i3rFdBSnqhNFT4ossm2dcRA=; b=g7sqhOw08byexHEKgFeMsUNhy+R9f1JfC/lzVH6pPU4fnQcuvMEGmKdMufZO19EmpiH028 zTESqv+hq3Vcscya8+jj8lhT9UQMElvspgvr+J38a52YV2b7kTgMGsSUT/ZEFEgYsRaxSB 147LrKxk0mlnaHq6Xcv/M2ILDkt34Jtno1eeOugPbpAtIHKgqTG/5kdf+1J+qrSdCxBPAH 2W9Gj4z2PP/bt/0np6Vz2BBh6s3DXSgYNI4ScS3N83kxndvjvNs9sjuiW9x+BMqYgWTlLM rnBVRKn+HtITZaDWRWVmz9QwCGzpDVXnAcj/puFy6ZxzkIDcouGOxl+9Uv1xxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737499579; a=rsa-sha256; cv=none; b=SFLEXQu8KrixFYxZpzWnorIHylflZUWJiY0F4OVaadYuQHgaUThe+upo48IL9tEdW3hd1J C8mgcHKb7W0mXRy/hwztztN9+pekuDNlQAly2/Pu7hsXd8uGA5uIfX1GSOd5G/c1iViAOJ a0XYPIiO1w/HpW2LP5O02lJy0FcAjNCl29MYzUZIAWk5HyFet7/YjVk7qKyAFGahRhkxKs ppihbp3q/ne3YdVx8roZAm52+6oL6M7ZmQnE06Gan+OlwfACDG2N78+hecyHx6ukXNjHUx Oz62mrTkx9xYDEbMBzCxEgovUwHOOcF66SPD4SPxXT5uXTOBwo5p2IcfYOQ5ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd2PR0vcPzBMc; Tue, 21 Jan 2025 22:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LMkIKi021860; Tue, 21 Jan 2025 22:46:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LMkIrk021857; Tue, 21 Jan 2025 22:46:18 GMT (envelope-from git) Date: Tue, 21 Jan 2025 22:46:18 GMT Message-Id: <202501212246.50LMkIrk021857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c669b08bd834 - main - vm_phys: reduce touching of page->pool fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c669b08bd834553ec056e3987693f247b2ec0433 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c669b08bd834553ec056e3987693f247b2ec0433 commit c669b08bd834553ec056e3987693f247b2ec0433 Author: Doug Moore AuthorDate: 2025-01-21 22:35:25 +0000 Commit: Doug Moore CommitDate: 2025-01-21 22:35:25 +0000 vm_phys: reduce touching of page->pool fields Change the usage of the pool field in vm_page structs. Currently, every page belongs to a pool, and the pool field identifies that pool, whether the page is allocated or free. With this change, the pool field of the first page of a free block is used by the buddy allocator to identify its pool, but the buddy allocator makes no guarantees about the pool field value for allocated pages. The buddy allocator requires that a pool parameter be passed as part of freeing memory. A function that allocates memory may use the pool field of a page to record what pool to pass as that parameter when the memory is freed, but might not need to do so for every allocated page. Suggested by: alc Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45409 --- sys/vm/vm_kern.c | 2 +- sys/vm/vm_page.c | 97 ++++++++++++++++++++++-------------------- sys/vm/vm_phys.c | 123 ++++++++++++++++++++++++++++------------------------- sys/vm/vm_phys.h | 6 +-- sys/vm/vm_reserv.c | 35 ++++++++------- 5 files changed, 140 insertions(+), 123 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 86ab2529e27f..2b85dbde1dd6 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -953,7 +953,7 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); - vm_phys_free_pages(m, 0); + vm_phys_free_pages(m, m->pool, 0); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ba22c7f97f2f..961b32da6599 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -572,6 +572,7 @@ vm_page_startup(vm_offset_t vaddr) #if defined(__i386__) && defined(VM_PHYSSEG_DENSE) long ii; #endif + int pool; #ifdef VM_FREEPOOL_LAZYINIT int lazyinit; #endif @@ -651,6 +652,8 @@ vm_page_startup(vm_offset_t vaddr) dump_add_page(pa); pa += PAGE_SIZE; } +#else + (void)pa; #endif /* * Compute the number of pages of memory that will be available for @@ -755,9 +758,12 @@ vm_page_startup(vm_offset_t vaddr) */ vm_phys_init(); + pool = VM_FREEPOOL_DEFAULT; #ifdef VM_FREEPOOL_LAZYINIT lazyinit = 1; TUNABLE_INT_FETCH("debug.vm.lazy_page_init", &lazyinit); + if (lazyinit) + pool = VM_FREEPOOL_LAZYINIT; #endif /* @@ -777,48 +783,27 @@ vm_page_startup(vm_offset_t vaddr) seg = &vm_phys_segs[segind]; /* - * If lazy vm_page initialization is not enabled, simply - * initialize all of the pages in the segment. Otherwise, we - * only initialize: - * 1. Pages not covered by phys_avail[], since they might be - * freed to the allocator at some future point, e.g., by - * kmem_bootstrap_free(). - * 2. The first page of each run of free pages handed to the - * vm_phys allocator, which in turn defers initialization - * of pages until they are needed. - * This avoids blocking the boot process for long periods, which - * may be relevant for VMs (which ought to boot as quickly as - * possible) and/or systems with large amounts of physical - * memory. + * Initialize pages not covered by phys_avail[], since they + * might be freed to the allocator at some future point, e.g., + * by kmem_bootstrap_free(). */ -#ifdef VM_FREEPOOL_LAZYINIT - if (lazyinit) { - startp = seg->start; - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (startp >= seg->end) - break; - - if (phys_avail[i + 1] < startp) - continue; - if (phys_avail[i] <= startp) { - startp = phys_avail[i + 1]; - continue; - } - - m = vm_phys_seg_paddr_to_vm_page(seg, startp); - for (endp = MIN(phys_avail[i], seg->end); - startp < endp; startp += PAGE_SIZE, m++) { - vm_page_init_page(m, startp, segind, - VM_FREEPOOL_DEFAULT); - } + startp = seg->start; + for (i = 0; phys_avail[i + 1] != 0; i += 2) { + if (startp >= seg->end) + break; + if (phys_avail[i + 1] < startp) + continue; + if (phys_avail[i] <= startp) { + startp = phys_avail[i + 1]; + continue; } - } else -#endif - for (m = seg->first_page, pa = seg->start; - pa < seg->end; m++, pa += PAGE_SIZE) { - vm_page_init_page(m, pa, segind, + m = vm_phys_seg_paddr_to_vm_page(seg, startp); + for (endp = MIN(phys_avail[i], seg->end); + startp < endp; startp += PAGE_SIZE, m++) { + vm_page_init_page(m, startp, segind, VM_FREEPOOL_DEFAULT); } + } /* * Add the segment's pages that are covered by one of @@ -835,16 +820,30 @@ vm_page_startup(vm_offset_t vaddr) if (pagecount == 0) continue; + /* + * If lazy vm_page initialization is not enabled, simply + * initialize all of the pages in the segment covered by + * phys_avail. Otherwise, initialize only the first + * page of each run of free pages handed to the vm_phys + * allocator, which in turn defers initialization of + * pages until they are needed. + * + * This avoids blocking the boot process for long + * periods, which may be relevant for VMs (which ought + * to boot as quickly as possible) and/or systems with + * large amounts of physical memory. + */ m = vm_phys_seg_paddr_to_vm_page(seg, startp); -#ifdef VM_FREEPOOL_LAZYINIT - if (lazyinit) { - vm_page_init_page(m, startp, segind, - VM_FREEPOOL_LAZYINIT); + vm_page_init_page(m, startp, segind, pool); + if (pool == VM_FREEPOOL_DEFAULT) { + for (int j = 1; j < pagecount; j++) { + vm_page_init_page(&m[j], + startp + ptoa(j), segind, pool); + } } -#endif vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); - vm_phys_enqueue_contig(m, pagecount); + vm_phys_enqueue_contig(m, pool, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; @@ -2341,6 +2340,7 @@ found: m->flags = flags; m->a.flags = 0; m->oflags = (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; + m->pool = VM_FREEPOOL_DEFAULT; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; else if ((req & VM_ALLOC_SBUSY) != 0) @@ -2558,6 +2558,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, m->ref_count = 1; m->a.act_count = 0; m->oflags = oflags; + m->pool = VM_FREEPOOL_DEFAULT; if (vm_page_iter_insert(&pages, m, object, pindex, mpred)) { if ((req & VM_ALLOC_WIRED) != 0) vm_wire_sub(npages); @@ -2655,6 +2656,7 @@ found: m->flags = (m->flags & PG_ZERO) | flags; m->a.flags = 0; m->oflags = VPO_UNMANAGED; + m->pool = VM_FREEPOOL_DIRECT; m->busy_lock = VPB_UNBUSIED; if ((req & VM_ALLOC_WIRED) != 0) { vm_wire_add(1); @@ -2803,6 +2805,7 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, m->ref_count = 1; m->a.act_count = 0; m->oflags = VPO_UNMANAGED; + m->pool = VM_FREEPOOL_DIRECT; /* * Zero the page before updating any mappings since the page is @@ -2881,7 +2884,7 @@ vm_page_zone_release(void *arg, void **store, int cnt) vm_domain_free_lock(vmd); for (i = 0; i < cnt; i++) { m = (vm_page_t)store[i]; - vm_phys_free_pages(m, 0); + vm_phys_free_pages(m, pgcache->pool, 0); } vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, cnt); @@ -3266,7 +3269,7 @@ unlock: do { MPASS(vm_page_domain(m) == domain); SLIST_REMOVE_HEAD(&free, plinks.s.ss); - vm_phys_free_pages(m, 0); + vm_phys_free_pages(m, m->pool, 0); cnt++; } while ((m = SLIST_FIRST(&free)) != NULL); vm_domain_free_unlock(vmd); @@ -4271,7 +4274,7 @@ vm_page_free_toq(vm_page_t m) return; } vm_domain_free_lock(vmd); - vm_phys_free_pages(m, 0); + vm_phys_free_pages(m, m->pool, 0); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); } diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index cf1ed5818b2f..a8b40b004d86 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -187,7 +187,7 @@ SYSCTL_INT(_vm, OID_AUTO, ndomains, CTLFLAG_RD, static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end); static void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, - int order, int tail); + int order, int pool, int tail); static bool __diagused vm_phys_pool_valid(int pool) @@ -391,10 +391,12 @@ sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS) #endif static void -vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int tail) +vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int pool, + int tail) { m->order = order; + m->pool = pool; if (tail) TAILQ_INSERT_TAIL(&fl[order].pl, m, listq); else @@ -687,7 +689,7 @@ vm_phys_register_domains(int ndomains __numa_used, */ static __inline void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, - int tail) + int pool, int tail) { vm_page_t m_buddy; @@ -697,19 +699,20 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, KASSERT(m_buddy->order == VM_NFREEORDER, ("vm_phys_split_pages: page %p has unexpected order %d", m_buddy, m_buddy->order)); - vm_freelist_add(fl, m_buddy, oind, tail); + vm_freelist_add(fl, m_buddy, oind, pool, tail); } } static void -vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int tail) +vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int pool, + int tail) { KASSERT(order >= 0 && order < VM_NFREEORDER, ("%s: invalid order %d", __func__, order)); - vm_freelist_add(fl, m, order, tail); + vm_freelist_add(fl, m, order, pool, tail); #ifdef VM_FREEPOOL_LAZYINIT - if (__predict_false(m->pool == VM_FREEPOOL_LAZYINIT)) { + if (__predict_false(pool == VM_FREEPOOL_LAZYINIT)) { vm_page_t m_next; vm_paddr_t pa; int npages; @@ -738,7 +741,8 @@ vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int tail) * The physical page m's buddy must not be free. */ static void -vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) +vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, + int tail) { int order; @@ -754,7 +758,7 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) order = ilog2(npages); KASSERT(order < VM_NFREEORDER, ("%s: order %d is out of range", __func__, order)); - vm_phys_enq_chunk(fl, m, order, tail); + vm_phys_enq_chunk(fl, m, order, pool, tail); m += 1 << order; npages -= 1 << order; } @@ -774,7 +778,8 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) * parameter m. Otherwise, the physical page m's buddy must not be free. */ static vm_page_t -vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) +vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, + int tail) { int order; @@ -788,7 +793,7 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) ("vm_phys_enq_range: page %p has unexpected order %d", m, m->order)); order = ffs(npages) - 1; - vm_phys_enq_chunk(fl, m, order, tail); + vm_phys_enq_chunk(fl, m, order, pool, tail); m += 1 << order; npages -= 1 << order; } @@ -796,33 +801,30 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) } /* - * Set the pool for a contiguous, power of two-sized set of physical pages. + * Complete initialization of a contiguous, power of two-sized set of physical + * pages. * * If the pages currently belong to the lazy init pool, then the corresponding * page structures must be initialized. In this case it is assumed that the * first page in the run has already been initialized. */ static void -vm_phys_set_pool(int pool, vm_page_t m, int order) +vm_phys_finish_init(vm_page_t m, int order) { #ifdef VM_FREEPOOL_LAZYINIT if (__predict_false(m->pool == VM_FREEPOOL_LAZYINIT)) { vm_paddr_t pa; int segind; - m->pool = pool; - TSENTER(); pa = m->phys_addr + PAGE_SIZE; segind = m->segind; for (vm_page_t m_tmp = m + 1; m_tmp < &m[1 << order]; m_tmp++, pa += PAGE_SIZE) - vm_page_init_page(m_tmp, pa, segind, pool); + vm_page_init_page(m_tmp, pa, segind, VM_NFREEPOOL); TSEXIT(); - } else + } #endif - for (vm_page_t m_tmp = m; m_tmp < &m[1 << order]; m_tmp++) - m_tmp->pool = pool; } /* @@ -833,7 +835,8 @@ vm_phys_set_pool(int pool, vm_page_t m, int order) * The returned pages may not be physically contiguous. However, in contrast * to performing multiple, back-to-back calls to vm_phys_alloc_pages(..., 0), * calling this function once to allocate the desired number of pages will - * avoid wasted time in vm_phys_split_pages(). + * avoid wasted time in vm_phys_split_pages(). The allocated pages have no + * valid pool field set. * * The free page queues for the specified domain must be locked. */ @@ -869,7 +872,8 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * Return excess pages to fl. Its order * [0, oind) queues are empty. */ - vm_phys_enq_range(m, avail - i, fl, 1); + vm_phys_enq_range(m, avail - i, fl, + pool, 1); return (npages); } } @@ -881,7 +885,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) while ((m = TAILQ_FIRST(&alt[oind].pl)) != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_set_pool(pool, m, oind); + vm_phys_finish_init(m, oind); avail = i + (1 << oind); end = imin(npages, avail); while (i < end) @@ -893,7 +897,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * are empty. */ vm_phys_enq_range(m, avail - i, - fl, 1); + fl, pool, 1); return (npages); } } @@ -940,7 +944,7 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) if (m != NULL) { vm_freelist_rem(fl, m, oind); /* The order [order, oind) queues are empty. */ - vm_phys_split_pages(m, oind, fl, order, 1); + vm_phys_split_pages(m, oind, fl, order, pool, 1); return (m); } } @@ -957,9 +961,9 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) m = TAILQ_FIRST(&alt[oind].pl); if (m != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_set_pool(pool, m, oind); + vm_phys_finish_init(m, oind); /* The order [order, oind) queues are empty. */ - vm_phys_split_pages(m, oind, fl, order, 1); + vm_phys_split_pages(m, oind, fl, order, pool, 1); return (m); } } @@ -1198,11 +1202,12 @@ vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end) /* * Free a contiguous, power of two-sized set of physical pages. + * The pool field in the first page determines the destination pool. * * The free page queues must be locked. */ void -vm_phys_free_pages(vm_page_t m, int order) +vm_phys_free_pages(vm_page_t m, int pool, int order) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1210,13 +1215,12 @@ vm_phys_free_pages(vm_page_t m, int order) vm_page_t m_buddy; KASSERT(m->order == VM_NFREEORDER, - ("vm_phys_free_pages: page %p has unexpected order %d", - m, m->order)); - KASSERT(vm_phys_pool_valid(m->pool), - ("vm_phys_free_pages: page %p has unexpected pool %d", - m, m->pool)); + ("%s: page %p has unexpected order %d", + __func__, m, m->order)); + KASSERT(vm_phys_pool_valid(pool), + ("%s: unexpected pool param %d", __func__, pool)); KASSERT(order < VM_NFREEORDER, - ("vm_phys_free_pages: order %d is out of range", order)); + ("%s: order %d is out of range", __func__, order)); seg = &vm_phys_segs[m->segind]; vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); if (order < VM_NFREEORDER - 1) { @@ -1230,15 +1234,14 @@ vm_phys_free_pages(vm_page_t m, int order) break; fl = (*seg->free_queues)[m_buddy->pool]; vm_freelist_rem(fl, m_buddy, order); - if (m_buddy->pool != m->pool) - vm_phys_set_pool(m->pool, m_buddy, order); + vm_phys_finish_init(m_buddy, order); order++; pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); m = vm_phys_seg_paddr_to_vm_page(seg, pa); } while (order < VM_NFREEORDER - 1); } - fl = (*seg->free_queues)[m->pool]; - vm_freelist_add(fl, m, order, 1); + fl = (*seg->free_queues)[pool]; + vm_freelist_add(fl, m, order, pool, 1); } #ifdef VM_FREEPOOL_LAZYINIT @@ -1290,12 +1293,13 @@ vm_phys_lazy_init_domain(int domain, bool locked) VM_ALLOC_NORMAL, 1 << oind); if (unlocked) vm_domain_free_unlock(vmd); - vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); + vm_phys_finish_init(m, oind); if (unlocked) { vm_domain_freecnt_inc(vmd, 1 << oind); vm_domain_free_lock(vmd); } - vm_phys_free_pages(m, oind); + vm_phys_free_pages(m, VM_FREEPOOL_DEFAULT, + oind); } } } @@ -1344,12 +1348,12 @@ SYSINIT(vm_phys_lazy_init, SI_SUB_SMP, SI_ORDER_ANY, vm_phys_lazy_sysinit, /* * Free a contiguous, arbitrarily sized set of physical pages, without - * merging across set boundaries. + * merging across set boundaries. Assumes no pages have a valid pool field. * * The free page queues must be locked. */ void -vm_phys_enqueue_contig(vm_page_t m, u_long npages) +vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1363,14 +1367,15 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) */ vm_domain_free_assert_locked(vm_pagequeue_domain(m)); seg = &vm_phys_segs[m->segind]; - fl = (*seg->free_queues)[m->pool]; + fl = (*seg->free_queues)[pool]; m_end = m + npages; /* Free blocks of increasing size. */ lo = atop(VM_PAGE_TO_PHYS(m)); if (m < m_end && (diff = lo ^ (lo + npages - 1)) != 0) { order = min(ilog2(diff), VM_NFREEORDER - 1); - m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, 1); + m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, + pool, 1); } /* Free blocks of maximum size. */ @@ -1379,20 +1384,22 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) KASSERT(seg == &vm_phys_segs[m->segind], ("%s: page range [%p,%p) spans multiple segments", __func__, m_end - npages, m)); - vm_phys_enq_chunk(fl, m, order, 1); + vm_phys_enq_chunk(fl, m, order, pool, 1); m += 1 << order; } /* Free blocks of diminishing size. */ - vm_phys_enq_beg(m, m_end - m, fl, 1); + vm_phys_enq_beg(m, m_end - m, fl, pool, 1); } /* * Free a contiguous, arbitrarily sized set of physical pages. + * Assumes that every page but the first has no valid pool field. + * Uses the pool value in the first page if valid, otherwise default. * * The free page queues must be locked. */ void -vm_phys_free_contig(vm_page_t m, u_long npages) +vm_phys_free_contig(vm_page_t m, int pool, u_long npages) { vm_paddr_t lo; vm_page_t m_start, m_end; @@ -1416,11 +1423,11 @@ vm_phys_free_contig(vm_page_t m, u_long npages) * end of the range last. */ if (m_start < m_end) - vm_phys_enqueue_contig(m_start, m_end - m_start); + vm_phys_enqueue_contig(m_start, pool, m_end - m_start); if (order_start < max_order) - vm_phys_free_pages(m, order_start); + vm_phys_free_pages(m, pool, order_start); if (order_end < max_order) - vm_phys_free_pages(m_end, order_end); + vm_phys_free_pages(m_end, pool, order_end); } /* @@ -1474,15 +1481,15 @@ vm_phys_unfree_page(vm_paddr_t pa) struct vm_phys_seg *seg; vm_paddr_t pa_half; vm_page_t m, m_set, m_tmp; - int order; + int order, pool; seg = vm_phys_paddr_to_seg(pa); vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); +#ifdef VM_FREEPOOL_LAZYINIT /* * The pages on the free lists must be initialized. */ -#ifdef VM_FREEPOOL_LAZYINIT vm_phys_lazy_init_domain(seg->domain, true); #endif @@ -1515,7 +1522,8 @@ vm_phys_unfree_page(vm_paddr_t pa) * is larger than a page, shrink "m_set" by returning the half * of "m_set" that does not contain "m" to the free lists. */ - fl = (*seg->free_queues)[m_set->pool]; + pool = m_set->pool; + fl = (*seg->free_queues)[pool]; order = m_set->order; vm_freelist_rem(fl, m_set, order); while (order > 0) { @@ -1527,7 +1535,7 @@ vm_phys_unfree_page(vm_paddr_t pa) m_tmp = m_set; m_set = vm_phys_seg_paddr_to_vm_page(seg, pa_half); } - vm_freelist_add(fl, m_tmp, order, 0); + vm_freelist_add(fl, m_tmp, order, pool, 0); } KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); return (true); @@ -1668,7 +1676,8 @@ vm_phys_find_queues_contig( * alignment of the first physical page in the set. If the given value * "boundary" is non-zero, then the set of physical pages cannot cross * any physical address boundary that is a multiple of that value. Both - * "alignment" and "boundary" must be a power of two. + * "alignment" and "boundary" must be a power of two. Sets the pool + * field to DEFAULT in the first allocated page. */ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, @@ -1727,12 +1736,12 @@ vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, fl = (*queues)[m->pool]; oind = m->order; vm_freelist_rem(fl, m, oind); - if (m->pool != VM_FREEPOOL_DEFAULT) - vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); + vm_phys_finish_init(m, oind); } /* Return excess pages to the free lists. */ fl = (*queues)[VM_FREEPOOL_DEFAULT]; - vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, 0); + vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, + VM_FREEPOOL_DEFAULT, 0); /* Return page verified to satisfy conditions of request. */ pa_start = VM_PAGE_TO_PHYS(m_run); diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index 43d94a9420f2..046fe26b476d 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -64,15 +64,15 @@ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); -void vm_phys_enqueue_contig(vm_page_t m, u_long npages); +void vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); vm_page_t vm_phys_fictitious_to_vm_page(vm_paddr_t pa); int vm_phys_find_range(vm_page_t bounds[], int segind, int domain, u_long npages, vm_paddr_t low, vm_paddr_t high); -void vm_phys_free_contig(vm_page_t m, u_long npages); -void vm_phys_free_pages(vm_page_t m, int order); +void vm_phys_free_contig(vm_page_t m, int pool, u_long npages); +void vm_phys_free_pages(vm_page_t m, int pool, int order); void vm_phys_init(void); vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa); vm_page_t vm_phys_seg_paddr_to_vm_page(struct vm_phys_seg *seg, vm_paddr_t pa); diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index ad513962d50d..0bedca54d3da 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -480,7 +480,8 @@ vm_reserv_depopulate(vm_reserv_t rv, int index) if (rv->popcnt == 0) { vm_reserv_remove(rv); vm_domain_free_lock(vmd); - vm_phys_free_pages(rv->pages, VM_LEVEL_0_ORDER); + vm_phys_free_pages(rv->pages, VM_FREEPOOL_DEFAULT, + VM_LEVEL_0_ORDER); vm_domain_free_unlock(vmd); counter_u64_add(vm_reserv_freed, 1); } @@ -943,7 +944,7 @@ static void vm_reserv_break(vm_reserv_t rv) { vm_page_t m; - int hi, lo, pos; + int pool, pos, pos0, pos1; vm_reserv_assert_locked(rv); CTR5(KTR_VM, "%s: rv %p object %p popcnt %d inpartpop %d", @@ -954,23 +955,27 @@ vm_reserv_break(vm_reserv_t rv) for (; m < rv->pages + VM_LEVEL_0_NPAGES; m += VM_SUBLEVEL_0_NPAGES) #endif m->psind = 0; - hi = lo = -1; - pos = 0; - for (;;) { - bit_ff_at(rv->popmap, pos, VM_LEVEL_0_NPAGES, lo != hi, &pos); - if (lo == hi) { - if (pos == -1) - break; - lo = pos; - continue; - } + pool = VM_FREEPOOL_DIRECT; + pos0 = bit_test(rv->popmap, 0) ? -1 : 0; + pos1 = -1 - pos0; + for (pos = 0; pos < VM_LEVEL_0_NPAGES; ) { + /* Find the first different bit after pos. */ + bit_ff_at(rv->popmap, pos + 1, VM_LEVEL_0_NPAGES, + pos1 < pos0, &pos); if (pos == -1) pos = VM_LEVEL_0_NPAGES; - hi = pos; + if (pos0 < pos1) { + /* Set pool for pages from pos1 to pos. */ + pos0 = pos1; + while (pos0 < pos) + rv->pages[pos0++].pool = pool; + continue; + } + /* Free unused pages from pos0 to pos. */ + pos1 = pos; vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); + vm_phys_enqueue_contig(&rv->pages[pos0], pool, pos1 - pos0); vm_domain_free_unlock(VM_DOMAIN(rv->domain)); - lo = hi; } bit_nclear(rv->popmap, 0, VM_LEVEL_0_NPAGES - 1); rv->popcnt = 0; From nobody Tue Jan 21 23:15:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd33T4q5Yz5lkJs; Tue, 21 Jan 2025 23:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd33T2BWcz3Hvg; Tue, 21 Jan 2025 23:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737501349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iLjkm56FroNDfUw7UiarxNAYl3x4kQ72ZFkmpfxPZUA=; b=TzkfVVhYIcTVuLA6ogldogL/ttHWkYvxhEmEMrFQ5U/oLK1ykdROsuNtprpwQtT6MLlarx WyGVzJzrQyZm92EcVS9mwSC7yI5nD+TpZ8URmq1wE8A1T+MJQchpLkVPdjvYWS8h92yM+8 MmmqI+pz/84mYEWlDwuxwvzIMLn8eyYzIX12PzyZD0pyQrt93Ip2TjP4iHHa+CB9de/Ciw 535o/L53mQZGGDpiDV4qms2xutOqQNV33tt2igC43y2O79xNA7lVqFLAF2fcR4gMCi19V/ KykomDqA5piNgFgjYIny/eaQ/hP/tBjN2fJHRz8RgH11HA26VuMq2sQuY8Lxng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737501349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iLjkm56FroNDfUw7UiarxNAYl3x4kQ72ZFkmpfxPZUA=; b=XtoNhwKtkk8OcyUwi55JFKO5XumkFurw5CWq27YE2FJKhB8qRlnbok45+DyU/X51jgrkQy mdpILMUYV2qZQ58YPrMKQJrYzKZb5Kriom+PKs3iwdWCNe6v007a5+mlIPHb4NFkBZYrAB VIet/M8Dst5l9VqTbF9fZeKPDdNqelvuPlXtRC8AygwEvczAaLOPnrKj9/KX4YBun/GBiR BDWurjVMTNfBcmteKWHNuCSU9OosMvHiPG6q3p3wGM9VUrObySawE6riZFPBH0PVTE9zYi 8dHGYD9AHRNS6ntZf5eNP5xQvi7zGfHHWbCSDKboSlBvkkOf4pl1nsSmORURKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737501349; a=rsa-sha256; cv=none; b=VYtBqVG2mmso0tUq+x/vHeL7hbe8tfUqNs6a7BEc2kb5mn/1rixKjO9yxouOKPlKuHi+Wy +f0IDr7eoOWcDprXqnKiRkdrxsvsqSzp56dWxxdVkZVa6VaWcjYoze9XaVQ1VR3mPxWrc7 5vEnrvUVRaCnTuFxoTQ3vAMZxnXTFCu9zPiPBZDsxRLOUgO+N/4gszTDADSp4K/7hFcfUX 17My95B3m5quXfEhuHTsLzYjfjmSBPX4enD27aYrJqasgj5nvA7OIm4SKeRMYNcNc+7O5j mh97kKFE2U4QPmEMYgNnAOydGDQHVm6+J0O+wPq6L6ywUWl37hGvyZlRfBcCwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd33T0qmZzB6d; Tue, 21 Jan 2025 23:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LNFmWk078531; Tue, 21 Jan 2025 23:15:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LNFmKa078528; Tue, 21 Jan 2025 23:15:48 GMT (envelope-from git) Date: Tue, 21 Jan 2025 23:15:48 GMT Message-Id: <202501212315.50LNFmKa078528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 58f77309c4e0 - main - Add machdep.cpu_idle_max_stop_state tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58f77309c4e0d3373705582e9ca7649fe74dd267 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=58f77309c4e0d3373705582e9ca7649fe74dd267 commit 58f77309c4e0d3373705582e9ca7649fe74dd267 Author: Timothy Pearson AuthorDate: 2025-01-20 20:03:55 +0000 Commit: Justin Hibbits CommitDate: 2025-01-21 23:14:40 +0000 Add machdep.cpu_idle_max_stop_state tunable Multiple idle and deep sleep states are supported on Power7+ platforms, with each state having a characteristic latency and effect on system real-time performance. Add a tunable to allow a maximum sleep state (maximum theoretical sleep-related latency) to be set, in order to better support specific latency-sensitive applications / real time workloads. Signed-off-by: Timothy Pearson --- sys/powerpc/powerpc/cpu.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index f73ed25c8924..4b8da50cf642 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -95,6 +95,9 @@ static void cpu_idle_booke(sbintime_t); static void cpu_idle_e500mc(sbintime_t sbt); #endif #if defined(__powerpc64__) && defined(AIM) +static int cpu_idle_max_stop_state = 2; +SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_max_stop_state, + CTLFLAG_RW, &cpu_idle_max_stop_state, 0, ""); static void cpu_idle_powerx(sbintime_t); static void cpu_idle_power9(sbintime_t); #endif @@ -815,6 +818,22 @@ cpu_idle_booke(sbintime_t sbt) static void cpu_idle_powerx(sbintime_t sbt) { + int max_stop_state = cpu_idle_max_stop_state; + + /* Limit maximum stop state to valid values */ + if (max_stop_state < 0) { + /* Don't nap at all, busy wait instead */ + cpu_idle_max_stop_state = -1; + return; + } + if (max_stop_state > 1) { + /* POWER8 and below only support the one stop state, + * i.e. 'nap' + */ + max_stop_state = 1; + cpu_idle_max_stop_state = max_stop_state; + } + /* Sleeping when running on one cpu gives no advantages - avoid it */ if (smp_started == 0) return; @@ -837,9 +856,28 @@ static void cpu_idle_power9(sbintime_t sbt) { register_t msr; + int max_stop_state = cpu_idle_max_stop_state; - msr = mfmsr(); + /* Limit maximum stop state to valid values */ + if (max_stop_state < 0) { + /* Don't stop at all, busy wait instead */ + cpu_idle_max_stop_state = -1; + return; + } + + /* Set maximum transition level to 3, for deepest lossless sleep. + * On POWER9 this is automatically downgraded to the next supported + * stop state (stop2), but other CPUs may support stop3. + */ + if (max_stop_state > 3) { + /* Stop states greater than 3 require register state save and + * restore functionality that is not yet implemented + */ + max_stop_state = 3; + cpu_idle_max_stop_state = max_stop_state; + } + msr = mfmsr(); /* Suspend external interrupts until stop instruction completes. */ mtmsr(msr & ~PSL_EE); /* Set the stop state to lowest latency, wake up to next instruction */ From nobody Tue Jan 21 23:15:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yd33V2jLNz5lk4p; Tue, 21 Jan 2025 23:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yd33V22P9z3J1Y; Tue, 21 Jan 2025 23:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737501350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYhT1diWU0VyJpemecRy8fRy2Qi21gyn7Koi/h0WKTQ=; b=Yg70DsIjFu/aeSd453zVW2Z+ces1pHYp8+pPCaoR4eu+my4KMl+fx6o68epPg/qNxmwIC8 MNoha3zlnx+N503kSZ1NZTrTGuaVhCHerfLBercPPl0ZxNfCwgT3SYOh5rwDUQ0rHnY/+m YckeC1JDyKNz3DhCtEfYEbEcNOV7N/IMPtgjotPI8Mqq9e55OP0v6jV3d5fMvK2+A4p2/O DT7W5XxaYqGznkJmi6vYWoeY2wIdwGLUo42gra1fYsT1IQvJECKp02VFYooQKVjnLA7uwm 5PG1jzAqMgr7mHOKrl+8/M1+7xmr525Snf+vKHLG/McsmM9jzRv9RmJ9E8B72A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737501350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYhT1diWU0VyJpemecRy8fRy2Qi21gyn7Koi/h0WKTQ=; b=T8Oq2U8cIYNXAbcpztlOqTpwcsrTfIJ3okZU4LWcOVAQFFlZOyUmUQk93/ytRSfb08V8Uc r/HY7BXlxF7+mkCiEGlCa0fw13wTrG2s4b2SRwI4sKMh8laQXokWhcvm6TYOwqKFbMHIRU CirQ9CmVGgEpqA0CZULg/s5LTEohiEQpL5tos6K8bhMC7I7n8CLi3lPGZ+lbgbsrVMu6RG Myo4+AENe5dg3q9SZPtlwPdCAlv0ynQzOWiaFEDa/Srv+FgXPpoEbS68rmtLKKbgj0LARm ce0ukA7FED6rCVT79jry1sjNsiFg/LTHOivwPJrYA9Jf9NyosnKi1+fYAAv4oA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737501350; a=rsa-sha256; cv=none; b=UYvkJCEqv9A+pYIbR2VAAfgw9+EFIata0MgF4udzGQUM72HpPIFH1ruPNfpzUV0+Xx/1D/ AoUNVaYQCHYj9yVxGDhOYF3efypdaHcX6KoPCUnqk+xefiwQyVhgFltJ5OaFZDYXyDLT7l Gz5rHRtXr4Yf7hdEPStF1MbUoMh1H1Vyp6Qjz0damS92jZ+TBOUpUsNIsHVihLGAIq8FFs PfRsGq4r8dFre7IsXmqL+18zBbuAZzTE+13cJ8/gdLCF4hLjYO50gMCl1d5pQOjKuyqoeL VBhWI2LaGUpSj3+6iNMKH7nI9mAEQN69xuPgPGCRZyf+LXdMbJDyN25krkx5Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yd33V0rngzBvh; Tue, 21 Jan 2025 23:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50LNFo0B078567; Tue, 21 Jan 2025 23:15:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50LNFo5Z078564; Tue, 21 Jan 2025 23:15:50 GMT (envelope-from git) Date: Tue, 21 Jan 2025 23:15:50 GMT Message-Id: <202501212315.50LNFo5Z078564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 6f0c2938e895 - main - Fix latency spikes on return from stop on POWER9+ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f0c2938e895bd3ddb14f44acf36dba3c6156a3f Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0c2938e895bd3ddb14f44acf36dba3c6156a3f commit 6f0c2938e895bd3ddb14f44acf36dba3c6156a3f Author: Timothy Pearson AuthorDate: 2025-01-20 20:03:40 +0000 Commit: Justin Hibbits CommitDate: 2025-01-21 23:14:41 +0000 Fix latency spikes on return from stop on POWER9+ On POWER9 and higher platforms, cpu_idle_power9() directly control the external interrupt enable lines when entering / exiting stop states. This does not provide needed information to the rest of the kernel regarding the core going into a stop state, and results in random, significant latency spikes (>200ms) due to the stopped core not receiving wakeup interrupts in a deterministic manner. Bring cpu_idle_power9() in line with cpu_idle_powerx() by using spinlock entry / exit to control the interrupt state vs. direct MSR read / write. Signed-off-by: Timothy Pearson --- sys/powerpc/powerpc/cpu.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index 4b8da50cf642..37eb01e2b74f 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -855,7 +855,6 @@ cpu_idle_powerx(sbintime_t sbt) static void cpu_idle_power9(sbintime_t sbt) { - register_t msr; int max_stop_state = cpu_idle_max_stop_state; /* Limit maximum stop state to valid values */ @@ -877,20 +876,30 @@ cpu_idle_power9(sbintime_t sbt) cpu_idle_max_stop_state = max_stop_state; } - msr = mfmsr(); - /* Suspend external interrupts until stop instruction completes. */ - mtmsr(msr & ~PSL_EE); + /* + * Enter spinlock and suspend external interrupts until the stop + * instruction completes. + */ + spinlock_enter(); + + /* Final scheduler checks before core shutdown */ + if (sched_runnable()) { + /* Exit spinlock and re-enable external interrupts */ + spinlock_exit(); + return; + } + /* Set the stop state to lowest latency, wake up to next instruction */ - /* Set maximum transition level to 2, for deepest lossless sleep. */ - mtspr(SPR_PSSCR, (2 << PSSCR_MTL_S) | (0 << PSSCR_RL_S)); - /* "stop" instruction (PowerISA 3.0) */ + mtspr(SPR_PSSCR, (max_stop_state << PSSCR_MTL_S) | (0 << PSSCR_RL_S)); + + /* Shut down core using "stop" instruction (PowerISA 3.0) */ __asm __volatile (".long 0x4c0002e4"); + /* * Re-enable external interrupts to capture the interrupt that caused - * the wake up. + * the wake up. Exit spinlock. */ - mtmsr(msr); - + spinlock_exit(); } #endif From nobody Wed Jan 22 07:35:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdG8G6fdxz5l4Nk; Wed, 22 Jan 2025 07:35: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdG8G5mDSz46P4; Wed, 22 Jan 2025 07:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737531342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPPhfP0Mry8g8mUJdUFPl61q8esfSyV2pX2/bFrxKOo=; b=ye10E9zSZse6jUpFvHQiEaUlEPMz2w7iLk57ZuQqrSXqDc93eFFSmdezmXBR3ac7G9a7RG v4+8+oS5shNDOB8i3Lyl+7RG/72U+M2fMuQFR4ikydSCY5lMJ01S+oT9qWsXpBiNHQ7yeL YldxHSsd2DZfzqYWWM71b6YWh1AkpjKwehKKd02c89KtmQr6ZvV+Q6axzLZ4KyXJzu+OoK N3yEM9mEb94fBZV2EwRHRMRJwFcWyD89jTp+ELkCQxYJlCZgQDK/mrgTARJPTuPwp4NqO5 h18S60MRnWMWPX2TV3//IKqEh45RaR3F9SQH6nC0NlRbOAw946NQ5pVgFHIDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737531342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPPhfP0Mry8g8mUJdUFPl61q8esfSyV2pX2/bFrxKOo=; b=Qp2UGsOpnIU5fGcoiZpDm6xmFNUKZZ7uZUpJi6aAYePAT05clW5zu6llB4YnBZEfYwsfeC 4nd4TIBV63u+eM2PAKiCLcb+zWVV0Vtahk30YCn7jqoUyV/2A+PGEgjTq1phDrT8dqUBP+ dgGoBWMj48LTc3lcFWJYXvqSzAi5g7fXylG1tTHmS2wSEL1Ov4gcKLI9dbBzwwbTmycR22 5A2Np1lRDzM7wMMweuG6QSDegto6gmzHPbGzy4pOOOWmDVBqLcxLxQ7aR8Axpfx6c09bOD PB6eKXNN2+46tRrZcO5kT7tHwu7Le0DtnCDeJjjIoNeMyM3PhzmSd7aFPFUxfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737531342; a=rsa-sha256; cv=none; b=ZPJCB/V999lSHfjnwXNnIjfpLgyfgcwLOcchsVgf5cSQFTuZmEEQ8/M3b7VUqYgex1Sp1Q d53iLNUqRUX0Cmrvp4pN+i8OQoQuKP062QEnf9IC5KDhxwJr9NbfE+p5MuAn2qTB8+GWnC d7KCqpR6kYcrfFqkuU40aIUsXDcdNjepPQZVpFhlv/j56gjGGzV8ehdJB2KC7qfMGb1oUs OKIKMgA+LInHlVI/UtnoVv00X2wYx/RMAyvWhu9AkcFpyZGzXjzr36ufZgupYWmHtXRlkn yu+VZJFZuvUS+AajrDykcpAwciyET8XNpDuapheYhrGWSZJD2XOWS7uKg+dZzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdG8G5Jk3zk6W; Wed, 22 Jan 2025 07:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50M7Zg13014499; Wed, 22 Jan 2025 07:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50M7ZgwU014496; Wed, 22 Jan 2025 07:35:42 GMT (envelope-from git) Date: Wed, 22 Jan 2025 07:35:42 GMT Message-Id: <202501220735.50M7ZgwU014496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 6ba2f08cea8c - main - ls: --group-directories requires stat information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ba2f08cea8cd5c801b78eb8842f7f96bf2d255c Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=6ba2f08cea8cd5c801b78eb8842f7f96bf2d255c commit 6ba2f08cea8cd5c801b78eb8842f7f96bf2d255c Author: Piotr Paweł Stefaniak AuthorDate: 2025-01-21 22:47:30 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2025-01-22 07:29:29 +0000 ls: --group-directories requires stat information Fixes: 8b92977857f8 --- bin/ls/ls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index ca0fb9877b7e..b3d0a508d714 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -547,12 +547,12 @@ main(int argc, char *argv[]) #endif /* - * If not -F, -i, -l, -s, -S or -t options, don't require stat - * information, unless in color mode in which case we do - * need this to determine which colors to display. + * If not -F, -i, -l, -s, -S, -t or --group-directories options, + * don't require stat information, unless in color mode in which case + * we do need this to determine which colors to display. */ if (!f_inode && !f_longform && !f_size && !f_timesort && - !f_sizesort && !f_type + !f_sizesort && !f_type && f_groupdir == GRP_NONE #ifdef COLORLS && !f_color #endif From nobody Wed Jan 22 12:13:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdNJR6C3zz5lNsk; Wed, 22 Jan 2025 12:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdNJR5NTlz3K4H; Wed, 22 Jan 2025 12:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737547991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8NBRVPcg5O7G+zp0MZ0HfXI6jOUW8V+1pcGb8dukSA=; b=NKcSdFV1UL6g1DcBxtLEYVSKbcKg2n5Ztw78ZMaqN8ILcRnODdlAytHqEy9v4xz/DrjkdE F2dToxd/ZShIyKn+zaoBi4B1iVvy9+zdVYADNiYK/HymsHO7H8rP89MBPjGqK5Q/6i3Mbk DKq19WZ2bzta3sgkA8M3YzCVVNCKz5ZrqMqWg1k05T4obpIjM5hoL2gcs/EY/7NY7LX2Zk 8QTha1kua3uDNPhbjPvLQEsPw9rSozrRjyJl34tilWTQLiD/q7OeExWVOSv0vYNFsZAtHS ONW82oz4dN96PUC4dOnBsGEQ5kyhtNOi3HtCYp3eommKxf6JYaTGKF7gURuJWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737547991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8NBRVPcg5O7G+zp0MZ0HfXI6jOUW8V+1pcGb8dukSA=; b=h09/Mg+PNx5ISN4S5we8viPmvNOCobCh3HGExU0QRskwOfY5dKiCMIR44LtfturYTPMnra XSyDnrrMHPaqfgGv9JzMcljheCNjx9yY99s820ouS0rgDjza9kmCNY6nuGB768T0d4gsid wsTjMdpddWOSDU2qxa5WCwoIJCyqv0692diXHT3xLDIUUUScZktiVjqE8ddQbvTi+paPDb YpuGL7mtZJZroIAknKACNkA91YSzyfTruVZqyTcoRgUMnshOUAPA57IxCfX8tBX+azWrjx kPKogVRDmt4eYqMSjime49xCJQvTtnIOjMpPREbyPTSGrR8GBzGPSLVlP58yTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737547991; a=rsa-sha256; cv=none; b=XD4l9Jdlb8bPqBRgQdJz/qBaCUZ0NwTkLTuPYDT7L2P7uBk1/zK14aPc2R0FST+KboB0pf 0/Hc6emMqeiZjNEPqcYaJmioXz1zs7SPsffIADjRdOgDlZUWTiLkpHum/cLRByt6tM12Cb iH+LPnezyac34DChA74Izf39HvMrWdI4Z9NQn4Wz8jvaAlqW5LTr58BmByWnC399jQe56+ CeGvBbAamALcvjME2mRX8sKEqXty7j5MLsaqvaPnf84y1W5BsxUsDq5iGbdtiZTj45Te8e fzkVAw6ayFsOi6Tcf2RyDM16n5HUtnGy7M2S/FZvB7akkCgZ68O/2aEqS3sp9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdNJR4sPJzsgK; Wed, 22 Jan 2025 12:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MCDB6v039729; Wed, 22 Jan 2025 12:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MCDBWt039726; Wed, 22 Jan 2025 12:13:11 GMT (envelope-from git) Date: Wed, 22 Jan 2025 12:13:11 GMT Message-Id: <202501221213.50MCDBWt039726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f6631da0b581 - main - sound tests: Fix gcc build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6631da0b581b28c2bfeea1199b52013bb46aa41 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f6631da0b581b28c2bfeea1199b52013bb46aa41 commit f6631da0b581b28c2bfeea1199b52013bb46aa41 Author: Christos Margiolis AuthorDate: 2025-01-22 12:09:54 +0000 Commit: Christos Margiolis CommitDate: 2025-01-22 12:12:59 +0000 sound tests: Fix gcc build /workspace/src/tests/sys/sound/pcm_read_write.c:36:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration] 36 | } static const afmt_tests[] = { | ^ Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") Sponsored by: The FreeBSD Foundation MFC after: 1 week --- tests/sys/sound/pcm_read_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c index 6bdc578615b5..e40ce52b67cc 100644 --- a/tests/sys/sound/pcm_read_write.c +++ b/tests/sys/sound/pcm_read_write.c @@ -25,7 +25,7 @@ #include /* Generic test data, with buffer content matching the sample values. */ -struct afmt_test_data { +static struct afmt_test_data { const char *label; uint8_t buffer[4]; size_t size; @@ -33,7 +33,7 @@ struct afmt_test_data { intpcm_t value; _Static_assert((sizeof(intpcm_t) == 4), "Test data assumes 32bit, adjust negative values to new size."); -} static const afmt_tests[] = { +} const afmt_tests[] = { /* 8 bit sample formats. */ {"s8_1", {0x01, 0x00, 0x00, 0x00}, 1, AFMT_S8, 0x00000001}, {"s8_2", {0x81, 0x00, 0x00, 0x00}, 1, AFMT_S8, 0xffffff81}, From nobody Wed Jan 22 12:59:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdPKX6wWhz5lS3y; Wed, 22 Jan 2025 12:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdPKX6B7Lz3PX6; Wed, 22 Jan 2025 12:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737550752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2o5QXKNhznFcsb0/44W4IFw938dvcnHkniFe9lhAJ5c=; b=USw+GGZD2hWlawDfllPoyeYHkN2MDnyOYPkYVo8FdgHiIojmEOSeqj2WQPAbrYuqA3yLHq EzQD11rtxh4T7UB6pMdczzcNB8qx9Adgop1TDKbSZBxRktW2rQGhKPaM3SDDVDKHGWDV2g pmy6ebO/q1MxP68ITLa9bFeGFp+q3LTQDiSKI9uIHIZKuFCm74GhB7ZbPlN0YyxTAodgP/ 9ThvyA9zd9DDnQeC6BXrlrb//fZRNNzMyXowfnR4M8J6rE7u+oIugJwTfZkfpmM1nPb2ao /iOAXMjLMFbCFxQBrKrOzSNglnPniiGNHGMR514LLVTsu6IZjZlJHyHaY0fVBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737550752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2o5QXKNhznFcsb0/44W4IFw938dvcnHkniFe9lhAJ5c=; b=iFcwf22IXIn9uFexGK/sL4ewFuJuXhBdL0b7FarWi1L67HuZv0NsDRJZda0cJpi1EJ3gEY ltpjz+WCMgIFxvsa4mtxTaREIlaP9ObhkuH1qSsfHOzWWWSDVWBlcQ19v8xKFAxbVij5WX H/QZzWvGa8QVy0ygJPPlm582aQnGuqMaLi6SDvmhOjS5ofsnY3eS17K+5kxBTP2KQnPkwP rFkrU/CzAY3acZtB+Sz19ki5Efct+QLtXpK89plVYs50fU402VEUPT3rOuabrN7IVoNLED q3HTmiDDm3s1fBx5Mcg2G+7RuzZwUWu4wzBkGBj9u/CkT2am8TTxvWhZBjAa4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737550752; a=rsa-sha256; cv=none; b=Vf3MOmNBpqo1xZZ438boPXgHzm9POWO54NIZQ6Rcyjhly3sZNmFj/eGls2lqBxcxyh1UMy OzbiYelDMH1GkfSQyQHlvB1czZLG8oeKTjQpRrxQ3y2j05lNeZkGodgyzQPvP66igQoJoL IUfeL9WZzOlXAK79n2qEEuGe/qkLq7mGHrmTptPWv6k1YBjvXiXNlUFbFe08dydu0QWU6Z 2DdgiwtW0DMEX/DnwpY4wFkoVu9SvNU4A0w2ZMcXSqtw2G0mOeuYr/Euswe1faGnawx8qU oQv+xW8In6r/7hDZKLIubvjQ5lj3sHAIV+6SYn6j6yucCp8CJ0R4rOkIAlX4gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdPKX57HnztS3; Wed, 22 Jan 2025 12:59:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MCxCPk015558; Wed, 22 Jan 2025 12:59:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MCxC6u015555; Wed, 22 Jan 2025 12:59:12 GMT (envelope-from git) Date: Wed, 22 Jan 2025 12:59:12 GMT Message-Id: <202501221259.50MCxC6u015555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: b9951017bab3 - main - amd64/fpu: Track supervisor state XSAVE components List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9951017bab396e24042e85632e2cc34ee0329ff Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=b9951017bab396e24042e85632e2cc34ee0329ff commit b9951017bab396e24042e85632e2cc34ee0329ff Author: Bojan Novković AuthorDate: 2025-01-15 16:41:24 +0000 Commit: Bojan Novković CommitDate: 2025-01-22 12:58:34 +0000 amd64/fpu: Track supervisor state XSAVE components The amd64/fpu.c xsave_* routines track supported XSAVE components and features. However, they only track supported user state components, and there is currently no way for a consumer to check whether the CPU supports a supervisor state component. Fix this by saving the supported supervisor state components, enumerated by CPUID function 0DH, sub-function 1, in a separate mask. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D48466 --- sys/amd64/amd64/fpu.c | 38 ++++++++++++++++++++++++-------------- sys/x86/include/fpu.h | 5 +++-- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 591bd196ca7d..79d1722268b7 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -164,6 +164,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ +static uint64_t xsave_mask_supervisor; static uint64_t xsave_extensions; static uma_zone_t fpu_save_area_zone; static struct savefpu *fpu_initialstate; @@ -324,6 +325,7 @@ fpuinit_bsp1(void) ctx_switch_xsave[3] |= 0x10; restore_wp(old_wp); } + xsave_mask_supervisor = ((uint64_t)cp[3] << 32) | cp[2]; } /* @@ -421,7 +423,7 @@ fpuinitstate(void *arg __unused) XSAVE_AREA_ALIGN - 1, 0); fpu_initialstate = uma_zalloc(fpu_save_area_zone, M_WAITOK | M_ZERO); if (use_xsave) { - max_ext_n = flsl(xsave_mask); + max_ext_n = flsl(xsave_mask | xsave_mask_supervisor); xsave_area_desc = malloc(max_ext_n * sizeof(struct xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); } @@ -1293,19 +1295,25 @@ fpu_save_area_reset(struct savefpu *fsa) } static __inline void -xsave_extfeature_check(uint64_t feature) +xsave_extfeature_check(uint64_t feature, bool supervisor) { + uint64_t mask; + mask = supervisor ? xsave_mask_supervisor : xsave_mask; KASSERT((feature & (feature - 1)) == 0, ("%s: invalid XFEATURE 0x%lx", __func__, feature)); - KASSERT(feature < flsl(xsave_mask), - ("%s: unsupported XFEATURE 0x%lx", __func__, feature)); + KASSERT(ilog2(feature) <= ilog2(mask), + ("%s: unsupported %s XFEATURE 0x%lx", __func__, + supervisor ? "supervisor" : "user", feature)); } static __inline void -xsave_extstate_bv_check(uint64_t xstate_bv) +xsave_extstate_bv_check(uint64_t xstate_bv, bool supervisor) { - KASSERT(xstate_bv != 0 && ilog2(xstate_bv) < flsl(xsave_mask), + uint64_t mask; + + mask = supervisor ? xsave_mask_supervisor : xsave_mask; + KASSERT(xstate_bv != 0 && ilog2(xstate_bv) <= ilog2(mask), ("%s: invalid XSTATE_BV 0x%lx", __func__, xstate_bv)); } @@ -1317,11 +1325,13 @@ bool xsave_extfeature_supported(uint64_t feature, bool supervisor) { int idx; + uint64_t mask; KASSERT(use_xsave, ("%s: XSAVE not supported", __func__)); - xsave_extfeature_check(feature); + xsave_extfeature_check(feature, supervisor); - if ((xsave_mask & feature) == 0) + mask = supervisor ? xsave_mask_supervisor : xsave_mask; + if ((mask & feature) == 0) return (false); idx = ilog2(feature); return (((xsave_area_desc[idx].flags & CPUID_EXTSTATE_SUPERVISOR) != 0) == @@ -1345,15 +1355,15 @@ xsave_extension_supported(uint64_t extension) */ size_t xsave_area_offset(uint64_t xstate_bv, uint64_t feature, - bool compact) + bool compact, bool supervisor) { int i, idx; size_t offs; struct xsave_area_elm_descr *xep; KASSERT(use_xsave, ("%s: XSAVE not supported", __func__)); - xsave_extstate_bv_check(xstate_bv); - xsave_extfeature_check(feature); + xsave_extstate_bv_check(xstate_bv, supervisor); + xsave_extfeature_check(feature, supervisor); idx = ilog2(feature); if (!compact) @@ -1376,16 +1386,16 @@ xsave_area_offset(uint64_t xstate_bv, uint64_t feature, * 'xstate_bv' and extended region format ('compact'). */ size_t -xsave_area_size(uint64_t xstate_bv, bool compact) +xsave_area_size(uint64_t xstate_bv, bool compact, bool supervisor) { int last_idx; KASSERT(use_xsave, ("%s: XSAVE not supported", __func__)); - xsave_extstate_bv_check(xstate_bv); + xsave_extstate_bv_check(xstate_bv, supervisor); last_idx = ilog2(xstate_bv); - return (xsave_area_offset(xstate_bv, (uint64_t)1 << last_idx, compact) + + return (xsave_area_offset(xstate_bv, (uint64_t)1 << last_idx, compact, supervisor) + xsave_area_desc[last_idx].size); } diff --git a/sys/x86/include/fpu.h b/sys/x86/include/fpu.h index 9d2e43f6386e..c94e058498f6 100644 --- a/sys/x86/include/fpu.h +++ b/sys/x86/include/fpu.h @@ -222,8 +222,9 @@ struct savefpu_ymm { bool xsave_extfeature_supported(uint64_t feature, bool supervisor); bool xsave_extension_supported(uint64_t extension); size_t xsave_area_hdr_offset(void); -size_t xsave_area_offset(uint64_t xstate_bv, uint64_t feature, bool compact); -size_t xsave_area_size(uint64_t xstate_bv, bool compact); +size_t xsave_area_offset(uint64_t xstate_bv, uint64_t feature, bool compact, + bool supervisor); +size_t xsave_area_size(uint64_t xstate_bv, bool compact, bool supervisor); #endif #endif /* !_X86_FPU_H_ */ From nobody Wed Jan 22 14:21:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdR8N44Rjz5lXB5; Wed, 22 Jan 2025 14:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdR8N3HBRz3WlJ; Wed, 22 Jan 2025 14:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737555684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KBUJrbvNscnpZniSYRK/0bGO6J3/SYQ9TKBLhLSLCDo=; b=icuUDBDU+06SL7P3dZuUyViAOXGemHdjodj+tgVWT9/eyNbFRlG3r21KedFUGKJJe85t8c M9VrWc1r480KnjhEILNMg1xlWxo5BH+GDHdw1XcXnXz53wlh2U+g19f/6dbRtfUYMDVWMn ysSJwbZunVP+HyYszH9fGN6uVrGVElVrAUhx/mlJpUn9OaMvBbuDRcHFFx0aQOeWXptZT8 SOnWz+nAon/4jqg4c28m8ovt3DTePnso0jujWZkgCBx9BJaKUjAe5P3mVfIcPtQo5Vm5Bu WGbzbhE4jun2wfQFAbFesLJbkiFrdqqhLKCa3xz1M8MhgO5DQJLM1lokJVr2tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737555684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KBUJrbvNscnpZniSYRK/0bGO6J3/SYQ9TKBLhLSLCDo=; b=t7sfnjbNTWvetWO3ItYE9ZEs6CLOS1qB763LdONJrCYeUMIuH/ZicOAsgRGAj3WCGHvvR2 vsICGtxPxbdXYLkrK86CkFEt3O1uUHW9x7DA7HlwgcXIhRz6tqQu7PenebXP4N3PYCssIy ArAJZrEduUhUGR094l7eVeGV2mER6ryLPcrZwYHZkh0ZrJijuFiLgPEAA4ljm2nfQAJoNq r/IACKs/pDWcMN73bYRYpPmf9kOncZCQykB6U+ixc7sHMB5/386oVpkJOZS0OXfKiMun/a LxWUFIBwq6yc3PWwpLvXZbxcOSu75B84YGz98QaTT/sh1ADEyobld300g3N5jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737555684; a=rsa-sha256; cv=none; b=lHDSAgWoFDS7VvY2qBuQoRwHwiY5yaJGIrzrTi5wIsoSNtqcr4fOXNGdqGteMqicY9s0Gn Nju9E+YlETcHACxOuzujn/JHHtTten1ffxc5/itO0GOlVXbeAcBKx0V+73dJ1veDwfRI5C gIg01wx3hJVC1vcPTDwdIhi9Zbvynp/bB5kBc2vlEcFW1cmAg6VGsiTDEMuDNIzfBpZLE+ SztwY9XUjqoopR8xsOYxECTFwP7eKaQYZ5V26FMs59Hg0nFu5rLDpJ1OkhfYP8UkIr8RDJ z+YQCL5Xw8j4oxFi64QEFQ8MSVh05tB5WmP3OxJm8yQHI8HOVaecN3U2USGKVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdR8N2tNZzwHr; Wed, 22 Jan 2025 14:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MELO2u079690; Wed, 22 Jan 2025 14:21:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MELOxb079687; Wed, 22 Jan 2025 14:21:24 GMT (envelope-from git) Date: Wed, 22 Jan 2025 14:21:24 GMT Message-Id: <202501221421.50MELOxb079687@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: 6e6a67e98652 - main - dtrace tests: Avoid hard-coding paths to required programs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 6e6a67e98652e1477973d031b27ce085d7f200c2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6e6a67e98652e1477973d031b27ce085d7f200c2 commit 6e6a67e98652e1477973d031b27ce085d7f200c2 Author: Mark Johnston AuthorDate: 2025-01-22 14:20:33 +0000 Commit: Mark Johnston CommitDate: 2025-01-22 14:20:33 +0000 dtrace tests: Avoid hard-coding paths to required programs MFC after: 1 week Sponsored by: Innovate UK --- cddl/usr.sbin/dtrace/tests/dtrace.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk index 001dc6253f82..da7c3a440be0 100644 --- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk +++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk @@ -12,7 +12,7 @@ ${TESTGROUP}EXEPACKAGE= ${PACKAGE} TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} -TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh /usr/local/bin/jq /usr/local/bin/perl /usr/local/bin/xmllint" +TEST_METADATA.t_dtrace_contrib+= required_progs="ksh jq perl xmllint" TEST_METADATA.t_dtrace_contrib+= required_user="root" GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh From nobody Wed Jan 22 14:41:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdRbd5PyKz5lYdZ; Wed, 22 Jan 2025 14:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdRbd4jBqz3YMb; Wed, 22 Jan 2025 14:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737556893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1OjnYNBnvHA+9Oont+QYdQRBmIwOnKTrCHEOXUeDAYY=; b=bpHEb4Cb2A1LNZKP2bZO3ydPrpoWRI+hSnrWLya3BPHHEDE8AZM6sXQvmHSK/2mvz6Nv3l JewOdBifayGvIyd2mfgzU56mb8G7VMRiWDsnS7aeXYt7c0C//BQd5V4gurxZqitW+bqPqn vOQ469/dqb+GccO0RO4I6ZXqsoaQmOuN1UlcxyCc9gHp4wASPm2FB65tEtYeEue/bgPlP2 z3jYoDSjpViFzPaLf6acqOjVBLMP00z+CiW3SBPgf+IJyIVU/1W394athR48DGY4B8Z63Q s44RJjdaC36F3l5HsSMhRuAgdPMHrmRng18cJORPihGSwSlvoaxKT+0vImjqRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737556893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1OjnYNBnvHA+9Oont+QYdQRBmIwOnKTrCHEOXUeDAYY=; b=sIs4SUG3ED6Cfy/kXpuKeoeObIE1UfM+w7PaA6v17X9VAkFdd/vqXWt1ydT93OHbwmNhGJ bfnsqwrm6YH02TQeKIcF427Pdyq4LaVhAkLiPJiurewgVvrwGnT0QwyD+fX+/FR/v56wZD zD3AUwW44J0ZdjPnZCPB7y3OGprRvfBFD4AC7dgzRdPjjYHtJ2wXNKPlnprTkDrL6yKMNq NeHeaKH5wVr1RXHgCrkClzzHtLHWRZsoJ5Ncb15VSixVV2v1y+y9zqC8gvfuovoc3a6dO6 6crGlhdsV1MVsWeoWUDq64L13SUTn+CcY2a6Jb9ZA+Ddzn+vg3S8Zk0A1EEp/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737556893; a=rsa-sha256; cv=none; b=pcyKZH7WwAr1pgcfeOY9U4E5r2tYdXE1NndI4PHswG17axC9Ujh3wl1u2Mf5SYe3Y2qNcp 1xE+d8nY90b2KBUxltFe7yNH/bhKsxsjP4N2qwS1nLxM9a96Ajz+BPBf51F5iDB8N+efu2 /Z49hCz0EI5/A1yCbrXuh0OnJRzMxdfUXt6KgZScGFm94Q+s35um4ILbyfcrkQZCFo/z8t ffvL74juVJGZjVZSRc+0GmqPWD8+ftRh4rO9FipxR42HnrEtfB3UJGYg+3CBZ1TXdDIIou U8+bJLgRPA/rJIG3/qniahtfhbfgsbzkk2jNjU8norurqDRyAwQ309DXYI277w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdRbd4Cx7zx1V; Wed, 22 Jan 2025 14:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MEfXRg012906; Wed, 22 Jan 2025 14:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MEfXZS012902; Wed, 22 Jan 2025 14:41:33 GMT (envelope-from git) Date: Wed, 22 Jan 2025 14:41:33 GMT Message-Id: <202501221441.50MEfXZS012902@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: 8ce6b4f2c48e - main - dtrace: Fix the definition of pc_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8ce6b4f2c48eca758fac90b58924f9b2e38fbc49 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ce6b4f2c48eca758fac90b58924f9b2e38fbc49 commit 8ce6b4f2c48eca758fac90b58924f9b2e38fbc49 Author: Mark Johnston AuthorDate: 2025-01-22 14:34:29 +0000 Commit: Mark Johnston CommitDate: 2025-01-22 14:40:50 +0000 dtrace: Fix the definition of pc_t This type is used only to store PC values corresponding to a thread stack trace, so a pointer type is not quite right. Switch to vm_offset_t, as in struct stack, to simplify a port of DTrace to CHERI. No functional change intended. MFC after: 1 week Sponsored by: Innovate UK --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 45201447024e..cfb97c71f262 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -51,7 +51,7 @@ extern "C" { #include #ifndef illumos -typedef uintptr_t pc_t; +typedef vm_offset_t pc_t; typedef u_long greg_t; #endif From nobody Wed Jan 22 14:41:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdRbg1Nryz5lYW2; Wed, 22 Jan 2025 14:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdRbf5Zjkz3YPy; Wed, 22 Jan 2025 14:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737556894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGb4OebYglr4Ed4wB9h7J2gVYu765DDSNHAkUGe+Tio=; b=Kh/lh9TAgpIrpu0dBZdgDvCLr2ojRtB/6+kzymi80imRVRc6Qgt8WvkRClhfNhnD9Cwq9l QOCyzqch7zG2U28Ij5P612ip7PJ8B9jKSx+WI3cVIX3YcccN84m/iAlzwrUiSvFc9y88ll T4DecRsfNsSlyI6tYCKbsYaCTlzaZkJqzFqAn4+lfqKh9ibOKnQQNpCTeNJG1FoFVV/Do2 RMPpOGxlId6E3jImLn7bte079RsOyyxU8hKrYxe0h56iJSqAYzLHOpu41igzu4pws2nhNf tGdWSAKeqNEFZO2wImPq8meLTgx8SD4P72zinBR761tRRqCYck+kFQPh5ojcow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737556894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGb4OebYglr4Ed4wB9h7J2gVYu765DDSNHAkUGe+Tio=; b=gNtLFYytBs29i9AXOKat3CBw+vLrd68eNXFeIM8cSsyPg2kSDl5wKkx504a84nslaNYwuI kqckRFtMOdPjQT1WdeF+HB2TZa4DaEfkmyOLEwk1kszli7iEi4ritNyAWF+6FqypeVforJ 5EnHMZ/SMw1y1IhDGf0aSCwxgX4O853MVF2dweaVSvMFdYciZotgcJcx68S6KVq4wB48Bi vSnHL4hxdXH+GPiLb3Gd+HmBOMR1oK7YclQZ0pofCyfZSXLoB7xu4GtAqKjcgj4dhhDXQz 1hgugxuX59S1+tU5FraqoP50ZRreM7x3Zmw8Op/R9OUg0p8Q1IPB/3Y+tx+nwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737556894; a=rsa-sha256; cv=none; b=HunXGl2XlUxZUqpN/FMxJiikv6zpYH9dEAl2sdHw/Jkz341Xp+LgxTFz9CqsADKwd2CT12 ajX1YbwmbOUyqDWH0oCN+Imrm85BoRfKJFVaAKcQ8SDp/l4to4aNnTuU5xtaDDEDyQMOMp 3/7pyKFm07JN12qf/BFWDnw0cmJS10MUWAO2L3rqHm57CYbYVCqjlYLgfzsi4digFN1iDq tnqo1k8hCxcKxx2rOZpuDdXJWTeg2K2vEOmamKH2bZIkc9jRePPbf0Ru8g1y06ELOFg09s W6SzSOszhgSs8pgNmX0Kd7vYx2yiVuwTUXS+cphuYoJ0RuPpiAAD6rdqRCdzzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdRbf51XQzwkF; Wed, 22 Jan 2025 14:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MEfY4s012940; Wed, 22 Jan 2025 14:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MEfYaU012937; Wed, 22 Jan 2025 14:41:34 GMT (envelope-from git) Date: Wed, 22 Jan 2025 14:41:34 GMT Message-Id: <202501221441.50MEfYaU012937@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: 61c4ac2df7b2 - main - libdtrace: Use C99 designated initializers for dt_idops_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 61c4ac2df7b2b866c8ee5e944aedc96aa79bd315 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=61c4ac2df7b2b866c8ee5e944aedc96aa79bd315 commit 61c4ac2df7b2b866c8ee5e944aedc96aa79bd315 Author: Mark Johnston AuthorDate: 2025-01-22 14:37:55 +0000 Commit: Mark Johnston CommitDate: 2025-01-22 14:40:54 +0000 libdtrace: Use C99 designated initializers for dt_idops_t No functional change intended. MFC after: 1 week Sponsored by: Innovate UK --- .../opensolaris/lib/libdtrace/common/dt_ident.c | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c index 5ff772be041d..d03347d0e7c1 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c @@ -577,51 +577,51 @@ dt_idsize_none(dt_ident_t *idp) } const dt_idops_t dt_idops_assc = { - dt_idcook_assc, - dt_iddtor_sign, - dt_idsize_none, + .di_cook = dt_idcook_assc, + .di_dtor = dt_iddtor_sign, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_func = { - dt_idcook_func, - dt_iddtor_sign, - dt_idsize_none, + .di_cook = dt_idcook_func, + .di_dtor = dt_iddtor_sign, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_args = { - dt_idcook_args, - dt_iddtor_none, - dt_idsize_none, + .di_cook = dt_idcook_args, + .di_dtor = dt_iddtor_none, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_regs = { - dt_idcook_regs, - dt_iddtor_free, - dt_idsize_none, + .di_cook = dt_idcook_regs, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_type = { - dt_idcook_type, - dt_iddtor_free, - dt_idsize_type, + .di_cook = dt_idcook_type, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_thaw = { - dt_idcook_thaw, - dt_iddtor_free, - dt_idsize_type, + .di_cook = dt_idcook_thaw, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_inline = { - dt_idcook_inline, - dt_iddtor_inline, - dt_idsize_type, + .di_cook = dt_idcook_inline, + .di_dtor = dt_iddtor_inline, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_probe = { - dt_idcook_thaw, - dt_iddtor_probe, - dt_idsize_none, + .di_cook = dt_idcook_thaw, + .di_dtor = dt_iddtor_probe, + .di_size = dt_idsize_none, }; static void From nobody Wed Jan 22 15:15:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdSML2YzSz5lbKc; Wed, 22 Jan 2025 15:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdSML1X3Cz3cgC; Wed, 22 Jan 2025 15:15:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737558958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LSndFPKLDOXZorww5tysFEXMl344rykSkNrBVHNPmw4=; b=C887eOTg46UfhW5+QDS4Gu43Atr6oMljCIntChBa7apD3XcZlw7WGsDgVUWskno1dOrzQn Jos4fcDgtidxqMbqWUxOrIFBDpwK2cwQRIoPv8mr0WLLoJ/WWdMHZI6EDFrjJc2D5kSt+Z o+PvRbSdwilCxC+ieJ0ujS8RnUGAHw18PI/9ffNRyMogpfwPsfvbiKm6sLcinNBl9dIuzl sJnZxwKajRtZRGnUf4YQim1SK4Gb+qyXiBc9OcWpcE1urcHMcfPf58L6d/vQTjhkJafdDz oO5m3Y9/JVT3lgdtxjiteRnGjSMKDxylFSN+NY/jBI9d7LAEyjP7BKsty+3pig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737558958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LSndFPKLDOXZorww5tysFEXMl344rykSkNrBVHNPmw4=; b=NiK4M8vFvN2EFKJ2EGR7d9inGLd9ctc7YnGnU190EFbdqWJVyW+PeB/Uo4r7Fcy3FKadAH VCOlMgfCJ3QKZsHKw3f+s/7uHi89rLooS+/K21t2dyYFbiDem+KxK672kX9zETZNuYyTtt 2boW49rhLAjQKhtzHpaQsyg5dk4DMY0uijy7cXq3zpdTaX4m61nA0UvHeRLM5Duz61uNck B72QSbKzMsK4PDQxV64rA/XOf0BDA2tNj1zA1YzqfsXh1I5JDKtlK0MN7FfSLcVxoUQ/Th /FqPffKtTw+B8sW/BgVBqotqPq68RJKPcDB6vAk7YOutQNCPqCq3R7+XiUABKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737558958; a=rsa-sha256; cv=none; b=xfMpT58M8nGD8SD+XPYoNQJ9P/XoTNbsR8Z06Ssvp7flD6bDx1LcpDikelr+KceGhOB4vB S43qm5Lyl9UsRIHiBXA/ilWkJevV6ePooZjp6jaqDH64vwYCrth6qr+6usek/vG48V2jlf mcOb4QJT7JEtN/YPCv3o0W/zuAPcIIXWhPpvH6CJnMKdnCkAEPz77soxqvruCB7WbnSU8F fyCfqapf1CA4wMyJ3VmkuGy9ESP/aT4MSIyCOhtOW0oNchF9TQkXo3W9YbVEUqADJNbbPV gVuDXhoxcq58x23NEuogH3GLa3dQ5ziviXyLupoMMN0deMYlCyQdKQnLK7VAyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdSML0rbkzy5h; Wed, 22 Jan 2025 15:15:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MFFwek077480; Wed, 22 Jan 2025 15:15:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MFFwso077477; Wed, 22 Jan 2025 15:15:58 GMT (envelope-from git) Date: Wed, 22 Jan 2025 15:15:58 GMT Message-Id: <202501221515.50MFFwso077477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: f0d036cf6655 - main - amd64/fpu: Fix build for NODEBUG kernels List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0d036cf665520cead4970b4337d72b077ed5eea Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=f0d036cf665520cead4970b4337d72b077ed5eea commit f0d036cf665520cead4970b4337d72b077ed5eea Author: Bojan Novković AuthorDate: 2025-01-22 15:02:17 +0000 Commit: Bojan Novković CommitDate: 2025-01-22 15:15:32 +0000 amd64/fpu: Fix build for NODEBUG kernels Fixes: b995101 Reported by: Michael Butler (imb@protected-networks.net) --- sys/amd64/amd64/fpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 79d1722268b7..48bfaa53c7b4 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -1297,6 +1297,7 @@ fpu_save_area_reset(struct savefpu *fsa) static __inline void xsave_extfeature_check(uint64_t feature, bool supervisor) { +#ifdef INVARIANTS uint64_t mask; mask = supervisor ? xsave_mask_supervisor : xsave_mask; @@ -1305,16 +1306,19 @@ xsave_extfeature_check(uint64_t feature, bool supervisor) KASSERT(ilog2(feature) <= ilog2(mask), ("%s: unsupported %s XFEATURE 0x%lx", __func__, supervisor ? "supervisor" : "user", feature)); +#endif } static __inline void xsave_extstate_bv_check(uint64_t xstate_bv, bool supervisor) { +#ifdef INVARIANTS uint64_t mask; mask = supervisor ? xsave_mask_supervisor : xsave_mask; KASSERT(xstate_bv != 0 && ilog2(xstate_bv) <= ilog2(mask), ("%s: invalid XSTATE_BV 0x%lx", __func__, xstate_bv)); +#endif } /* From nobody Wed Jan 22 15:26:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdSbg701xz5lc3Z; Wed, 22 Jan 2025 15:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdSbg5yKYz3f9N; Wed, 22 Jan 2025 15:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737559599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyX0uVVAcBsFe49utK2kJnoNFVl8rKFL1ZuFblPEzcA=; b=EPsra4sJsJaU1B97eJnihyXoWww8vPOI8XfDp4hcN0kVqUIf0CTUadv62CiZzaJS8WP+Uh 8lSt5iztFkTWBG8zHMolQcuuz4ltxOGzQirTuCZmbTVL/3Ggai2p4Z+s2v8iL4l+3Pv5KJ l0A7FK3qrHyXTM4u/KMw9puCU1dgPYjDPqoYtamAJVQf5pTluwzuQC4GIJ06fSaLAQmgGP bErG0zmzomTFaeBXezVLPDwVXKJWfyC7hbhRMgRET/N8TsLclWl4Ss1zNNWGr9L+v72fhQ IRgJ2OBxIX36ye1R/FyaIUJqXkoDXZOh+tQvxA+hLcUUt/0R65spzLwc08fRfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737559599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyX0uVVAcBsFe49utK2kJnoNFVl8rKFL1ZuFblPEzcA=; b=nppYW5WxvPGiGDu0RDSgYRjRt3X2vEiNV+cldlQ/Gfzl91SKDyaICmL1hqUYgTAev2rD+m VHLlmLv7TCEt5I7pd+W/l5UEIzUKSLaRNvqXtyXHZSblTO7X+nIxKbypdBbkAsr32q+3W/ kdRFqqitHLYAoHsgiMuVSZ9JAftClyYRyieD/duEjhC/5tW5YUqGoRUCAyEX+c5VyDkfJ1 O9Upn9SaaH5IKK+ZN0XIFXGoqHvJxSdgzw6gCeN3CHJ/hZeGRuegCVwdgtJOfTgd6Ngx4o 6ItrdPGinZ7v/jLvH2v5zwvmQ5N3H1Xf9NAlXUh1Vi+XwBedSjdmeJl46Dsi6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737559599; a=rsa-sha256; cv=none; b=PHerYXLrR6RNQ5H2ETO+c34rzVeLdD33R6uE+pAxwNSRjRLaF0GT6RLMAJpK7I+qDHDS3N 3QCcYXKcE6tetmdalAQjLvdOHZLPahCUYC3Oug/zPNBc2ih3EapI2zQfwj/UpDZhc/7+Ai XPNg6y5cUMYbO1757z1jzq669xD60Z1kdsr/vjzejxtUmezLaZcN/iFamQGP8ZlqduF/aH RjptGqvJJQ0oL2ecvb3arB2Kc1aMABWHNZJJ4kDR00ifi2uZwqZ39Y3XZfcxQBXu2Cc5GH VXr+UvkdD58YWH/sTu3T2RQ8a6G4ipjfGNGfoGK7DNGozzjVhOxlXfgu+6VfHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdSbg5L1jzy1T; Wed, 22 Jan 2025 15:26:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MFQdWR096170; Wed, 22 Jan 2025 15:26:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MFQdF4096167; Wed, 22 Jan 2025 15:26:39 GMT (envelope-from git) Date: Wed, 22 Jan 2025 15:26:39 GMT Message-Id: <202501221526.50MFQdF4096167@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: 8384a19adc88 - main - dtrace/arm64: Simplify variable declarations in the invop handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8384a19adc88ef31794f5aed1d8c5621b7dff8c9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8384a19adc88ef31794f5aed1d8c5621b7dff8c9 commit 8384a19adc88ef31794f5aed1d8c5621b7dff8c9 Author: Mark Johnston AuthorDate: 2025-01-22 15:15:18 +0000 Commit: Mark Johnston CommitDate: 2025-01-22 15:26:30 +0000 dtrace/arm64: Simplify variable declarations in the invop handler Remove some unused variables and reduce the scope of some others. No functional change intended. MFC after: 1 week Sponsored by: Innovate UK --- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index b4dae1cba539..20418e3a475b 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -262,17 +262,15 @@ dtrace_store64(uint64_t *addr, struct trapframe *frame, u_int reg) static int dtrace_invop_start(struct trapframe *frame) { - int data, invop, reg, update_sp; - register_t arg1, arg2; - register_t *sp; - int offs; - int tmp; - int i; + int data, invop, tmp; invop = dtrace_invop(frame->tf_elr, frame, frame->tf_x[0]); tmp = (invop & LDP_STP_MASK); if (tmp == STP_64 || tmp == LDP_64) { + register_t arg1, arg2, *sp; + int offs; + sp = (register_t *)frame->tf_sp; data = invop; arg1 = (data >> ARG1_SHIFT) & ARG1_MASK; From nobody Wed Jan 22 15:40:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdSv872W0z5lclt; Wed, 22 Jan 2025 15:40:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdSv86D9sz3h7k; Wed, 22 Jan 2025 15:40:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737560404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CLPZTFkUF3yjB9dL2HNBMRTORWXaNbGoRWrAxeBNVdU=; b=vZdbNxCG2I/SdqZqdN3jsxmoh3lTtOBGwtsV2PRSroyAyiqABpqo62oVvRhAb3QW977CwT 3sewH8qSaGHzYhLVQmDSWBvCprTUrOHo3pNtERWcA4a+wCzHDEh4EF0TXgSJnNR+1hFd9Z xRrHnXULnFPuerpME4idlf95THtJXSPTHKWYTcygy30aVjrdRiVDAWPot1kGrjx47kyY9e N9tKYIFcRQy+JyFVRT1DVHuxLr9o5D/9bG96hVnO9swC4CvJ0YZ8A97Y20Dj3VeffPqdAZ RAgJDD2kR8bgvW8OPNoxHrlDVh2QjPVXyUpMZlPWepwZfhVw8kKGZ3R/T4zvRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737560404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CLPZTFkUF3yjB9dL2HNBMRTORWXaNbGoRWrAxeBNVdU=; b=cUEo0+VOTCyo8r0PhH0UJpRYhsIbJFyKYj9kQ0WqT9kMckFjiki3eUoDGXYMIC0vlEOKck y7z6IZpeE5D2XTLgLrLQcCH8aPIH6Fv1RJr13J//Z5KgWptBinr7RH8Er0Un3E4jiQEyks 2GMjAct5pNz1qJpirPFDlbV9SF4R8m9om2UAEbibnAQ4vF4Dg/vALBJo3GMWfQngUHT2qh TAk0urzI9lA+ExwkzEq7ScT1jns2WCWfkH1tV/17d49m6hYNXIxvKvJV0hssRCwqgypI7j 9+x8sMltO38ilxkULloh6K9yHZ8BXW63ZyYjGRLRtyJi4h3QHvJPQeoAd68Pbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737560404; a=rsa-sha256; cv=none; b=uO7vLN9lUgxqWhsptjg4rn23/d0V/DjFhp3dcVvuAAtk5FJE6ofuoZ8TlGubbVUT2N7Ha3 027vaYDMU58wZJmoaFXCvnuWWUrr3JxXe98Yl9ESuZpT0oAXWjcqsoc9RNKV2byXxD4Ya8 3v75qC4urrP0Aabt59ZHXe6TWuGljYPqUoGZb/RNRT4GIOf40EiRjLzPuKTwim2JCYDdUr HfQCUWu4qgRaOkzNmAz3cz34G53vhSQtvgkBurSyKdHfJm+S833iQiihI+G74qBNtU1Cuy li4OJW2F4NOj+rcQHxtvhVd1an9Hralx5U0eNhcUwpFPdXusS1IEuqd46O0P7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4200:b830:d5db:419f:2286:1c0d] (unknown [IPv6:2601:5c0:4200:b830:d5db:419f:2286:1c0d]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YdSv843xpz13TT; Wed, 22 Jan 2025 15:40:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 22 Jan 2025 10:40:03 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: b9951017bab3 - main - amd64/fpu: Track supervisor state XSAVE components Content-Language: en-US To: =?UTF-8?Q?Bojan_Novkovi=C4=87?= , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202501221259.50MCxC6u015555@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202501221259.50MCxC6u015555@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/22/25 07:59, Bojan Novković wrote: > The branch main has been updated by bnovkov: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b9951017bab396e24042e85632e2cc34ee0329ff > > commit b9951017bab396e24042e85632e2cc34ee0329ff > Author: Bojan Novković > AuthorDate: 2025-01-15 16:41:24 +0000 > Commit: Bojan Novković > CommitDate: 2025-01-22 12:58:34 +0000 > > amd64/fpu: Track supervisor state XSAVE components > > The amd64/fpu.c xsave_* routines track supported XSAVE components and > features. However, they only track supported user state components, and > there is currently no way for a consumer to check whether the CPU > supports a supervisor state component. Fix this by saving the supported > supervisor state components, enumerated by CPUID function 0DH, > sub-function 1, in a separate mask. > > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D48466 Note that if we add support for supervisor state components we need to be careful to scrub those components from the XSAVE state stored in process core dumps or used with ptrace (e.g. zeroring those regions). This is something Linux does. -- John Baldwin From nobody Wed Jan 22 17:04:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdVn42jHPz5klFW; Wed, 22 Jan 2025 17:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdVn429x8z3rtg; Wed, 22 Jan 2025 17:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737565496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7ML7f4SX/M1I0gCnCyKFvsZTwS2jiNkbPTtBl4rfrk=; b=rt6pDZJ6YexNjyhdpdypv1Zz7Tye7zewy73Xz6spmq37WmsIDakx5yn8XhygfpyCTd5bdI jPuPH0i1DmliZ6K/FOK5FD/0XeSaCGJ3qZd9w/BmFw6PTyy1YE81IexYacsOtWJ4Rr1p/N skUNdUqVoexPoM9eJcwMATxxOMa++fuj3jKhpXGfbTt2SUBIS3TsE0YpA7zJeunp4kUzdY wxuT8Ua8Q6yehioClc6WC4bmykWtVU6R4oAOSePOE2nOwhwdUOJ3NLy4XteDxdrCKYNQue 5dXkttoNFg7TMzooysy0cC9+BfCMznHKWX6rGfizB++Ht99f63veviZ90Dod+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737565496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7ML7f4SX/M1I0gCnCyKFvsZTwS2jiNkbPTtBl4rfrk=; b=YExFZ/WDFB/TSnr27RYsOa9C9aXkQHnszctG89zDSRnHpp+j8kFbK0Z1d69LOaW7cx9KMJ /vNzpz0S0FsRZGpu9mh5wL9lZ076TzsD/1q58iyDLDoJx9RTI33CNpU/oqdQxDdcWjKfzi LTVRpi/O52bIaDxvffVbB8hJKD+Esmi4yF34w+PvvTiRa9JjYlZWYvgn1VIrAQenHdJ7kg U6fSjw1rozc2qXjLsJxUO5MWJX2tnWDWS8OhP6adlGgKrn+/ikTTzKtMfNJET6VchxrxRR 33sudDQxlRZ9AbHiM6CMcA2hS/hvl6OFi2a8Eqk8hWwuezPJKHykyCUvT98nNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737565496; a=rsa-sha256; cv=none; b=jlrg9QU1OH96ZCCo56bujIUibBRRVlhglfmJV0DxH8Y2evUYnFirUiuK7a9MD50n8iH6qF UuE7QlL/HNvfB/HhYqugo5zEhQyPVwnC+9fnXvGHe26uK57b1zY+0ZZV3ENf2u2AbO3nPJ owMp6UvD+1YxqJXMq9O7EAPshK2dg8EbLEH3vBk7QSt4I6Ws39L6Fd8oh27eWo5MC9X+Ds jlf+upmJCvz/o/coLi90p5ZmDaAbSSgO2ysEvxQL5r4OILStG9ImQtCy2mf/HOHOb4AvFf pV2NHISlQB3BjR4v2vL5P7W7mnyxHEfBNoEpgqBwhM1rsEXMfvj9CVvO9k79Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdVn414lkz11wt; Wed, 22 Jan 2025 17:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MH4uol083295; Wed, 22 Jan 2025 17:04:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MH4uiV083292; Wed, 22 Jan 2025 17:04:56 GMT (envelope-from git) Date: Wed, 22 Jan 2025 17:04:56 GMT Message-Id: <202501221704.50MH4uiV083292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 723425f83727 - main - Deprecate publickey(5) stuff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 723425f837270dd3b22098168ae9464a1ebe38c6 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=723425f837270dd3b22098168ae9464a1ebe38c6 commit 723425f837270dd3b22098168ae9464a1ebe38c6 Author: Emmanuel Vadot AuthorDate: 2025-01-22 16:56:58 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-22 17:03:45 +0000 Deprecate publickey(5) stuff This uses DES and it's likely that nobody uses that in 2025. If somebody uses this we help them by deprecating and removing this. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D30682 --- usr.bin/chkey/chkey.1 | 5 +++++ usr.bin/chkey/chkey.c | 1 + usr.bin/keylogin/keylogin.1 | 5 +++++ usr.bin/keylogin/keylogin.c | 1 + usr.bin/keylogout/keylogout.1 | 5 +++++ usr.bin/keylogout/keylogout.c | 1 + usr.bin/newkey/newkey.8 | 5 +++++ usr.bin/newkey/newkey.c | 1 + usr.sbin/keyserv/keyserv.8 | 5 +++++ usr.sbin/keyserv/keyserv.c | 1 + 10 files changed, 30 insertions(+) diff --git a/usr.bin/chkey/chkey.1 b/usr.bin/chkey/chkey.1 index 39a0022199cb..556d6c281d21 100644 --- a/usr.bin/chkey/chkey.1 +++ b/usr.bin/chkey/chkey.1 @@ -25,3 +25,8 @@ database. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c index 8309237990f1..24cb3ec3b0b5 100644 --- a/usr.bin/chkey/chkey.c +++ b/usr.bin/chkey/chkey.c @@ -90,6 +90,7 @@ main(int argc, char **argv) char *cryptpw; #endif + fprintf(stderr, "chkey is deprecated and removed from FreeBSD 15.\n"); while ((ch = getopt(argc, argv, "f")) != -1) switch(ch) { case 'f': diff --git a/usr.bin/keylogin/keylogin.1 b/usr.bin/keylogin/keylogin.1 index 0c89268c7f18..550d670afbe7 100644 --- a/usr.bin/keylogin/keylogin.1 +++ b/usr.bin/keylogin/keylogin.1 @@ -30,3 +30,8 @@ to be used by any secure network services, such as NFS. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogin/keylogin.c b/usr.bin/keylogin/keylogin.c index be38937ea239..c64afa4846bc 100644 --- a/usr.bin/keylogin/keylogin.c +++ b/usr.bin/keylogin/keylogin.c @@ -51,6 +51,7 @@ main(void) char fullname[MAXNETNAMELEN + 1]; struct key_netstarg netst; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (!getnetname(fullname)) { fprintf(stderr, "netname lookup failed -- make sure the "); fprintf(stderr, "system domain name is set.\n"); diff --git a/usr.bin/keylogout/keylogout.1 b/usr.bin/keylogout/keylogout.1 index 52b2340d3ad0..348d7e380ea0 100644 --- a/usr.bin/keylogout/keylogout.1 +++ b/usr.bin/keylogout/keylogout.1 @@ -42,3 +42,8 @@ This will break secure NFS if it is done on a server. .Xr publickey 5 , .Xr keyserv 8 , .Xr newkey 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.bin/keylogout/keylogout.c b/usr.bin/keylogout/keylogout.c index 03eeee0f6417..faad41462340 100644 --- a/usr.bin/keylogout/keylogout.c +++ b/usr.bin/keylogout/keylogout.c @@ -47,6 +47,7 @@ main(int argc, char **argv) { static char secret[HEXKEYBYTES + 1]; + fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); if (geteuid() == 0) { if ((argc != 2 ) || (strcmp(argv[1], "-f") != 0)) { fprintf(stderr, diff --git a/usr.bin/newkey/newkey.8 b/usr.bin/newkey/newkey.8 index b197067fff66..c92a4b8ff208 100644 --- a/usr.bin/newkey/newkey.8 +++ b/usr.bin/newkey/newkey.8 @@ -52,6 +52,11 @@ password of the given username. .Xr keylogin 1 , .Xr publickey 5 , .Xr keyserv 8 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . .Sh NOTES The Network Information Service .Pq NIS diff --git a/usr.bin/newkey/newkey.c b/usr.bin/newkey/newkey.c index 32f449c237b2..ddeaee6914d4 100644 --- a/usr.bin/newkey/newkey.c +++ b/usr.bin/newkey/newkey.c @@ -99,6 +99,7 @@ main(int argc, char *argv[]) struct hostent *h; #endif + fprintf(stderr, "newkey is deprecated and removed from FreeBSD 15.\n"); if (argc != 3 || !(strcmp(argv[1], "-u") == 0 || strcmp(argv[1], "-h") == 0)) { usage(); diff --git a/usr.sbin/keyserv/keyserv.8 b/usr.sbin/keyserv/keyserv.8 index f067c421a333..ca396ef644c9 100644 --- a/usr.sbin/keyserv/keyserv.8 +++ b/usr.sbin/keyserv/keyserv.8 @@ -79,3 +79,8 @@ Display status of DES support (enabled/disabled). .Xr keylogin 1 , .Xr keylogout 1 , .Xr publickey 5 +.Sh HISTORY +The +.Nm +utility was removed from +.Fx 15.0 . diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c index 080798ad84bd..fd8d23d2e9f1 100644 --- a/usr.sbin/keyserv/keyserv.c +++ b/usr.sbin/keyserv/keyserv.c @@ -108,6 +108,7 @@ main(int argc, char *argv[]) register SVCXPRT *transp; struct netconfig *nconf = NULL; + fprintf(stderr, "keyserv is deprecated and removed from FreeBSD 15.\n"); __key_encryptsession_pk_LOCAL = &key_encrypt_pk_2_svc_prog; __key_decryptsession_pk_LOCAL = &key_decrypt_pk_2_svc_prog; __key_gendes_LOCAL = &key_gen_1_svc_prog; From nobody Wed Jan 22 17:04:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdVn541KGz5klHs; Wed, 22 Jan 2025 17:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdVn52hf3z3rnG; Wed, 22 Jan 2025 17:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737565497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=crVOunZJCxQGy1TZaVXrqUnAHkza3o83fpI67F/0E1g=; b=Aw8U945t1OlJVmjNAiLeYLm0MXDyunZqXRgnQOKHEFSv2U0ZYm9cKHppj22SFNfSae0fV3 wZ0HDx5G76G2GqWRDlL9pjcbXHvQYwB9ZPaGvMACwSSSeh9mvbVcmpi3sTnsU56RkH8TNV 887WLy7ZEN2ZGdS2aZ25pGJOL/9J8xsirOYjwvui1022ohlfxri0rvfUEOx9DjDqwkpeaj ejAipxWiQIcEWU7NCVkOtPO599B5og/csc5vTIVwAdHoqoIz4VIWUU3CFsSR/g7fNOrA8B VWcdCmrNbLMKOtmGatReY4ym1/ozCzj0tNjJGyWBjEk6SKK9SPtgnIirUu4MIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737565497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=crVOunZJCxQGy1TZaVXrqUnAHkza3o83fpI67F/0E1g=; b=qJZzoVUCrYVPTCdOqbFrQ/2Q+pmirCHTHpmyRSS3rs7K78SVUOymass/c3d5BMvD0MxqFK dzCvc+pKnhepSv1W8Nwd68/+Ge34O2vVg7MiMtwliSmN/gAnfjIFk6BDa2pi/5AsZnF7qA 1QkQjQXxzTWrkE0qf8o31BZwuxptz2CGFMuE94s2PwfCUVm15TPHgVM+MHuPVozaqjjJRC Qot7IIiSoxa6yRXW1XXri4bZLsgNYkBiEcPFCe2Vw60OotHi9DWLw1GTNDigRprESbmFzA l/pmw6YI4EDfb/g4UcvUZhXcmNLYV2Xr/C1JR9uO6+9ww1T+mzyP0rlh74OH3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737565497; a=rsa-sha256; cv=none; b=ku+eIZsd7AJ+K/XTqRKdpcrsrB0GIqpWbHzaAig66+xLwnojDlp+C5/63RIfb9NjWtGyTk ZgUAWpySTeAJhpvzbw5cYDkEsM1UiBrVNfodEbEF58WrJ/XMr6BAaLzy53460i6T+jyuaP w3UlDnlt+zoencyM2YyUHGrgxtdEXlY20aE47pgP5qCvzB74r5yiCby8UGrl1uiW6puNC0 EZnNDChfh6O6BnbPaHO8W7m4WPkqHh05rtNR+4Wv80Qe3T5HQVF498+K2Tyf9DT4l8PjaF H12/Dqt7Nsrn66EfHGWGpBu+kCLRScPyFndTN6i/gqWEnrRbBHVz1pl1BfKg2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdVn522Nhz11L2; Wed, 22 Jan 2025 17:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MH4vuS083330; Wed, 22 Jan 2025 17:04:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MH4vBJ083327; Wed, 22 Jan 2025 17:04:57 GMT (envelope-from git) Date: Wed, 22 Jan 2025 17:04:57 GMT Message-Id: <202501221704.50MH4vBJ083327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 9dcb984251b3 - main - Remove publickey(5) stuff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dcb984251b35ab1959bcaafcb3f129c8ae2f25b Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9dcb984251b35ab1959bcaafcb3f129c8ae2f25b commit 9dcb984251b35ab1959bcaafcb3f129c8ae2f25b Author: Emmanuel Vadot AuthorDate: 2025-01-22 17:00:09 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-22 17:04:26 +0000 Remove publickey(5) stuff This uses DES and it's likely that nobody uses that in 2025. If somebody uses this we help them by deprecating and removing this. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D30683 --- ObsoleteFiles.inc | 12 + lib/libc/rpc/Makefile.inc | 2 +- usr.bin/Makefile | 4 - usr.bin/chkey/Makefile | 13 - usr.bin/chkey/Makefile.depend | 16 - usr.bin/chkey/Makefile.depend.options | 7 - usr.bin/chkey/chkey.1 | 32 -- usr.bin/chkey/chkey.c | 267 ------------ usr.bin/keylogin/Makefile | 5 - usr.bin/keylogin/Makefile.depend | 18 - usr.bin/keylogin/keylogin.1 | 37 -- usr.bin/keylogin/keylogin.c | 81 ---- usr.bin/keylogout/Makefile | 3 - usr.bin/keylogout/Makefile.depend | 17 - usr.bin/keylogout/keylogout.1 | 49 --- usr.bin/keylogout/keylogout.c | 68 --- usr.bin/newkey/Makefile | 11 - usr.bin/newkey/Makefile.depend | 20 - usr.bin/newkey/extern.h | 45 -- usr.bin/newkey/generic.c | 124 ------ usr.bin/newkey/newkey.8 | 66 --- usr.bin/newkey/newkey.c | 228 ---------- usr.bin/newkey/update.c | 332 --------------- usr.sbin/Makefile | 1 - usr.sbin/keyserv/Makefile | 23 -- usr.sbin/keyserv/Makefile.depend | 20 - usr.sbin/keyserv/crypt_server.c | 265 ------------ usr.sbin/keyserv/keyserv.8 | 86 ---- usr.sbin/keyserv/keyserv.c | 753 ---------------------------------- usr.sbin/keyserv/keyserv.h | 16 - usr.sbin/keyserv/setkey.c | 497 ---------------------- 31 files changed, 13 insertions(+), 3105 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index c05a0d37c727..afb71c46a459 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,18 @@ # xargs -n1 | sort | uniq -d; # done +# 20250122: Remove publickey(5) stuff +OLD_FILES+=usr/bin/chkey +OLD_FILES+=usr/bin/keylogin +OLD_FILES+=usr/bin/keylogout +OLD_FILES+=usr/sbin/keyserv +OLD_FILES+=usr/bin/newkey +OLD_FILES+=usr/share/man/man1/chkey.1.gz +OLD_FILES+=usr/share/man/man1/keylogin.1.gz +OLD_FILES+=usr/share/man/man1/keylogin.1.gz +OLD_FILES+=usr/share/man/man5/publickey.5.gz +OLD_FILES+=usr/share/man/man8/keyserv.1.gz + # 20241206: Remove Altera DE4 drivers OLD_FILES+=usr/share/man/man4/altera_atse.4.gz OLD_FILES+=usr/share/man/man4/altera_avgen.4.gz diff --git a/lib/libc/rpc/Makefile.inc b/lib/libc/rpc/Makefile.inc index 021b7390ca54..5ee4ffc256a2 100644 --- a/lib/libc/rpc/Makefile.inc +++ b/lib/libc/rpc/Makefile.inc @@ -47,7 +47,7 @@ MAN+= bindresvport.3 des_crypt.3 getnetconfig.3 getnetpath.3 getrpcent.3 \ rpc_clnt_create.3 rpc_svc_calls.3 rpc_svc_create.3 rpc_svc_err.3 \ rpc_svc_reg.3 rpc_xdr.3 rpcbind.3 publickey.3 rpc_secure.3 \ rtime.3 -MAN+= publickey.5 rpc.5 netconfig.5 +MAN+= rpc.5 netconfig.5 MLINKS+= bindresvport.3 bindresvport_sa.3 \ des_crypt.3 ecb_crypt.3 \ des_crypt.3 cbc_crypt.3 \ diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 9baa90aab499..bca7896e5a17 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -61,8 +61,6 @@ SUBDIR= alias \ ipcs \ join \ jot \ - keylogin \ - keylogout \ killall \ ktrace \ ktrdump \ @@ -236,8 +234,6 @@ SUBDIR.${MK_NIS}+= ypcat SUBDIR.${MK_NIS}+= ypmatch SUBDIR.${MK_NIS}+= ypwhich SUBDIR.${MK_OPENSSH}+= ssh-copy-id -SUBDIR.${MK_OPENSSL}+= chkey -SUBDIR.${MK_OPENSSL}+= newkey SUBDIR.${MK_QUOTAS}+= quota SUBDIR.${MK_SENDMAIL}+= vacation SUBDIR.${MK_TALK}+= talk diff --git a/usr.bin/chkey/Makefile b/usr.bin/chkey/Makefile deleted file mode 100644 index 4b734787c0a3..000000000000 --- a/usr.bin/chkey/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -.include - -.PATH: ${SRCTOP}/usr.bin/newkey - -PROG= chkey -SRCS= chkey.c generic.c update.c -CFLAGS+= -I${SRCTOP}/usr.bin/newkey -.if ${MK_NIS} != "no" -CFLAGS+= -DYP -.endif -LIBADD+= rpcsvc mp - -.include diff --git a/usr.bin/chkey/Makefile.depend b/usr.bin/chkey/Makefile.depend deleted file mode 100644 index 341f44c61163..000000000000 --- a/usr.bin/chkey/Makefile.depend +++ /dev/null @@ -1,16 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - secure/lib/libcrypto \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/chkey/Makefile.depend.options b/usr.bin/chkey/Makefile.depend.options deleted file mode 100644 index da5bb6f2ea36..000000000000 --- a/usr.bin/chkey/Makefile.depend.options +++ /dev/null @@ -1,7 +0,0 @@ -# This file is not autogenerated - take care! - -DIRDEPS_OPTIONS= NIS - -DIRDEPS.NIS.yes= lib/libmp - -.include diff --git a/usr.bin/chkey/chkey.1 b/usr.bin/chkey/chkey.1 deleted file mode 100644 index 556d6c281d21..000000000000 --- a/usr.bin/chkey/chkey.1 +++ /dev/null @@ -1,32 +0,0 @@ -.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. -.\" -.Dd July 5, 1989 -.Dt CHKEY 1 -.Os -.Sh NAME -.Nm chkey -.Nd change your encryption key -.Sh SYNOPSIS -.Nm -.Sh DEPRECATION NOTICE -.Nm -is deprecated and is not available as of -.Fx 15.0. -.Sh DESCRIPTION -The -.Nm -utility prompts the user for their login password, -and uses it to encrypt a new encryption key -for the user to be stored in the -.Xr publickey 5 -database. -.Sh "SEE ALSO" -.Xr keylogin 1 , -.Xr publickey 5 , -.Xr keyserv 8 , -.Xr newkey 8 -.Sh HISTORY -The -.Nm -utility was removed from -.Fx 15.0 . diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c deleted file mode 100644 index 24cb3ec3b0b5..000000000000 --- a/usr.bin/chkey/chkey.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#include -/* - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -/* - * Command to change one's public key in the public key database - */ -#include -#include -#ifdef YP -#include -#include -#else -#define YPOP_STORE 4 -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "extern.h" - -#ifdef YPPASSWD -struct passwd *ypgetpwuid(uid_t); -#endif - -#ifdef YP -static char *domain; -static char PKMAP[] = "publickey.byname"; -#else -static char PKFILE[] = "/etc/publickey"; -#endif /* YP */ -static char ROOTKEY[] = "/etc/.rootkey"; - -static void usage(void) __dead2; -extern int yp_update(char *, char *, int, char *, size_t, char *, size_t); - -int -main(int argc, char **argv) -{ - char name[MAXNETNAMELEN+1]; - char public[HEXKEYBYTES + 1]; - char secret[HEXKEYBYTES + 1]; - char crypt1[HEXKEYBYTES + KEYCHECKSUMSIZE + 1]; - char crypt2[HEXKEYBYTES + KEYCHECKSUMSIZE + 1]; - int status; - char *pass; - struct passwd *pw; - uid_t uid; - int force = 0; - int ch; -#ifdef YP - char *master; -#endif -#ifdef YPPASSWD - char *cryptpw; -#endif - - fprintf(stderr, "chkey is deprecated and removed from FreeBSD 15.\n"); - while ((ch = getopt(argc, argv, "f")) != -1) - switch(ch) { - case 'f': - force = 1; - break; - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc != 0) - usage(); - -#ifdef YP - (void)yp_get_default_domain(&domain); - if (yp_master(domain, PKMAP, &master) != 0) - errx(1, "can't find master of publickey database"); -#endif - uid = getuid() /*geteuid()*/; - if (uid == 0) { - if (host2netname(name, NULL, NULL) == 0) - errx(1, "cannot convert hostname to netname"); - } else { - if (user2netname(name, uid, NULL) == 0) - errx(1, "cannot convert username to netname"); - } - (void)printf("Generating new key for %s.\n", name); - - if (!force) { - if (uid != 0) { -#ifdef YPPASSWD - pw = ypgetpwuid(uid); -#else - pw = getpwuid(uid); -#endif - if (pw == NULL) { -#ifdef YPPASSWD - errx(1, - "no NIS password entry found: can't change key"); -#else - errx(1, - "no password entry found: can't change key"); -#endif - } - } else { - pw = getpwuid(0); - if (pw == NULL) - errx(1, "no password entry found: can't change key"); - } - } - pass = getpass("Password:"); -#ifdef YPPASSWD - if (!force) { - cryptpw = crypt(pass, pw->pw_passwd); - if (cryptpw == NULL || strcmp(cryptpw, pw->pw_passwd) != 0) - errx(1, "invalid password"); - } -#else - force = 1; /* Make this mandatory */ -#endif - genkeys(public, secret, pass); - - memcpy(crypt1, secret, HEXKEYBYTES); - memcpy(crypt1 + HEXKEYBYTES, secret, KEYCHECKSUMSIZE); - crypt1[HEXKEYBYTES + KEYCHECKSUMSIZE] = 0; - xencrypt(crypt1, pass); - - if (force) { - memcpy(crypt2, crypt1, HEXKEYBYTES + KEYCHECKSUMSIZE + 1); - xdecrypt(crypt2, getpass("Retype password:")); - if (memcmp(crypt2, crypt2 + HEXKEYBYTES, KEYCHECKSUMSIZE) != 0 - || memcmp(crypt2, secret, HEXKEYBYTES) != 0) - errx(1, "password incorrect"); - } - -#ifdef YP - (void)printf("Sending key change request to %s...\n", master); -#endif - status = setpublicmap(name, public, crypt1); - if (status != 0) { -#ifdef YP - errx(1, "unable to update NIS database (%u): %s", - status, yperr_string(status)); -#else - errx(1, "unable to update publickey database"); -#endif - } - - if (uid == 0) { - /* - * Root users store their key in /etc/$ROOTKEY so - * that they can auto reboot without having to be - * around to type a password. Storing this in a file - * is rather dubious: it should really be in the EEPROM - * so it does not go over the net. - */ - int fd; - - fd = open(ROOTKEY, O_WRONLY|O_TRUNC|O_CREAT, 0); - if (fd < 0) { - warn("%s", ROOTKEY); - } else { - char newline = '\n'; - - if (write(fd, secret, strlen(secret)) < 0 || - write(fd, &newline, sizeof(newline)) < 0) - warn("%s: write", ROOTKEY); - } - close(fd); - } - - if (key_setsecret(secret) < 0) - errx(1, "unable to login with new secret key"); - (void)printf("Done.\n"); - exit(0); - /* NOTREACHED */ -} - -static void -usage(void) -{ - (void)fprintf(stderr, "usage: chkey [-f]\n"); - exit(1); - /* NOTREACHED */ -} - - -/* - * Set the entry in the public key file - */ -int -setpublicmap(char *name, char *public, char *secret) -{ - char pkent[1024]; - - (void)sprintf(pkent,"%s:%s", public, secret); -#ifdef YP - return (yp_update(domain, PKMAP, YPOP_STORE, - name, strlen(name), pkent, strlen(pkent))); -#else - return (localupdate(name, PKFILE, YPOP_STORE, - strlen(name), name, strlen(pkent), pkent)); -#endif -} - -#ifdef YPPASSWD -struct passwd * -ypgetpwuid(uid_t uid) -{ - char uidstr[10]; - char *val; - int vallen; - static struct passwd pw; - char *p; - - (void)sprintf(uidstr, "%d", uid); - if (yp_match(domain, "passwd.byuid", uidstr, strlen(uidstr), - &val, &vallen) != 0) { - return (NULL); - } - p = strchr(val, ':'); - if (p == NULL) { - return (NULL); - } - pw.pw_passwd = p + 1; - p = strchr(pw.pw_passwd, ':'); - if (p == NULL) { - return (NULL); - } - *p = 0; - return (&pw); -} -#endif /* YPPASSWD */ diff --git a/usr.bin/keylogin/Makefile b/usr.bin/keylogin/Makefile deleted file mode 100644 index 7a267e4c5a72..000000000000 --- a/usr.bin/keylogin/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -PROG= keylogin - -LIBADD= rpcsvc - -.include diff --git a/usr.bin/keylogin/Makefile.depend b/usr.bin/keylogin/Makefile.depend deleted file mode 100644 index 352a225b19c6..000000000000 --- a/usr.bin/keylogin/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/rpc \ - include/rpcsvc \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/librpcsvc \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/keylogin/keylogin.1 b/usr.bin/keylogin/keylogin.1 deleted file mode 100644 index 550d670afbe7..000000000000 --- a/usr.bin/keylogin/keylogin.1 +++ /dev/null @@ -1,37 +0,0 @@ -.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. -.\" -.Dd September 9, 1987 -.Dt KEYLOGIN 1 -.Os -.Sh NAME -.Nm keylogin -.Nd decrypt and store secret key -.Sh SYNOPSIS -.Nm -.Sh DEPRECATION NOTICE -.Nm -is deprecated and is not available as of -.Fx 15.0. -.Sh DESCRIPTION -The -.Nm -utility prompts the user for their login password, and uses it to decrypt -the user's secret key stored in the -.Xr publickey 5 -database. -Once decrypted, the user's key is stored by the local -key server process -.Xr keyserv 8 -to be used by any secure network services, such as NFS. -.Sh SEE ALSO -.Xr chkey 1 , -.Xr keylogout 1 , -.Xr login 1 , -.Xr publickey 5 , -.Xr keyserv 8 , -.Xr newkey 8 -.Sh HISTORY -The -.Nm -utility was removed from -.Fx 15.0 . diff --git a/usr.bin/keylogin/keylogin.c b/usr.bin/keylogin/keylogin.c deleted file mode 100644 index c64afa4846bc..000000000000 --- a/usr.bin/keylogin/keylogin.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -#include -/* - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -/* - * Set secret key on local machine - */ -#include -#include -#include -#include -#include -#include -#include - -extern int key_setnet(struct key_netstarg *); - -int -main(void) -{ - char fullname[MAXNETNAMELEN + 1]; - struct key_netstarg netst; - - fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); - if (!getnetname(fullname)) { - fprintf(stderr, "netname lookup failed -- make sure the "); - fprintf(stderr, "system domain name is set.\n"); - exit(1); - } - - if (! getsecretkey(fullname, (char *)&(netst.st_priv_key), - getpass("Password:"))) { - fprintf(stderr, "Can't find %s's secret key\n", fullname); - exit(1); - } - if (netst.st_priv_key[0] == 0) { - fprintf(stderr, "Password incorrect for %s\n", fullname); - exit(1); - } - - netst.st_pub_key[0] = 0; - netst.st_netname = strdup(fullname); - - if (key_setnet(&netst) < 0) { - fprintf(stderr, "Could not set %s's secret key\n", fullname); - fprintf(stderr, "Maybe the keyserver is down?\n"); - exit(1); - } - exit(0); - /* NOTREACHED */ -} diff --git a/usr.bin/keylogout/Makefile b/usr.bin/keylogout/Makefile deleted file mode 100644 index 244d6d2d0be7..000000000000 --- a/usr.bin/keylogout/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -PROG= keylogout - -.include diff --git a/usr.bin/keylogout/Makefile.depend b/usr.bin/keylogout/Makefile.depend deleted file mode 100644 index a2d89550fa2b..000000000000 --- a/usr.bin/keylogout/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/rpc \ - include/rpcsvc \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/keylogout/keylogout.1 b/usr.bin/keylogout/keylogout.1 deleted file mode 100644 index 348d7e380ea0..000000000000 --- a/usr.bin/keylogout/keylogout.1 +++ /dev/null @@ -1,49 +0,0 @@ -.Dd April 15, 1989 -.Dt KEYLOGOUT 1 -.Os -.Sh NAME -.Nm keylogout -.Nd delete stored secret key -.Sh SYNOPSIS -.Nm -.Op Fl f -.Sh DEPRECATION NOTICE -.Nm -is deprecated and is not available as of -.Fx 15.0. -.Sh DESCRIPTION -The -.Nm -utility deletes the key stored by the key server process -.Xr keyserv 8 -to be used by any secure network services, such as NFS. -Further access to the key is revoked, -however current session keys may remain valid till they expire, -or are refreshed. -This option will cause any background jobs that need secure RPC -services to fail, and any scheduled -.Nm at -jobs that need the key to fail. -Also since only one copy is kept on a machine of the key, -it is a bad idea to place this in your -.Pa .logout -file since it will affect other sessions on the same machine. -.Pp -The following option is available: -.Bl -tag -width indent -.It Fl f -Forget the rootkey. -This will break secure NFS if it is done on a server. -.El -.Sh SEE ALSO -.Xr chkey 1 , -.Xr keylogin 1 , -.Xr login 1 , -.Xr publickey 5 , -.Xr keyserv 8 , -.Xr newkey 8 -.Sh HISTORY -The -.Nm -utility was removed from -.Fx 15.0 . diff --git a/usr.bin/keylogout/keylogout.c b/usr.bin/keylogout/keylogout.c deleted file mode 100644 index faad41462340..000000000000 --- a/usr.bin/keylogout/keylogout.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -#include -/* - * unset the secret key on local machine - */ - -#include -#include -#include -#include -#include - -int -main(int argc, char **argv) -{ - static char secret[HEXKEYBYTES + 1]; - - fprintf(stderr, "keylogin is deprecated and removed from FreeBSD 15.\n"); - if (geteuid() == 0) { - if ((argc != 2 ) || (strcmp(argv[1], "-f") != 0)) { - fprintf(stderr, -"keylogout by root would break all servers that use secure rpc!\n"); - fprintf(stderr, -"root may use keylogout -f to do this (at your own risk)!\n"); - exit(1); - } - } - - if (key_setsecret(secret) < 0) { - fprintf(stderr, "Could not unset your secret key.\n"); - fprintf(stderr, "Maybe the keyserver is down?\n"); - exit(1); - } - exit(0); - /* NOTREACHED */ -} diff --git a/usr.bin/newkey/Makefile b/usr.bin/newkey/Makefile deleted file mode 100644 index a081774288ac..000000000000 --- a/usr.bin/newkey/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.include - -PROG= newkey -SRCS= newkey.c generic.c update.c -.if ${MK_NIS} != "no" -CFLAGS+= -DYP -.endif -MAN= newkey.8 -LIBADD= rpcsvc mp - -.include diff --git a/usr.bin/newkey/Makefile.depend b/usr.bin/newkey/Makefile.depend deleted file mode 100644 index 67fb1e963614..000000000000 --- a/usr.bin/newkey/Makefile.depend +++ /dev/null @@ -1,20 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/rpc \ - include/rpcsvc \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libmp \ - lib/librpcsvc \ - secure/lib/libcrypto \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/newkey/extern.h b/usr.bin/newkey/extern.h deleted file mode 100644 index 2e8573b4c78c..000000000000 --- a/usr.bin/newkey/extern.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#ifdef YP -#define MAXMAPNAMELEN 256 -#else -#define YPOP_CHANGE 1 /* change, do not add */ -#define YPOP_INSERT 2 /* add, do not change */ -#define YPOP_DELETE 3 /* delete this entry */ -#define YPOP_STORE 4 /* add, or change */ -#endif - -void genkeys(char *, char *, char *); -int setpublicmap(char *, char *, char *); -int mapupdate(char *, char *, u_int, u_int, char *, u_int, char *); -void xencrypt(char *, char *); -void xdecrypt(char *, char *); -int localupdate(char *, char *, u_int, u_int, char *, u_int, char *); diff --git a/usr.bin/newkey/generic.c b/usr.bin/newkey/generic.c deleted file mode 100644 index faf2247376b0..000000000000 --- a/usr.bin/newkey/generic.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user or with the express written consent of - * Sun Microsystems, Inc. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -#include -#include - -#include -#include - -#include -#include -#include - -#include "extern.h" - -static void adjust(char[HEXKEYBYTES + 1], char *); -static void getseed(char *, int, unsigned char *); - -/* - * Generate a seed - */ -static void -getseed(char *seed, int seedsize, unsigned char *pass) -{ - int i; - - for (i = 0; i < seedsize; i++) { - seed[i] = (arc4random() & 0xff) ^ pass[i % 8]; - } -} - -/* - * Generate a random public/secret key pair - */ -void -genkeys(char *public, char *secret, char *pass) -{ - unsigned int i; - -# define BASEBITS (8*sizeof (short) - 1) -# define BASE (1 << BASEBITS) - - MINT *pk = mp_itom(0); - MINT *sk = mp_itom(0); - MINT *tmp; - MINT *base = mp_itom((short)BASE); - MINT *root = mp_itom(PROOT); - MINT *modulus = mp_xtom(HEXMODULUS); - short r; - unsigned short seed[KEYSIZE/BASEBITS + 1]; - char *xkey; - - getseed((char *)seed, sizeof (seed), (u_char *)pass); - for (i = 0; i < KEYSIZE/BASEBITS + 1; i++) { - r = seed[i] % BASE; - tmp = mp_itom(r); *** 2395 LINES SKIPPED *** From nobody Wed Jan 22 18:39:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdXt26dpKz5krwd; Wed, 22 Jan 2025 18:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdXt25vVQz42bg; Wed, 22 Jan 2025 18:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737571162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8H+GfHAYT+zWBTypsxba60HSD746WdFAXLrwYNUrRew=; b=f7ZtcjtgQpmWhx46b7K4r7nd1DFzHhMvDRGEUbUO3w72eo4izMXJgsMnkrHB1eMeUVNhof zbi2kv93eW1JORaKQdDCTqE7i7Vso+p6b2PZVzUCFcWDH8Zdw9QpALhE+m7SZueMnvdevc KWx5EL8t2SgLRakkh5mcfi5WnPILO8jTFucjNUsvDX4OCYGebh6YAZWsabWaka34Nln67X YYdh6NNCc5YAk9fKhhrmlMwP+SNdWp0/ywCKjnpjVIlQLmdylM5Bad4KdVxci00M2NELQk rswaMuZCKemsm7MRZu5Ylc7kW9l+94QHqFv7ifDieurzpyDW25CQ5CM+qQQA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737571162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8H+GfHAYT+zWBTypsxba60HSD746WdFAXLrwYNUrRew=; b=CR1rZVQeOuidC6LzUx0xN05lXRO11S9MZ2vHwwkl91w7Q6wNvgqNP+EihPtRP5Y50+wPQz 9gKXeSVMrcyMJZndjsO2tE4i8PywgQ7PriHswYQTOqCuuSXeBNBIFnw+wVsXedKN21Hne9 4pBh6fJLEOAI1k6UgsF8GqAsQU6IuSNyyI+NpoOs9nc9KhKyMXPQ2/P48fL8ZEQ/z1pk4D REJX1wsKWYingS/XRhWcNTTxYgpyZDlhgZt5a0/kKVTA517Z71AVpRW3l4wsPnaSxxgzAW 0KkDnOCTIOyfOIDc+hp47p2HqKz54Be0n8qfvoNkq57JDdl8ucGqXPyakbwnaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737571162; a=rsa-sha256; cv=none; b=Bwm9WwULrXK/nl4p4e95ZGQL29+GxuMZXAvme2VNZaJ/1t1ij/89AdHQTjIFb1NQx426QF CEQvPWm94Y23JCqy2OKqrjFqNLL9Xk3yuQA8k/laFwjMVl5DAax04FLMjn7ZCQqIT7YzAn fYsA/kMNjT7xOtKGDH5qH5MQyW9exVlxCk1RDoC/igsOkSjRPx6HPoDJrFigXf3323o3fQ O8NJVvZpYxbuH2Q2udCfc1PnOOoARnTzzqRb1aGTjrC7vtY24ZhP7OjJ5RYqqMT0N19t96 WvcrOcj/rK8PUTsSN5dUdDFlPaUri7t1IQwK3qAhxYNIIoWLPUEu39WLMfa4Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdXt24zLKz14Cx; Wed, 22 Jan 2025 18:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MIdMeK053065; Wed, 22 Jan 2025 18:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MIdMIx053062; Wed, 22 Jan 2025 18:39:22 GMT (envelope-from git) Date: Wed, 22 Jan 2025 18:39:22 GMT Message-Id: <202501221839.50MIdMIx053062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: 2a44cccd404d - main - Add option to clear caller-used registers on function return. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a44cccd404d94c273c78e279df3fdc5531d25a2 Auto-Submitted: auto-generated The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=2a44cccd404d94c273c78e279df3fdc5531d25a2 commit 2a44cccd404d94c273c78e279df3fdc5531d25a2 Author: Alexander Leidinger AuthorDate: 2025-01-11 12:48:50 +0000 Commit: Alexander Leidinger CommitDate: 2025-01-22 18:33:23 +0000 Add option to clear caller-used registers on function return. The WITH_ZEROREGS option for src.conf will zero caller-used register contents just before returning from a function, ensuring that temporary values are not leaked beyond the function boundary. This means that register contents are less likely to be available for side channel attacks and information exposures. It reduces all except 1 of the simple "write-what-where" ROP gadgets in /lib: grep "Gadget found" /tmp/before_lib* | wc -l 197 grep "Gadget found" /tmp/after_lib* | wc -l 1 grep "Gadget found" /tmp/after_lib* /tmp/after_libbsdxml.so.4.txt: [+] Gadget found: 0x1b3f1 mov qword ptr [rdi], rcx ; pop rbp ; ret To reproduce: for lib in *.so.*; do echo $lib: ROPgadget --ropchain --binary /tmp/be_mount.Sx87/lib/$lib | sed -n '/Step 1/,/Step 2/p' >! /tmp/before_$lib.txt ROPgadget --ropchain --binary $lib | sed -n '/Step 1/,/Step 2/p' >! /tmp/after_$lib.txt done Additionally, in some cases this reduces the number of all ROP gadgets (quick check with /libs only): libalias.so.7: reduction 10.000% libavl.so.2: reduction 13.900% libbsdxml.so.4: reduction 37.500% libc.so.7: reduction 10.000% libc++.so.1: reduction 14.800% libcam.so.7: reduction 50.700% libcap_netdb.so.1: reduction 5.800% libcasper.so.1: reduction 14.600% libcrypto.so.30: reduction 7.500% libdtrace.so.2: reduction 3.900% libelf.so.2: reduction 15.800% libgcc_s.so.1: reduction 32.700% libibverbs.so.1: reduction 5.300% libicp.so.3: reduction 2.100% libipt.so.0: reduction 28.200% libirdma.so.1: reduction 1.600% libkiconv.so.4: reduction 0% libm.so.5: reduction 21.900% libmd.so.6: reduction 0% libmd.so.7: reduction 3.100% libncursesw.so.9: reduction 11.200% libnvpair.so.2: reduction 40.200% libpcap.so.8: reduction 11.400% libpjdlog.so.0: reduction 27.400% libsbuf.so.6: reduction 2.900% libspl.so.2: reduction 42.300% libsys.so.7: reduction 2.700% libthr.so.3: reduction 21.000% libuutil.so.2: reduction 13.100% libz.so.6: reduction 5.600% libzpool.so.2: reduction 15.100% In some cases it adds some ROP gadgets despite removing the simple ROP gadgets: lib80211.so.1: reduction -32.700% libbe.so.1: reduction -22.300% libbegemot.so.4: reduction -20.500% libcap_dns.so.2: reduction -58.000% libcap_fileargs.so.1: reduction -28.200% libcap_grp.so.1: reduction -54.000% libcap_net.so.1: reduction -28.800% libcap_pwd.so.1: reduction -38.800% libcap_sysctl.so.2: reduction -71.100% libcap_syslog.so.1: reduction -15.000% libcrypt.so.5: reduction -14.600% libctf.so.2: reduction -.300% libcxxrt.so.1: reduction -14.000% libdevstat.so.7: reduction -1.600% libedit.so.8: reduction -4.200% libgeom.so.5: reduction -16.500% libicp_rescue.so.3: reduction -2.300% libipsec.so.4: reduction -31.800% libjail.so.1: reduction -21.700% libkvm.so.7: reduction -5.300% libmlx5.so.1: reduction -6.300% libmt.so.5: reduction -23.000% libnv.so.1: reduction -.400% librss.so.1: reduction -3.800% librt.so.1: reduction -24.000% libssp.so.0: reduction -21.100% libstats.so.0: reduction -9.000% libtinfow.so.9: reduction -3.500% libtpool.so.2: reduction -36.500% libufs.so.8: reduction -11.900% libulog.so.0: reduction -67.400% libumem.so.2: reduction -2.000% libutil.so.9: reduction -7.200% libxo.so.0: reduction -9.000% libzdb.so.2: reduction -11.700% libzfs_core.so.2: reduction -17.700% libzfs.so.4: reduction -.300% libzfsbootenv.so.1: reduction -26.900% libzutil.so.2: reduction -5.600% To reproduce: for lib in *.so.*; do echo -n $lib: before="$(ROPgadget --nosys --nojop --binary /tmp/be_mount.Sx87/lib/$lib | tail -n1 | cut -d : -f 2)" after="$(ROPgadget --nosys --nojop --binary $lib | tail -n1 | cut -d : -f 2)" echo " reduction" $(bc -S 3 -e "(1-${after}/${before})*100")% done >/tmp/reduction.txt Most of the time the size difference is very small (<1% for >50% of the files and >10% for only 2 files): lib80211.so.1: size change .100% libalias.so.7: size change 0% libavl.so.2: size change 0% libbe.so.1: size change .100% libbegemot.so.4: size change .100% libbsdxml.so.4: size change 0% libc.so.7: size change 1.200% libc++.so.1: size change 1.600% libcam.so.7: size change 1.900% libcap_dns.so.2: size change .100% libcap_fileargs.so.1: size change .100% libcap_grp.so.1: size change .100% libcap_net.so.1: size change .100% libcap_netdb.so.1: size change .100% libcap_pwd.so.1: size change .100% libcap_sysctl.so.2: size change .100% libcap_syslog.so.1: size change .100% libcasper.so.1: size change 0% libcrypt.so.5: size change 3.900% libcrypto.so.30: size change 1.400% libctf.so.2: size change .100% libcxxrt.so.1: size change .100% libdevstat.so.7: size change 15.400% exceptional libdtrace.so.2: size change .600% libedit.so.8: size change 1.800% libelf.so.2: size change .100% libgcc_s.so.1: size change 3.000% libgeom.so.5: size change 0% libibverbs.so.1: size change .100% libicp_rescue.so.3: size change .100% libicp.so.3: size change 1.500% libipsec.so.4: size change .100% libipt.so.0: size change 3.100% libirdma.so.1: size change .100% libjail.so.1: size change .100% libkiconv.so.4: size change .100% libkvm.so.7: size change .100% libm.so.5: size change 1.700% libmd.so.6: size change 0% libmd.so.7: size change .100% libmlx5.so.1: size change 0% libmt.so.5: size change .100% libncursesw.so.9: size change 1.900% libnv.so.1: size change 4.300% libnvpair.so.2: size change 4.300% libpcap.so.8: size change 1.200% libpjdlog.so.0: size change .100% librss.so.1: size change .200% librt.so.1: size change .100% libsbuf.so.6: size change .100% libspl.so.2: size change 0% libssp.so.0: size change .100% libstats.so.0: size change .100% libsys.so.7: size change .100% libthr.so.3: size change 2.400% libtinfow.so.9: size change 1.600% libtpool.so.2: size change .100% libufs.so.8: size change .100% libulog.so.0: size change .100% libumem.so.2: size change 54.300% exceptional libutil.so.9: size change .100% libuutil.so.2: size change .100% libxo.so.0: size change .100% libz.so.6: size change .100% libzdb.so.2: size change .300% libzfs_core.so.2: size change .100% libzfs.so.4: size change 2.000% libzfsbootenv.so.1: size change .100% libzpool.so.2: size change 1.200% libzutil.so.2: size change 0% --- share/man/man5/src.conf.5 | 7 ++++++- share/mk/bsd.compiler.mk | 6 ++++++ share/mk/bsd.lib.mk | 9 +++++++++ share/mk/bsd.opts.mk | 3 ++- share/mk/bsd.prog.mk | 9 +++++++++ stand/defs.mk | 1 + tools/build/options/WITHOUT_ZEROREGS | 2 ++ tools/build/options/WITH_ZEROREGS | 4 ++++ 8 files changed, 39 insertions(+), 2 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 88df18b3142e..4d48edff3c80 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd November 22, 2024 +.Dd January 22, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1856,6 +1856,11 @@ Build without support for the IEEE 802.1X protocol and without support for EAP-PEAP, EAP-TLS, EAP-LEAP, and EAP-TTLS protocols (usable only via 802.1X). +.It Va WITH_ZEROREGS +Build the basesystem with code to zero caller-used register contents +on function return. +This prevents leaking temporary values for side channel attacks. +Additionally this reduces the number of usable ROP gadgets for attackers. .It Va WITHOUT_ZFS Do not build the ZFS file system kernel module, libraries such as .Xr libbe 3 , diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index fd236b2e6b8f..bf6ef3956d7d 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -24,6 +24,7 @@ # - retpoline: supports the retpoline speculative execution vulnerability # mitigation. # - init-all: supports stack variable initialization. +# - zeroregs: supports zeroing used registers on return # - aarch64-sha512: supports the AArch64 sha512 intrinsic functions. # # When bootstrapping on macOS, 'apple-clang' will be set in COMPILER_FEATURES @@ -263,6 +264,11 @@ ${X_}COMPILER_FEATURES+= compressed-debug ${X_}COMPILER_FEATURES+= fileprefixmap .endif +.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 150000) || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 110000) +${X_}COMPILER_FEATURES+= zeroregs +.endif + .if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 130000) || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 90000) # AArch64 sha512 intrinsics are supported (and have been tested) in diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index d669dccdc268..cf4140d0b3e6 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -118,6 +118,15 @@ CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-cl .endif .endif +# Zero used registers on return (mitigate some ROP) +.if ${MK_ZEROREGS} != "no" +.if ${COMPILER_FEATURES:Mzeroregs} +ZEROREG_TYPE?= used +CFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} +CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} +.endif +.endif + # bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). .sinclude "bsd.sanitizer.mk" diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index c05de9b079ce..f79c5bc61a20 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -81,7 +81,8 @@ __DEFAULT_NO_OPTIONS = \ RETPOLINE \ STALE_STAGED \ UBSAN \ - UNDEFINED_VERSION + UNDEFINED_VERSION \ + ZEROREGS __DEFAULT_DEPENDENT_OPTIONS = \ MAKE_CHECK_USE_SANDBOX/TESTS \ diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 89534b21d0e7..1894a8b938d0 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -90,6 +90,15 @@ CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-cl .endif .endif +# Zero used registers on return (mitigate some ROP) +.if ${MK_ZEROREGS} != "no" +.if ${COMPILER_FEATURES:Mzeroregs} +ZEROREG_TYPE?= used +CFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} +CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE} +.endif +.endif + # bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). .sinclude "bsd.sanitizer.mk" diff --git a/stand/defs.mk b/stand/defs.mk index fa3c89a4c3cc..f39966f2ca8e 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -11,6 +11,7 @@ FORTIFY_SOURCE= 0 MK_CTF= no MK_SSP= no MK_PIE= no +MK_ZEROREGS= no MAN= .if !defined(PIC) NO_PIC= diff --git a/tools/build/options/WITHOUT_ZEROREGS b/tools/build/options/WITHOUT_ZEROREGS new file mode 100644 index 000000000000..edaf5fd8d6c9 --- /dev/null +++ b/tools/build/options/WITHOUT_ZEROREGS @@ -0,0 +1,2 @@ +Do not build build the basesystem with code to zero caller-used register +contents on function return. diff --git a/tools/build/options/WITH_ZEROREGS b/tools/build/options/WITH_ZEROREGS new file mode 100644 index 000000000000..1fc4b856bd50 --- /dev/null +++ b/tools/build/options/WITH_ZEROREGS @@ -0,0 +1,4 @@ +Build the basesystem with code to zero caller-used register contents +on function return. +This prevents leaking temporary values for side channel attacks. +Additionally this reduces the number of usable ROP gadgets for attackers. From nobody Wed Jan 22 18:44:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdY064tWmz5ksst; Wed, 22 Jan 2025 18:44:38 +0000 (UTC) (envelope-from netchild@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdY064BLcz43Tr; Wed, 22 Jan 2025 18:44:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737571478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LRhwfuYyTHiK00ldykZ381Gf5UKmRa8SH1fOC0b0hmU=; b=sg3r97S8mRC0d3kVdw7DWGQlLkwVGQSYaaRt61zdadIdSM0ONabKR7Wq08V4LusaLFCQeE B71Hk9N3laI3kTpuvQLOn6mwp17ejdbjH0mTZnTmfExat2FDu1B3+0XURGhxGXdSl4iS+Y NiRw9QaPWvjPC9lKai+h2wRuED3iKX5LDsNswxI6rYi993enORt5qE3spV6sK2xyCCbcrj rMkX3mlm/+Li67DvDrgBVi1edFDKABBD/2mvCPnA0ZpL2z97lGptOKROZ3cKh5TD/YFu+F Edop6jn8Zd5TLGtowMeGcGsly1OyMQKtWud8+Ru+3Z4mLXkQiK0y+l3pWwlSVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737571478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LRhwfuYyTHiK00ldykZ381Gf5UKmRa8SH1fOC0b0hmU=; b=RAY/SLisDhOSePIB1rpXa+w9lqXhp3gwq7Y9ylPl9dmeKogF9zbHkc6bNJckLp+70iZXIM zGnfmLnwjqeIZEmkcnVrdKTrdbaSjM9PgJGgETjINidSrZFgYCt/BaIAZqEa17aZLk/hBJ FpjHwXbdkvdMya0l1CigI2AKRe5daZW3/gjf8XLyt8UVpBBpqyASlDFawbSJE1RtTAyhpL sxYqw32nUKI3qIcEkl9WCrOmsmXBMu4Y+YcWB0YCIKCmxBzJGKLQ+YTZV0RJW1QKR/GFvJ bUgFKNffEq5+u58lpBNFGQTWEkUsMYuTjKtVBouC/5e9Vi9da4sr0ICkus6pYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737571478; a=rsa-sha256; cv=none; b=DfTQ9FgBy3qPmSPlFesl3O0vUCFT9q7Fr8UTbw8vBHdJn2RR2S/jzCXVGpha5GxlBIXaVY sYZPiZpAdmqDk8k2dmRIwixvvYcuybQB/bN119bVYkfVxec7THAvM6SMlpYeVJxOaSvxrJ IlZ+qn4AfARu0q71xWRz/wsz+Rrw8192t4Cr3KapX4zt+dToILrY9C8kUAoPmSMQXNZsSf EgpSB56fQGgNEix+eciHCqEMQLn2JVhWVXrSKD/bwHEiZICH+npLogJAviScLLdJcElBLj IZltYe/qbbgdke7HGLNOmgq4xtaYNX+FGnWXtB8T2TJjMfY1qgnsKsmyF/33lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b16583a.dip0.t-ipconnect.de [91.22.88.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "E5" (verified OK)) (Authenticated sender: netchild) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YdY062hfqz17nd; Wed, 22 Jan 2025 18:44:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from webmail.leidinger.net (roundcube.Leidinger.net [192.168.1.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: alexander@leidinger.net) by outgoing.leidinger.net (Postfix) with ESMTPSA id 4CDC140A; Wed, 22 Jan 2025 19:44:33 +0100 (CET) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Date: Wed, 22 Jan 2025 19:44:16 +0100 From: Alexander Leidinger To: src-committers@freebsd.org Cc: dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2a44cccd404d - main - Add option to clear caller-used registers on function return. In-Reply-To: <202501221839.50MIdMIx053062@gitrepo.freebsd.org> References: <202501221839.50MIdMIx053062@gitrepo.freebsd.org> Message-ID: <431de0037dc3f00fbcb596b9cbf2a942@FreeBSD.org> Organization: FreeBSD Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_ca047571fc92c6478f3a074d575502de"; micalg=pgp-sha256 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_ca047571fc92c6478f3a074d575502de Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Am 2025-01-22 19:39, schrieb Alexander Leidinger: > The branch main has been updated by netchild: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=2a44cccd404d94c273c78e279df3fdc5531d25a2 > > commit 2a44cccd404d94c273c78e279df3fdc5531d25a2 > Author: Alexander Leidinger > AuthorDate: 2025-01-11 12:48:50 +0000 > Commit: Alexander Leidinger > CommitDate: 2025-01-22 18:33:23 +0000 > > Add option to clear caller-used registers on function return. I forgot to add: https://reviews.freebsd.org/D48427 Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_ca047571fc92c6478f3a074d575502de Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmeRPJAACgkQEg2wmwP4 2IbQ5g//TRQD8VjX9JsW/Fkc3NFiSJAAss9OkhadL1yCUexoiNDqn75rZ/bwyVFP WPwO/FMvC6z8yorO+J0WzFueSMm96lKL57OIUextE6B7QLF8hgL1q8kLITPN7L9z 66WOGvl+tHnKgsLkJZFh9HJHLsPBEWiYKiB2cuuCbtRlstA2DY/z5b2BcMyshRHj t4ahT8g5wu1kTH/i9h/3HEPy6Llte5rZqNfpMkttz8qFcss34cBM7ODk2qxq4kIu 6B03ogDE3YueoBGNk1wl1f05thLfYQifnpYd8ZfGJ1C7xV/foDIP1pdACXyZDsGy pOGiuxXLPePWJfAxdriSgV6btGJY6rN0MMgBLmgMw3p0wiy+TvH1eG43aPQqY8mZ m8PEPa0XDQxBSbrF6uk0kuRJbCRMI/ngEW9t7MU4d1wdI+9bqkWjeo69A+kLdjMo jabcrfgX9hhVcPrHyGdEVhCCstBbBON3iVB8QZvQtGsTOPgQAK2ZauL5g7Ro7VX9 xyD+TTZfiaksdJaQ7nqq5rj2TcGQnuxtcAwDV43x8WoPEEsCzvmPWDBnRave7lUZ BQnqvI60dAG5gs9pszvzDtxbNozbjL0+IKF1hQiBibp4DQma8VqzFddPUbzr7LgO RiFoDW+h1pmMTNhoDkziHOkqQVkWtOC0Zvf0ZuUoOnsnmVGAK98= =p8Ko -----END PGP SIGNATURE----- --=_ca047571fc92c6478f3a074d575502de-- From nobody Wed Jan 22 19:58:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdZdJ02J1z5kyVP; Wed, 22 Jan 2025 19:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdZdH6WsWz3CPH; Wed, 22 Jan 2025 19:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737575907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=McfUsPJsLpYBQKi4myEfqQ1sRv6eOWyMRce2ZRTXzok=; b=nbytcHBkBqtHu+e4sICmsWJ27694mSRf5ROYadt9DcSzQgM1/Mgll9w1429MQGlMsTTlJ2 iR0CTuNYdnXpgg1MfUJAwrEqKs8mi5AULYeM712LoTFJbRMJQslKS6TVb+ETFlNurk+4Tz MGlPq3FVvGYaj0bVIcq6xtJsb8tz/4oH9huLJCXd4wiq88x2izfc6M07xw4PiaFeHuvkvZ ky2Vxf/1saCfouSn0yywa9Hu5XViLx6gJMMTMh3kon90CprIdFfK4hw97PV4yqXj94RTPi 7buOvPpIl7XgzfP03L8sUFpLzDP/nNMa//1iwzgo1X6Fg8dJiHDlrZPMG14Wjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737575907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=McfUsPJsLpYBQKi4myEfqQ1sRv6eOWyMRce2ZRTXzok=; b=rzJdLZT4sH3DYqnfwsGpfxow9ZlubVhRxmYbAGwik8Q9kXLYIHFmPQRI7Hfwz3l+16dn8L 2C6TzDgU+j9Jig1iJu87i8sVbADQeDnKsHv7WH/HstUsQfKX+HzDRdGzJo1jQUsxl3l6YV ti7W1ZUWxYDxr9nLKQRcYQGZe2pL68aj4g7JYSAwYZfbjMOSndsC9B7Yq6Z3Dt/3IQX61y EkD8nfIE/fFPsdzkfKL7F1pEjoQObI/n0jKtSvB34ZotpgtlZI827SE5rh9db14UCaaTGi 1F3R+EDhUFCRmmkvTGKCT62yZ0vv85rj2WuYB/qQMCVs3e/9RYlqFsl4mO/VIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737575907; a=rsa-sha256; cv=none; b=G1xra2iylhMZOD86CYWZI3Pq+70bJvi8Ov6MTRlBZIGpQqpzL8wI92m5/Ctw/76kzUwql8 3UIZ2nccwzM2o5YTlxdRmbGhz4YN9eUuUXZLiIqz/Ba/lvV3xaULJzqozEyioVGmEMCvtU /GRwEOsuHfQU4YaLXaSksJim7qrObgyxEXFjK/CTxq29EED2X+Md/IbkQ6/7w3zptJ1q5J ZxzrefblwaHUyssyvjk+/onCwqak9rDActf2HYCn23XYCZ71MsdwsEABtPoHj0sLY5h0T+ gxJsqb25aNn5kyM/3db02YsbvBknI6wT5chOg+HXRm9oAVdNZSw0GLx/eXLgVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdZdH5mTkz15W0; Wed, 22 Jan 2025 19:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MJwRck002082; Wed, 22 Jan 2025 19:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MJwRHi002079; Wed, 22 Jan 2025 19:58:27 GMT (envelope-from git) Date: Wed, 22 Jan 2025 19:58:27 GMT Message-Id: <202501221958.50MJwRHi002079@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: 237e9b7f5e90 - main - ctld: Trim trailing whitespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 237e9b7f5e90debb31ae7fd1e0a288e302659bfd Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=237e9b7f5e90debb31ae7fd1e0a288e302659bfd commit 237e9b7f5e90debb31ae7fd1e0a288e302659bfd Author: John Baldwin AuthorDate: 2025-01-18 17:19:41 +0000 Commit: John Baldwin CommitDate: 2025-01-22 19:57:46 +0000 ctld: Trim trailing whitespace Sponsored by: Chelsio Communications --- usr.sbin/ctld/ctld.c | 6 +++--- usr.sbin/ctld/parse.y | 2 +- usr.sbin/ctld/uclparse.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 497e0f6e7600..3136a5d4b7cb 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -945,7 +945,7 @@ isns_register(struct isns *isns, struct isns *oldisns) error = gethostname(hostname, sizeof(hostname)); if (error != 0) log_err(1, "gethostname"); - + if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets)) oldisns = isns; isns_do_deregister(oldisns, s, hostname); @@ -973,7 +973,7 @@ isns_check(struct isns *isns) error = gethostname(hostname, sizeof(hostname)); if (error != 0) log_err(1, "gethostname"); - + res = isns_do_check(isns, s, hostname); if (res < 0) { isns_do_deregister(isns, s, hostname); @@ -1000,7 +1000,7 @@ isns_deregister(struct isns *isns) error = gethostname(hostname, sizeof(hostname)); if (error != 0) log_err(1, "gethostname"); - + isns_do_deregister(isns, s, hostname); close(s); set_timeout(0, false); diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index d8274b623d3a..128a5b4ea042 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -115,7 +115,7 @@ debug: DEBUG STR free($2); return (1); } - + conf->conf_debug = tmp; } ; diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index e9e42bdf953e..b93142ede8a4 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -111,7 +111,7 @@ uclparse_chap_mutual(struct auth_group *auth_group, const ucl_object_t *obj) log_warnx("chap-mutual section in auth-group \"%s\" is missing " "\"mutual-user\" string key", auth_group->ag_name); return (1); - } + } mutual_secret = ucl_object_find_key(obj, "mutual-secret"); if (!secret || secret->type != UCL_STRING) { @@ -317,7 +317,7 @@ uclparse_toplevel(const ucl_object_t *top) log_warnx("\"isns-period\" property value is not integer"); return (1); } - } + } if (!strcmp(key, "isns-timeout")) { if (obj->type == UCL_INT) @@ -462,7 +462,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) it2 = NULL; while ((tmp = ucl_iterate_object(obj, &it2, true))) { const char *value = ucl_object_tostring(tmp); - + an = auth_name_new(auth_group, value); if (an == NULL) return (1); @@ -547,7 +547,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) while ((tmp = ucl_iterate_object(obj, &it2, true))) { if (portal_group_add_listen( - portal_group, + portal_group, ucl_object_tostring(tmp), false) != 0) return (1); @@ -757,7 +757,7 @@ uclparse_target(const char *name, const ucl_object_t *top) target->t_auth_group = auth_group_new(conf, NULL); if (target->t_auth_group == NULL) return (1); - + target->t_auth_group->ag_target = target; } error = auth_group_set_type(target->t_auth_group, @@ -982,7 +982,7 @@ uclparse_conf(struct conf *newconf, const char *path) { struct ucl_parser *parser; ucl_object_t *top; - int error; + int error; conf = newconf; parser = ucl_parser_new(0); From nobody Wed Jan 22 21:28:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydcdf71lTz5l5KY; Wed, 22 Jan 2025 21:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydcdf5tXNz3P1v; Wed, 22 Jan 2025 21:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4CsSMvOZiDAWSNdQg7n0JfZzYxWX76tU3YBpP9lfbxI=; b=TR3q24mTskoHrmG4C6igDoBfDU0g3JjgUZBeii4t65kN8SK2nhpyVPfOf3F03LCP2ys7Hf n4lOfzgk/Ft17y6pLBZUtO0JuZqLWhHqiVXwj5MXmIsJ7ExFMnhUE+7ZHvvYIUZPGbY0Qg JH+16Ry+zdPKtkcH+D2wZGg+IQsl4W3+1/o/evjVnGWxQpnPclN/OZPtc6dKWIrRoEl4RC Q6Cskm7J2Dw+/32G2U/87jg3Zce3PVqj2KNwDFHwe57MCWgHPHRkqJ37rI+dRKJxhxDLXD z05QH8aF+nQJSEIVly5D8BQBE2I7jxNW2/V3cnoNCM76S4IeaLpTFlbe19VDfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4CsSMvOZiDAWSNdQg7n0JfZzYxWX76tU3YBpP9lfbxI=; b=saGbq36aE/gHSDlM3oo772SjfxW9uAZfS4IATaIx3xTU1DlJrlDxTRQdo/L2qNOS+AVkvW j0vLx/xBqIBBh8f4bkW4hr9Qe1Lqn80/NPmrVLbPnP6KNIGP4iXR2yKou+qc334wpER/cQ k7NHd+KixNH+X+glEhwVGj5XZCVSx35EvbB2TNK1oJaFLwndriseK/O13XrA+oHT+syN08 8AEIHJFOihRVcvjvg6u5wgdaUOT+HlhnGTvRSEbt2z27/oQi8l7wxYcdsUv4ap7hVPfLR/ 9M9PsgVT3QI62ag7U9x8kLv9dXOBa6EwpzrZkH6ZTI/o1vtRZy+o6Ads2U6mMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737581334; a=rsa-sha256; cv=none; b=pmgE6OE/t6UswWHhgHrpPRF/vseypC9E/TMsDTCAOaJc5+g/Cx8O214MxBqrzTbmLBD1sX m+MREa9wPYyTWCq4kQH5ss4ZLRIL2gOCB1aPJp0p5dRxExwehf1UfBabLpvVPIH27BfKwV Ljau+AwM20ZR8ExK9W2a2Uhg7z57dpra4O/u+D5rqAh4KZZpoHH8hLHzChlZCOJKcrSZAR Ee6WcL154Na3mkXx43C8kLg8PqEDYtBqaC0u5JBQvlMX2OOBlxJzI0Q7o4FX9M+wbPXN+k N25zYoqfp3eR099vUNYdNOvIGOZlL4Jp9ubz3lgczajpQ68gDy1sDm8yCCw2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydcdf5CG6z18Pg; Wed, 22 Jan 2025 21:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLSswC071688; Wed, 22 Jan 2025 21:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLSsEO071685; Wed, 22 Jan 2025 21:28:54 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:28:54 GMT Message-Id: <202501222128.50MLSsEO071685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: e6061e54d6d4 - stable/14 - fwget: Silence log() when -q is used List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6061e54d6d4c0549b259c7d94630a6511561007 Auto-Submitted: auto-generated The branch stable/14 has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=e6061e54d6d4c0549b259c7d94630a6511561007 commit e6061e54d6d4c0549b259c7d94630a6511561007 Author: Renato Botelho AuthorDate: 2025-01-09 12:16:10 +0000 Commit: Renato Botelho CommitDate: 2025-01-22 21:28:44 +0000 fwget: Silence log() when -q is used Summary: Silence log function when -q parameter is used to prevent undesired output PR: 283939 Reviewed By: manu Differential Revision: https://reviews.freebsd.org/D48391 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 19a6bc9f51e5c5705a2b396b0da61e6536acb4cb) --- usr.sbin/fwget/fwget.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index 3e2181e53b73..d87cd03aa139 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -47,7 +47,9 @@ EOF log() { - echo "$@" + if [ "${QUIET}" != "y" ]; then + echo "$@" + fi } log_verbose() From nobody Wed Jan 22 21:28:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydcdh0rXdz5l5SH; Wed, 22 Jan 2025 21:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydcdg6RWkz3Nyk; Wed, 22 Jan 2025 21:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAA2ZFnbwi0PDHgulbtZBIetRBhX3+YWfo81yK9TUKQ=; b=wOMsDu+dFxpsCuW8yMeQk04GvNsaDinTFkqtdY7rzjHy93Obs4lcg+uVOSb7ZgfsVi0jRD Ngs7yo4tJJYULiT9pQaTd2yVY8mjDJw12tRzGbVIPIN1G7jo4JGOpTyxMluH7LrGi7tX73 SL3hxY9feJ73zytR9RfWd2pUQCxwxoXbXzGrz7VmE6V3FVsI/HsiTaAQK7vZDj4A5Y8Wk+ QkWZF6xtEWcOtLHFLjrxjuHOl2zHtCbthwcwUY5XbvhMkwaea4bUsqofkBGAxMnZmn/gRq Ht50vmE6WkD1oxsqVdtMgA3Ib7TVTqv4ZrVdOae1KYeGeh+fyldrpDhjJY6NTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAA2ZFnbwi0PDHgulbtZBIetRBhX3+YWfo81yK9TUKQ=; b=igF9b0G57dBmvCiBDhQZU4AKyTmvPLyizLEFROkZVCgdw9iPaXsVG8LyKEJNDY03cxtYjd 1jWB6S1l7naPB7jzg5kvT9VAdUrdKuxRlHbNQ4ga4SgnEpc+0snm5O1IOl7/6jUET08DE9 SRyt+iEBf+lo4rtc/N83WyRpLrt8GGEjP8lT9JTtLE2iVUxBYgLIV5IE1aXeU1YvB+8qrc Q2vQdS3HguzWOPg8vhrQ8blmuUPC2oKHaEjUF/aR9gLmZrdCFUI4GV69B84+VOZn6a9J6o Y4ofQTtzxw8yKKXcGM3Kkc6c874vnwjtgJp+cng74xIsQzDS8ORhtrcmmxaGVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737581335; a=rsa-sha256; cv=none; b=msynHhjHeeTNI1GBgVyg0FMTDucW+70woLfgTYuytCBnT00+lSowgvBPeB0tI8QFgi4LzP jWJR0hmIO6fbRX1os5+L3vpE6WefzlrmfVEsss2nbcvM7UiUy6e6A1/oPQQ9OVqtB/OEd+ rkEqwlS0TZ9VwK+2zN4SILLiKiJY6UXvBgMA/ZaLIoKGgEsjnD/mDkttHUYSF/N460FIFa tMZgPaagKIW9unjK4Dzed34jrWJROUaKNpJPhe45nEoyP0DKpYJnizSNahKU7UsNuOaJJM Yq0QNKPqJevVMS46pcGtV4kWDA5IACav4Bu+lj8uY/R09jVJOTJqI3pDs0iK8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydcdg5qr5z18D8; Wed, 22 Jan 2025 21:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLStuZ071722; Wed, 22 Jan 2025 21:28:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLStYV071719; Wed, 22 Jan 2025 21:28:55 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:28:55 GMT Message-Id: <202501222128.50MLStYV071719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Renato Botelho Subject: git: 4cdfa4e8db56 - stable/14 - fwget: Simplify logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: garga X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by garga: URL: https://cgit.FreeBSD.org/src/commit/?id=4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 commit 4cdfa4e8db56460bf5b51974019bd26fdab5a9b4 Author: Renato Botelho AuthorDate: 2025-01-09 14:24:18 +0000 Commit: Renato Botelho CommitDate: 2025-01-22 21:28:45 +0000 fwget: Simplify logic Summary: Use log() to print messages that should be supressed when -q is in use. No functional changes intended. Differential Revision: https://reviews.freebsd.org/D48393 Reviewed By: manu Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fb98fc4755def2cb8ca145751b0e54485d5e2f4a) --- usr.sbin/fwget/fwget.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index d87cd03aa139..138a2a26bfb1 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -120,16 +120,12 @@ done case "${packages}" in ""|^[[:space:]]*$) - if [ "${QUIET}" != "y" ]; then - echo "No firmware packages to install." - fi + log "No firmware packages to install." exit 0 ;; esac -if [ "${QUIET}" != "y" ]; then - echo "Needed firmware packages: '${packages}'" -fi +log "Needed firmware packages: '${packages}'" if [ "${DRY_RUN}" = "y" ]; then if [ "${QUIET}" = "y" ]; then for pkg in ${packages}; do From nobody Wed Jan 22 21:30:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydcg03mypz5l4y3; Wed, 22 Jan 2025 21:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydcg038Vnz3PcD; Wed, 22 Jan 2025 21:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7SLI3WXJYZMO5YsOZtHqtCnNmvKDzwo1l1JuboW51M=; b=k1x6r1EaZsd0njuxHPNEFRRgandA/bMloavOa0XYyU1MVY5+t8BOQQVvtgwfiIsIZPP8qE uVKfs3BeVa9Oql3ZhhfStLfbUcLRNMz6TGjDcfmDaAZR4Bv3HfdBbeeNxflwh+tH35Rgrm q+TEbxXez1Y8KEWpT4YiNmr/cnvi+YmTd6epIy8aVThhh1fGMWZc/6b3wPrnNZTj3n+wWV xhl4e5LsTmdPFoTM15EHxNLa5xLumdgvXNf5EV6J4EZMvfPBl3pjLgafvlgbgm10sLPytj fziSxe8Spt8WzPMxMzo8ppy38aZNnvJ/E+19CFLc7Q45e43cGNid7p3uGC7aOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737581404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7SLI3WXJYZMO5YsOZtHqtCnNmvKDzwo1l1JuboW51M=; b=ByE7k8GcH79NisdlVzQFMxWWp9yJJPuRjlVK0WDv2QX5cX5/Yy0GoyJyjcilGB5kU1TZIE 3JQMrtKrgw8fIbmo71UHoAjklWbyVTtuGOoqOt8ezCQtIy1paqxkjnlYLyN2fjrnWjYUOB b5iBImjye2D2b4aMPRQ9XUWmohkP3sqOKMUGKs1XJl3ewEk50Z2nMYwZ5iTBqfvdBPXyxZ iyjgqKYHAY8ReqSD4agVzPwB/q3nbVdDarmVu52J9nFLo/P/zuDckgkHEopDigg6fdr071 So91RlGe9xAXY1g/83yzJi3EwgOS+wZ+WHOTStpa47yf01dyDq5Aw5G3mC5ZJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737581404; a=rsa-sha256; cv=none; b=FmNncUC5umhqeXcC24ctrk4thEpWdUyMbRlXc52bHzzUZaTcYF/C6991HTPhqlL8kqa/dk CfGvwhD0R31wO7RKbZGeltrG2jviNcv8Cx2KuS6hwGfJtA8chFtQKKmQK43wWAO3dN7+8t HKjtEIPAb769owEfcqwniBQn2d/oONz1vE+ihLFYQo+HmR2VA85LojpGKiHuHUj10kZ9BR FCoEo6eCDZkepeINzTFdaY3DAvyhYdbtRud+jVPd3m2bhzygtGEApIaGi37rc/1lKZuov+ s6avkkzNUoNpAI4r/06yCLuJ2693pmO8jTnxmWILMOm5orqhsMx4VLihGCqKNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydcg02V6Dz182g; Wed, 22 Jan 2025 21:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLU4nu074705; Wed, 22 Jan 2025 21:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLU4n7074700; Wed, 22 Jan 2025 21:30:04 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:30:04 GMT Message-Id: <202501222130.50MLU4n7074700@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: 1e734f15c709 - main - dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configured List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 1e734f15c7099408f45d3b1ea433868d0468916f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1e734f15c7099408f45d3b1ea433868d0468916f commit 1e734f15c7099408f45d3b1ea433868d0468916f Author: Mark Johnston AuthorDate: 2025-01-22 21:26:07 +0000 Commit: Mark Johnston CommitDate: 2025-01-22 21:26:07 +0000 dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configured MFC after: 1 week Sponsored by: Innovate UK --- sys/modules/dtrace/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile index 9a67f517fc5c..3a3769b8b4b5 100644 --- a/sys/modules/dtrace/Makefile +++ b/sys/modules/dtrace/Makefile @@ -27,8 +27,10 @@ SUBDIR+= fasttrap .if ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "powerpc64" +.if !empty(COMPAT_FREEBSD32_ENABLED) SUBDIR+= systrace_freebsd32 .endif +.endif .if ${MACHINE_CPUARCH} != "powerpc" || ${MACHINE_ARCH} == "powerpc64" SUBDIR+= sdt .endif From nobody Wed Jan 22 21:47:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydd2p03Bcz5l6h9; Wed, 22 Jan 2025 21:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydd2n6NsPz3Rs5; Wed, 22 Jan 2025 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7ECSpQEF5zpNdvTCnW9hFsVTELux5whSC+jdxjsacs=; b=NfkiSEhmjHjTdw1kJP4piaLOIC5JfBT51sZj/RDsSBuHodww+fc8uNH+s7A8t3NnTwm0t3 r7rYgWu2GXTWiPCgPneTzqV9lU3a4E4CJZKKGOEz4ZETe1g2h1oUrEU1wZh27aoWPOmT/q SGoI4T716i04h1Xx++Nexv+yXjgwdVNJkeAcQzBJb5znUaS9OPEiEgdzwmGTdbsGX0LP5t UhoHp3uEAuYm8B7jvjBBNj+sBaKluhACi6jOy75sOW3uAPiwkAzFv7uXPVVTnQd8a1I8xB T/2RsQZ06A/c/jkQ9T70xOOaWlF/7woDx7KaznXejtXStTIBqiqJk7/716CHAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I7ECSpQEF5zpNdvTCnW9hFsVTELux5whSC+jdxjsacs=; b=cN1z0DbklP+FWysb5gEF8wC0ZTsCL4BoF6HqaWMR4bxs+Vp8V39T9lmrWHNJiOu2pcgoEa zWoALKPcKrCXJ00C5//0dKs1Y+HePlvl2td2ooUKUK98523JFhbdIkcj/X6HJLqnLnIWGR ER0Dzc3TLVpOfhbDKq7ldkUr/ccgTz0dFksDkRM58BtCchjH2PDu0qOm41qp1qnfqLY4+j mM8Y6UA1iPqb1JB67+VCjyjd9PNVCPVCztGr+4bIwV+HFPfZ91mTFDu8RrI9ohK2ixB3Wy vizaFE3mFK9DD8YQNIuzJSMHGruMSCetheodTtmyIpfp0yLcDGlI3F5gzrI2jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737582433; a=rsa-sha256; cv=none; b=A2ReGi7LFcrQ4svbldoDejlV6Icc+fF5r4rj5t67a2O77GmSB1kqbp9Be/WyL9c2EWxK3U xJ3zoohq06aGylZ7NMxVVhcZDgxT1r57MaVLbqLt1iAxTsLyWI/f8zZg+4MunRJUOzMjUg XqMB/rvU7fcVjgBNYeO0AmZzSbPRLyo5O6KhBXgnCL94coACK7PE2zxrVQgPwWcIZrj30R D7HAPjfc5fGZwewLPo6xScKfCbYRATtYRAd8AlUI+iCQkRpUdpn60bLjyEB5AuPJCUzoAt GgRvJPArFQ69i7TL4tMk/KP+bSjY1JEJ1S/RlEDmhDNUke/aDgR0Dt1V1ZdTPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydd2n5xS3z17yy; Wed, 22 Jan 2025 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLlDfe009044; Wed, 22 Jan 2025 21:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLlDkL009041; Wed, 22 Jan 2025 21:47:13 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:47:13 GMT Message-Id: <202501222147.50MLlDkL009041@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: 40fc36ff2c1d - main - rtwn: fix RTL8192EU power-down / power-up hanging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b commit 40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b Author: Adrian Chadd AuthorDate: 2025-01-11 14:55:28 +0000 Commit: Adrian Chadd CommitDate: 2025-01-22 21:46:57 +0000 rtwn: fix RTL8192EU power-down / power-up hanging The RTL8192EU NIC (on older USB 2/USB 3 ports, not on newer USB 3 ports, that still needs to be fixed!) will attach, scan, associate fine. However, restarting wpa_supplicant results in the NIC hanging until you disconnect it. It turns out early in the power_on sequence - BUT only after a power_off - the NIC would suddenly stop responding to any USB transfers. It doesn't require the MCU to be available for USB transfers - the hardware itself does that - so something had to be going very sideways. I traced it down to these steps during the power_off sequence. They don't exist in the Linux rtl8xxxu driver, and there are commits earlier in their RTL8192EU bring-up that suggest the author was facing similar power sequencing / re-sequencing issues. This likely won't fix the actual channel programming / power sequencing / deafness issues on later USB-3 ports. There are other commits / fixes in the rtl8xxxu driver related to RTL8192EU bring-up that we don't have. Differential Revision: https://reviews.freebsd.org/D48428 Obtained from: Linux rtl8xxxu driver --- sys/dev/rtwn/rtl8192e/r92e_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/rtwn/rtl8192e/r92e_init.c b/sys/dev/rtwn/rtl8192e/r92e_init.c index 925221bdabb1..077c64626f8c 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_init.c +++ b/sys/dev/rtwn/rtl8192e/r92e_init.c @@ -368,6 +368,7 @@ r92e_power_off(struct rtwn_softc *sc) return; } +#if 0 /* SOP option to disable BG/MB. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0xff, R92C_APS_FSMCO_SOP_RCK, 3); @@ -377,12 +378,15 @@ r92e_power_off(struct rtwn_softc *sc) /* Disable small LDO. */ rtwn_setbits_1(sc, R92C_SPS0_CTRL, 0x1, 0); +#endif /* Enable WL suspend. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_AFSM_PCIE, R92C_APS_FSMCO_AFSM_HSUS, 1); +#if 0 /* Enable SW LPS. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_APFM_RSM, 1); +#endif } From nobody Wed Jan 22 21:47:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydd2q0WShz5l6c6; Wed, 22 Jan 2025 21:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydd2p734bz3RY1; Wed, 22 Jan 2025 21:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TK0pwdqMeILTqMAAxMm1YLC9//nDDkiTm7rpk4GuVv4=; b=vhm9j6TINPDsm+H0zvedoyktdTMlmzGsyV6eC/yeq4wdXDxwhZ86TkPZxe4Fbz6iLEL+lx jaKjgiiW51IVgYEK/DO70pOYwE5NQS+aLlvx7rlPS+Vu1Z5xCFZ4ZDSxL5a6ElaLNVmsUk a2VfXpi9FtaYf/7yd0k/fCTOAWiM58CHLp1jVARiXBBEML71Ku6Ux4K6Qehck0zz66rwXK Y8MlQqru4yupvUK8byjC9Dcj/zFD7g5Ih0kx8orN7hMYpxjTDJMtTttUrhJblVSBvAAmMI OsKPfHCeubqCkcZqS8LAXDagcOoDsQJUKdPCbYFzSdh7G5UoJ52DhHNx+jmJOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TK0pwdqMeILTqMAAxMm1YLC9//nDDkiTm7rpk4GuVv4=; b=tD7Ss5t5b1J3zQfYvFZ0J7lESvppwfhhWIJE9093cKluwrQAmeLzi0Ljp4MLzPD+HDn3F8 Wv6ZzyF/EBf4dY7aGHWkv3jsYEf8WsfpwwIfPM1ihxBUgcKIp7L4jWqjzfNjlSKV/OR7dy jwDkoDNwnGqTr8DW2aPn5sPR9ob9mryv1Cpu+spggdEqsU00NpiWaq9grp8gK00TaXP2sn YcnuLHAY8XdEO7NQM20aeGO5f8H7Q21LcezSGR8nCLKkra3nY5hWFTVmblrTmGQS9KFqA1 5SOrerx9AJ53MqW8M7A00EMZ5Zb8HYlhO11Jlfq+ooxvwmb7su02+I3DO9fSKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737582435; a=rsa-sha256; cv=none; b=wcdVzdK/M5NukCJG9AdSXio877YbRmCV7zFWU/3EmPf/ehJWpTcXa8/vCu5troYvccsKPx 4wT8m9/ntjh8/ArKiIrTllHzO9eTR/9JyxQRhmLPUCaOFxkHQkCvEsP9yUMfKFosXAnZTW RmyPRkbH4dc63/9lqjkTq5uChg4qHf9DHYlHLxyBDEu4PEOC7tIO+THGwLo18yVzJ43ogo Xa564bSnQnNb0dHPFuXiqJ5u/ScO51q5CNIekjIkqgw+J8+JgRunkbcokvoZ3Ed6C2xf5M 26/SvT5F3i+NpNd2bNDIB+j9AhXQGPQJK4dGVNt8uSvZdHRxpOIeWd6PurWWQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydd2p6Ywqz18Xg; Wed, 22 Jan 2025 21:47:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLlEXx009076; Wed, 22 Jan 2025 21:47:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLlE27009073; Wed, 22 Jan 2025 21:47:14 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:47:14 GMT Message-Id: <202501222147.50MLlE27009073@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: 5f9a2eec337c - main - rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5f9a2eec337c9cfdbfa800aff8875f5424e847e8 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=5f9a2eec337c9cfdbfa800aff8875f5424e847e8 commit 5f9a2eec337c9cfdbfa800aff8875f5424e847e8 Author: Adrian Chadd AuthorDate: 2025-01-19 01:08:32 +0000 Commit: Adrian Chadd CommitDate: 2025-01-22 21:46:57 +0000 rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu The Linux rtl8xxxu driver has more delays in the RF read and write path. It looks like for writes it's ensuring the hardware is out of power save and that the transition has properly occured. And it looks for reads that it wants a delay after some bit setting, likely some shifting into the RF register space is occuring with a bit set/clear to trigger a load. See rtl8xxxu_write_rfreg() and rtl8xxxu_read_rfreg() for more information. Differential Revision: https://reviews.freebsd.org/D48512 Obtained from: Linux rtl8xxxu --- sys/dev/rtwn/rtl8192e/r92e_rf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/rtwn/rtl8192e/r92e_rf.c b/sys/dev/rtwn/rtl8192e/r92e_rf.c index 8e05a827262b..478945d13c85 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_rf.c +++ b/sys/dev/rtwn/rtl8192e/r92e_rf.c @@ -64,7 +64,9 @@ r92e_rf_read(struct rtwn_softc *sc, int chain, uint8_t addr) RW(val, R92C_HSSI_PARAM2_READ_ADDR, addr) & ~R92C_HSSI_PARAM2_READ_EDGE); + rtwn_delay(sc, 10); rtwn_bb_setbits(sc, R92C_HSSI_PARAM2(0), R92C_HSSI_PARAM2_READ_EDGE, 0); + rtwn_delay(sc, 100); rtwn_bb_setbits(sc, R92C_HSSI_PARAM2(0), 0, R92C_HSSI_PARAM2_READ_EDGE); rtwn_delay(sc, 20); @@ -82,5 +84,6 @@ r92e_rf_write(struct rtwn_softc *sc, int chain, uint8_t addr, uint32_t val) rtwn_bb_setbits(sc, 0x818, 0x20000, 0); rtwn_bb_write(sc, R92C_LSSI_PARAM(chain), SM(R88E_LSSI_PARAM_ADDR, addr) | SM(R92C_LSSI_PARAM_DATA, val)); + rtwn_delay(sc, 1); rtwn_bb_setbits(sc, 0x818, 0, 0x20000); } From nobody Wed Jan 22 21:47:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydd2r33ssz5l6L7; Wed, 22 Jan 2025 21:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydd2r12wpz3Rs9; Wed, 22 Jan 2025 21:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+eyoehiscLNblr88X601EZ95lLrWbaQXQx07ljs3Zo=; b=f71Bjtmj2T5Yjf8+MUq1/6E4WXNXYGygY7jXjTlHRUS5ACsvgWz21R4wpCiz6bJKDIUD6M 6gT7O/vEGPQ5BKvV7T6i4JWwdyJ8sbpfOnAnNvw56DhM+Bcm3KFFHY56yaKLTqq/tEMQAF NQMtSVr23iAQwgGpCRcxuDIxz+tot3OLFBVrdAaQCH1UMktdf90zCLa6zKNG7CTrtQsu8o 0ZMQL6KbDo+zh0vcpgiPm8YHAKy/9bIohspi5gl7inKKupI5QXcS1zmGjDB4aN8INcp/Ul yarIF6XcxabT5AWt4jyBlK3rFnZEG6+wh+e9j5x+BAZiF5ITDoxOHHVuoAy8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+eyoehiscLNblr88X601EZ95lLrWbaQXQx07ljs3Zo=; b=QWoBp5PI9p9mCFZGi+mhDTuSDqkajiN0SsdrZYKX3fQaWxx9wW0UPGPPc1YbAzmYZlqC5w HibAEznAmcBiiKslObipjd4j05Sjn+Lat3STPQ+U5sm63VP9jdv/XnvnFjeO8s2mnefsfc iJlTGESw73ie8tX35+YIeNFus7nnpcD10VAEjbDMhy85bwmCQCvHiI2JBGxfsfGORm0SBi U1Tp8kIYBueRa3Q0Vdq1aMfr6mW6r4iDRHt0mtvkQp64NNcYoVcShIzP/tBh6Ie0zaeUR3 iJFnBg5bs2Rm8CCR4otfuczY632HSXgjobA/dFKuUj7yvDaVQKwibHbaQyo/EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737582436; a=rsa-sha256; cv=none; b=LUwbVjXobuAOe367etSn117hjQvDbyxWSX8JJrh90xhrMdaaWVJC19E66RuwUhAHvIKpY3 FAzF7U8yV67vWaoQB8gqmomSC36LbBFfh8CC3/WEYecpPspWtg7SFtPG2zB5/0CnL30aGy vw1AqZqBT+nM/56/FxWwLCu/GFBy7SS2y5l6jGxDJiG4A2/jw1jwxQaUpxp+iqH9gm+MUH P4b+Gi9POQ9nmA0ZcpmBR4vlAR58ce/wg3liEbAkfGl1LetwPhkOh98o9x0m82GVQZBT+d 1wiiID0FFnKpMGiOIITwyklbfGOCf5Dq4TU1bK/lRQv2JcxcFHWBC0a+WV9X7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydd2r0NnTz18lV; Wed, 22 Jan 2025 21:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLlFIM009108; Wed, 22 Jan 2025 21:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLlFNa009105; Wed, 22 Jan 2025 21:47:15 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:47:15 GMT Message-Id: <202501222147.50MLlFNa009105@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: 043d6a24b290 - main - rtwn: add workaround sleep in r92e_set_chan() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 043d6a24b29030989fdf2b79c5ff90391f859225 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=043d6a24b29030989fdf2b79c5ff90391f859225 commit 043d6a24b29030989fdf2b79c5ff90391f859225 Author: Adrian Chadd AuthorDate: 2025-01-19 20:16:55 +0000 Commit: Adrian Chadd CommitDate: 2025-01-22 21:46:57 +0000 rtwn: add workaround sleep in r92e_set_chan() It /looks/ like there's some weirdness in initial frame send after the chip programming / channel change. Linux rtl8xxxu has no sleeps here, instead it just retries the auth frame a few times. My guess is there's some sequencing going on here between finishing the programming, doing a calibration run and then sending the initial frame. Instead of doing sleeps on every write during the RF channel change, this 10ms sleep at the end is enough to reliably associate in my test environment (12-core intel laptop, USB-3 port.) It's not required for an earlier 2-core haswell laptop w/ USB-3. See the PR for more information. PR: kern/247528 Differential Revision: https://reviews.freebsd.org/D48517 --- sys/dev/rtwn/rtl8192e/r92e_chan.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/rtwn/rtl8192e/r92e_chan.c b/sys/dev/rtwn/rtl8192e/r92e_chan.c index 4c7121a80c89..4cf17433d257 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_chan.c +++ b/sys/dev/rtwn/rtl8192e/r92e_chan.c @@ -252,4 +252,28 @@ r92e_set_chan(struct rtwn_softc *sc, struct ieee80211_channel *c) /* Set Tx power for this new channel. */ r92e_set_txpower(sc, c); + + /* + * Work around some timing issues with RTL8192EU on faster + * CPUs / USB-3 ports by sleeping for 10ms. + * + * Without this delay the initial frame send during authentication + * doesn't occur. + * + * My (adrian) guess is that there's a race condition between + * everything being programmed into the hardware and the first + * send. Notably, TXPAUSE isn't 0x0 after rf init, + * which the rtl8xxxu driver has a commit to address (c6015bf3ff1ff) + * - wifi: rtl8xxxu: fixing transmission failure for rtl8192eu + * + * Although it's hard to do due to locking constraints, reading + * TXPAUSE during scan / association shows it's non-zero, which + * needs to be looked at in more depth. + * + * Linux doesn't have a delay here, however it does try multiple + * times to send an authentication frame. + * + * See PR/247528 for more info. + */ + rtwn_delay(sc, 10000); } From nobody Thu Jan 23 03:12:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdmGX2w1Dz5lVhd; Thu, 23 Jan 2025 03:12: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdmGX1mq1z45lB; Thu, 23 Jan 2025 03:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737601972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2gLejA5rLogLpmI7G/XuuUqKQe+rNfb9zDx9fL5t7r4=; b=eZrGgVwxo9vi81a9aqXXjShi7V8xFJjHu1N8WVCJF9jBnKO4VZZpm4dAH1TlxttorlRCwo YYqccD9avFWJCHzvnxVNlWB+2uFLrbKgD/hYqBM/97j1LXldHgDS3L8vzhI3iXJy7szSD8 PUnBHdIieLwUPH1wZ81fDwTg1I/OiwF85BSXhuxWUXEAOgHtZIXcg+NyJWhvdLYX8ai70x jgi6YrVwgAJ13/4R/TY+0jDtbjvjDe3n/ZlDw0NJGAkrk/6fRnrKjO5wYkBEFAoV+cyADA rjN8twshHITuYDAh480ayID9sjeNaYP6mY7I/Fk+VcDWirHf8NjIWfd9QB3ZZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737601972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2gLejA5rLogLpmI7G/XuuUqKQe+rNfb9zDx9fL5t7r4=; b=OCdY0dwTGzdxXKcqmr9AkcD562CQoWwGvvBldJwOrOLxiEj2/RRzrtxr8s79GWmbUo9Yd0 +70BkyVg5mtgE320RRknDA/01aXHCLBhH6diGVdgnxn6GJJwXkO239lkjl4l8gsD9EA0vg hQgRcYbYX+kkXe+z9W542iPE7TVq5LKOK9qh+aFgAwpPZp/uYlnXgMHsCoFodmCvnws23q 8b8ABJXBRQ2zISpphvdzO8zPQdP0a9yQqEi7p8EL8ORabFnUWyqiOqTd6lruh49CVDjQsN q91otbf9C/PoVDK5seHYQ/BX8Dg9pA2kHWuSRSlu1+toDZxPY2iOf2jceqs3mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737601972; a=rsa-sha256; cv=none; b=yhxZ7gpOYKsz2Uel8vzxWTPJ6BejuYF7SXmqHOeLzImyq0iHv0pvBpNCUnwr3Kddb4KbvR QWVFTWxH0E7MPvFHs7ByX5XIUk6mf+zLPmtaOpuNkPTtMMwH8KVs7Dpo6CeH0wNXSWnqZ6 Bu62RNuwvNxBWG7+Ra1ypDQNrbs2zjXgWa8OEOO+c0BqzNINPphIgMzhEUQWNFCD8A+cVY zzj5pWR2bjpRB1CtDmzl7nAvSiocrxcTXCskwYqfIaQvOXdyS/ORT6DolBkj/7f7/ZOx2A 6b5Q/GoxZUdlXeQ1JsyLqbzep3n6C65mBY2wU7QWcoYinidcrSCwBx2myPyrXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdmGX1C0Nz5NX; Thu, 23 Jan 2025 03:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N3CqPW025247; Thu, 23 Jan 2025 03:12:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N3CqB2025244; Thu, 23 Jan 2025 03:12:52 GMT (envelope-from git) Date: Thu, 23 Jan 2025 03:12:52 GMT Message-Id: <202501230312.50N3CqB2025244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: f486ebb5e36b - main - libsecureboot/README.rst clarify use of gpg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f486ebb5e36b0dada882cfa1592cee110da2afb2 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f486ebb5e36b0dada882cfa1592cee110da2afb2 commit f486ebb5e36b0dada882cfa1592cee110da2afb2 Author: Simon J. Gerraty AuthorDate: 2025-01-23 03:10:10 +0000 Commit: Simon J. Gerraty CommitDate: 2025-01-23 03:10:10 +0000 libsecureboot/README.rst clarify use of gpg Clarify some language and provide an example of gpg use to generate a detached signature. --- lib/libsecureboot/README.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/libsecureboot/README.rst b/lib/libsecureboot/README.rst index 85b949db58cc..f1d3c5679d35 100644 --- a/lib/libsecureboot/README.rst +++ b/lib/libsecureboot/README.rst @@ -1,7 +1,8 @@ libsecureboot ************* -This library depends one way or another on verifying digital signatures. +This library depends one way or another on verifying detached digital +signatures. To do that, the necessary trust anchors need to be available. The simplest (and most attractive for an embedded system) is to @@ -16,7 +17,7 @@ provide access to the necessary trust anchors. That signing server is freely available - see http://www.crufty.net/sjg/docs/signing-server.htm -X.509 certificates chains offer a lot of flexibility over time and are +X.509 certificate chains offer a lot of flexibility over time and are a great solution for an embedded vendor like Juniper or even FreeBSD.org, but are probably overkill for personal or small site use. @@ -74,8 +75,12 @@ header. Signatures ---------- -We expect ascii armored (``.asc``) detached signatures. -Eg. signature for ``manifest`` would be in ``manifest.asc`` +We expect ascii armored (``.asc``) detached signatures +Eg.:: + + gpg -a --detach-sign manifest + +should produce the expected signature in ``manifest.asc`` We only support version 4 signatures using RSA (the default for ``gpg``). @@ -108,6 +113,10 @@ Ie. client sends a hash which during signing gets hashed again. So for Junos we define VE_ECDSA_HASH_AGAIN which causes ``verify_ec`` to hash again. +Later I added a FakeHash class to the signing server so we could +generate signatures compatible with our previous RSA scheme and +others. + Otherwise our EC DSA and RSA signatures are the default used by OpenSSL - an original design goal was that a customer could verify our signatures using nothing but an ``openssl`` binary. From nobody Thu Jan 23 06:36:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdrnK4Msvz5ljQ7; Thu, 23 Jan 2025 06:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdrnK2tRlz3RQM; Thu, 23 Jan 2025 06:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KagLGCtijYCYEkTMNd/KX6fNE9wP2tfFPxxj8L31qXM=; b=fxqnWFjlA1NPH79IvH1CnitUphT9zRt8XCHrXuhr4wm9WSYF1ZsrviStoMBQRleGpSkSN2 P7vnQlPa+fugmOPgM1HVjXU0pwQstXUgZ4BuTmU8G9kFZX761+RT987yXe40OwnfKHCxos OT+9RnzBvrwgNmjZazWqnJQTwyLCQ+1g3Qz3+ZwK8KgkDfR+FtSsgPF7mYnL2G1ZM/7MIq PeEFpXQ+Qx264JiGbIu4iQ1dy3wGYwXjMsFivzSdUZYsy3qJVkZzi722XNaK/L6FUzC6cI W1PKDa/yLTecniKfgrA6eEZZBXR3V8F1+Z8ER6jbj2hlnf9TG0u54gJu1aFUPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KagLGCtijYCYEkTMNd/KX6fNE9wP2tfFPxxj8L31qXM=; b=C/lBsakDdun90SZfnlBglAXWYBiOlAuUgnIWMNUVfuaZ52Yltt3asjKJPDnpiDEYdQg5yE 1lB74xmqXvi3z9T9N1xku3RRlc/9uyV4jZaDwGFIvkmGtEttBUdVFLeudfpCe0GbBMLgPG jPKpdwplLpDpwShiv+oNx4q7AAB2XmZezEQXgOFQ8H3s1/nsbPt8kQuSn5qbQ5nIS33tFy QtM3WSyzl1NuVv+6X8uUXMLHGDVs30GhPpZHvc3KOMyfOvVzlY2QgnwK5bt5K9LINv14LH 8FcsYVVBXIsi/DcUAbn4Engv4/indIwsZE1+bvwiL/7HF3V7ZXnOaJefH6DZ4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614181; a=rsa-sha256; cv=none; b=R/+zZ2hQ3W7iaFNjaf7B9SEW+BM3xl/zKseEcshP1tMQw3Q2dSktaJ7qIOBJHEQfELu4At 9UCzUCt+GgcOjSiYmhNtdEw2v5cuJtKaJa3bFr2fvPkQka+OWTHGFmYzqiABIZdzRaAjiy BYXLQ4UCuLl4G1EwbanRiNG5DouhfskNMsK4EvVkr4rh68Kqec58qvrd8H7kuatgxbHsMh 98dA5it054aPbrm8nRRkWKzrPAsf7l51j31vlz9EKvCR5UwnuvRCKkM5tdTsgsBAwPUpcC pFlo29iKJIOfUv4ewZULL9qhGoDhZWue5OPOIigxbiHemILSaQIc6Djw0CN2tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdrnK2D8PzBt8; Thu, 23 Jan 2025 06:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6aLmI001252; Thu, 23 Jan 2025 06:36:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6aLGC001249; Thu, 23 Jan 2025 06:36:21 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:36:21 GMT Message-Id: <202501230636.50N6aLGC001249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 996fe40e05c9 - stable/14 - Eliminate unneeded variables and computations. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 996fe40e05c9b863ef029e27b6a44907a1d7fa4b Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=996fe40e05c9b863ef029e27b6a44907a1d7fa4b commit 996fe40e05c9b863ef029e27b6a44907a1d7fa4b Author: Kirk McKusick AuthorDate: 2025-01-12 21:51:24 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:36:04 +0000 Eliminate unneeded variables and computations. No functional change. (cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a) --- sys/ufs/ffs/ffs_suspend.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index 3afbab82cba5..c35831c4bb96 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -245,16 +245,12 @@ ffs_susp_unsuspend(struct mount *mp) static void ffs_susp_dtor(void *data) { - struct fs *fs; - struct ufsmount *ump; struct mount *mp; int error; sx_xlock(&ffs_susp_lock); mp = (struct mount *)data; - ump = VFSTOUFS(mp); - fs = ump->um_fs; if (ffs_susp_suspended(mp) == 0) { sx_xunlock(&ffs_susp_lock); @@ -266,7 +262,8 @@ ffs_susp_dtor(void *data) error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) - panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + panic("failed to unsuspend writes on %s", + VFSTOUFS(mp)->um_fs->fs_fsmnt); ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock); From nobody Thu Jan 23 06:38:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydrr72j4pz5ljQJ; Thu, 23 Jan 2025 06:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydrr71zNKz3RRx; Thu, 23 Jan 2025 06:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSY1AuscYOptyQh+KwYXHzBK8IuOvjrN8Lcq4MprOSI=; b=eeXkjtMu8t0/wMI81pDAwN56r22BagEv1kV4t0HoKl2BsxyTM8zWKoOGKmcPMlS10xoCXU wdlnGuqjfOvrFp/49Tfi/WmwRCt9TRgo4QjzowiFy29KP+dHPg9ddxhqYEzdePPHWkxi4y VtmV5DFdhldPwPu5QwefSlXEvNQHWqDb1qQQBf5bMxcVFfsmfM14MUhrp1iDz8dshClvo5 dYzRz2a1ALXIbNIGgHBVMU18t77rrS9t0W+a9wIEFIsvRcFayCmtZXaNCeN92IcyT8bNkV OL3mQIVoOLi8xKf5/5l6voruN1TnykMqgs0xnmUKiVncemTrTUrOwU7YUHn+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSY1AuscYOptyQh+KwYXHzBK8IuOvjrN8Lcq4MprOSI=; b=TXRZq0QDlilTAsW5VCMil788D7v+y+eiLXo07YVcxwAtYx0Xv1bLoUoWNUiYhwHxByRguR /n6KjXBZPNPvLHgYLLqS5ukE59hsaEcu19PujJif7lb/5oS5cNwY6AJtxepC+KUPaXcTjB 2qoqNhMzapOBRqkrQt+S3LS4mVWkQBeuxAVJK9ED35vJwiHl6dod6fwgZj1xhUXwGpVY8R u7SBWpwZcKRb5fGX4TwfwW958bLU3mJWJ+QPMy5rS12V1+lveUFE8fqo0moq84JvwXo1HN U94CZ4pr9ZOKRYnS8lzMEuL0BC99P2zoz0Va/O8LTr8/7viAGa++K5z0hJlisQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614327; a=rsa-sha256; cv=none; b=x4AmOdq9JMkYWuQVxPGiETs+pSH6Qc1Ziy7UhxJ6t1EtuisuMVf165OIV3dB+XaM/lX85H ezaDoslrOqwEJxbtLtEa2ajKM5qITdB8NFeccgmG17vYfqAbScpmVzvesrc5AtPVXxeh51 dv/5zZRjVQZ4BEvzPfdPizuze4RYcMQVAqB1R+sOxO333PGR9nno3Jo4gPKsCLhKqGqiYW tXLBeuUqw8/Is7+t7qVK3s3x9kvoHnWDnwckvnEAeMqxD/R6YEEyjiwjsbR2Oa2DL8yCxd Nghi671C3RFnhNfk2UnWsKREkyhKuD9ELqZVsZquQ+mWKwADgvyPjFcOZ+YFkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydrr714K3zC5t; Thu, 23 Jan 2025 06:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6ckZH002178; Thu, 23 Jan 2025 06:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6ckKV002175; Thu, 23 Jan 2025 06:38:46 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:38:46 GMT Message-Id: <202501230638.50N6ckKV002175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: f31c37f8acb2 - stable/14 - Use ffs_sbget() to replace open-coded superblock reload. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f31c37f8acb2c1edf356562994bb524bc2e67ed0 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=f31c37f8acb2c1edf356562994bb524bc2e67ed0 commit f31c37f8acb2c1edf356562994bb524bc2e67ed0 Author: Kirk McKusick AuthorDate: 2025-01-15 21:08:42 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:37:43 +0000 Use ffs_sbget() to replace open-coded superblock reload. No functional change intended. Tested-by: Peter Holm (cherry picked from commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2) --- sys/ufs/ffs/ffs_vfsops.c | 87 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index c56603752a50..2b7353d157e2 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -580,8 +580,12 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) { return (error); + } else { + /* ffs_reload replaces the superblock structure */ + fs = ump->um_fs; + } if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -742,26 +746,20 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * Things to do to update the mount: * 1) invalidate all cached meta-data. * 2) re-read superblock from disk. - * 3) re-read summary information from disk. - * 4) invalidate all inactive vnodes. - * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary - * writers, if requested. - * 6) invalidate all cached file data. - * 7) re-read inode data for all active vnodes. + * 3) If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. + * 4) invalidate all cached file data. + * 5) re-read inode data for all active vnodes. */ int ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; - void *space; struct buf *bp; struct fs *fs, *newfs; struct ufsmount *ump; - ufs2_daddr_t sblockloc; - int i, blks, error; - uint64_t size; - int32_t *lp; + int error; ump = VFSTOUFS(mp); @@ -784,31 +782,22 @@ ffs_reload(struct mount *mp, int flags) /* * Step 2: re-read superblock from disk. */ - fs = VFSTOUFS(mp)->um_fs; - if ((error = bread(devvp, btodb(fs->fs_sblockloc), fs->fs_sbsize, - NOCRED, &bp)) != 0) + if ((error = ffs_sbget(devvp, &newfs, UFS_STDSB, 0, M_UFSMNT, + ffs_use_bread)) != 0) return (error); - newfs = (struct fs *)bp->b_data; - if ((newfs->fs_magic != FS_UFS1_MAGIC && - newfs->fs_magic != FS_UFS2_MAGIC) || - newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs)) { - brelse(bp); - return (EINTEGRITY); - } /* - * Preserve the summary information, read-only status, and - * superblock location by copying these fields into our new - * superblock before using it to update the existing superblock. + * Replace our superblock with the new superblock. Preserve + * our read-only status. */ - newfs->fs_si = fs->fs_si; + fs = VFSTOUFS(mp)->um_fs; newfs->fs_ronly = fs->fs_ronly; - sblockloc = fs->fs_sblockloc; - bcopy(newfs, fs, (uint64_t)fs->fs_sbsize); - brelse(bp); + free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); + free(fs, M_UFSMNT); + fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); + ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -818,42 +807,10 @@ ffs_reload(struct mount *mp, int flags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - - /* - * Step 3: re-read summary information from disk. - */ - size = fs->fs_cssize; - blks = howmany(size, fs->fs_fsize); - if (fs->fs_contigsumsize > 0) - size += fs->fs_ncg * sizeof(int32_t); - size += fs->fs_ncg * sizeof(uint8_t); - free(fs->fs_csp, M_UFSMNT); - space = malloc(size, M_UFSMNT, M_WAITOK); - fs->fs_csp = space; - for (i = 0; i < blks; i += fs->fs_frag) { - size = fs->fs_bsize; - if (i + fs->fs_frag > blks) - size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); - if (error) - return (error); - bcopy(bp->b_data, space, (uint64_t)size); - space = (char *)space + size; - brelse(bp); - } /* - * We no longer know anything about clusters per cylinder group. + * Step 3: If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. */ - if (fs->fs_contigsumsize > 0) { - fs->fs_maxcluster = lp = space; - for (i = 0; i < fs->fs_ncg; i++) - *lp++ = fs->fs_contigsumsize; - space = lp; - } - size = fs->fs_ncg * sizeof(uint8_t); - fs->fs_contigdirs = (uint8_t *)space; - bzero(fs->fs_contigdirs, size); if ((flags & FFSR_UNSUSPEND) != 0) { MNT_ILOCK(mp); mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); From nobody Thu Jan 23 06:41:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydrtl25QSz5ljxM; Thu, 23 Jan 2025 06:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydrtl1Yf5z3Rqn; Thu, 23 Jan 2025 06:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2Rts2BooKqxqkHHzRuecqgJpHG+iyPJXWe6IlH48yI=; b=LMKsmcW0XU3yh5ir/M5sk0TGXQM7r9qO6cU7+9L59aJyl4b1+PPeZh2DpANpeEPA4f4F2L 0uufgyoV9p6qrSJJdXhb/VPoCsijH+F3myfLUAHcn+7qgXqrfsZ8/BP8/ZLtyTHLAYN3FS XxHE0CbJtPV/mx8Rcy3I4WA3XCI3vTYJDytCJV8R6KOJaF7cW9FZX15R3UtEpXop15u96F czRXNR6uomNvKzwyqrr56qsCyEi1BA9mJwLFYxPPhdc1hSaez9MFC3zadZbnn/0viCiTeY u4aJt10Eeu7JEW0c6kBezG2Y4PPoCBjmCjzKlYN80HNi9qAPTyLAeruk6oQHvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j2Rts2BooKqxqkHHzRuecqgJpHG+iyPJXWe6IlH48yI=; b=Ix1jrzxR80VPHVlGSuKzKIEBWvE4DgG2DuYx6XPnwRdu5xcyBQHJvSIcH/GJbipScLS1tl +Yq51J+koX4EGMjLLoqo+GJnRH0aFYWaTgqXlTJXPHsFdbhgpTkwPO597UR2gN+0+EfutR WMfOXZs4yjeztYc2BmC8wUzOC9xMSV4uoO7MJB5TdnytFmL2zMEBUQwiPEp6hZxCvV2Ypt B8hfSeXkjskzzSA72PhhchJ2P4NUs59mne1erngCunlCU4Lahi2VleB8MpbhxXZsKuMrjW Nz065x1L6n6ghlaCOA8ENwlbqg5lQXTOxLhj6AzTNarL586l+bJl+IfPKgRldQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614463; a=rsa-sha256; cv=none; b=HpU12WVkNiVlrVUBXAL9mFy4uzV6L7fOqoTf7j7fSn+wCf/iZ3TbVjCtAXrrbVe0nMzHkW 2NRt5NdcuEAWygvwXT0pZgsIsrRu76YeXG5IT1j0Tt/YMc5I1eIARf+UK0XVdIgK2fQ6Ma q3p4Wck/ywGP1+sS/ZrkalYWJM17cQ+KaUukxAPSAMmUVFCXo+iysu8g2/TBOSExLa/07Q LnmnRwC48HAu21ayB4bOrOJj6ObZhC5Il7EEMIcbPUWj8Jm3Y5cgBfVj+Dm65GL3OCMlaw MXd98rZ6xOt9sHIOOhYujeuGUe5dy4Zv+WH1B02AgYhz3Bjy/jQpTP8NhhPRQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydrtl18DvzBtW; Thu, 23 Jan 2025 06:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6f3ds014324; Thu, 23 Jan 2025 06:41:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6f3Ae014321; Thu, 23 Jan 2025 06:41:03 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:41:03 GMT Message-Id: <202501230641.50N6f3Ae014321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 26c483aec039 - stable/14 - Fix backward compatibility with UFS1 filesystems created before June 2002 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 26c483aec039b01182bfef468fd7979895bcb645 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=26c483aec039b01182bfef468fd7979895bcb645 commit 26c483aec039b01182bfef468fd7979895bcb645 Author: Kirk McKusick AuthorDate: 2025-01-16 18:43:48 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:39:45 +0000 Fix backward compatibility with UFS1 filesystems created before June 2002 Reviewed-by: kib Tested-by: Peter Holm Differential-Revision: https://reviews.freebsd.org/D48472 (cherry picked from commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31) --- sbin/growfs/debug.c | 2 - sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_snapshot.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 +- sys/ufs/ffs/ffs_subr.c | 81 +++++++++++++++++++++++++++++++++++++- sys/ufs/ffs/ffs_vfsops.c | 96 +--------------------------------------------- sys/ufs/ffs/fs.h | 5 ++- 7 files changed, 88 insertions(+), 104 deletions(-) diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 456e67dbc5c2..ab4539d06a69 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -305,8 +305,6 @@ dbg_dump_fs(struct fs *sb, const char *comment) sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", sb->fs_avgfpdir); - fprintf(dbg_log, "save_cgsize int32_t 0x%08x\n", - sb->fs_save_cgsize); fprintf(dbg_log, "flags int32_t 0x%08x\n", sb->fs_flags); fprintf(dbg_log, "contigsumsize int32_t 0x%08x\n", diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index f0c6eaaa1088..56e2fdd6ce51 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -84,7 +84,7 @@ int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **, int); int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t); -void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +void ffs_oldfscompat_write(struct fs *); int ffs_own_mount(const struct mount *mp); int ffs_sbsearch(void *, struct fs **, int, struct malloc_type *, int (*)(void *, off_t, void **, int)); diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index ae3b444a19e9..77480f36e827 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -840,7 +840,7 @@ resumefs: copy_fs->fs_fmod = 0; bpfs = (struct fs *)&nbp->b_data[loc]; bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize); - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index fa2b0bf24366..316c978e1bdf 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9941,7 +9941,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) if (pino == 0) { bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, @@ -9973,7 +9973,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index fc43b4c06e7f..1792e1628a48 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -126,6 +126,7 @@ ffs_update_dinode_ckhash(struct fs *fs, struct ufs2_dinode *dip) static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); +static void ffs_oldfscompat_read(struct fs *, ufs2_daddr_t); static int validate_sblock(struct fs *, int); /* @@ -271,6 +272,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, if (fs->fs_magic == FS_UFS1_MAGIC && (flags & UFS_ALTSBLK) == 0 && fs->fs_bsize == SBLOCK_UFS2 && sblockloc == SBLOCK_UFS2) return (ENOENT); + ffs_oldfscompat_read(fs, sblockloc); if ((error = validate_sblock(fs, flags)) > 0) return (error); /* @@ -319,6 +321,83 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, return (0); } +/* + * Sanity checks for loading old filesystem superblocks. + * See ffs_oldfscompat_write below for unwound actions. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +static void +ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc) +{ + uint64_t maxfilesize; + + /* + * If not yet done, update fs_flags location and value of fs_sblockloc. + */ + if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { + fs->fs_flags = fs->fs_old_flags; + fs->fs_old_flags |= FS_FLAGS_UPDATED; + fs->fs_sblockloc = sblockloc; + } + /* + * If not yet done, update UFS1 superblock with new wider fields. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { + fs->fs_maxbsize = fs->fs_bsize; + fs->fs_time = fs->fs_old_time; + fs->fs_size = fs->fs_old_size; + fs->fs_dsize = fs->fs_old_dsize; + fs->fs_csaddr = fs->fs_old_csaddr; + fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; + fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; + fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; + fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; + } + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_inodefmt < FS_44INODEFMT) { + fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; + fs->fs_qbmask = ~fs->fs_bmask; + fs->fs_qfmask = ~fs->fs_fmask; + } + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_save_maxfilesize = fs->fs_maxfilesize; + maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } + /* Compatibility for old filesystems */ + if (fs->fs_avgfilesize <= 0) + fs->fs_avgfilesize = AVFILESIZ; + if (fs->fs_avgfpdir <= 0) + fs->fs_avgfpdir = AFPDIR; +} + +/* + * Unwinding superblock updates for old filesystems. + * See ffs_oldfscompat_read above for details. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +void +ffs_oldfscompat_write(struct fs *fs) +{ + + /* + * Copy back UFS2 updated fields that UFS1 inspects. + */ + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_old_time = fs->fs_time; + fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; + fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; + fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; + fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = fs->fs_save_maxfilesize; + } +} + /* * Verify the filesystem values. */ @@ -564,7 +643,7 @@ validate_sblock(struct fs *fs, int flags) sizepb *= NINDIR(fs); maxfilesize += sizepb; } - WCHK(fs->fs_maxfilesize, !=, maxfilesize, %jd); + WCHK(fs->fs_maxfilesize, >, maxfilesize, %jd); /* * These values have a tight interaction with each other that * makes it hard to tightly bound them. So we can only check diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 2b7353d157e2..16a955bc7f6d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -85,8 +85,6 @@ static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); -static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, - ufs2_daddr_t); static void ffs_ifree(struct ufsmount *ump, struct inode *ip); static int ffs_sync_lazy(struct mount *mp); static int ffs_use_bread(void *devfd, off_t loc, void **bufp, int size); @@ -797,7 +795,6 @@ ffs_reload(struct mount *mp, int flags) fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -1012,7 +1009,6 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); sx_init(&ump->um_checkpath_lock, "uchpth"); - ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; mp->mnt_data = ump; @@ -1221,96 +1217,6 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int size) return (0); } -static int bigcgs = 0; -SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, ""); - -/* - * Sanity checks for loading old filesystem superblocks. - * See ffs_oldfscompat_write below for unwound actions. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -static void -ffs_oldfscompat_read(struct fs *fs, - struct ufsmount *ump, - ufs2_daddr_t sblockloc) -{ - off_t maxfilesize; - - /* - * If not yet done, update fs_flags location and value of fs_sblockloc. - */ - if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { - fs->fs_flags = fs->fs_old_flags; - fs->fs_old_flags |= FS_FLAGS_UPDATED; - fs->fs_sblockloc = sblockloc; - } - /* - * If not yet done, update UFS1 superblock with new wider fields. - */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { - fs->fs_maxbsize = fs->fs_bsize; - fs->fs_time = fs->fs_old_time; - fs->fs_size = fs->fs_old_size; - fs->fs_dsize = fs->fs_old_dsize; - fs->fs_csaddr = fs->fs_old_csaddr; - fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; - fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; - fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; - fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; - } - if (fs->fs_magic == FS_UFS1_MAGIC && - fs->fs_old_inodefmt < FS_44INODEFMT) { - fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; - fs->fs_qbmask = ~fs->fs_bmask; - fs->fs_qfmask = ~fs->fs_fmask; - } - if (fs->fs_magic == FS_UFS1_MAGIC) { - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; - } - /* Compatibility for old filesystems */ - if (fs->fs_avgfilesize <= 0) - fs->fs_avgfilesize = AVFILESIZ; - if (fs->fs_avgfpdir <= 0) - fs->fs_avgfpdir = AFPDIR; - if (bigcgs) { - fs->fs_save_cgsize = fs->fs_cgsize; - fs->fs_cgsize = fs->fs_bsize; - } -} - -/* - * Unwinding superblock updates for old filesystems. - * See ffs_oldfscompat_read above for details. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -void -ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump) -{ - - /* - * Copy back UFS2 updated fields that UFS1 inspects. - */ - if (fs->fs_magic == FS_UFS1_MAGIC) { - fs->fs_old_time = fs->fs_time; - fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; - fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; - fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; - fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; - fs->fs_maxfilesize = ump->um_savedmaxfilesize; - } - if (bigcgs) { - fs->fs_cgsize = fs->fs_save_cgsize; - fs->fs_save_cgsize = 0; - } -} - /* * unmount system call */ @@ -2194,7 +2100,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size) UFS_UNLOCK(ump); fs = (struct fs *)bp->b_data; fs->fs_fmod = 0; - ffs_oldfscompat_write(fs, ump); + ffs_oldfscompat_write(fs); fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 5769cd7776b4..c634c73e9a39 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -413,7 +413,8 @@ struct fs { int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ int64_t fs_metaspace; /* size of area reserved for metadata */ - int64_t fs_sparecon64[13]; /* old rotation block list head */ + uint64_t fs_save_maxfilesize; /* save old UFS1 maxfilesize */ + int64_t fs_sparecon64[12]; /* old rotation block list head */ int64_t fs_sblockactualloc; /* byte offset of this superblock */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ @@ -426,7 +427,7 @@ struct fs { uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ uint32_t fs_avgfilesize; /* expected average file size */ uint32_t fs_avgfpdir; /* expected # of files per directory */ - int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ + uint32_t fs_available_spare; /* old scratch space */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ int32_t fs_sparecon32[21]; /* reserved for future constants */ From nobody Thu Jan 23 06:44:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydryp4CFYz5lk0h; Thu, 23 Jan 2025 06:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydryp3KT3z3SKY; Thu, 23 Jan 2025 06:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/us0cXdrYN/ooC8rlj8qgnwqUphXiQOSuG6qd03V+zs=; b=WcOG2F0Mv4ZeIvnKl4HxT60J5C5oRi4lbrEMBhtpA1nVwRxO2frFb/dSSV8RNLlLea4GrL VzAjDslCjSexM/MpoxDiiqKsDpBZiRfyX+X1bXDnUah8utWSGtphBM0Fe8Cl49bWOT5t9G NDTbmDa7JLt9M681h7Y0i3QDSSJNSIA53N8i6r1rxLoerx8lrt6Cc4gC26Er536eWJIZWH Vt4nCJIplpA9x4Ae1Mb/MKEB40REhM0tB2PPtFmb+wKvtMm/JhwKujyY33pHIYn+rg5SMI 2sKmfHzGLfeAoFWsoCX347CzdAA2Lc5Ovfpu3Iu9+KXic0cm3NvXTlGf4x2EdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737614674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/us0cXdrYN/ooC8rlj8qgnwqUphXiQOSuG6qd03V+zs=; b=wCbRg9aY4+5TrrSI9WGHWnintqGBjEgbChFRNy/72AGdKStVWdX5AbtSRFdlA4Dac56l09 4PzAy3J2sjP/Hqzj1yCVOK7qBBCjsPVzmLY74rfXVGzJDwlCxr5/5HlHCAPhsZgxGRWrHL 7yr4w8MdFuR+jM7AFAS6MUvFhl3+YcU51kmSKbx1LHHD0VeTWfShixVQS0IbsgaTB3u0e3 Z36jvFCSXQOmmD6RPQNFYuLC1r35P8WmjIRzPtcV8tZ5B7mSaTepIVRxGvxJrtuGffCnf9 UgIpSF87SEfVWHQPLgp3/g05PWpTUwBCrJgaYAaQGQJt4uKnfItATn79RTjU6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737614674; a=rsa-sha256; cv=none; b=gdmljM+h7514Yz1uf1CpIEd3ipM0tRnydEfMwZ8hMDyKkrb4x/aRl6e/qy9R9V9FSzNRZz Wy7RvJwtfAwpyH5s2kq9gxZTTKcU3qJKpA6XCghhv7E0x2PDcAYCnlLFCy21urDf+zb2Vs UNqJpbtOmBbJ3+kf4ElDEJd2lrVNpWpUHt2yTaOR7lrvdmyFMDcEmriJlO1Udzfrojg4hI NX1fGIxoPanZyIX1ZD1BD6pbxA/b68wf+RshcD2EtkPNQ0FmUJEvlPu98Tg3m+eXV5LZ5e hREWrmVhY+lzNKJxxDEUJHkrmDgqSapEJTI++nHwKa9PbZQh4swghhlXjz/X/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydryp2VrBzCQ2; Thu, 23 Jan 2025 06:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N6iY1L019490; Thu, 23 Jan 2025 06:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N6iY6d019487; Thu, 23 Jan 2025 06:44:34 GMT (envelope-from git) Date: Thu, 23 Jan 2025 06:44:34 GMT Message-Id: <202501230644.50N6iY6d019487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: bb14579988c5 - stable/13 - Eliminate unneeded variables and computations. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb14579988c5d82a272578e77ea719603b237fb3 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=bb14579988c5d82a272578e77ea719603b237fb3 commit bb14579988c5d82a272578e77ea719603b237fb3 Author: Kirk McKusick AuthorDate: 2025-01-12 21:51:24 +0000 Commit: Kirk McKusick CommitDate: 2025-01-23 06:44:17 +0000 Eliminate unneeded variables and computations. No functional change. (cherry picked from commit df48361e7792f9a9e6371f95c1228d4af2808d2a) --- sys/ufs/ffs/ffs_suspend.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c index e23e12cc8be4..9e65cddc0d8f 100644 --- a/sys/ufs/ffs/ffs_suspend.c +++ b/sys/ufs/ffs/ffs_suspend.c @@ -242,16 +242,12 @@ ffs_susp_unsuspend(struct mount *mp) static void ffs_susp_dtor(void *data) { - struct fs *fs; - struct ufsmount *ump; struct mount *mp; int error; sx_xlock(&ffs_susp_lock); mp = (struct mount *)data; - ump = VFSTOUFS(mp); - fs = ump->um_fs; if (ffs_susp_suspended(mp) == 0) { sx_xunlock(&ffs_susp_lock); @@ -263,7 +259,8 @@ ffs_susp_dtor(void *data) error = ffs_reload(mp, FFSR_FORCE | FFSR_UNSUSPEND); if (error != 0) - panic("failed to unsuspend writes on %s", fs->fs_fsmnt); + panic("failed to unsuspend writes on %s", + VFSTOUFS(mp)->um_fs->fs_fsmnt); ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock); From nobody Thu Jan 23 07:26:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydsv65j9fz5lmGB; Thu, 23 Jan 2025 07:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydsv64jr9z3WTY; Thu, 23 Jan 2025 07:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737617186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G89szDB2sKXjcIWx4W6qbYKsZf9mj5JQeDR3YMmP6sQ=; b=vQANES/EZY3TZMFJxkxjTc3xMEl267vejT+s3yI/dYbgL5pV907qdyJtz8mfridxSFy57A e2NNWk7lvQf1l3t8A89ZUXDdGFahMqdqoX5afE+Pk9l4UUoXFkeCaeWtv+vRpUQwnlVkv7 B5MQ5ffv7MD5rsY8h+SsSIkTyiDsCqSa8PLOUuvoN0JVW81Q2ZBJ5I5MxokJW0HSO7cj69 gy4iSoaIzBQaTqMWZvxgQGSbxn3BfE81fyMtzKH9J5brhydY8Vy5goTn3dzPW8YaN6aixQ IGjqUE5p2fOxWmngV44KgMI1kvaRv4b2FfArh3UCzMkQoopzqe53HvmJ4X6H8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737617186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G89szDB2sKXjcIWx4W6qbYKsZf9mj5JQeDR3YMmP6sQ=; b=OADEfEahZtlUKsBsMGWf9dTaf3Smes72+yExm1QPX/T7vbmcCEQdkZAFvffiXcHUHCeTqW ddwrDVUnYnet7jdmb4qSLcT3sBDma25ZWN1OpvkJxLkxiPNFH7HUypdsaZUloEFvMeTws+ /ST5KMtlZMmMhSmOun6i1r6gudaChNAJEz4JDCkanuQjPzDMYtZOophjGR+BsOLDMDZaSG yF1M+cC0uDRWtPzUjRx1A4fWN1Qrp9tKH4WzCv3i59Tlta+Ie9GmLmegaakEOiXQecfrnJ c3nWwU0HrDh+s1Bi5UrC1ziQ8NzCniHqjgKqqBgWS4VRNorRTZHf/2qpBPz6Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737617186; a=rsa-sha256; cv=none; b=FtrpvTV+N7iFPYdJBUzU3R/8U3YZ7/l2OsOZNPdPayEy2n4OFN2Yc4g5Ccze8N0upHuM/E 9MG9Eex6n+4fjIvKQpM9mBnlHeq8T30y40UZM0xuobhdFXtbOcFmUylT5t2anKwCfvrNJy uc7KdQx+knKgRHwNFCZTSf0LlEYxx2GCVxHRAMJjelFxcZrYRQJgOpjubmRcoot6eIGCS5 /BT83uws37siCBVJna/ipoWMEKnlGbmDjYKSrcosnfgCmbP4xw6dxku2qJdEwW6I9+hFVL r/nQB/kDZyDfGLYU3XwlB9bP+geKh8/3oIQcOrh5AnOGZmmBnXDUgPaQi6RIMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydsv64HXCzCvY; Thu, 23 Jan 2025 07:26:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N7QQ0P095176; Thu, 23 Jan 2025 07:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N7QQnw095172; Thu, 23 Jan 2025 07:26:26 GMT (envelope-from git) Date: Thu, 23 Jan 2025 07:26:26 GMT Message-Id: <202501230726.50N7QQnw095172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 0ee3e29e1d9e - main - sysctl: Fix usage() and SYNOPSIS section of man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3 commit 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3 Author: Zhenlei Huang AuthorDate: 2025-01-23 07:24:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 07:24:15 +0000 sysctl: Fix usage() and SYNOPSIS section of man page I forgot to update the usage() and SYNOPSIS section of man page when adding the two options -J and -V. While here, fix the options sort order in SYNOPSIS section. Fixes: 5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables MFC after: 1 day --- sbin/sysctl/sysctl.8 | 6 +++--- sbin/sysctl/sysctl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 792ebf6c4e9d..8cffb180ca67 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 29, 2024 +.Dd January 23, 2025 .Dt SYSCTL 8 .Os .Sh NAME @@ -36,13 +36,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdeFhilNnoTtqWx +.Op Fl bdeFhiJlNnoqTtVWx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm -.Op Fl bdeFhlNnoTtqWx +.Op Fl bdeFhJlNnoqTtVWx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 1a9cb0a13254..ef5d0508e5c3 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -121,8 +121,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdeFhilNnoqTtWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdeFhlNnoqTtWx] [ -B ] -a"); + "usage: sysctl [-bdeFhiJlNnoqTtVWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdeFhJlNnoqTtVWx] [ -B ] -a"); exit(1); } From nobody Thu Jan 23 08:01:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydth15KmPz5lp10; Thu, 23 Jan 2025 08:01: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydth14gp0z3fCN; Thu, 23 Jan 2025 08:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737619313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PQ65zFx+BlCrtbfcmE8EWFnHAGrPonFhTCM4N/LYeTM=; b=AMDrCf12dSkiEWVkR/03BVZlTJXyQtOj+GHJ4WMImhuu7aHeGUgMan23bW67Xi/pR1LRmb 2lzOw4mhq29VeJ/OBNFniv+m46AOrCA/Q+s+3jRV6BYbbbAHQQwFRJf8g97aZcLPvQqoNH AiLCHp1hHfxBBd5nkl8NkpMln4bGbCmD59kWGM7NaAheoL1mXSHbAhLexNAXQiWCPSSKjD +9CsSe5yWpJZfMHH6zUylxOOFW2qWle/7OpbLGBLrMyBZFBB/cKi4B8PF8qHzQAU1jsurR mfjeXAZhToUpMA1P69Lvp0vMWuc3F2lz3Wj5WkaYpjls9YDvRT6oCsUeRBptAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737619313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PQ65zFx+BlCrtbfcmE8EWFnHAGrPonFhTCM4N/LYeTM=; b=GyiEuR7OMKoHR1QTAOQJHyQFLctN8zCiI0f8PwAu4oxnArw5d7vGBzvzZMLgZMkJQA80dv VU2UFH7Is7vnyOR5esfpiWpPMqutpuga1n2PkitueYjpyZ5gGlSy4O0XQHyIVZ6NDBkk5t GUIICl9xLdbqZPcP8/53u+24osiNmmndv41RmGqJlBdfgvCCLqgmGnef53LBQnEcMXUUIz 8PYkov4riRuT92wZl5LZJmrarvPPdYd0mPcHMK5dAx8wZYQuOw/tn7FVySVUgQFk1N2EZ3 Tp3ygxGYUSHEOcX8barDoWFwgWf0VVTnPhutjKS/IP9LLnTBC5SjzitEaMgS9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737619313; a=rsa-sha256; cv=none; b=i2EXw6q+ptR8CJ+PgJbyuAhms1RL1XrC7m4vC65q8tW/4VTWD14U1u0FqqtbiNN4lDHcbe Rbl2a8OTIa3r09w4liIWYPBHEdnPsLSgaGH9Vv6Euk6WVdXoNEZRwS3l1VlEC62gD2bfzU ku//eaQwPjUVJrZ2SXjH3CBRIOnfApGGTmZULdJqYQLF/IT35S0x1SLyTMn5dqU8csRVGP Sa46zRozAdROscr9fZ3BJRUdZDq7Kce6fWkCim8Y8gppIrria1BWYhKU5wSF1L577OQmnP 43F+14qrhqqTYUXo/XQ3pzj3XSIpPdZFeSnvIrifXWvwL5gaun7xFpQTJ/XIhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydth14Gl1zDW0; Thu, 23 Jan 2025 08:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N81rLp067097; Thu, 23 Jan 2025 08:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N81reA067094; Thu, 23 Jan 2025 08:01:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 08:01:53 GMT Message-Id: <202501230801.50N81reA067094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: c294ecb25b5f - main - sysctl: Sort options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c294ecb25b5f3553b5c84b630869bb05724c9629 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c294ecb25b5f3553b5c84b630869bb05724c9629 commit c294ecb25b5f3553b5c84b630869bb05724c9629 Author: Zhenlei Huang AuthorDate: 2025-01-23 08:01:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 08:01:04 +0000 sysctl: Sort options No functional change intended. MFC after: 1 day --- sbin/sysctl/sysctl.8 | 16 ++++++++-------- sbin/sysctl/sysctl.c | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 8cffb180ca67..b6a06e2c3bab 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -68,10 +68,6 @@ opaque or excluded from listing via the flag. This option is ignored if one or more variable names are specified on the command line. -.It Fl b -Force the value of the variable(s) to be output in raw, binary format. -No names are printed and no terminating newlines are output. -This is mostly useful with a single variable. .It Fl B Ar bufsize Set the buffer size to read from the .Nm @@ -81,6 +77,10 @@ This is necessary for a .Nm that has variable length, and the probe value of 0 is a valid length, such as .Va kern.arandom . +.It Fl b +Force the value of the variable(s) to be output in raw, binary format. +No names are printed and no terminating newlines are output. +This is mostly useful with a single variable. .It Fl d Print the description of the variable instead of its value. .It Fl e @@ -94,15 +94,15 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl F +Print the format of the variable. +This is additional information to describe the type of the variable and +most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl f Ar filename Specify a file which contains a pair of name and value in each line. .Nm reads and processes the specified file first and then processes the name and value pairs in the command line argument. -.It Fl F -Print the format of the variable. -This is additional information to describe the type of the variable and -most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl h Format output for human, rather than machine, readability. .It Fl i diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index ef5d0508e5c3..d3a3c64057d3 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -136,7 +136,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:FhiJlNnoqtTVwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AaB:bdeFf:hiJlNnoqTtVWwXx")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -145,24 +145,24 @@ main(int argc, char **argv) case 'a': aflag = 1; break; - case 'b': - bflag = 1; - break; case 'B': Bflag = strtol(optarg, NULL, 0); break; + case 'b': + bflag = 1; + break; case 'd': dflag = 1; break; case 'e': eflag = 1; break; - case 'f': - conffile = optarg; - break; case 'F': Fflag = true; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -187,22 +187,22 @@ main(int argc, char **argv) case 'q': qflag = 1; break; - case 't': - tflag = 1; - break; case 'T': Tflag = 1; break; + case 't': + tflag = 1; + break; case 'V': Vflag = true; break; + case 'W': + Wflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; - case 'W': - Wflag = 1; - break; case 'X': /* compatibility */ aflag = xflag = 1; From nobody Thu Jan 23 09:52:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydx745kXQz5lvwB; Thu, 23 Jan 2025 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydx745Bcmz3s3c; Thu, 23 Jan 2025 09:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02UE+NO1VoGMw6B7aHzBATQOItsWPKhCjHJZxmtRFK8=; b=uR6G/ifC+euvKvJ4bNNqUSRi8oelTlhq5Hfhx4F+ZmnRXWWo7mdBfpO/N5bVHFXvflaD/s 3cwpjDNDrGYv921UedOtsu4JdTGkw/rINwU0lPaN0OfYti0UX8GgsqrpSkauT+1O9XCqez xVhpxLECEZ4N19Qq8jc3+Rb4OOx4OqVLjuc9ugIbIQyxSyM9RXt52t9Pv7y5Va/c4zozZ+ 3AqT6DuO+OeJrRjwNWrIOD2g2hdQApuNduic1zw8CyjxTE+3Ae0DgRHbZ/7LVKGQ6KAJpZ qF+CElcUr48lf/uizvU3KSxzXgSjcBmXK2PWtEnnw6x7FX0jZ5f4a+sfsYTyzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02UE+NO1VoGMw6B7aHzBATQOItsWPKhCjHJZxmtRFK8=; b=GvMeRBVmueoiRRDHqeTpkZEG44wuO1fL7zrlE5Kxp+S76JgjauOCB5x1gx2hEUmbKmlHg+ R8wA/mEed6XVpRKyYS9Z9h+IU1JLvic+cgOBnRosirld0e3JuiVhGCYBZ8fvB1OW9rqZeV WyYXwJmFjc1QN3MDH7WaLTyBKb4WO1o+h68bgo96wdsEvz3mi4usy8wM2wBbAxP9xQyzfb aEpEHP4+Is/P6LEfZ6RGheSjpNIwgLumaPt9lvgHv3WGFb7d+a6vtNBH961vbkh/7iLMfg 8UKIMyzlOKN11TWlHLwg2TjEkEC6eGuDv347PL9G/W/KBjfyOvnaek8IalNgaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737625920; a=rsa-sha256; cv=none; b=rxoqmuPNvw6b/z+qSdrEzt+afkD8s+527ioMGmOesERsuDk9gL7f5UVacdtVZsw891t8mL UjU89kp804kIDUMyY8yX0ybQFOK/gucSN+pWk6cTrkv2c4sv2C4UFPbC6HnrIdZeTjkUdi tUWa/GDyjlYICZoJkdTOfzZ2omaDo5Xd1GWo26CHKQJsCh/vyFQQ9dl46IeiUwaGQ3LFJA iZrmikJY1WxC+EhxGJ9ZeiSiSz6afVkEsmu7/v71N4WHMaedXJUqFTRXvBgPhcKmf9gA/H 4LRwy5o34SZFpfYFDKf1KCo6dqIt9b1iuH0psT/JtLpcfRhevwtE2oiNYcpqRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydx744crXzZpt; Thu, 23 Jan 2025 09:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N9q0VU073402; Thu, 23 Jan 2025 09:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N9q0qY073399; Thu, 23 Jan 2025 09:52:00 GMT (envelope-from git) Date: Thu, 23 Jan 2025 09:52:00 GMT Message-Id: <202501230952.50N9q0qY073399@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: 86e95bb26ad8 - stable/14 - stat(2): add st_filerev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 86e95bb26ad8f357ddc6aef655b56d695b01fa7e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=86e95bb26ad8f357ddc6aef655b56d695b01fa7e commit 86e95bb26ad8f357ddc6aef655b56d695b01fa7e Author: Konstantin Belousov AuthorDate: 2025-01-13 21:14:04 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-23 09:46:57 +0000 stat(2): add st_filerev (cherry picked from commit b4663a8d111767206bb3ebcfec5b95a6b88bc720) --- sys/compat/freebsd32/freebsd32.h | 3 ++- sys/compat/freebsd32/freebsd32_misc.c | 1 + sys/fs/tmpfs/tmpfs_vnops.c | 1 + sys/kern/kern_descrip.c | 1 + sys/kern/vfs_default.c | 2 ++ sys/kern/vfs_subr.c | 1 + sys/sys/stat.h | 3 ++- sys/sys/vnode.h | 1 + sys/ufs/ufs/ufs_vnops.c | 2 ++ 9 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index e1bfe282c4b1..3dbf1b5a876d 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -240,7 +240,8 @@ struct stat32 { uint32_t st_blksize; uint32_t st_flags; uint64_t st_gen; - uint64_t st_spare[10]; + uint64_t st_filerev; + uint64_t st_spare[9]; }; struct freebsd11_stat32 { uint32_t st_dev; diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index facbf00a4c51..c4872373735c 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2249,6 +2249,7 @@ copy_stat(struct stat *in, struct stat32 *out) CP(*in, *out, st_blksize); CP(*in, *out, st_flags); CP(*in, *out, st_gen); + CP(*in, *out, st_filerev); TS_CP(*in, *out, st_birthtim); out->st_padding0 = 0; out->st_padding1 = 0; diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index a42ada6a5469..d67f71202228 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -476,6 +476,7 @@ tmpfs_stat(struct vop_stat_args *v) sb->st_blksize = PAGE_SIZE; sb->st_flags = node->tn_flags; sb->st_gen = node->tn_gen; + sb->st_filerev = 0; if (vp->v_type == VREG) { #ifdef __ILP32__ vm_object_t obj = node->tn_reg.tn_aobj; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 61cf7fc845a2..b054bb43074c 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1622,6 +1622,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp) AUDIT_ARG_FILE(td->td_proc, fp); + sbp->st_filerev = 0; error = fo_stat(fp, sbp, td->td_ucred); fdrop(fp, td); #ifdef __STAT_TIME_T_EXT diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 69a7a2cb472c..d044a52bce2d 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1514,6 +1514,7 @@ vop_stdstat(struct vop_stat_args *a) vap->va_fsid = VNOVAL; vap->va_gen = 0; vap->va_rdev = NODEV; + vap->va_filerev = 0; error = VOP_GETATTR(vp, vap, a->a_active_cred); if (error) @@ -1590,6 +1591,7 @@ vop_stdstat(struct vop_stat_args *a) sb->st_flags = vap->va_flags; sb->st_blocks = vap->va_bytes / S_BLKSIZE; sb->st_gen = vap->va_gen; + sb->st_filerev = vap->va_filerev; out: return (vop_stat_helper_post(a, error)); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 404c51b7db77..729741ea901f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1165,6 +1165,7 @@ vattr_null(struct vattr *vap) vap->va_flags = VNOVAL; vap->va_gen = VNOVAL; vap->va_vaflags = 0; + vap->va_filerev = VNOVAL; } /* diff --git a/sys/sys/stat.h b/sys/sys/stat.h index d083b877e6dd..bbdf485581c6 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -187,7 +187,8 @@ struct stat { blksize_t st_blksize; /* optimal blocksize for I/O */ fflags_t st_flags; /* user defined flags for file */ __uint64_t st_gen; /* file generation number */ - __uint64_t st_spare[10]; + __uint64_t st_filerev; /* file revision, incr on changes */ + __uint64_t st_spare[9]; }; #ifdef _KERNEL diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 2cf62a51e101..404121ecabc2 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -994,6 +994,7 @@ void vop_rename_fail(struct vop_rename_args *ap); ap->a_sb->st_padding0 = 0; \ ap->a_sb->st_padding1 = 0; \ bzero(_ap->a_sb->st_spare, sizeof(_ap->a_sb->st_spare)); \ + ap->a_sb->st_filerev = 0; \ } \ _error; \ }) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index fcd5e7478cad..1a50089781ee 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -551,6 +551,7 @@ ufs_stat(struct vop_stat_args *ap) sb->st_birthtim.tv_sec = -1; sb->st_birthtim.tv_nsec = 0; sb->st_blocks = dbtob((uint64_t)ip->i_din1->di_blocks) / S_BLKSIZE; + sb->st_filerev = ip->i_din1->di_modrev; } else { sb->st_rdev = ip->i_din2->di_rdev; sb->st_size = ip->i_din2->di_size; @@ -561,6 +562,7 @@ ufs_stat(struct vop_stat_args *ap) sb->st_birthtim.tv_sec = ip->i_din2->di_birthtime; sb->st_birthtim.tv_nsec = ip->i_din2->di_birthnsec; sb->st_blocks = dbtob((uint64_t)ip->i_din2->di_blocks) / S_BLKSIZE; + sb->st_filerev = ip->i_din2->di_modrev; } sb->st_blksize = max(PAGE_SIZE, vp->v_mount->mnt_stat.f_iosize); From nobody Thu Jan 23 09:52:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydx760DWfz5lvrH; Thu, 23 Jan 2025 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydx755FJnz3s5Y; Thu, 23 Jan 2025 09:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgQlKMWHRLQVdFpPDb1X2fefAckuC7N4Wvwmy2vey5s=; b=FKObdqxrliVT9AOZFnvpEdx/oAzlrtEzkxDYcuYqDmI4RCJpbeXo9vfj49PBsLyfA+X849 DAGtBNg0ZP72sjXfJEQiQJ0MdFlmbbxF01NkeW9e8pr49Mflbf5lbq6n2MW0OsTPCKkeaj +ywLhQB7TH3XuYEJUH2yRhaiWYGrLDpXFBBXaMVYp33zm3giCzWV58xxKiy48VL0bIkz0B pxND2i7euO6LPI4B9FznPhUxexal5JoE26X+eTmIACFTu63ZEIInSgVasy7plv3/pKkDva Jxr2MXdtm8T6YjnXjLpVMhC1eHFuDd/jHGXOE7JPEGw9ECx6E6FxulHjUSRe3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgQlKMWHRLQVdFpPDb1X2fefAckuC7N4Wvwmy2vey5s=; b=YvP0XKQZpIpMkpOyCnX+vYOcRtbUv7T34Y2FSLOvPA6K2Fb5y+65CO3mZX+J/DaI0FJW3w lvmLy6SNd935yvjNr445nNQ4BoMrTuN0aZ0AbMST0wH3z5r1vbAQ1uBJTfZq0y2qtLq/fg ABsEyZUikoMOpArmlLMqzQQeD3Acnih/Xm+2iO0meUXf+Iz2KXq6+BwcBJ2U9/iDoqC98Q 5WN/z6G8IlkhLu0V6wZ7IOF6WTqVMkVtEP8+1g1YhjU8XU0ZmaNK0myv9ed0RnOxmb8wHF MJvmlu984Eg+nXomeiGdzCdo9MkRTqaU9fylosuPtH0JnhMtQPSDx/vXkY6NpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737625921; a=rsa-sha256; cv=none; b=iuJIpnSld+dJSGCnsgtNuTYw2m1iX5I8hZ2r9hPGF6x4wCkyB/fBK1/B7CzeA6P4hwhyWx s/j5Ndg3HDdAhoZsSwb+RQPdIysH7vcPxU8ZxeZzAq9pxDfMSxS+bbfNjJllXmMB060ceR sL6hMnLANz1LfdKWpsQ2LhR8qX4d5Lo4Wv1mekD04yMIY71IpyeBWNnqn13AOHjZKo0WaT fOhXfri/LC4hpJqzEt3bQgFg3llfvh84SVE/ovWj9AqTkSoWOg6zynLnSqN17w2XkCPHqF TmAlD0XgO0/2o1FPB62M1ItVHXHIM2UmIrQjCCicecDvaYWrlZZ4mRqMT5bjug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydx754rwkzZlY; Thu, 23 Jan 2025 09:52:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N9q1vw073436; Thu, 23 Jan 2025 09:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N9q1Da073433; Thu, 23 Jan 2025 09:52:01 GMT (envelope-from git) Date: Thu, 23 Jan 2025 09:52:01 GMT Message-Id: <202501230952.50N9q1Da073433@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: 57820508a012 - stable/14 - rtld-elf/rtld.c: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 57820508a0128bb768bd8f54c6465bb2b88edada Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=57820508a0128bb768bd8f54c6465bb2b88edada commit 57820508a0128bb768bd8f54c6465bb2b88edada Author: Konstantin Belousov AuthorDate: 2025-01-18 06:33:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-23 09:46:57 +0000 rtld-elf/rtld.c: fix typo in comment (cherry picked from commit dd1d72961b8d343b29480b74afcfe4292fd166af) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index c0d0be1d6cda..47680c363187 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5319,7 +5319,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) maxalign = MAX(tcbalign, tls_static_max_align); tls_init_align = MAX(obj_main->tlsalign, 1); - /* Compute fragmets sizes. */ + /* Compute fragments sizes. */ extra_size = tcbsize - TLS_TCB_SIZE; post_size = calculate_tls_post_size(tls_init_align); tls_block_size = tcbsize + post_size; From nobody Thu Jan 23 09:52:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydx770wzwz5lvl4; Thu, 23 Jan 2025 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydx766M9cz3rxY; Thu, 23 Jan 2025 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y5i07r8Vn0Gbp4JfkPwF15rprcRuwytp24F9fQuJWg=; b=q93IYBn8AjJkZUOe+glZ6vnfjcv2JCulbzl/+bwfA+7e24sfUZsquCVHlSPKC6S4s4gmdt jIURB2DBdu9tySFZ6V1UDbDJvxtaZnilsPnATg4d0gXQMJinvZyEdBTxxwGR3znM958pW3 7Pu3cvW74Irg5IWosJbeAX09aKXD3hnSOuzAzKwve+zcutA0nJQ5v4qOKp2l61cN0qMZms hohcc6fF5bzkZ+MWPhBFSbskk9rPRaJ25rhHJOSLuzqFUksybL3x+34lLigBgrELOD8U3m bGuhZCc9NOCkn5NDdHpVK0e3CcYeLVTH1Yuv8x5nEL+SFg3vx2ALoHIOYyLJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737625922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Y5i07r8Vn0Gbp4JfkPwF15rprcRuwytp24F9fQuJWg=; b=PxSBTeu05Qs1PXQsz0ryRXtCP6ksrL62B8fO05OLotHudg7Q/hwHcMXXRnGt8xB1lGRYNu 64kSJipBltrtF/Sy3nS2T4zAc5LH4htiSruxqFM0T0p2T7UED/wDyfDoz/2TQ+SVcdEQpH DKCEN3ouNIEEiwvNN9ltW/Tcxjgl62m8SV42CGr9RpD4m5yq3BYoH7ZhUKPfJLG2EoYypD sZyCkL/r2M91gEC2SW7zSCa1MMK5Aep7qjOfxYSiLOqcc2fhz0843fjWfDCF2Fv2eWfsCV t7yYhujt7H9tnShKGAw257NznGHcxw7Q3no0d52yIA7eX4+wbbGM52g/COKYEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737625922; a=rsa-sha256; cv=none; b=tmG45GWpgtHLV+27e5VCjWO6dOITI9S9S133ugWjtkLFsAfqQZ2WInmhCELBTmS7sTDxHS +6wGoZL4v4Y4hGiMuVpUBJxukW+nxRGmI9xqYYZ0xIv+PQkJraxvfpl76mGfoXwtKRg4qS 2usn9LBXi62oAfgnCrfUOHOJPaaO0cxG4Ul2C5u92s2lwjaBE1gWxUBmXNt7kntP7boNa9 PbdynUFl5dLfBU13MhhDn4D5XQrkpo71m8FjbjCtixwvgHo3Yyj72Hp1dUnmwIqDe35NId 0ZBXKqcOpiTYLoYGWFv9LYEl20o+H5D6HHBWj/9Zexiyv/WWcxX9ZBG+39NdKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydx765tQYzZg1; Thu, 23 Jan 2025 09:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N9q2KZ073470; Thu, 23 Jan 2025 09:52:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N9q2Xc073467; Thu, 23 Jan 2025 09:52:02 GMT (envelope-from git) Date: Thu, 23 Jan 2025 09:52:02 GMT Message-Id: <202501230952.50N9q2Xc073467@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: f10a06556f56 - stable/14 - rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: f10a06556f56ddbcf348a7b1e67a8e89b71c739d Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f10a06556f56ddbcf348a7b1e67a8e89b71c739d commit f10a06556f56ddbcf348a7b1e67a8e89b71c739d Author: Konstantin Belousov AuthorDate: 2025-01-18 03:07:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-23 09:46:58 +0000 rtld-elf/{amd64,i386}/reloc.c: remove unneeded #ifdef dbg (cherry picked from commit e3035c52f25356299abc8e08be9221032967554d) --- libexec/rtld-elf/amd64/reloc.c | 2 -- libexec/rtld-elf/i386/reloc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index 9c5887def356..7e7f01a5d186 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -405,9 +405,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index 04a8354343bc..361bb777315a 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -358,9 +358,7 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *obj __unused, const Obj_Entry *refobj __unused, const Elf_Rel *rel __unused) { -#ifdef dbg dbg("reloc_jmpslot: *%p = %p", where, (void *)target); -#endif if (!ld_bind_not) *where = target; return (target); From nobody Thu Jan 23 10:17:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydxhx39WGz5kjc3; Thu, 23 Jan 2025 10:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydxhx2WJxz3xYD; Thu, 23 Jan 2025 10:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737627473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NqndeKLtt6Hmx1PtbH2fVic8AQaBr4aB1+yH6BMiPQ=; b=Jir9FDyg579kkX0GdMjS9gsy+ErgClBGBOS8gVzMxDbFMbdUhhgjIIeRHPJ/tk46CdBP3y aV/GnzMGXIJSJojuvgk+HlKtEN86OV8LTCiciKnhErC4+ruSvBI2muEV0wDkVutV6U8MCa sgJ10hWMBM5zTKgfnpCdwDf21mCD6IAJ48IOsRKnlEEnf0L4k1ND8EZJ2s9bbkNmn6tTJo qRliVAlrC/rJ3oB66BwOkSDpSkl33geaZChopQHbCYywLO/epyyTaoNB6LgANIvyVuoqm7 Tg0hL/59a6WAfZ67p7+WirI+X6FsRQEmgH53vzSYfq9i6xPM6wKeP4vHSJHuUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737627473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NqndeKLtt6Hmx1PtbH2fVic8AQaBr4aB1+yH6BMiPQ=; b=QlSbDeHgSXYejzriVzsnH+re0bh0sDko1jE/rMd3krqW9qGmeRkdXHkDssLmdcGfFNUqqd Tg36kNL9DMSUhufZHfvom/Y0/WVp51QylI/z36u16m4/zYimcTEIB2twm9Xfw3ShAxnPHE 4h3J7rskDzEONUOjw0wOj7aFBRo2O/1MHkGQXtLFghsHv0pg0GfITYmrFRW1GQaWyoQ2iZ FPgDgOPaCqXMwL9CXjiN03TplhE+H+Yh4at0B0LtUD1Ea6KO7Yn4zFFMqE5VSVOs35Ndjl +RrMPwK7QDerKxRSNnXEUnGVMdhDnYtEYXN89onEWdi1zykt2tQeNkyglgR6eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737627473; a=rsa-sha256; cv=none; b=cbIhEA8siW/BEfHWMv5lekRCPNJfjA476c30P4vIn5CcsGsvRIhqFRTxzPeYMg49AoXqm3 XyAl5ZEk/TkwAa5joE6MpngivuPyIr9gOuUqjuOroSDtEXPIzDFcLtrKh7MKeMhUYM5MY4 GlKbGbbmEcg5+2inmlixjW3/Dwx97X84pMPIdQOXPpTlxqMHW4fBmF67zYTVHzqfz23ozs i7bB1cAKSZtc+3OUFUulOD6QPwk4wvakIS/RqPOXqV488MD1e7e4hjl5QC9uZDk504vOzm WeH7N97upNwqcgCAt5iBXX1j8IQTPmPsvv40X+W/6Vw0n88d3Lp+e1fx6W1oXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydxhx227Bzbgr; Thu, 23 Jan 2025 10:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NAHrVM015188; Thu, 23 Jan 2025 10:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NAHro9015184; Thu, 23 Jan 2025 10:17:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 10:17:53 GMT Message-Id: <202501231017.50NAHro9015184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 09cbd68e4e47 - stable/13 - sysctl: Add flags to filter jail prison and vnet variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 09cbd68e4e4728dbac768937b35ad09995c20fea Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09cbd68e4e4728dbac768937b35ad09995c20fea commit 09cbd68e4e4728dbac768937b35ad09995c20fea Author: Zhenlei Huang AuthorDate: 2024-10-29 11:26:11 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 09:47:10 +0000 sysctl: Add flags to filter jail prison and vnet variables So users do not have to contact the source code to tell whether a variable is a jail prison / vnet one or not. Reviewed by: cy (previous version), markj, jamie (for #jails) MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D47107 (cherry picked from commit 5ec83c660acaf30c1d6b9417dbd8c80dfa9d56ac) --- sbin/sysctl/sysctl.8 | 9 +++++++-- sbin/sysctl/sysctl.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index ee3f8579882f..ff0a8cea266d 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd August 18, 2023 +.Dd October 29, 2024 .Dt SYSCTL 8 .Os .Sh NAME @@ -107,6 +107,8 @@ The purpose is to make use of .Nm for collecting data from a variety of machines (not all of which are necessarily running exactly the same software) easier. +.It Fl J +Display only jail prision sysctl variables (CTLFLAG_PRISON). .It Fl N Show only variable names, not their values. This is particularly useful with shells that offer programmable @@ -144,6 +146,8 @@ to standard error. Display only variables that are settable via loader (CTLFLAG_TUN). .It Fl t Print the type of the variable. +.It Fl V +Display only VNET sysctl variables (CTLFLAG_VNET). .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. @@ -316,7 +320,8 @@ option has been deprecated and is silently ignored. .Xr loader.conf 5 , .Xr sysctl.conf 5 , .Xr security 7 , -.Xr loader 8 +.Xr loader 8 , +.Xr jail 8 .Sh HISTORY A .Nm diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 6f5c886bbf05..0fe6c92dc386 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -64,6 +64,7 @@ static const char *conffile; static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; +static bool Jflag, Vflag; static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); @@ -136,7 +137,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:hiJNnoqtTVwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -166,6 +167,9 @@ main(int argc, char **argv) case 'i': iflag = 1; break; + case 'J': + Jflag = true; + break; case 'N': Nflag = 1; break; @@ -184,6 +188,9 @@ main(int argc, char **argv) case 'T': Tflag = 1; break; + case 'V': + Vflag = true; + break; case 'w': /* compatibility */ /* ignored */ @@ -992,10 +999,18 @@ show_var(int *oid, int nlen, bool honor_skip) if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) return (1); + /* if Jflag then only list sysctls that are prison variables. */ + if (Jflag && (kind & CTLFLAG_PRISON) == 0) + return (1); + /* if Tflag then only list sysctls that are tuneables. */ if (Tflag && (kind & CTLFLAG_TUN) == 0) return (1); + /* if Vflag then only list sysctls that are vnet variables. */ + if (Vflag && (kind & CTLFLAG_VNET) == 0) + return (1); + if (Nflag) { printf("%s", name); return (0); From nobody Thu Jan 23 10:57:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YdyZN2j6lz5klwk; Thu, 23 Jan 2025 10:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YdyZN1vfNz42rw; Thu, 23 Jan 2025 10:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737629836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D51q9atbZqGvKIWYZNNs2epEYYTSkfUF3/K/Do8UtO0=; b=Kt1Uo5oZ3hA+iDvpW9v0iY5Jvdb2CEaBKKRyC2hWK5lUqk2NQ47KdBrvoFeEE4JC3N8EQX e1Vk5Fz26j0isiGpUePHvEq8IZ19Ah2WOjcY9XXlGZXrES35FqSmXrJK0PbId6zhZAfLqw pGUUVI+wtWciKD+EKYL7UQCQxPBcSb2vi6iuobyX4rR4ZtsU0njqshh/G0P1EnszVsV8W6 1T99ZhUi6ATxxwGY38dYVYEdeXvogdGamVDGlRA08RAXYi0GkSoHdeGOz6F3Awsqf/HfI1 PECLIH2szOrs2ypKtMe6XjZnw8CZVpf1LIbaKUN6++96dvu9ZGUU2AawZc5UNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737629836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D51q9atbZqGvKIWYZNNs2epEYYTSkfUF3/K/Do8UtO0=; b=urxrcyCSA/2naDsD0CuHzTFkHGQWglE8uOnObmyuSfsl8wxv/v3E51VpVCVE2jYud2JdsC TpNZNL3rbHP9zOrwPdGZ8Ezr4SH22x2VjYeJYJ0MUnvJZhhGE1WSUuHo6jLkwNNEiub3pO eohSsl+3npsGU8wgame/Jk95a+PkBAMiFVT7jbBADBu65DycG5S+Mtq4TkwJESr87XlX8d Qq8ZJzHh/rg6ss/eJmmxpsix656Ai2GzYZo+dlQwWYcNmIZF5n+NXYQtaH9LYcEOX190lp lnpOwFIkaKNm/lDyeyNPa8zbdZAcCTBsk1b2CBBcz6m2Ei3W6M/j5Z6jPipqZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737629836; a=rsa-sha256; cv=none; b=Ck74/hKXxFO+m80UafrdBwhGSkYHHap0/uKzxSIwcjol++1Pdhl7QZJBWu+O/+maNn4HN4 uKzR7MuN2JbBbFVPnuWGqB5aJqfhL/qDaPZZP5K0LV0ZSYsCkXM3zFEV9TH2de+V/qqXEP v21hOhaOyxFWWVexbFbMlFPUHBL/aDu06ennSmal5xjAkGI6LRkiB0NJkZweGD+T4fNz3u ukjqkMiGZr/8RE0M4bRovnpr169qf3unVllsvVW+4kmbW1BTnNorn0m6uXlejSRxCrAgrH 3PKZp8QmR+RnCo4lvFT8Cfobx1M30U/HDHXN7srjca2no84MJQ+KnHHa8Z6Etg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YdyZN1PM0zbcV; Thu, 23 Jan 2025 10:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NAvGp4089287; Thu, 23 Jan 2025 10:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NAvGwU089284; Thu, 23 Jan 2025 10:57:16 GMT (envelope-from git) Date: Thu, 23 Jan 2025 10:57:16 GMT Message-Id: <202501231057.50NAvGwU089284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1a1a1728e0be - stable/14 - kern_sysctl: Make name2oid() non-destructive to the name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a1a1728e0bec6e5b978e6c5c7433ca91596b389 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1a1a1728e0bec6e5b978e6c5c7433ca91596b389 commit 1a1a1728e0bec6e5b978e6c5c7433ca91596b389 Author: Alexander Motin AuthorDate: 2023-09-23 16:13:46 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 10:56:26 +0000 kern_sysctl: Make name2oid() non-destructive to the name It is not the first time I see it panicking while trying to modify const memory. Lets make it safer and easier to use. While there, mark few functions using it also const. MFC after: 10 days (cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31) --- sys/kern/kern_sysctl.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2e983e2ff803..7f0bd48747f3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -127,6 +127,7 @@ static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); +static int name2oid(const char *, int *, int *, struct sysctl_oid **); static struct sysctl_oid * sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) @@ -142,6 +143,21 @@ sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) return (NULL); } +static struct sysctl_oid * +sysctl_find_oidnamelen(const char *name, size_t len, + struct sysctl_oid_list *list) +{ + struct sysctl_oid *oidp; + + SYSCTL_ASSERT_LOCKED(); + SYSCTL_FOREACH(oidp, list) { + if (strncmp(oidp->oid_name, name, len) == 0 && + oidp->oid_name[len] == '\0') + return (oidp); + } + return (NULL); +} + /* * Initialization of the MIB tree. * @@ -1317,21 +1333,26 @@ static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int -name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) +name2oid(const char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; + const char *n; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - oidp = sysctl_find_oidname(strsep(&name, "."), lsp); + n = strchrnul(name, '.'); + oidp = sysctl_find_oidnamelen(name, n - name, lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; (*len)++; - if (name == NULL || *name == '\0') { + name = n; + if (*name == '.') + name++; + if (*name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -2899,7 +2920,7 @@ db_show_sysctl_all(int *oid, size_t len, int flags) * Show a sysctl by its user facing string */ static int -db_sysctlbyname(char *name, int flags) +db_sysctlbyname(const char *name, int flags) { struct sysctl_oid *oidp; int oid[CTL_MAXNAME]; From nobody Thu Jan 23 11:21:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydz6P4bHBz5knHW; Thu, 23 Jan 2025 11:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydz6P40t2z481j; Thu, 23 Jan 2025 11:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BTmv3ZalWqRNFIM0q6qxaCQni8+yGDt4G2B95jbIkNA=; b=PZUaH3P24Pa7d6pwyhtbFbiIklZ9F7KkxHaPxsHEZOeaz4cIyFvu4JTJb6ImieCNfTJGdz 5F2UcB+i4XOmRIKyWVyw21/m+CUqul6Z9linzLvX8yIUitajRTZ9XQsyBABBhTa1GlRf5O qHvQQkUUta6RR/wMB+SxzQAquWBbNcP5MnztFr+AToi68Nn458E0cv4VGLW4SSep1W2WYc EKFBtu0+/f0uwUGUQyQdrSqFLTUOtdMNGIGXoAbE+PAdmO6FT9DYnrYaH+Q4MDEkDgss63 cq4ktJzpGHFNOWtVYM+Be/unJVWvWdnlr1CR2tehkfwukOgFzfA1NZmwbz6NkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BTmv3ZalWqRNFIM0q6qxaCQni8+yGDt4G2B95jbIkNA=; b=JLUAnpKsTGiXgfp4vS9l+dx3+kWOrrZpeK8tR/QhpQqSA14VA+LMV+vJL/uSm7tbL2g61v g42KslE8foWvViGMZ5SoJbzTszyETeskWQKynu3lED/fm9d1ie2twq2v7KT3s+Imqo62vT twTRXn4Fr04r3hcspBE4vnk6ZabtM00d9jkT7XaZt6qxePpxoObCclvGdYrVCzOPtnVNtP 6nTVQ9SO5ysqUWIkAe9NsN8jT2owksf3/IrTKnkd66ab5wdZCJota23pi0dJEsoyLXU6Lw Fg8QD99Pw4vq/bgaVyAG5rt6ibuZacEy3khEdxPSSzqpV2yFmpFOZrCeVHYYGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737631293; a=rsa-sha256; cv=none; b=RMOY+Py3zlZV7gFqjdkZLN5cTgnhL+i+Twb8TmWKdKVaNDcGwjl/wdqSovNcH083D2IZIw i+siMaEs+cKJI5N7QA2Rca6asafF7ni7RVSzNOweoJWrI3WX/WB9M0FDJ5LTs+a6Tg62YX ORQ2Sg2qKRJzzSqeUMg7AwJBlRyrINEb0EqFYFLQjMcxbRPXBC2f2gN/9SaVxlQ56Beg9b MCeLSk3QL4SRXs/RJ1MXpGNn5VAmqUWTxswzQnhSayu+FBuvdE/xtWfgBKxalbgVVkYsXP 6U5vopIitpI83RXn9QF/mhCcAkk8Sk3ChQt76d2i/j2ejrxAM0MhzHBmxqUEkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydz6P3bDBzd5q; Thu, 23 Jan 2025 11:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NBLXtb038098; Thu, 23 Jan 2025 11:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NBLXEI038095; Thu, 23 Jan 2025 11:21:33 GMT (envelope-from git) Date: Thu, 23 Jan 2025 11:21:33 GMT Message-Id: <202501231121.50NBLXEI038095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: c44335b1a313 - stable/13 - name2oid: use find_oidname List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c44335b1a3137628f1b5c657c11aff1a95329085 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c44335b1a3137628f1b5c657c11aff1a95329085 commit c44335b1a3137628f1b5c657c11aff1a95329085 Author: Doug Moore AuthorDate: 2022-09-27 21:17:55 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 11:09:18 +0000 name2oid: use find_oidname In name2oid, use sysctl _find_oidname instead of re-implementing it. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36765 (cherry picked from commit 9f6f9007b98fc407a1b064c4492697e27954191a) --- sys/kern/kern_sysctl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2543c4bde785..aa9d271f3bd2 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1323,17 +1323,11 @@ name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; - char *p; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - p = strsep(&name, "."); - - SYSCTL_FOREACH(oidp, lsp) { - if (strcmp(p, oidp->oid_name) == 0) - break; - } + oidp = sysctl_find_oidname(strsep(&name, "."), lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; From nobody Thu Jan 23 11:21:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ydz6Q6vPhz5knDk; Thu, 23 Jan 2025 11:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydz6Q5RxHz48Bm; Thu, 23 Jan 2025 11:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8JVI37aWZZHza9eLbQFO8lIyq8nZBtx/0qfWUN43iY=; b=Jzmq8eS1b+FW+DFBqBBvAupxTxBz+M20QCddMDTlcQpsPxBM3QO0SN2uTSS4CPg+i2qQf4 E+AVyjFMYq98obl8nkHcAkhSbLgnLDRJWe7OPbloglaZHd6Ds/eNZpgbEat56Sisi2SDHp YM7Kms2TC1BK6A3a5gZQsDTEkWaTsEujZZ0st9Hp9RQ42Za1JdWs1yKqIUADkzjlfe9voW ZggvsPlx4CvEGL/KHx5RHHbK7OVjqnqHTcGEdxtJQOgE9+XayoBojBIQ1oyX9U1JvgxTDT K/hRsXWD6QYNvErsQn3UIxXDYe0mdRGnep3owYkzrNNp7dQ65MbOZb+qbG8Tvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737631294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p8JVI37aWZZHza9eLbQFO8lIyq8nZBtx/0qfWUN43iY=; b=QA8LIeve4mnmE8vEe6iVinrGTvDXB++YQ5kZ1rSCcEk0PK3vcqwyob206udJRp+vt++XNo mFvu/84RPqjTx/KWFGhwD4bSUZy2fIIRAlNf4CL5FmHnjDgay9mRvSYqxRZfxSr8npo7Pl Yb9t43qig76y3ReAL42TMSEbSVDt3VErhTpgzga+scMY+sVBnPLSohZEgzMR1jQ6EmDtRO UjOHQJwQFbKrj65ZH9x/KgIZZidlJ4yH32qHAQc/N+xNRlI2oRSutPtZCJX0y717SXVJaG KA5rOfscmRUcX/2qmdhHS1m4haI2NY3jKpyfraDAvMrYHH3xGc/fVMXt/KUVqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737631294; a=rsa-sha256; cv=none; b=TskLaN15c38GFT51gNcI4LCuUW2F6xdY8bb3qRG+gJppDTK7nI+Nus9nZp2m23Llhcf+U/ 4s6zxbKnJ7lPso2sr/3PMrC/BSnEg7eYBYJ+vPBRHelK0N70HUXqBoDCMo2LY7TQNi9FnY 0VbRzg6WaRFgE562Fa/1rya8HFcU631nQrMswE3brFKn5Q6anYNSeDMVyzZjQdjOSW1vew RyXls+ujM8jxJAQNKW6soKUJSz0NaGV6K/5KX8WG3tZBCwfS6EIdDGpnq3MlpifpVU0fzh bbWQhfY7kA4rD9Flww9j4rI+ta0D2cox7DyWevDZeFdKMjnbf9Mp+/exzvVo5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ydz6Q4Lslzd5r; Thu, 23 Jan 2025 11:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NBLYUF039194; Thu, 23 Jan 2025 11:21:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NBLYoq039191; Thu, 23 Jan 2025 11:21:34 GMT (envelope-from git) Date: Thu, 23 Jan 2025 11:21:34 GMT Message-Id: <202501231121.50NBLYoq039191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 69e2004d8434 - stable/13 - kern_sysctl: Make name2oid() non-destructive to the name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 69e2004d843452bffdebdf164ab5346b1b81a9e6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=69e2004d843452bffdebdf164ab5346b1b81a9e6 commit 69e2004d843452bffdebdf164ab5346b1b81a9e6 Author: Alexander Motin AuthorDate: 2023-09-23 16:13:46 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 11:09:34 +0000 kern_sysctl: Make name2oid() non-destructive to the name It is not the first time I see it panicking while trying to modify const memory. Lets make it safer and easier to use. While there, mark few functions using it also const. MFC after: 10 days (cherry picked from commit f80babf906b7be51b2a031ef26525893c7bf4e31) (cherry picked from commit 1a1a1728e0bec6e5b978e6c5c7433ca91596b389) --- sys/kern/kern_sysctl.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index aa9d271f3bd2..a19f3a5ab27b 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -125,6 +125,7 @@ static int sysctl_remove_oid_locked(struct sysctl_oid *oidp, int del, int recurse); static int sysctl_old_kernel(struct sysctl_req *, const void *, size_t); static int sysctl_new_kernel(struct sysctl_req *, void *, size_t); +static int name2oid(const char *, int *, int *, struct sysctl_oid **); static struct sysctl_oid * sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) @@ -140,6 +141,21 @@ sysctl_find_oidname(const char *name, struct sysctl_oid_list *list) return (NULL); } +static struct sysctl_oid * +sysctl_find_oidnamelen(const char *name, size_t len, + struct sysctl_oid_list *list) +{ + struct sysctl_oid *oidp; + + SYSCTL_ASSERT_LOCKED(); + SYSCTL_FOREACH(oidp, list) { + if (strncmp(oidp->oid_name, name, len) == 0 && + oidp->oid_name[len] == '\0') + return (oidp); + } + return (NULL); +} + /* * Initialization of the MIB tree. * @@ -1319,21 +1335,26 @@ static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int -name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) +name2oid(const char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp = &sysctl__children; + const char *n; SYSCTL_ASSERT_LOCKED(); for (*len = 0; *len < CTL_MAXNAME;) { - oidp = sysctl_find_oidname(strsep(&name, "."), lsp); + n = strchrnul(name, '.'); + oidp = sysctl_find_oidnamelen(name, n - name, lsp); if (oidp == NULL) return (ENOENT); *oid++ = oidp->oid_number; (*len)++; - if (name == NULL || *name == '\0') { + name = n; + if (*name == '.') + name++; + if (*name == '\0') { if (oidpp) *oidpp = oidp; return (0); @@ -2909,7 +2930,7 @@ db_show_sysctl_all(int *oid, size_t len, int flags) * Show a sysctl by its user facing string */ static int -db_sysctlbyname(char *name, int flags) +db_sysctlbyname(const char *name, int flags) { struct sysctl_oid *oidp; int oid[CTL_MAXNAME]; From nobody Thu Jan 23 12:39:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf0qx00Zjz5kt8m; Thu, 23 Jan 2025 12:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf0qw6W5vz3THB; Thu, 23 Jan 2025 12:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737635948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcFDUvsYdwL04dfvo+JPneBiLnLz/QNU5Whhyypa8GE=; b=YFEv0+/AZSQq8a8qAOrneARndfori8GfBUkoirKl2SHUSuATd/vZkpoVu8QyAY2inq1vsO R9v8Gua4XivgRxt2LnY6+Yu+3msYu1icvDmgQmbwSJVKFHHRMi9k1R2j2iWJ8zFqgT70v2 LfST62GMeSGyt8J2UuxaA2wlL3N44zWdrRsJDYrOQRyTxKg4it+i1XWaGmVAlfEwFrAyNt mz3A1ry/gJeVexEJKnWJC1QJI2ByN8tyPXUawgdOiA6hLGvutu95kx+bY2cd8TkX3L9Y1W xAWh86uThq/ogiD48gySBKE09A89F4NwiaEklNuSRUQXoLkguHFdYcg8uaJD5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737635948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcFDUvsYdwL04dfvo+JPneBiLnLz/QNU5Whhyypa8GE=; b=t0wD4kfG9Mke5z0P74wo61/p74X49F865iNXn96gHcuxwA3KksAiN0WCsBe9+fLIk+WsJV cBDgA3Ok8etwoqOluR31oWzRnEVFzFrBE4FTavW2EmejpfTjA5oU9fIWUY9po7ZL9aIDKR P/Sr677/2krmx4DfE34yRum1SEl8Ko7pvg+s2uVikJr88nJHdUL+r7do4o2TSg35uFSuUL BcoF+qSQabLwYvCeyR1iUq5bxQ6V72Ljii0jrtd2l4MwLB1vXAGZ0gWMIoix/RoSZV5MAB QbesSMWNuKi+KRBIDrosDpSG7NWnQAIQSJAxk45kZquUTH/NCHUmSEu98M8pCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737635948; a=rsa-sha256; cv=none; b=GssApfCfSrWiT9HSnqvc509sCqV8F+w9V7hKFTotbWzgRKBI4sovlqDkKYD0i5mTImD20K ruqmB9P0aiwe/AqpFidnKXjs4n0mStdDwGQGqdXZeOR/GBvt5hf/0Y+VQOAvJiv2IAeBr4 R507Z+tMxh/kQ8Fpy7POT49DDnf2jNE4dchEswODZBZU9H92GRjDKm3NoE1/cZC/5grFDm pluqy169wiCcPrwrVLLCrrFVvq5kBgKJDJ7M3aXEPBb8PpBJl376FN/Y/UYx3H2ai/W7TG KMElHwWBqVTOhboNiiXL2KETr883ML5EdyxBmVdCkT4l6IbnRIrDRij5aA7s9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf0qw62wdzflx; Thu, 23 Jan 2025 12:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NCd8Qh076958; Thu, 23 Jan 2025 12:39:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NCd8Qi076955; Thu, 23 Jan 2025 12:39:08 GMT (envelope-from git) Date: Thu, 23 Jan 2025 12:39:08 GMT Message-Id: <202501231239.50NCd8Qi076955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e02b579b5379 - main - sound tests: Fix 32bit calculation detection in pcm_read_write List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e02b579b537998495b06d02be6aa07f03db3a42a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e02b579b537998495b06d02be6aa07f03db3a42a commit e02b579b537998495b06d02be6aa07f03db3a42a Author: Florian Walpen AuthorDate: 2025-01-23 12:38:00 +0000 Commit: Christos Margiolis CommitDate: 2025-01-23 12:38:00 +0000 sound tests: Fix 32bit calculation detection in pcm_read_write Fix a mistake in the pcm_read_write test that would result in not properly detecting 32bit calculation on 32bit architectures like i386. As a consequence, the wrong values would be checked, thus failing the test. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D48617 --- tests/sys/sound/pcm_read_write.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c index e40ce52b67cc..7ef310a35c25 100644 --- a/tests/sys/sound/pcm_read_write.c +++ b/tests/sys/sound/pcm_read_write.c @@ -95,8 +95,14 @@ local_normalize(intpcm_t value, int val_bits, int norm_bits) static intpcm_t local_calc_limit(intpcm_t value, int val_bits) { - /* Avoid implementation defined behavior. */ - if (sizeof(intpcm32_t) == 32 && val_bits == 32) + /* + * When intpcm32_t is defined to be 32bit, calculations for mixing and + * volume changes use 32bit integers instead of 64bit. To get some + * headroom for calculations, 32bit sample values are restricted to + * 24bit magnitude in that case. Also avoid implementation defined + * behavior here. + */ + if (sizeof(intpcm32_t) == (32 / 8) && val_bits == 32) /* Divide instead of right shift (value may be negative). */ return (value / (1 << 8)); return value; @@ -456,7 +462,7 @@ ATF_TC_BODY(pcm_write, tc) } local_pcm_write_calc(dst, value, test->format); ATF_CHECK_MSG(memcmp(dst, expected, sizeof(dst)) == 0, - "pcm_write[\"%s\"].value: " + "pcm_write[\"%s\"].calc: " "expected={0x%02x, 0x%02x, 0x%02x, 0x%02x}, " "result={0x%02x, 0x%02x, 0x%02x, 0x%02x}, ", test->label, expected[0], expected[1], expected[2], expected[3], From nobody Thu Jan 23 12:58:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf1GH4ln8z5kvQS; Thu, 23 Jan 2025 12:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf1GH3pmtz3VwM; Thu, 23 Jan 2025 12:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737637111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYGwskPS6Sye15IhwBXXX9pIAuzDe4DWMcsugCsEUtQ=; b=WhUEBessWl4xE8kJ1rTXnEfh9Wd5bD/qRp4E4YsM/5YfiuvHNuVsaekS6LFnjFXNLMKcOs vNjyCnvEDldtq93Z900ntvpJ8EpEu7Gg1iURBYMA57XCZMWir++9+cQWFl0J2ClAzb+Yo9 3tJTgIWdqEHLdqylzwxifyvdfRiTRgquQ3h6jydwf3oNf9seozGQNYkJkmDEtHCdFXq4B+ fro5z0HAcHEvE90hjwFQNlsByigUacMDpjeEicqKu+MWNdi6+ayeK+ztI2fdEpujLhVRGU wnOLIvqUxpRyuh0tre+FBp8wu5V6R90X+s3XyzxTlD1+9CkoY1USQ9i534tPMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737637111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYGwskPS6Sye15IhwBXXX9pIAuzDe4DWMcsugCsEUtQ=; b=J5jv1ZgtrOHcf/UHeG68wGcMP57dvBCfM5mwdoIER+H1/3cyEttGuawzVvZHVux7L5lMcu ABxZqN0oyi2zBog7aqb/UuPiJXRvQMTvydLYt4NId/fYsEpjtxKOhsiMi4zfnEm3l79PcK s5M57X3k2MNO/gUcMHVf5hxLMuGuIJL76TuAu7MIN25LMx2VRdwpS4sPZUXhaofNs8Se9t IvK1Xy8o0V4/Z4v7SYChIzHnM9/l17eenVHEnFOBTl+hDOUohpPooy9yl7DykqkQm+hJ9d Y0LRYQU/apdgCXJzmBG7QsVjMtYEgeDqzKxJXIvPbQelFxyGKuP6CzLIb8yFpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737637111; a=rsa-sha256; cv=none; b=M4jh2PkLmaZ7gLxY7M0zDTdxosDQtWE01hXuq3o/znPzEi8S2UQSLQ9j7lVaTs8jk3BF/L zRDw65bB+GWU6Y2Mdt+Me/8xsDVWQWbXTOX227DYOF0BUlCQ6fs9CV6pxlhV3I1TD4tHCQ gCiqKpSHqLtQpCVgg0p0MWqDdrkoLQqUIys74y7Ec/v7unPGJxOwfbL5S/V76CpeTDlvgV DRtVsjvdLOp/geQkQsWvov3ff7Ptf2QLEfbHoaXJkpD9cldFryOHNmEEO2vvbIZ8R/t7C9 wuajtog4gHa+F854YoDF9upFkTUyhGj8re142wRSfDffHtXrRTUgLsp6bfFNUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf1GH3LBbzgRd; Thu, 23 Jan 2025 12:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NCwV1I014336; Thu, 23 Jan 2025 12:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NCwVRh014333; Thu, 23 Jan 2025 12:58:31 GMT (envelope-from git) Date: Thu, 23 Jan 2025 12:58:31 GMT Message-Id: <202501231258.50NCwVRh014333@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: 697c1568b75a - main - pf: fix IPv6 route lookup for nat64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 697c1568b75a0053e422782dd7c0d9d1e28a67e8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=697c1568b75a0053e422782dd7c0d9d1e28a67e8 commit 697c1568b75a0053e422782dd7c0d9d1e28a67e8 Author: Kristof Provost AuthorDate: 2025-01-23 09:53:55 +0000 Commit: Kristof Provost CommitDate: 2025-01-23 12:53:18 +0000 pf: fix IPv6 route lookup for nat64 The route lookup in pf_route6() (for the nat64 case) had the src/dst for bcopy() swapped around, so any nat64 setup that passed via a gateway on the IPv6 side was broken. Fix this, add 'const' to make this error actually fail to compile and add a test case. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 6 ++--- tests/sys/netpfil/pf/nat64.sh | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 3b9c71296a2b..83eca735d2bb 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8961,7 +8961,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, if (ifp == NULL && (pd->af != pd->naf)) { /* We're in the AFTO case. Do a route lookup. */ - struct nhop_object *nh; + const struct nhop_object *nh; nh = fib4_lookup(M_GETFIB(*m), ip->ip_dst, 0, NHR_NONE, 0); if (nh) { ifp = nh->nh_ifp; @@ -9220,14 +9220,14 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } if (ifp == NULL && (pd->af != pd->naf)) { - struct nhop_object *nh; + const struct nhop_object *nh; nh = fib6_lookup(M_GETFIB(*m), &ip6->ip6_dst, 0, NHR_NONE, 0); if (nh) { ifp = nh->nh_ifp; /* Use the gateway if needed. */ if (nh->nh_flags & NHF_GATEWAY) - bcopy(&dst.sin6_addr, &nh->gw6_sa.sin6_addr, + bcopy(&nh->gw6_sa.sin6_addr, &dst.sin6_addr, sizeof(dst.sin6_addr)); else dst.sin6_addr = ip6->ip6_dst; diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 79fa0c99a311..913f90480e5d 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -609,6 +609,68 @@ dummynet_cleanup() pft_cleanup } +atf_test_case "gateway6" "cleanup" +gateway6_head() +{ + atf_set descr 'NAT64 with a routing hop on the v6 side' + atf_set require.user root +} + +gateway6_body() +{ + pft_init + + epair_lan_link=$(vnet_mkepair) + epair_link=$(vnet_mkepair) + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet6 2001:db8:1::2/64 up no_dad + route -6 add default 2001:db8:1::1 + + vnet_mkjail lan_rtr ${epair}b ${epair_lan_link}a + jexec lan_rtr ifconfig ${epair}b inet6 2001:db8:1::1/64 up no_dad + jexec lan_rtr ifconfig ${epair_lan_link}a inet6 2001:db8::2/64 up no_dad + jexec lan_rtr route -6 add default 2001:db8::1 + jexec lan_rtr sysctl net.inet6.ip6.forwarding=1 + + vnet_mkjail rtr ${epair_lan_link}b ${epair_link}a + jexec rtr ifconfig ${epair_lan_link}b inet6 2001:db8::1/64 up no_dad + jexec rtr ifconfig ${epair_link}a 192.0.2.1/24 up + jexec rtr route -6 add default 2001:db8::2 + + vnet_mkjail dst ${epair_link}b + jexec dst ifconfig ${epair_link}b 192.0.2.2/24 up + jexec dst route add default 192.0.2.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8:1::1 + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + atf_check -s exit:0 -o ignore \ + jexec dst ping -c 1 192.0.2.1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass in on ${epair_lan_link}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" + + # One ping + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + # Make sure packets make it even when state is established + atf_check -s exit:0 \ + -o match:'5 packets transmitted, 5 packets received, 0.0% packet loss' \ + ping6 -c 5 64:ff9b::192.0.2.2 +} + +gateway6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -624,4 +686,5 @@ atf_init_test_cases() atf_add_test_case "table_range" atf_add_test_case "table_round_robin" atf_add_test_case "dummynet" + atf_add_test_case "gateway6" } From nobody Thu Jan 23 13:58:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf2bw58hbz5l041; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2bw4TXYz3bqs; Thu, 23 Jan 2025 13:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOgB/7cyjpL2wubQyJZHxXEXU6q2GzrVW6xXVQ3saAM=; b=Lqbo8DLQzVgSmi7DeECJ2e6JXESicm6RST7DqA+xPxTSKPuaoiCPeZh/5Mpu4QQhJCUVqR mLmq+6S3ujE/AZ2fx5tAlmPQD8W9UEK1imSSl9rDA3BwYA+kwa4Ebwnhodxqg74rBdBh2V GeTsOI2Vzz/7zADwjABGW6BLXSAuiKWq1vX7Cpue0tocKqxdzMvECOKNKTbrM0q00wwtqV k+osiONNuJt8//kgZNsM2v5fwZVbln3EKvn2IiopgdYjWiN5FwX82B8yf2rCxR0HKXqzbq AtYYcFcQyxyhghAIWVnw68pQfFFJP0/tsgbi7sigBqVCK5OTCdKSbkR//8DDaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GOgB/7cyjpL2wubQyJZHxXEXU6q2GzrVW6xXVQ3saAM=; b=ukmu2otBVUUrlp0QsnS4cxN3ybW3P+Tojri99p0MussZqSSDRZZ2hhVx2bUvePmvZstt6q q+nXrv6EP8pY4H+KlD2cj60jNIhhotSADo1qxeSpUUOBlpTHQdHtf7Carvi/2Q67wfZyna h8h/kzVA0ggbs3mFEQaK/5zlMfLtcn2T0BKjo2Wi1cZe8sduJmOrVzWYP34ZdHjX1onS7l ToDkfmug9llzR+wVbIVQPUEpDCzCiAC9pxcEWKo7o9+gpmX4iyOBr4pUx3BIy5H3eX3jx3 Xulr5dC8dBt+vt9ssSst7HRYLHbl9CBaE8u4n9cRt7F8XuD/UlB7AHGuevud+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640732; a=rsa-sha256; cv=none; b=gZqfAGguLJLEqx3sAz8ydNIR9gcw+v3I/zgMR/QbOK4vaRRl6vES4TQPGVJFaWtrnYPitR IjhRbkaxfD+tiSghliPPLJG2yEhgLk1im7PJvB39t6Up4iGlNvxfbPDIm0evfRMZe83iG5 ZBzj22OhczhOlmnMujUcu4TqZNsV7dXSpVr8Sa0rA+lpan22eWHN5hhv1GMbovcJCXy1WB +c+vBq7DgWY5s8kwmGMfZF34tmPpebh5n54zGrNBG8T2ZXpln+t7Gc7On1rFveDlLQjtnx CgvWfCEzo/jxmnifJnUGt+EIl02xaCiPF+jUhIz02oC5iD0VBqKIoVqOtb92CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2bw3xGFzj8t; Thu, 23 Jan 2025 13:58:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwqs8026233; Thu, 23 Jan 2025 13:58:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwqSh026230; Thu, 23 Jan 2025 13:58:52 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:52 GMT Message-Id: <202501231358.50NDwqSh026230@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: 49f741240242 - stable/14 - inpcb: Further restrict binding to a port owned by a different UID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 49f7412402428e827f4f8b3583703a6784baa764 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49f7412402428e827f4f8b3583703a6784baa764 commit 49f7412402428e827f4f8b3583703a6784baa764 Author: Mark Johnston AuthorDate: 2024-12-23 15:31:11 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 inpcb: Further restrict binding to a port owned by a different UID See commit 4f02a7d739b3 for more background. I cannot see a good reason to continue ignoring mismatching UIDs when binding to INADDR_ANY. Looking at the sdr.V2.4a7n sources (mentioned in bugzilla PR 7713), there is a CANT_MCAST_BIND hack wherein the application binds to INADDR_ANY instead of a multicast address, but CANT_MCAST_BIND isn't defined for FreeBSD builds. It seems unlikely that we still have a use-case for allowing sockets from different UIDs to bind to the same port when binding to the unspecified address. And, as noted in D47832, applications like sdr would have been broken by the inverted SO_REUSEPORT check removed in that revision, apparently without any bug reports. Let's break compatibility and simply disallow this case outright. Also, add some comments, remove a hack in a regression test which tests this funtionality, and add a new regression test to exercise the remaining checks that were added in commit 4658dc8325e03. MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47870 (cherry picked from commit c9756953bded0d8428027fa3e812c9bdac069252) --- sys/netinet/in_pcb.c | 11 ++++- sys/netinet6/in6_pcb.c | 11 ++++- tests/sys/netinet/socket_afinet.c | 86 ++++++++++++++++++++++++++++++++++----- 3 files changed, 94 insertions(+), 14 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 15729bcd1ce3..937fa6f826c0 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -921,13 +921,20 @@ in_pcbbind_avail(struct inpcb *inp, const struct in_addr laddr, if (!IN_MULTICAST(ntohl(laddr.s_addr)) && priv_check_cred(inp->inp_cred, PRIV_NETINET_REUSEPORT) != 0) { + /* + * If a socket owned by a different user is already + * bound to this port, fail. In particular, SO_REUSE* + * can only be used to share a port among sockets owned + * by the same user. + * + * However, we can share a port with a connected socket + * which has a unique 4-tuple. + */ t = in_pcblookup_local(inp->inp_pcbinfo, laddr, lport, INPLOOKUP_WILDCARD, cred); if (t != NULL && (inp->inp_socket->so_type != SOCK_STREAM || in_nullhost(t->inp_faddr)) && - (!in_nullhost(laddr) || - !in_nullhost(t->inp_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index b3b2f03451aa..a88e47abef64 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -241,13 +241,20 @@ in6_pcbbind_avail(struct inpcb *inp, const struct sockaddr_in6 *sin6, if (!IN6_IS_ADDR_MULTICAST(laddr) && priv_check_cred(inp->inp_cred, PRIV_NETINET_REUSEPORT) != 0) { + /* + * If a socket owned by a different user is already + * bound to this port, fail. In particular, SO_REUSE* + * can only be used to share a port among sockets owned + * by the same user. + * + * However, we can share a port with a connected socket + * which has a unique 4-tuple. + */ t = in6_pcblookup_local(inp->inp_pcbinfo, laddr, lport, INPLOOKUP_WILDCARD, cred); if (t != NULL && (inp->inp_socket->so_type != SOCK_STREAM || IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && - (!IN6_IS_ADDR_UNSPECIFIED(laddr) || - !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index ba8c03af46a6..6fc98d982602 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -337,7 +337,8 @@ ATF_TC_BODY(socket_afinet_bindany, tc) * Returns true if the bind succeeded, and false if it failed with EADDRINUSE. */ static bool -child_bind(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt, bool unpriv) +child_bind(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt, + bool unpriv) { const char *user; pid_t child; @@ -483,16 +484,8 @@ multibind_test(const atf_tc_t *tc, int domain, int type) /* * Multi-binding is only allowed when both * sockets have the same owner. - * - * XXX-MJ we for some reason permit this when - * binding to the unspecified address, but I - * don't think that's right */ - if (flags[flagi] && opts[opti] != 0 && - opts[opti] != SO_REUSEADDR && opti == optj) - ATF_REQUIRE(res); - else - ATF_REQUIRE(!res); + ATF_REQUIRE(!res); } ATF_REQUIRE(close(s) == 0); } @@ -517,6 +510,78 @@ ATF_TC_BODY(socket_afinet_multibind, tc) multibind_test(tc, AF_INET6, SOCK_DGRAM); } +static void +bind_connected_port_test(const atf_tc_t *tc, int domain) +{ + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + struct sockaddr *sinp; + int error, sd[3], tmp; + bool res; + + /* + * Create a connected socket pair. + */ + sd[0] = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd[0] >= 0, "socket failed: %s", strerror(errno)); + sd[1] = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd[1] >= 0, "socket failed: %s", strerror(errno)); + if (domain == PF_INET) { + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = htonl(INADDR_ANY); + sin.sin_port = htons(0); + sinp = (struct sockaddr *)&sin; + } else { + ATF_REQUIRE(domain == PF_INET6); + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_addr = in6addr_any; + sin6.sin6_port = htons(0); + sinp = (struct sockaddr *)&sin6; + } + + error = bind(sd[0], sinp, sinp->sa_len); + ATF_REQUIRE_MSG(error == 0, "bind failed: %s", strerror(errno)); + error = listen(sd[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen failed: %s", strerror(errno)); + + error = getsockname(sd[0], sinp, &(socklen_t){ sinp->sa_len }); + ATF_REQUIRE_MSG(error == 0, "getsockname failed: %s", strerror(errno)); + + error = connect(sd[1], sinp, sinp->sa_len); + ATF_REQUIRE_MSG(error == 0, "connect failed: %s", strerror(errno)); + tmp = accept(sd[0], NULL, NULL); + ATF_REQUIRE_MSG(tmp >= 0, "accept failed: %s", strerror(errno)); + ATF_REQUIRE(close(sd[0]) == 0); + sd[0] = tmp; + + /* bind() should succeed even from an unprivileged user. */ + res = child_bind(tc, SOCK_STREAM, sinp, 0, false); + ATF_REQUIRE(!res); + res = child_bind(tc, SOCK_STREAM, sinp, 0, true); + ATF_REQUIRE(!res); +} + +/* + * Normally bind() prevents port stealing by a different user, even when + * SO_REUSE* are specified. However, if the port is bound by a connected + * socket, then it's fair game. + */ +ATF_TC(socket_afinet_bind_connected_port); +ATF_TC_HEAD(socket_afinet_bind_connected_port, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "unprivileged_user"); +} +ATF_TC_BODY(socket_afinet_bind_connected_port, tc) +{ + bind_connected_port_test(tc, AF_INET); + bind_connected_port_test(tc, AF_INET6); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_afinet); @@ -527,6 +592,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, socket_afinet_stream_reconnect); ATF_TP_ADD_TC(tp, socket_afinet_bindany); ATF_TP_ADD_TC(tp, socket_afinet_multibind); + ATF_TP_ADD_TC(tp, socket_afinet_bind_connected_port); return atf_no_error(); } From nobody Thu Jan 23 13:58:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf2by0kQsz5l042; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2bx54Rhz3byc; Thu, 23 Jan 2025 13:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBRzkyQHKUcDaon1Zk6IwjLy4ZMjiKkWYySWWY7XmSw=; b=sVza74/3yoSAakqirQXl10UPpJuYKIb6QCSR96Lwzk9SgZRYKoY0YbdRuiw1zfjtxTqTrr 7ycymXx8w/ZpFmlFOO65SiTMGQZrRjKrs0oZS63I0NsHWouinj9tCCiK9pmpTmr7uPHjA/ jM3dktRW9vJ5tcoYH/wffPIl4cKxyc89WVSRTlLKz+L6DtmL9q6N+OER4eyhJfslmNOI50 zqWjPUlaN5yJ10b+pJ/hyH362TVdpQ0t4vnop/VIVKZvvdQfliva1cVOPa1UaSX/PSLeCA Pxx2GMRVLjPwvcuj6GBpwyaKJ5zzwOJcDz6zedVxaVedxJ9K+V0UhAanP+vWuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBRzkyQHKUcDaon1Zk6IwjLy4ZMjiKkWYySWWY7XmSw=; b=QYHFXHpFdcfgKTxAHWj8HtVdCBfCZogCUaTRhPJgcM4GrGkVV2bShDLFEiUSL2HFSX/a8L Ea/W/KkAh7QAvJxokkJ/kVejfuVfJrNh26SLil75kDPnpW8Wl/6xR+q9SsOJ+qlA3t5SVM cETqzXcw0gUgN8m+vLIx5XafEE6XZy5/QRpnBcmr0ires/+dL/JvoW17oVEFZahEyd5pZT z0N2qz51rWpoOfU4BLIx77WJoK3Qq1Ih+z7NOumyzZBJ22Xw1CJ+ov4EftLYesBVJ1YP76 GV+uEtBh8nLX2fKpO4swctxnKONhjgbP5SWKyL37hMqqpxTKoX1jDB5EBCul2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640733; a=rsa-sha256; cv=none; b=U48Il/OJeS2Id1D5R9Rq51KrrvIcbNihecC6S24zvi9PKo+vPNGB4w7XZ+qn7bVUBAac8M HF3VoP2xyueMx1Ar3sxuQyXbYTmk/Kt2RMU0l59aKzfx6Ytasfdmu5ovbuUy9gSdY88kpp nyZH9xusIA1hq7ObDT3PJFOhh2FINojmKWIujouTZ9C+FlwXJj4uekIE8aXTTHxTSR2mjH Go0IHcHVJ4ltRVUODQ7NXce+/YW+58PdD3B01988fvY5QbzR/DcEJBqqhVueogjaiyh7lf V9b473RHu9mO6yR7O4RH6nI1FX0KC9wZvbiqcIojF8DtQSLTQ6tk24C0JeJz+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2bx4TTjzjBt; Thu, 23 Jan 2025 13:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwr50026268; Thu, 23 Jan 2025 13:58:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwrVr026265; Thu, 23 Jan 2025 13:58:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:53 GMT Message-Id: <202501231358.50NDwrVr026265@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: 67e54a07e948 - stable/14 - vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 67e54a07e948d99f97322a9933a438f5c64caf3d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=67e54a07e948d99f97322a9933a438f5c64caf3d commit 67e54a07e948d99f97322a9933a438f5c64caf3d Author: Mark Johnston AuthorDate: 2025-01-09 14:54:10 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning Right now we have the vm.pageout_cpus_per_thread tunable which controls the number of threads to start up per CPU per NUMA domain, but after booting, it's not possible to disable multi-threaded scanning. There is at least one workload where this mechanism doesn't work well; let's make it possible to disable it without a reboot, to simplify troubleshooting. Reviewed by: dougm, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48377 (cherry picked from commit 55b343f4f9bc586eba5e26a2524a35f04dd60c65) --- sys/vm/vm_page.c | 1 + sys/vm/vm_pageout.c | 9 +++++++-- sys/vm/vm_pagequeue.h | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 2facdca9bf27..7eebf30e19a7 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -460,6 +460,7 @@ vm_page_domain_init(int domain) vmd->vmd_free_count = 0; vmd->vmd_segs = 0; vmd->vmd_oom = false; + vmd->vmd_helper_threads_enabled = true; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 3b07af2c76d4..bc946e2bb844 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1657,8 +1657,9 @@ vm_pageout_inactive_dispatch(struct vm_domain *vmd, int shortage) * If we have more work than we can do in a quarter of our interval, we * fire off multiple threads to process it. */ - threads = vmd->vmd_inactive_threads; - if (threads > 1 && vmd->vmd_inactive_pps != 0 && + if ((threads = vmd->vmd_inactive_threads) > 1 && + vmd->vmd_helper_threads_enabled && + vmd->vmd_inactive_pps != 0 && shortage > vmd->vmd_inactive_pps / VM_INACT_SCAN_RATE / 4) { vmd->vmd_inactive_shortage /= threads; slop = shortage % threads; @@ -2295,6 +2296,10 @@ vm_pageout_init_domain(int domain) pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid)); vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd); + SYSCTL_ADD_BOOL(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO, + "pageout_helper_threads_enabled", CTLFLAG_RWTUN, + &vmd->vmd_helper_threads_enabled, 0, + "Enable multi-threaded inactive queue scanning"); } static void diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 1f1f818d3ec3..70122fef9fff 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -254,8 +254,9 @@ struct vm_domain { /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - bool vmd_oom; - u_int vmd_inactive_threads; + bool vmd_oom; /* An OOM kill was requested. */ + bool vmd_helper_threads_enabled;/* Use multiple threads to scan. */ + u_int vmd_inactive_threads; /* Number of extra helper threads. */ u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ blockcount_t vmd_inactive_starting; /* Number of threads started. */ From nobody Thu Jan 23 13:58:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf2bz4Ldbz5kyhL; Thu, 23 Jan 2025 13:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2by653Cz3bp0; Thu, 23 Jan 2025 13:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+We/OAfx9sL1F8I+KQIZRpc/7sO2kUXa/9HUtrFqyDM=; b=T7h4SiPXj9uBu7oMg1Nnlpra2hSfmnEVpuDWhY4owJYk++1a92KtxWtP7unzLp1eNulqS7 eCQD94BjAcoQkavcOY3wsypU0ObviaeGWef+k1FjgnroO+Fnofz08Phyd1llRqZcBMMts8 DomyAvQgNg/KK0XgLX083FW3Hx7Na705daTPrdm3ElZePoR/NRTQoe+Fr4WddkSSXkl4s2 ldaGBAuNxwFfJIYoenAV4vDpr0F4a7SCjviZr9LH31m8f0Xk7f4AIEKfJdooxBtPMCGRlP fRXaqSEmuDM0s3E6w3n/XFqS52gjg0ZmU+SGCZRgy4ZOIzKzxo+mvNyayj5zuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+We/OAfx9sL1F8I+KQIZRpc/7sO2kUXa/9HUtrFqyDM=; b=wetAJLohyZn4CbGsCyKv170PEEE0iwGQ5WQ8SpfdAvs3wyA170agdYe/yRdBaqpCKn5ocE TLbCT/qMANiZxBEHn3TJL0MEUespL8lR3ps/bSsIYdry3M6Ecn7ZWGePpUrSqofDlVKZQX Xx7Yez0m6wN6X7zDrjVfLxL3ovb2PGo3RSMLsWge99eJffi9/Kq6Ema2aYgHGmku9KWgUx 5SVTZFFkw1VvAsRLZ+hsWPIKvn0htdrSbqkgxnlLf37ODaCv8fqHUr4x805YYevaaxzqyR j001aiGGNOl4MNc6FnzBgsYZDRpFycrxjM4AfMhoiUal5s2leaR4kR+uUKIHgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640734; a=rsa-sha256; cv=none; b=W7eDvzx19o5IBmD6UKamFobSbCrkKEBkEtlGW+j4CyIl/CyFFyQrh7D3nKe5dhuJrn393m M/3eOGKgZIlBi0IbmngwFvZ7WXFCl2dfqgkZ/N+4+jFKZWhKCrJMthuMioHtZEnrHGIb/u 2G/CChHse4Pb77ek4v/9P86+2ToSzgKQWN+7swGnA2EroT3S20yiK7I3IRexLrY9jFDL4T 53XXolRuAQMm29MmJNHAv6lHWChRu8EVdkPr83Z2jDLVntK2OaTsLoPhXHRy9MoN6MAT9D avr2jXEfF17UqXUxcLsaKmzRxO42Ka1F/cCgZzkTBMroXgx/v+UCaQ3awGxhAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2by5R4lzjBv; Thu, 23 Jan 2025 13:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDwsJf026309; Thu, 23 Jan 2025 13:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDwsIs026306; Thu, 23 Jan 2025 13:58:54 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:58:54 GMT Message-Id: <202501231358.50NDwsIs026306@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: e8e2e213ab53 - stable/14 - pkgbase: Fix OSVERSION specification when creating a repo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: e8e2e213ab53845fe38a8220fb7fbd473255ad8e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e8e2e213ab53845fe38a8220fb7fbd473255ad8e commit e8e2e213ab53845fe38a8220fb7fbd473255ad8e Author: Mark Johnston AuthorDate: 2025-01-19 23:25:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:07 +0000 pkgbase: Fix OSVERSION specification when creating a repo -o OSVERSION= needs to appear before the "repo" verb, otherwise it has no effect. In this case, recent pkg-devel fails to create the repo, saying that ABI cannot be specified without OSVERSION. Reviewed by: kevans, manu MFC after: 2 weeks Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") Differential Revision: https://reviews.freebsd.org/D48518 (cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517) --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index d4ec63091e5a..94f74392f4fb 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2283,7 +2283,7 @@ real-sign-packages: _pkgbootstrap .PHONY .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ + @${PKG_CMD} -o ABI=${PKG_ABI} -o OSVERSION="${SRCRELDATE}" repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ From nobody Thu Jan 23 13:59:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf2c46cN7z5l0Bd; Thu, 23 Jan 2025 13:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf2c45Cknz3bpl; Thu, 23 Jan 2025 13:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ogGd4XLCsydAEGo3nnchpdMcaLP9vzELWslOYsf7yI=; b=M26YZ3Mth3WJI8RsqUWJ/r4WChrwcL0b5YhPrHzxekW4YeK8w1IeINR8e2FrWifFTMlJOe 92Le+umZsHsxdmP/OPjNP4lIe+2JZYhEsDIrhWFd8NxH70X4L/xxBjtqNNvvp8iDdO4FDU GUsXtVIQ1y9rNxTIhXiQ2bSxwcFPdK4jSfZTwWOurqoI+j0yUmjnxlusgeL1Rbjm9OGrN7 MRSvFq967V+9DauLfNMTakAqi/s4qxfZhnYc+jUEsNbV7uvGyywDmWWrS34qZTILeUfWTx NgGF2OuPiyjGCGmT3xPM+hBI+7qc0VG2fk6O+vbZ8Bfl2K5iSKJ+YXli+PIegw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737640740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ogGd4XLCsydAEGo3nnchpdMcaLP9vzELWslOYsf7yI=; b=P5FFaUIhIchyZjQC1bKCvp1VJkF9404b5Wk8bZBExN1/xUENTqPDOTkAZdWluEIh1F18Iu GWwRkBWxE2CdhTTfR4LMlx+UJsbIKgh56UQomDh5Zj0WTh7/8Yt+S9bTPIOMKN00AnutQh 1DMYhzaUk/hnucqHNB4WQgeJvJTespvDjhou0cgntm4VOqqeogXMme0qXgPJo8dJOu8gJt 0/el2BBYSEL1kx9+omrOBM2m1/jmWFiykCnZC5865mpRLnVHJg6M2Q9Lh739rHKoqctM2g B+pcUtuFCG7f1cC751i8J0Dv/aU93nu95fTMD0QB4EYvPeq58LSzQg9sIsJ4Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737640740; a=rsa-sha256; cv=none; b=McNxCoGA9DYEh7tJNWen3mi30GtyFCfkw8VEMuImZwQpOwlQAa9LovgYGH1Gz3ui2O+dZf Uj78Ru1YHLCn8v8x9CjI3cW6xWXtcZywPVp7IuKwPCma6MyGjArCPhcRNaimI1K7qCxsJX xk4M0SCCUIFSfzzztOxhQ9chvBOv/V1hOiYMYcWGSTrHDhR9gOzF9D4K80LufKGBmrIBYO d7DWr4akGc4wUD0HVqnChibrGymzGjrxLRImiFF4zYLdxmttkyfPgbgThdNIR7zZPtqnVe ZeCkXPuhaKwCZ4IeXoAjrtLNLCFahrP9RsnaBmgA0g75kyXd6xe7LATibmRyEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf2c43jGXzj6G; Thu, 23 Jan 2025 13:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NDx0BY026480; Thu, 23 Jan 2025 13:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NDx0Zl026476; Thu, 23 Jan 2025 13:59:00 GMT (envelope-from git) Date: Thu, 23 Jan 2025 13:59:00 GMT Message-Id: <202501231359.50NDx0Zl026476@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: 7b95d2a40219 - stable/13 - pkgbase: Fix OSVERSION specification when creating a repo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 7b95d2a40219ddaf187dbc087e1f9a0615b70b60 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7b95d2a40219ddaf187dbc087e1f9a0615b70b60 commit 7b95d2a40219ddaf187dbc087e1f9a0615b70b60 Author: Mark Johnston AuthorDate: 2025-01-19 23:25:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 13:58:36 +0000 pkgbase: Fix OSVERSION specification when creating a repo -o OSVERSION= needs to appear before the "repo" verb, otherwise it has no effect. In this case, recent pkg-devel fails to create the repo, saying that ABI cannot be specified without OSVERSION. Reviewed by: kevans, manu MFC after: 2 weeks Fixes: 188fe88ec50e ("pkgbase: force OSVERSION") Differential Revision: https://reviews.freebsd.org/D48518 (cherry picked from commit f9097705fb1c8d9c1f8946d1c1897d606bdbd517) --- Makefile.inc1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c8b5fc856dd5..65a5aa203aa3 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2150,8 +2150,7 @@ sign-packages: _pkgbootstrap .PHONY .endif @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ - -o OSVERSION="${SRCRELDATE}" \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o OSVERSION="${SRCRELDATE}" repo \ -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ From nobody Thu Jan 23 15:31:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf4g12qMCz5l5bM; Thu, 23 Jan 2025 15:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf4g11v6rz3nvj; Thu, 23 Jan 2025 15:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737646301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXWUdyw6tHjtPP9AL4BqHtl0DB7Y2/70w/zoLXR1ABI=; b=byIgjBuol7eP+Ab3VVkLeygqhD+U9hTOVbz24hShHp10m5VRZ3p0r9a2NYOo/x0ogvRVQ+ quZCBsF/+VbQkVfBfJSZv2+pEVWU5aV3JFiR7EA9Rj/bhg4Pq+mkLqWP3bEEBnU5yahBlK TGN074ZSCBwbZjMPTvlTJnDNYgQCSjAR+77mjK4/+h2VytgsJiw+8FY2KxLLX1QqiszEzJ n5qKqIq/xzuJ8NmcQhaH6U/ys7OnOQY+IlfofWfxhGTEqo+dFSzFIDLuR1l5NMXrWFKkNN /ypL53PBb4Ez/CvEmE6efW5Twdv361D7JLgSKmqmkYXYTZnnJyY0oFyAJd4jYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737646301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vXWUdyw6tHjtPP9AL4BqHtl0DB7Y2/70w/zoLXR1ABI=; b=tY416ebV7ZH6Tt2i95LZv1IJzA1WlhKH52hiN2M4jTl3O6znorBr8RErSaH6VnF7NZ9SKs E4m9uZSBdtr2/b0+cQVmR/UZx485NHtyiEX3tCItsyK1GneiksBewADjyZ+XBaAiHq1EtO 9tmEB/TR3hWKTO4EvEnLN1QwA9eLUTdfP9F2h6uDb/8x6Af/r2OdEJTnfrvdHAzt0K0B++ TzvGDVSD+PpuBQdK3BItR6DVDpjvNjSVVMYwpRF+5/eegGh648kVIl/QbsBr3cWaY8KTyu 42JemqDG1HaU0QPkW9x25wXLZmO6nq+eVowhb2m758/Tozi3JCoyUZ8NSs9UFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737646301; a=rsa-sha256; cv=none; b=kR+wrkKqgAvGTjLPRc2vL2pjd45lmZTnCw3PikqTM8SPfM5Eb1WB8CTwYPE2dwpivlYhla krnzkoCqR/pXzAazoUPhFCpd6y3bw1cUzmzypCtL3yQ660m7c+MgDDpMJlrNWpTCrjcgVh 1t16BdIctlsWaQ/pvmyPUvxf0Hwc8gJ4SAiX8gRGPi5yvWRC3zbuPgPT25634NgewVVDFb SS9VqCn9F/Vygc2080BoIIE91hmSfsjzeXCuIbCRTLYDqw2QB1LB9+MzyR/gOQMXK7Kzbo Cy3BHQBO0IyUYhQl5t0D+YXfSkf0/9JCV6/PrY46VZ0b25TvC3Jt454knCtVjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf4g11V10zlT5; Thu, 23 Jan 2025 15:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NFVf1d011891; Thu, 23 Jan 2025 15:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NFVf9a011888; Thu, 23 Jan 2025 15:31:41 GMT (envelope-from git) Date: Thu, 23 Jan 2025 15:31:41 GMT Message-Id: <202501231531.50NFVf9a011888@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: 916f6e6dd3a9 - main - gvinum.8: Update deprecation warning to note that this is removed in 15.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 916f6e6dd3a95145c70e1c2c55467dd4979a0118 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=916f6e6dd3a95145c70e1c2c55467dd4979a0118 commit 916f6e6dd3a95145c70e1c2c55467dd4979a0118 Author: John Baldwin AuthorDate: 2025-01-23 15:27:44 +0000 Commit: John Baldwin CommitDate: 2025-01-23 15:27:44 +0000 gvinum.8: Update deprecation warning to note that this is removed in 15.0 Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48592 --- sbin/gvinum/gvinum.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index 28e4cd7d76db..e861681203c6 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 28, 2021 +.Dd January 23, 2025 .Dt GVINUM 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nm and associated .Xr geom 4 -kernel support is deprecated, and may not be available in +kernel support is deprecated, and is not be available in .Fx 15.0 and later. Users are advised to migrate to From nobody Thu Jan 23 15:31:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf4g23vmlz5l5by; Thu, 23 Jan 2025 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf4g22d76z3nyk; Thu, 23 Jan 2025 15:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737646302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVmoBfQZbcN4qQTbgMbDZMcJUGMCm47CjVTCjpZm9Cc=; b=Z+Hfmm0rqHXM+EFsd3kb6C/sCLUHtpJzxpqkvU2BA88Hx+N9dHXNklQhFP4tY0xb2B+nb4 +GEktzWPJA+tPvZf5isVbxV/hoUTEwX3D6z6St9OuZmvVsbs1qZbptvjdAPDGpo6uR6XfP 6dQiGFro7QdfUBfVlVWhR/Su8XogSiOcu7RY1jt93oTmvW9Mu3RUewKJHKbO5Q1hFI1TSC NxMkqh2lWfIl0ZCY0zdiSP5fOLvZXe1zYoBY0sVPKGp8o3Mp+rpQfbRHcK619PpAq/D5bY ipsSD2u47XgS7uHdv2CgC+K+M09dfI4lEwNfp0Tphh/PVXg516iULTLZcju1rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737646302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVmoBfQZbcN4qQTbgMbDZMcJUGMCm47CjVTCjpZm9Cc=; b=I2Wu3EvDTD22H8az20t06P5kFftmGQM7mzV4hbwz9oOINlM7rscqmg7Q822utKLse+Jikg un/DK/0OX3NFZGNP+wl+X2y9G5pLOXMr9/3kB86f6ojqpvqGbyfG1426ngXqoaqdzouqfP p2ThZwFU5EZzATEo0L/MkJqEvaPyNY38UDepTLxlpzGTYHkKrUHAHic5BB1BKrMuC4iVm+ 0gPr9fvlKC+FY2nBrqEz2z8mwZh+P2rP5OQkNKRATvHD6tce+dnXW1WAWI8ZZF2pZO4dmV 1333i1GgUluUBya7RxAXeMiH0l4eTELuCMRAisMg9Daij2cYKBPVXuz6BtAgQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737646302; a=rsa-sha256; cv=none; b=JM9oVqCchFNlvdlMGD99kkxel62ynFUITt4LQbARF34XRNwJfQaIvRmCVZhxNkSFTHV5lx Hdkkr0cvOrQ5xqbqiXdkfP5YQOnDl3NF581ek56eqOy/YaLgJLbr5a7++RlwyArxs5tjwV JBaJRqWFha6wEwxYIjXDxRHmH/b+HpelLXZD8mVWeQ/pjkniYFfZW439z0iKCOUyQo/+CX PI6U0rHqy/p4QmA9e5Iffpxd8rHBZqlIIdymPXuLbA0UHt6ecg1ZN4H0y1yCG5ztaKw5+c zOiLq7qgCz89OJNZyHSOWAcfSvX67bnSkZfoisuRiMsj3WQrpEbDaElWsUofhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf4g225JSzlhg; Thu, 23 Jan 2025 15:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NFVgCK011931; Thu, 23 Jan 2025 15:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NFVgaj011928; Thu, 23 Jan 2025 15:31:42 GMT (envelope-from git) Date: Thu, 23 Jan 2025 15:31:42 GMT Message-Id: <202501231531.50NFVgaj011928@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: 86116ab256c4 - main - ccdconfig.8: Refer to graid(8) and zfs(8) instead of gvinum(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 86116ab256c476191e2fc1fffd79f94382960362 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=86116ab256c476191e2fc1fffd79f94382960362 commit 86116ab256c476191e2fc1fffd79f94382960362 Author: John Baldwin AuthorDate: 2025-01-23 15:28:27 +0000 Commit: John Baldwin CommitDate: 2025-01-23 15:28:27 +0000 ccdconfig.8: Refer to graid(8) and zfs(8) instead of gvinum(8) Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48536 --- sbin/ccdconfig/ccdconfig.8 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 085d83cab7a2..55cda5b2b356 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -199,15 +199,16 @@ If you need more than this you should look into external hardware RAID SCSI boxes, RAID controllers (see GENERIC), or software RAID systems such as -.Xr geom 8 -and -.Xr gvinum 8 . +.Xr graid 8 +or +.Xr zfs 8 . .Sh SEE ALSO .Xr dd 1 , .Xr ccd 4 , .Xr gpart 8 , -.Xr gvinum 8 , -.Xr rc 8 +.Xr graid 8 , +.Xr rc 8 , +.Xr zfs 8 .Sh HISTORY The .Nm From nobody Thu Jan 23 16:07:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5Rs2Y9Xz5l7M4; Thu, 23 Jan 2025 16:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5Rs1w4bz3rBp; Thu, 23 Jan 2025 16:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737648425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kX+s0TdMvHBTGYYCWl6aHJ9nDX9Wum0bvhMc9RIJb58=; b=cjZwmENx6F8JsWTurDJ7NJ7r1NB0auB56+yQvxX4iT5ImFvmoYlY17KPv/SpJRD8VXq1Sz 8qYjk8vgGaNAsMj4wfCEsf6b3fZkCZ9Xibldpz0z2ZnKyMlLkbYQTeuJcbRRIaqInTKXc1 GVBviZ8ZZgoZHp+OdE4XeT7Jce8vRkMCtcAyMX3iSLVH6SrS1TEfA++Z6JH4E8zFB/InoM Gzf0wzeQuI4H8HfW6Q8sM3DluD8CS9Fu3j8VRPhJqQJRbEageIHdlytKw3j7Ej5K2bV4Rg nmGyOyb8N+G1GShQIHdreDbJZNGXb2atDmr/F7adXq4f/9mdmnlnJmg1VX2yDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737648425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kX+s0TdMvHBTGYYCWl6aHJ9nDX9Wum0bvhMc9RIJb58=; b=jud4S8b4hxCjU3oG1qHmKNLNXbgeEwXqIMXKHwCp6Dkd3YTqt1nTO2om5SVlI+0ZKLAQwP +KavNOlUjaeZzDYCySpT+bUFqLHfkIyY2hqPq7b2KysEYK3JHMTrkt3JMmVejKF5wCtiLc MTggatS8Yn8vfc/c2EqMKnWKln0ZHbU+19VphCTneLe8S/ivI7RpzEkYdn/cxZxWrcNKFy H0SSy3meVEfiPXMIF5IzJRJneTEM1+1SRRDLGI38znUl8ePCS4K0j6dxRDidUNiEp4emef 0SgWuIc0p5Iykcgo3M77MsZUJ0i2JaNFXoh2FB4G2bdOJxTbAcs1wSh/KtNGEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737648425; a=rsa-sha256; cv=none; b=npUQxKoADC/gQQKoJlVTNL6SgPylQ1NgHqIx0QIfoZbIWJyqurGBgib1Ri8QqCTxB6Yd5+ R7Pef6XjmUbaYiCLl7AS96angRTqwq+kJ9N4SlAEpOUIFc4I+rb8trD5Hw6mJxmwcB8Hmn JQy0kdyFWbsUz+GoaZWZzpAC5g99xIbqMlduJ8m2nvzEWeeODLD9UbK5PG8K0xPiKGPVxC YnflYDgGneQvHKUKJfpDqJzOIYMQn0JKyXSWiK+6m+Z/Gpddf9eM4Xt9O3YpxVoUteXeT+ UzVoFo7nYOKfIVefZZx+jRzkN3MmscwXE46gx1jKMxV9hv/8iXmnSBWd84Xv7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5Rs1G0Vzmgq; Thu, 23 Jan 2025 16:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NG75uw071400; Thu, 23 Jan 2025 16:07:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NG75lb071397; Thu, 23 Jan 2025 16:07:05 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:07:05 GMT Message-Id: <202501231607.50NG75lb071397@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: 07423969869c - main - src.conf.5: Update xref for SSP description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 07423969869c2034d1e70439ae5d70ddd390bf17 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=07423969869c2034d1e70439ae5d70ddd390bf17 commit 07423969869c2034d1e70439ae5d70ddd390bf17 Author: Ed Maste AuthorDate: 2025-01-23 14:02:31 +0000 Commit: Ed Maste CommitDate: 2025-01-23 16:06:11 +0000 src.conf.5: Update xref for SSP description SSP is currently documented in migitations.7. Fixes: 297bb39b6f0f ("mitigations.7: move SSP documentation from security.7 to here") Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48620 --- tools/build/options/WITHOUT_SSP | 2 +- tools/build/options/WITH_SSP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/options/WITHOUT_SSP b/tools/build/options/WITHOUT_SSP index 7a773fe1e5aa..160da71bf9c2 100644 --- a/tools/build/options/WITHOUT_SSP +++ b/tools/build/options/WITHOUT_SSP @@ -1,4 +1,4 @@ Do not build world with stack smashing protection. See -.Xr security 7 +.Xr mitigations 7 for more information. diff --git a/tools/build/options/WITH_SSP b/tools/build/options/WITH_SSP index 4f06a73d4173..910fdc9b3b1a 100644 --- a/tools/build/options/WITH_SSP +++ b/tools/build/options/WITH_SSP @@ -1,4 +1,4 @@ Build world with stack smashing protection. See -.Xr security 7 +.Xr mitigations 7 for more information. From nobody Thu Jan 23 16:21:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m01CB6z5l8KG; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m00xzPz3sLr; Thu, 23 Jan 2025 16:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmD1yis2khBzGGPYFv3C3lnJNlMXa7KkROOA4SslquU=; b=HcyR1b0DBAeac4+GvcE3yPcY1GaT8DkMg4Srb4rFL2manIs9hC2La850L85LmvCbElE8VZ moS0QLj2vccaTyMQUGHrj+V8lWSD7aDfjXAagR4GDviokpj5baDUA4sD8mDS5H65Zk6FRr stge7YERTcKg+Svly5zl1Dt/5oL0Gt9i0KaQ6DQZCE/4mKTaZddwC0agtf86JUE9fiHFI1 1tT1vKfp6OoU20HfTt3YaVd6FuzJeHbyIitNv3zzvI/Fg5fU7Q+FzRcXS53npzc3c3JRjv t6DcMFY6SPFG9FxD/W6sgLRo6L9wGY09HyGT9DgzAt7F9yskUvxwKHh1jNWLvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmD1yis2khBzGGPYFv3C3lnJNlMXa7KkROOA4SslquU=; b=GbSbK92AjUj8mt692HhblKTXNhE0mFTcpw31hTX49BDZnWszKs08Xy4uHLzFEixx/dCdlu IzungpDWc7ZuaidI2q7BODVnjC+7se7g/rR6rRd0uWsvRQFHuVzcaXY2Zuwbe4AygnQzdU gJmzq+duZk0bvTXfqIK7db6OhuH+xbNRMzDKr6Zu9AwXoOcpmsDZWIkupjxp6/5HwNFwOp k8h0Myv0gzyV95+5daNHm1MiMm/G/A8Hn8VPd+ax8zqURUpPfrpqIV6DYFaQQxOJjZv9gj n8jO0mN+8tZd7a/SdHvQxLqVUmbPn1bP3wf4UKhDX5Vw/yRGQqrUxA8IA0hphA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649264; a=rsa-sha256; cv=none; b=VHkxtUyKLaB5H2WXz7LZIqYZuKfRZ9vZt6qCkd/nIpXeCoDcmlkHQUQ9/tR5U5s3PqyQPr EiEMxqpvaM6/GXyGvXCc7IY53Y0g0Kxyopulp3WeVvnTTCSRSbIUwhWCvcGy2xqvsOe8wY u6I9Yg9qUQ5s/QbxDq/Tpep1yx94p816rQaNVboTQOuQCJds9k0LP4O/AmJGjvedxTUnK7 jJ5EElPurYWL/o2onR1MId/vyHoc2IoHCVWMprFPDevkYKWRO8d1uDEMvFpRg+bp82hAEx 6HJDxN2OE5SV9z1DM6Mip4EysCj5c03pE4DHrJg5JyXjE/ha4evb6SVcHJrrgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m00Y58zmkj; Thu, 23 Jan 2025 16:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL4m2001027; Thu, 23 Jan 2025 16:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL3Iu001024; Thu, 23 Jan 2025 16:21:03 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:03 GMT Message-Id: <202501231621.50NGL3Iu001024@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: f87bb5967670 - main - gvinum: Remove kernel support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: f87bb5967670914f2f6d9ab4c732ab083a61b4c8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f87bb5967670914f2f6d9ab4c732ab083a61b4c8 commit f87bb5967670914f2f6d9ab4c732ab083a61b4c8 Author: John Baldwin AuthorDate: 2025-01-23 15:32:41 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:42 +0000 gvinum: Remove kernel support Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48541 --- sys/conf/NOTES | 1 - sys/conf/files | 15 - sys/geom/vinum/geom_vinum.c | 1044 --------------------------- sys/geom/vinum/geom_vinum.h | 163 ----- sys/geom/vinum/geom_vinum_create.c | 608 ---------------- sys/geom/vinum/geom_vinum_drive.c | 351 ---------- sys/geom/vinum/geom_vinum_events.c | 282 -------- sys/geom/vinum/geom_vinum_init.c | 388 ----------- sys/geom/vinum/geom_vinum_list.c | 500 ------------- sys/geom/vinum/geom_vinum_move.c | 189 ----- sys/geom/vinum/geom_vinum_plex.c | 1045 ---------------------------- sys/geom/vinum/geom_vinum_raid5.c | 662 ------------------ sys/geom/vinum/geom_vinum_raid5.h | 55 -- sys/geom/vinum/geom_vinum_rename.c | 261 ------- sys/geom/vinum/geom_vinum_rm.c | 387 ----------- sys/geom/vinum/geom_vinum_share.c | 723 ------------------- sys/geom/vinum/geom_vinum_share.h | 67 -- sys/geom/vinum/geom_vinum_state.c | 534 -------------- sys/geom/vinum/geom_vinum_subr.c | 1277 ---------------------------------- sys/geom/vinum/geom_vinum_var.h | 393 ----------- sys/geom/vinum/geom_vinum_volume.c | 163 ----- sys/modules/geom/Makefile | 1 - sys/modules/geom/geom_vinum/Makefile | 10 - 23 files changed, 9119 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 181bd351b460..aedb89e49b67 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -177,7 +177,6 @@ options GEOM_RAID3 # RAID3 functionality. options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. options GEOM_UZIP # Read-only compressed disks -options GEOM_VINUM # Vinum logical volume manager options GEOM_VIRSTOR # Virtual storage. options GEOM_ZERO # Performance testing helper. diff --git a/sys/conf/files b/sys/conf/files index 5fd7b887581a..496f1617a67a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3714,21 +3714,6 @@ geom/uzip/g_uzip_wrkthr.c optional geom_uzip geom/uzip/g_uzip_zlib.c optional geom_uzip geom/uzip/g_uzip_zstd.c optional geom_uzip zstdio \ compile-with "${NORMAL_C} -I$S/contrib/zstd/lib/freebsd" -geom/vinum/geom_vinum.c optional geom_vinum -geom/vinum/geom_vinum_create.c optional geom_vinum -geom/vinum/geom_vinum_drive.c optional geom_vinum -geom/vinum/geom_vinum_plex.c optional geom_vinum -geom/vinum/geom_vinum_volume.c optional geom_vinum -geom/vinum/geom_vinum_subr.c optional geom_vinum -geom/vinum/geom_vinum_raid5.c optional geom_vinum -geom/vinum/geom_vinum_share.c optional geom_vinum -geom/vinum/geom_vinum_list.c optional geom_vinum -geom/vinum/geom_vinum_rm.c optional geom_vinum -geom/vinum/geom_vinum_init.c optional geom_vinum -geom/vinum/geom_vinum_state.c optional geom_vinum -geom/vinum/geom_vinum_rename.c optional geom_vinum -geom/vinum/geom_vinum_move.c optional geom_vinum -geom/vinum/geom_vinum_events.c optional geom_vinum geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c deleted file mode 100644 index 5c66216aaf3e..000000000000 --- a/sys/geom/vinum/geom_vinum.c +++ /dev/null @@ -1,1044 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2004, 2007 Lukas Ertl - * Copyright (c) 2007, 2009 Ulf Lilleengen - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY 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 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, - "GEOM_VINUM stuff"); -u_int g_vinum_debug = 0; -SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RWTUN, &g_vinum_debug, 0, - "Debug level"); - -static int gv_create(struct g_geom *, struct gctl_req *); -static void gv_attach(struct gv_softc *, struct gctl_req *); -static void gv_detach(struct gv_softc *, struct gctl_req *); -static void gv_parityop(struct gv_softc *, struct gctl_req *); - -static void -gv_orphan(struct g_consumer *cp) -{ - struct g_geom *gp; - struct gv_softc *sc; - struct gv_drive *d; - - g_topology_assert(); - - KASSERT(cp != NULL, ("gv_orphan: null cp")); - gp = cp->geom; - KASSERT(gp != NULL, ("gv_orphan: null gp")); - sc = gp->softc; - KASSERT(sc != NULL, ("gv_orphan: null sc")); - d = cp->private; - KASSERT(d != NULL, ("gv_orphan: null d")); - - g_trace(G_T_TOPOLOGY, "gv_orphan(%s)", gp->name); - - gv_post_event(sc, GV_EVENT_DRIVE_LOST, d, NULL, 0, 0); -} - -void -gv_start(struct bio *bp) -{ - struct g_geom *gp; - struct gv_softc *sc; - - gp = bp->bio_to->geom; - sc = gp->softc; - - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - case BIO_DELETE: - break; - case BIO_GETATTR: - default: - g_io_deliver(bp, EOPNOTSUPP); - return; - } - mtx_lock(&sc->bqueue_mtx); - bioq_disksort(sc->bqueue_down, bp); - wakeup(sc); - mtx_unlock(&sc->bqueue_mtx); -} - -void -gv_done(struct bio *bp) -{ - struct g_geom *gp; - struct gv_softc *sc; - - KASSERT(bp != NULL, ("NULL bp")); - - gp = bp->bio_from->geom; - sc = gp->softc; - - mtx_lock(&sc->bqueue_mtx); - bioq_disksort(sc->bqueue_up, bp); - wakeup(sc); - mtx_unlock(&sc->bqueue_mtx); -} - -int -gv_access(struct g_provider *pp, int dr, int dw, int de) -{ - struct g_geom *gp; - struct gv_softc *sc; - struct gv_drive *d, *d2; - int error; - - gp = pp->geom; - sc = gp->softc; - /* - * We want to modify the read count with the write count in case we have - * plexes in a RAID-5 organization. - */ - dr += dw; - - LIST_FOREACH(d, &sc->drives, drive) { - if (d->consumer == NULL) - continue; - error = g_access(d->consumer, dr, dw, de); - if (error) { - LIST_FOREACH(d2, &sc->drives, drive) { - if (d == d2) - break; - g_access(d2->consumer, -dr, -dw, -de); - } - G_VINUM_DEBUG(0, "g_access '%s' failed: %d", d->name, - error); - return (error); - } - } - return (0); -} - -static void -gv_init(struct g_class *mp) -{ - struct g_geom *gp; - struct gv_softc *sc; - - g_trace(G_T_TOPOLOGY, "gv_init(%p)", mp); - - gp = g_new_geomf(mp, "VINUM"); - gp->spoiled = gv_orphan; - gp->orphan = gv_orphan; - gp->access = gv_access; - gp->start = gv_start; - gp->softc = g_malloc(sizeof(struct gv_softc), M_WAITOK | M_ZERO); - sc = gp->softc; - sc->geom = gp; - sc->bqueue_down = g_malloc(sizeof(struct bio_queue_head), - M_WAITOK | M_ZERO); - sc->bqueue_up = g_malloc(sizeof(struct bio_queue_head), - M_WAITOK | M_ZERO); - bioq_init(sc->bqueue_down); - bioq_init(sc->bqueue_up); - LIST_INIT(&sc->drives); - LIST_INIT(&sc->subdisks); - LIST_INIT(&sc->plexes); - LIST_INIT(&sc->volumes); - TAILQ_INIT(&sc->equeue); - mtx_init(&sc->config_mtx, "gv_config", NULL, MTX_DEF); - mtx_init(&sc->equeue_mtx, "gv_equeue", NULL, MTX_DEF); - mtx_init(&sc->bqueue_mtx, "gv_bqueue", NULL, MTX_DEF); - kproc_create(gv_worker, sc, &sc->worker, 0, 0, "gv_worker"); -} - -static int -gv_unload(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) -{ - struct gv_softc *sc; - - g_trace(G_T_TOPOLOGY, "gv_unload(%p)", mp); - - g_topology_assert(); - sc = gp->softc; - - if (sc != NULL) { - gv_worker_exit(sc); - gp->softc = NULL; - g_wither_geom(gp, ENXIO); - } - - return (0); -} - -/* Handle userland request of attaching object. */ -static void -gv_attach(struct gv_softc *sc, struct gctl_req *req) -{ - struct gv_volume *v; - struct gv_plex *p; - struct gv_sd *s; - off_t *offset; - int *rename, type_child, type_parent; - char *child, *parent; - - child = gctl_get_param(req, "child", NULL); - if (child == NULL) { - gctl_error(req, "no child given"); - return; - } - parent = gctl_get_param(req, "parent", NULL); - if (parent == NULL) { - gctl_error(req, "no parent given"); - return; - } - offset = gctl_get_paraml(req, "offset", sizeof(*offset)); - if (offset == NULL) { - gctl_error(req, "no offset given"); - return; - } - rename = gctl_get_paraml(req, "rename", sizeof(*rename)); - if (rename == NULL) { - gctl_error(req, "no rename flag given"); - return; - } - - type_child = gv_object_type(sc, child); - type_parent = gv_object_type(sc, parent); - - switch (type_child) { - case GV_TYPE_PLEX: - if (type_parent != GV_TYPE_VOL) { - gctl_error(req, "no such volume to attach to"); - return; - } - v = gv_find_vol(sc, parent); - p = gv_find_plex(sc, child); - gv_post_event(sc, GV_EVENT_ATTACH_PLEX, p, v, *offset, *rename); - break; - case GV_TYPE_SD: - if (type_parent != GV_TYPE_PLEX) { - gctl_error(req, "no such plex to attach to"); - return; - } - p = gv_find_plex(sc, parent); - s = gv_find_sd(sc, child); - gv_post_event(sc, GV_EVENT_ATTACH_SD, s, p, *offset, *rename); - break; - default: - gctl_error(req, "invalid child type"); - break; - } -} - -/* Handle userland request of detaching object. */ -static void -gv_detach(struct gv_softc *sc, struct gctl_req *req) -{ - struct gv_plex *p; - struct gv_sd *s; - int *flags, type; - char *object; - - object = gctl_get_param(req, "object", NULL); - if (object == NULL) { - gctl_error(req, "no argument given"); - return; - } - - flags = gctl_get_paraml(req, "flags", sizeof(*flags)); - type = gv_object_type(sc, object); - switch (type) { - case GV_TYPE_PLEX: - p = gv_find_plex(sc, object); - gv_post_event(sc, GV_EVENT_DETACH_PLEX, p, NULL, *flags, 0); - break; - case GV_TYPE_SD: - s = gv_find_sd(sc, object); - gv_post_event(sc, GV_EVENT_DETACH_SD, s, NULL, *flags, 0); - break; - default: - gctl_error(req, "invalid object type"); - break; - } -} - -/* Handle userland requests for creating new objects. */ -static int -gv_create(struct g_geom *gp, struct gctl_req *req) -{ - struct gv_softc *sc; - struct gv_drive *d, *d2; - struct gv_plex *p, *p2; - struct gv_sd *s, *s2; - struct gv_volume *v, *v2; - struct g_provider *pp; - int i, *drives, *flags, *plexes, *subdisks, *volumes; - char buf[20]; - - g_topology_assert(); - - sc = gp->softc; - - /* Find out how many of each object have been passed in. */ - volumes = gctl_get_paraml(req, "volumes", sizeof(*volumes)); - plexes = gctl_get_paraml(req, "plexes", sizeof(*plexes)); - subdisks = gctl_get_paraml(req, "subdisks", sizeof(*subdisks)); - drives = gctl_get_paraml(req, "drives", sizeof(*drives)); - if (volumes == NULL || plexes == NULL || subdisks == NULL || - drives == NULL) { - gctl_error(req, "number of objects not given"); - return (-1); - } - flags = gctl_get_paraml(req, "flags", sizeof(*flags)); - if (flags == NULL) { - gctl_error(req, "flags not given"); - return (-1); - } - - /* First, handle drive definitions ... */ - for (i = 0; i < *drives; i++) { - snprintf(buf, sizeof(buf), "drive%d", i); - d2 = gctl_get_paraml(req, buf, sizeof(*d2)); - if (d2 == NULL) { - gctl_error(req, "no drive definition given"); - return (-1); - } - /* - * Make sure that the device specified in the drive config is - * an active GEOM provider. - */ - pp = g_provider_by_name(d2->device); - if (pp == NULL) { - gctl_error(req, "%s: device not found", d2->device); - goto error; - } - if (gv_find_drive(sc, d2->name) != NULL) { - /* Ignore error. */ - if (*flags & GV_FLAG_F) - continue; - gctl_error(req, "drive '%s' already exists", d2->name); - goto error; - } - if (gv_find_drive_device(sc, d2->device) != NULL) { - gctl_error(req, "device '%s' already configured in " - "gvinum", d2->device); - goto error; - } - - d = g_malloc(sizeof(*d), M_WAITOK | M_ZERO); - bcopy(d2, d, sizeof(*d)); - - gv_post_event(sc, GV_EVENT_CREATE_DRIVE, d, NULL, 0, 0); - } - - /* ... then volume definitions ... */ - for (i = 0; i < *volumes; i++) { - snprintf(buf, sizeof(buf), "volume%d", i); - v2 = gctl_get_paraml(req, buf, sizeof(*v2)); - if (v2 == NULL) { - gctl_error(req, "no volume definition given"); - return (-1); - } - if (gv_find_vol(sc, v2->name) != NULL) { - /* Ignore error. */ - if (*flags & GV_FLAG_F) - continue; - gctl_error(req, "volume '%s' already exists", v2->name); - goto error; - } - - v = g_malloc(sizeof(*v), M_WAITOK | M_ZERO); - bcopy(v2, v, sizeof(*v)); - - gv_post_event(sc, GV_EVENT_CREATE_VOLUME, v, NULL, 0, 0); - } - - /* ... then plex definitions ... */ - for (i = 0; i < *plexes; i++) { - snprintf(buf, sizeof(buf), "plex%d", i); - p2 = gctl_get_paraml(req, buf, sizeof(*p2)); - if (p2 == NULL) { - gctl_error(req, "no plex definition given"); - return (-1); - } - if (gv_find_plex(sc, p2->name) != NULL) { - /* Ignore error. */ - if (*flags & GV_FLAG_F) - continue; - gctl_error(req, "plex '%s' already exists", p2->name); - goto error; - } - - p = g_malloc(sizeof(*p), M_WAITOK | M_ZERO); - bcopy(p2, p, sizeof(*p)); - - gv_post_event(sc, GV_EVENT_CREATE_PLEX, p, NULL, 0, 0); - } - - /* ... and, finally, subdisk definitions. */ - for (i = 0; i < *subdisks; i++) { - snprintf(buf, sizeof(buf), "sd%d", i); - s2 = gctl_get_paraml(req, buf, sizeof(*s2)); - if (s2 == NULL) { - gctl_error(req, "no subdisk definition given"); - return (-1); - } - if (gv_find_sd(sc, s2->name) != NULL) { - /* Ignore error. */ - if (*flags & GV_FLAG_F) - continue; - gctl_error(req, "sd '%s' already exists", s2->name); - goto error; - } - - s = g_malloc(sizeof(*s), M_WAITOK | M_ZERO); - bcopy(s2, s, sizeof(*s)); - - gv_post_event(sc, GV_EVENT_CREATE_SD, s, NULL, 0, 0); - } - -error: - gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc, NULL, 0, 0); - gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0); - - return (0); -} - -static void -gv_config(struct gctl_req *req, struct g_class *mp, char const *verb) -{ - struct g_geom *gp; - struct gv_softc *sc; - struct sbuf *sb; - char *comment; - - g_topology_assert(); - - gp = LIST_FIRST(&mp->geom); - sc = gp->softc; - - if (!strcmp(verb, "attach")) { - gv_attach(sc, req); - - } else if (!strcmp(verb, "concat")) { - gv_concat(gp, req); - - } else if (!strcmp(verb, "detach")) { - gv_detach(sc, req); - - } else if (!strcmp(verb, "list")) { - gv_list(gp, req); - - /* Save our configuration back to disk. */ - } else if (!strcmp(verb, "saveconfig")) { - gv_post_event(sc, GV_EVENT_SAVE_CONFIG, sc, NULL, 0, 0); - - /* Return configuration in string form. */ - } else if (!strcmp(verb, "getconfig")) { - comment = gctl_get_param(req, "comment", NULL); - if (comment == NULL) { - gctl_error(req, "no comment parameter given"); - return; - } - sb = sbuf_new(NULL, NULL, GV_CFG_LEN, SBUF_FIXEDLEN); - gv_format_config(sc, sb, 0, comment); - sbuf_finish(sb); - gctl_set_param(req, "config", sbuf_data(sb), sbuf_len(sb) + 1); - sbuf_delete(sb); - - } else if (!strcmp(verb, "create")) { - gv_create(gp, req); - - } else if (!strcmp(verb, "mirror")) { - gv_mirror(gp, req); - - } else if (!strcmp(verb, "move")) { - gv_move(gp, req); - - } else if (!strcmp(verb, "raid5")) { - gv_raid5(gp, req); - - } else if (!strcmp(verb, "rebuildparity") || - !strcmp(verb, "checkparity")) { - gv_parityop(sc, req); - - } else if (!strcmp(verb, "remove")) { - gv_remove(gp, req); - - } else if (!strcmp(verb, "rename")) { - gv_rename(gp, req); - - } else if (!strcmp(verb, "resetconfig")) { - gv_post_event(sc, GV_EVENT_RESET_CONFIG, sc, NULL, 0, 0); - - } else if (!strcmp(verb, "start")) { - gv_start_obj(gp, req); - - } else if (!strcmp(verb, "stripe")) { - gv_stripe(gp, req); - - } else if (!strcmp(verb, "setstate")) { - gv_setstate(gp, req); - } else - gctl_error(req, "Unknown verb parameter"); -} - -static void -gv_parityop(struct gv_softc *sc, struct gctl_req *req) -{ - struct gv_plex *p; - int *flags, *rebuild, type; - char *plex; - - plex = gctl_get_param(req, "plex", NULL); - if (plex == NULL) { - gctl_error(req, "no plex given"); - return; - } - - flags = gctl_get_paraml(req, "flags", sizeof(*flags)); - if (flags == NULL) { - gctl_error(req, "no flags given"); - return; - } - - rebuild = gctl_get_paraml(req, "rebuild", sizeof(*rebuild)); - if (rebuild == NULL) { - gctl_error(req, "no operation given"); - return; - } - - type = gv_object_type(sc, plex); - if (type != GV_TYPE_PLEX) { - gctl_error(req, "'%s' is not a plex", plex); - return; - } - p = gv_find_plex(sc, plex); - - if (p->state != GV_PLEX_UP) { - gctl_error(req, "plex %s is not completely accessible", - p->name); - return; - } - - if (p->org != GV_PLEX_RAID5) { - gctl_error(req, "plex %s is not a RAID5 plex", p->name); - return; - } - - /* Put it in the event queue. */ - /* XXX: The state of the plex might have changed when this event is - * picked up ... We should perhaps check this afterwards. */ - if (*rebuild) - gv_post_event(sc, GV_EVENT_PARITY_REBUILD, p, NULL, 0, 0); - else - gv_post_event(sc, GV_EVENT_PARITY_CHECK, p, NULL, 0, 0); -} - -static struct g_geom * -gv_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) -{ - struct g_geom *gp; - struct g_consumer *cp; - struct gv_softc *sc; - struct gv_hdr vhdr; - int error; - - g_topology_assert(); - g_trace(G_T_TOPOLOGY, "gv_taste(%s, %s)", mp->name, pp->name); - - gp = LIST_FIRST(&mp->geom); - if (gp == NULL) { - G_VINUM_DEBUG(0, "error: tasting, but not initialized?"); - return (NULL); - } - sc = gp->softc; - - cp = g_new_consumer(gp); - cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; - if (g_attach(cp, pp) != 0) { - g_destroy_consumer(cp); - return (NULL); - } - if (g_access(cp, 1, 0, 0) != 0) { - g_detach(cp); - g_destroy_consumer(cp); - return (NULL); - } - g_topology_unlock(); - - error = gv_read_header(cp, &vhdr); - - g_topology_lock(); - g_access(cp, -1, 0, 0); - g_detach(cp); - g_destroy_consumer(cp); - - /* Check if what we've been given is a valid vinum drive. */ - if (!error) - gv_post_event(sc, GV_EVENT_DRIVE_TASTED, pp, NULL, 0, 0); - - return (NULL); -} - -void -gv_worker(void *arg) -{ - struct g_provider *pp; - struct gv_softc *sc; - struct gv_event *ev; - struct gv_volume *v; - struct gv_plex *p; - struct gv_sd *s; - struct gv_drive *d; - struct bio *bp; - int newstate, flags, err, rename; - char *newname; - off_t offset; - - sc = arg; - KASSERT(sc != NULL, ("NULL sc")); - for (;;) { - /* Look at the events first... */ - ev = gv_get_event(sc); - if (ev != NULL) { - gv_remove_event(sc, ev); - - switch (ev->type) { - case GV_EVENT_DRIVE_TASTED: - G_VINUM_DEBUG(2, "event 'drive tasted'"); - pp = ev->arg1; - gv_drive_tasted(sc, pp); - break; - - case GV_EVENT_DRIVE_LOST: - G_VINUM_DEBUG(2, "event 'drive lost'"); - d = ev->arg1; - gv_drive_lost(sc, d); - break; - - case GV_EVENT_CREATE_DRIVE: - G_VINUM_DEBUG(2, "event 'create drive'"); - d = ev->arg1; - gv_create_drive(sc, d); - break; - - case GV_EVENT_CREATE_VOLUME: - G_VINUM_DEBUG(2, "event 'create volume'"); - v = ev->arg1; - gv_create_volume(sc, v); - break; - - case GV_EVENT_CREATE_PLEX: - G_VINUM_DEBUG(2, "event 'create plex'"); - p = ev->arg1; - gv_create_plex(sc, p); - break; - - case GV_EVENT_CREATE_SD: - G_VINUM_DEBUG(2, "event 'create sd'"); - s = ev->arg1; - gv_create_sd(sc, s); - break; - - case GV_EVENT_RM_DRIVE: - G_VINUM_DEBUG(2, "event 'remove drive'"); - d = ev->arg1; - flags = ev->arg3; - gv_rm_drive(sc, d, flags); - /*gv_setup_objects(sc);*/ - break; - - case GV_EVENT_RM_VOLUME: - G_VINUM_DEBUG(2, "event 'remove volume'"); - v = ev->arg1; - gv_rm_vol(sc, v); - /*gv_setup_objects(sc);*/ - break; - - case GV_EVENT_RM_PLEX: - G_VINUM_DEBUG(2, "event 'remove plex'"); - p = ev->arg1; - gv_rm_plex(sc, p); - /*gv_setup_objects(sc);*/ - break; - - case GV_EVENT_RM_SD: - G_VINUM_DEBUG(2, "event 'remove sd'"); - s = ev->arg1; - gv_rm_sd(sc, s); - /*gv_setup_objects(sc);*/ - break; - - case GV_EVENT_SAVE_CONFIG: - G_VINUM_DEBUG(2, "event 'save config'"); - gv_save_config(sc); - break; - - case GV_EVENT_SET_SD_STATE: - G_VINUM_DEBUG(2, "event 'setstate sd'"); - s = ev->arg1; - newstate = ev->arg3; - flags = ev->arg4; - err = gv_set_sd_state(s, newstate, flags); - if (err) - G_VINUM_DEBUG(0, "error setting subdisk" - " state: error code %d", err); - break; - - case GV_EVENT_SET_DRIVE_STATE: - G_VINUM_DEBUG(2, "event 'setstate drive'"); - d = ev->arg1; - newstate = ev->arg3; - flags = ev->arg4; - err = gv_set_drive_state(d, newstate, flags); - if (err) - G_VINUM_DEBUG(0, "error setting drive " - "state: error code %d", err); - break; - - case GV_EVENT_SET_VOL_STATE: - G_VINUM_DEBUG(2, "event 'setstate volume'"); - v = ev->arg1; - newstate = ev->arg3; - flags = ev->arg4; - err = gv_set_vol_state(v, newstate, flags); - if (err) - G_VINUM_DEBUG(0, "error setting volume " - "state: error code %d", err); - break; - - case GV_EVENT_SET_PLEX_STATE: - G_VINUM_DEBUG(2, "event 'setstate plex'"); - p = ev->arg1; - newstate = ev->arg3; - flags = ev->arg4; - err = gv_set_plex_state(p, newstate, flags); - if (err) - G_VINUM_DEBUG(0, "error setting plex " - "state: error code %d", err); - break; - - case GV_EVENT_SETUP_OBJECTS: - G_VINUM_DEBUG(2, "event 'setup objects'"); - gv_setup_objects(sc); - break; - - case GV_EVENT_RESET_CONFIG: - G_VINUM_DEBUG(2, "event 'resetconfig'"); - err = gv_resetconfig(sc); - if (err) - G_VINUM_DEBUG(0, "error resetting " - "config: error code %d", err); - break; - - case GV_EVENT_PARITY_REBUILD: - /* - * Start the rebuild. The gv_plex_done will - * handle issuing of the remaining rebuild bio's - * until it's finished. - */ - G_VINUM_DEBUG(2, "event 'rebuild'"); - p = ev->arg1; - if (p->state != GV_PLEX_UP) { - G_VINUM_DEBUG(0, "plex %s is not " - "completely accessible", p->name); - break; - } - if (p->flags & GV_PLEX_SYNCING || - p->flags & GV_PLEX_REBUILDING || - p->flags & GV_PLEX_GROWING) { - G_VINUM_DEBUG(0, "plex %s is busy with " - "syncing or parity build", p->name); - break; - } - p->synced = 0; - p->flags |= GV_PLEX_REBUILDING; - g_topology_assert_not(); - g_topology_lock(); - err = gv_access(p->vol_sc->provider, 1, 1, 0); - if (err) { - G_VINUM_DEBUG(0, "unable to access " - "provider"); - break; - } - g_topology_unlock(); - gv_parity_request(p, GV_BIO_CHECK | - GV_BIO_PARITY, 0); - break; - - case GV_EVENT_PARITY_CHECK: - /* Start parity check. */ - G_VINUM_DEBUG(2, "event 'check'"); - p = ev->arg1; - if (p->state != GV_PLEX_UP) { - G_VINUM_DEBUG(0, "plex %s is not " - "completely accessible", p->name); - break; - } - if (p->flags & GV_PLEX_SYNCING || - p->flags & GV_PLEX_REBUILDING || - p->flags & GV_PLEX_GROWING) { - G_VINUM_DEBUG(0, "plex %s is busy with " - "syncing or parity build", p->name); - break; - } - p->synced = 0; - g_topology_assert_not(); - g_topology_lock(); - err = gv_access(p->vol_sc->provider, 1, 1, 0); - if (err) { - G_VINUM_DEBUG(0, "unable to access " - "provider"); - break; - } - g_topology_unlock(); - gv_parity_request(p, GV_BIO_CHECK, 0); - break; - - case GV_EVENT_START_PLEX: - G_VINUM_DEBUG(2, "event 'start' plex"); - p = ev->arg1; - gv_start_plex(p); - break; - - case GV_EVENT_START_VOLUME: - G_VINUM_DEBUG(2, "event 'start' volume"); - v = ev->arg1; - gv_start_vol(v); - break; - - case GV_EVENT_ATTACH_PLEX: - G_VINUM_DEBUG(2, "event 'attach' plex"); - p = ev->arg1; - v = ev->arg2; - rename = ev->arg4; - err = gv_attach_plex(p, v, rename); - if (err) - G_VINUM_DEBUG(0, "error attaching %s to" - " %s: error code %d", p->name, - v->name, err); - break; - - case GV_EVENT_ATTACH_SD: - G_VINUM_DEBUG(2, "event 'attach' sd"); - s = ev->arg1; - p = ev->arg2; - offset = ev->arg3; - rename = ev->arg4; - err = gv_attach_sd(s, p, offset, rename); - if (err) - G_VINUM_DEBUG(0, "error attaching %s to" - " %s: error code %d", s->name, - p->name, err); - break; - - case GV_EVENT_DETACH_PLEX: - G_VINUM_DEBUG(2, "event 'detach' plex"); - p = ev->arg1; - flags = ev->arg3; - err = gv_detach_plex(p, flags); - if (err) - G_VINUM_DEBUG(0, "error detaching %s: " - "error code %d", p->name, err); - break; - - case GV_EVENT_DETACH_SD: - G_VINUM_DEBUG(2, "event 'detach' sd"); - s = ev->arg1; - flags = ev->arg3; - err = gv_detach_sd(s, flags); - if (err) - G_VINUM_DEBUG(0, "error detaching %s: " - "error code %d", s->name, err); - break; - - case GV_EVENT_RENAME_VOL: - G_VINUM_DEBUG(2, "event 'rename' volume"); - v = ev->arg1; - newname = ev->arg2; - flags = ev->arg3; - err = gv_rename_vol(sc, v, newname, flags); - if (err) - G_VINUM_DEBUG(0, "error renaming %s to " - "%s: error code %d", v->name, - newname, err); *** 8325 LINES SKIPPED *** From nobody Thu Jan 23 16:21:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m12pM4z5l8bZ; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m127jmz3sQZ; Thu, 23 Jan 2025 16:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/mvTWwhlcdTaCX9O9e3SfnxPqK1mjyhYDQfOc9G7HM=; b=Bh6Cf4a/IA4jm80GaDfnwgYJ3Z88jtV8YhXKk9OGHXceW4TW79Iov+Rv4clUVE+JO5hi/F RxVD/5fXM8aBUHqYFMxfPnrT9TgTBnthAHVE4dwWdVyqVmGTM3S6s7KU5ddPRMPSIuWLKq K58Kgo8hxj6QMwQMYO5xn4EPIE4xxa5KeWerNrMYiyITOf1DvIJdaNWKjpgteh+1s86h9f Lj+f39w2Yak9b+jHJNjuHwTU3an8n+Hc5F6yxK89zdRSPzkCrr6NjvM4sI5CmTxVtUrJFl 3uU2I4rrN6FbB7kgPbfc17fsxFl/RrAZrr1xwpJG7EQiF+fIncBXiR4xu/jukg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/mvTWwhlcdTaCX9O9e3SfnxPqK1mjyhYDQfOc9G7HM=; b=f2TMQGUtiDTve6L8XwXt8nrL47QIxPoT68VlTipIyavoXCREMRjGxA5mlf6Zj4KFEoUpXA MJyfqDhMRKj9e2Hiw1H8izpQ/kQtkFQVEjal++UvKwT8333RSkDFF/G78f1qf9bsST6UBa bdEzfSkyqj2SELihEX22ryR5G2tWzZMETuRVff1MaTyBdoMtHPAmVH0h8t0l165eU0DPs7 U9P9h0PKqqxlHComW92T7ByjeKQkMIAYN97zEn3C1WhnTYI87zPE50FdtzHkGZ0BpZpgxQ JE7CF9ae2joTiSwauclAzbzop+6gzDJ9WUUr4MVx5odC8Khwr7YXzZtUU+iT1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649265; a=rsa-sha256; cv=none; b=juhbO9UNBFZVIulH7xm+IeP7Xg8ey2IX6Cyly6kbBQ5bGSt5TygNxb4UpwOA3i71n9WDv0 gB2zw6KjKdS++w6Fu1Lr2dD6JITZl8UMYcHkDlD6NWznBsGlUnmlZNCn8Xl4R3bJvxbyGN mJo5nbiNHDy8rRDJuR9U9YmyxaQpsxbDZrlYzjQb4pFcgyGwI35BXOplZhgPEXaWGAoIGJ zPPMa+eeC2Cg8+FcWeWcuoDXbw/rnKIUiH8zR9OIQGmO+a+FuBLY60z11IdGkJrlImSBEl Iqm37mXaN/+8q0sDmKSrl27xyZsBjZD3pWE7MjQyCD/dj9sfchmSn37cZjSg/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m11kQ1zmSc; Thu, 23 Jan 2025 16:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL5bL001060; Thu, 23 Jan 2025 16:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL5Td001057; Thu, 23 Jan 2025 16:21:05 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:05 GMT Message-Id: <202501231621.50NGL5Td001057@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: e51036fbf3f8 - main - gvinum(8): Remove userland tool for managing vinum volumes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: e51036fbf3f896e8802ed0a5ef06ae1bcd7c0737 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e51036fbf3f896e8802ed0a5ef06ae1bcd7c0737 commit e51036fbf3f896e8802ed0a5ef06ae1bcd7c0737 Author: John Baldwin AuthorDate: 2025-01-23 15:32:49 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:43 +0000 gvinum(8): Remove userland tool for managing vinum volumes Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48542 --- ObsoleteFiles.inc | 4 + sbin/Makefile | 1 - sbin/geom/core/geom.8 | 3 - sbin/gvinum/Makefile | 13 - sbin/gvinum/Makefile.depend | 18 - sbin/gvinum/gvinum.8 | 460 ---------- sbin/gvinum/gvinum.c | 1450 ------------------------------- sbin/gvinum/gvinum.h | 41 - targets/pseudo/userland/Makefile.depend | 1 - 9 files changed, 4 insertions(+), 1987 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index afb71c46a459..eea25cc2e489 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20250123: Remove gvinum(8) +OLD_FILES+=sbin/gvinum +OLD_FILES+=usr/share/man/man8/gvinum.8.gz + # 20250122: Remove publickey(5) stuff OLD_FILES+=usr/bin/chkey OLD_FILES+=usr/bin/keylogin diff --git a/sbin/Makefile b/sbin/Makefile index 5e5a8943c67a..ef953e80ba1e 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -24,7 +24,6 @@ SUBDIR=adjkerntz \ geom \ ggate \ growfs \ - gvinum \ ifconfig \ init \ kldconfig \ diff --git a/sbin/geom/core/geom.8 b/sbin/geom/core/geom.8 index 7f0f0b2911b3..b864b3b238f5 100644 --- a/sbin/geom/core/geom.8 +++ b/sbin/geom/core/geom.8 @@ -168,8 +168,6 @@ STRIPE .It UNION .It -VINUM (deprecated) -.It VIRSTOR .El .Sh ENVIRONMENT @@ -221,7 +219,6 @@ geom md unload .Xr gshsec 8 , .Xr gstripe 8 , .Xr gunion 8 , -.Xr gvinum 8 , .Xr gvirstor 8 .Sh HISTORY The diff --git a/sbin/gvinum/Makefile b/sbin/gvinum/Makefile deleted file mode 100644 index 7e7066964514..000000000000 --- a/sbin/gvinum/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -PACKAGE=geom -PROG= gvinum -SRCS= gvinum.c gvinum.h geom_vinum_share.c -MAN= gvinum.8 - -WARNS?= 2 -CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit - -LIBADD= edit geom - -.PATH: ${SRCTOP}/sys/geom/vinum - -.include diff --git a/sbin/gvinum/Makefile.depend b/sbin/gvinum/Makefile.depend deleted file mode 100644 index 8d1c78126db9..000000000000 --- a/sbin/gvinum/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libedit \ - lib/libedit/readline \ - lib/libgeom \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 deleted file mode 100644 index e861681203c6..000000000000 --- a/sbin/gvinum/gvinum.8 +++ /dev/null @@ -1,460 +0,0 @@ -.\" Copyright (c) 2005 Chris Jones -.\" All rights reserved. -.\" -.\" This software was developed for the FreeBSD Project by Chris Jones -.\" thanks to the support of Google's Summer of Code program and -.\" mentoring by Lukas Ertl. -.\" -.\" 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd January 23, 2025 -.Dt GVINUM 8 -.Os -.Sh NAME -.Nm gvinum -.Nd Logical Volume Manager control program -.Sh DEPRECATION NOTICE -.Nm -and associated -.Xr geom 4 -kernel support is deprecated, and is not be available in -.Fx 15.0 -and later. -Users are advised to migrate to -.Xr gconcat 8 , -.Xr gmirror 8 , -.Xr gstripe 8 , -.Xr graid 8 , -or -.Xr zfs 8 . -More information is available at -.Pa https://wiki.freebsd.org/DeprecationPlan/gvinum . -.Sh SYNOPSIS -.Nm -.Op Ar command -.Op Fl options -.Sh COMMANDS -.Bl -tag -width indent -.It Ic attach Ar plex volume Op Cm rename -.It Ic attach Ar subdisk plex Oo Ar offset Oc Op Cm rename -Attach a plex to a volume, or a subdisk to a plex. -If offset is specified, the subdisk will be attached to the given offset within -the plex. -If rename is specified, the subdisk or plex will change name according to the -object it attaches to. -.It Ic checkparity Oo Fl f Oc Ar plex -Check the parity blocks of a RAID-5 plex. -The parity check will start at the -beginning of the plex if the -.Fl f -flag is specified, or otherwise at the location of the parity check pointer, -the first location at which plex's parity is incorrect. -All subdisks in the -plex must be up for a parity check. -.It Ic concat Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives -Create a concatenated volume from the specified drives. -If no name is specified, a unique name will be set by -.Ic gvinum . -.It Ic create Oo Fl f Oc Op Ar description-file -Create a volume as described in -.Ar description-file . -If no -.Ar description-file -provided, opens an editor and provides the current -.Nm -configuration for editing. -The -.Fl f -flag will make gvinum ignore any errors regarding creating objects that already -exists. -However, in contrast to vinum, objects that are not properly named in the -.Ar description-file -will not be created when the -.Fl f -flag is given. -.It Ic detach Oo Fl f Oc Op Ar plex | subdisk -Detach a plex or subdisk from the volume or plex to which it is -attached. -.It Ic grow Ar plex device -Grow a plex by creating a gvinum drive and subdisk on device and attach it to -the plex. -If required by the plex organization, it will be put into the growable state. -.It Ic help -Provides a synopsis of -.Nm -commands and arguments. -.It Ic l | list Oo Fl rvV Oc Op Ar volume | plex | subdisk -.It Ic ld Oo Fl rvV Oc Op Ar drive ... -.It Ic ls Oo Fl rvV Oc Op Ar subdisk ... -.It Ic lp Oo Fl rvV Oc Op Ar plex ... -.It Ic lv Oo Fl rvV Oc Op Ar volume ... -List information about the relevant object(s). -The -.Fl r -flag provides recursive display, showing each object's subordinate objects in -proper relation. -The -.Fl v -and -.Fl V -flags provide progressively more detailed output. -.It Ic mirror Oo Fl fsv Oc Oo Fl n Ar name Oc Ar drives -Create a mirrored volume from the specified drives. -It requires at least a multiple of 2 drives. -If no name is specified, a unique name will be set by gvinum. -If the -.Fl s -flag is specified, a striped mirror will be created, and thus requires a -multiple of 4 drives. -.It Ic move | mv Fl f Ar drive subdisk Op Ar ... -Move the subdisk(s) to the specified drive. -The -.Fl f -flag is required, as all data on the indicated subdisk(s) will be destroyed as -part of the move. -This can currently only be done when the subdisk is -not being accessed. -.Pp -If a single subdisk is moved, and it forms a part of a RAID-5 plex, the moved -subdisks will need to be set to the -.Dq stale -state, and the plex will require a -.Ic start -command. -If multiple subdisk(s) is moved, and form part of a RAID-5 plex, the -moved disk(s) will need to be set to the -.Dq up -state and the plex will require a -.Ic rebuildparity -command. -If the subdisk(s) form part of a plex that is mirrored with other -plexes, the plex will require restarting and will sync once restarted. -Moving -more than one subdisk in a RAID-5 plex or subdisks from both sides of a -mirrored plex volume will destroy data. -Note that parity rebuilds and syncing -must be started manually after a move. -.It Ic printconfig -Write a copy of the current configuration to standard output. -.It Ic quit -Exit -.Nm -when running in interactive mode. -Normally this would be done by entering the -EOF character. -.It Ic raid5 Oo Fl fv Oc Oo Fl s Ar stripesize Oc Oo Fl n Ar name Oc Ar drives -Create a RAID-5 volume from the specified drives. -If no name is specified, a unique name will be set by -.Ic gvinum . -This organization requires at least three drives. -.It Ic rename Oo Fl r Oc Ar drive | subdisk | plex | volume newname -Change the name of the specified object. -The -.Fl r -flag will recursively rename subordinate objects. -.Pp -Note that device nodes will not be renamed until -.Nm -is restarted. -.It Ic rebuildparity Oo Fl f Oc Ar plex -Rebuild the parity blocks of a RAID-5 plex. -The parity rebuild will start at -the beginning of the plex if the -.Fl f -flag is specified, or otherwise at the location of the parity check pointer. -All subdisks in the plex must be up for a parity check. -.It Ic resetconfig Oo Fl f Oc -Reset the complete -.Nm -configuration. -.It Ic rm Oo Fl r Oc Ar volume | plex | subdisk -Remove an object and, if -.Fl r -is specified, its subordinate objects. -.It Ic saveconfig -Save -.Nm -configuration to disk after configuration failures. -.It Ic setstate Oo Fl f Oc Ar state volume | plex | subdisk | drive -Set state without influencing other objects, for diagnostic purposes -only. -The -.Fl f -flag forces state changes regardless of whether they are legal. -.It Ic start -Read configuration from all vinum drives. -.It Ic start Oo Fl S Ar size Oc Ar volume | plex | subdisk -Allow the system to access the objects. -If necessary, plexes will be synced and rebuilt. -If a subdisk was added to a running RAID-5 or striped plex, gvinum will -expand into this subdisk and grow the whole RAID-5 array. -This can be done without unmounting your filesystem. -The -.Fl S -flag is currently ignored. -.It Ic stop Oo Fl f Oc Op Ar volume | plex | subdisk -Terminate access to the objects, or stop -.Nm -if no parameters are specified. -.It Ic stripe Oo Fl fv Oc Oo Fl n Ar name Oc Ar drives -Create a striped volume from the specified drives. -If no name is specified, a unique name will be set by -.Ic gvinum . -This organization requires at least two drives. -.El -.Sh DESCRIPTION -The -.Nm -utility communicates with the kernel component of the GVinum logical volume -manager. -It is designed either for interactive use, when started without -command line arguments, or to execute a single command if the command is -supplied on the command line. -In interactive mode, -.Nm -maintains a command line history. -.Sh OPTIONS -The -.Nm -commands may be followed by an option. -.Bl -tag -width indent -.It Fl f -The -.Fl f -.Pq Dq force -option overrides safety checks. -It should be used with extreme caution. -This -option is required in order to use the -.Ic move -command. -.It Fl r -The -.Fl r -.Pq Dq recursive -option applies the command recursively to subordinate objects. -For example, in -conjunction with the -.Ic lv -command, the -.Fl r -option will also show information about the plexes and subdisks belonging to -the volume. -It is also used by the -.Ic rename -command to indicate that subordinate objects such as subdisks should be renamed -to match the object(s) specified and by the -.Ic rm -command to delete plexes belonging to a volume and so on. -.It Fl v -The -.Fl v -.Pq Dq verbose -option provides more detailed output. -.It Fl V -The -.Fl V -.Pq Dq "very verbose" -option provides even more detailed output than -.Fl v . -.El -.Sh ENVIRONMENT -.Bl -tag -width ".Ev EDITOR" -.It Ev EDITOR -The name of the editor to use for editing configuration files, by -default -.Xr vi 1 -is invoked. -.El -.Sh FILES -.Bl -tag -width ".Pa /dev/gvinum/plex" -.It Pa /dev/gvinum -directory with device nodes for -.Nm -objects -.El -.Sh EXAMPLES -To create a mirror on disks /dev/ada1 and /dev/ada2, create a filesystem, -mount, unmount and then stop -.Ic gvinum : -.Pp -.Dl "gvinum mirror /dev/ada1 /dev/ada2" -.Dl "newfs /dev/gvinum/gvinumvolume0" -.Dl "mount /dev/gvinum/gvinumvolume0 /mnt" -.Dl "..." -.Dl "unmount /mnt" -.Dl "gvinum stop" -.Pp -To create a striped mirror on disks /dev/ada1 /dev/ada2 /dev/ada3 and -/dev/ada4 named "data" and create a filesystem: -.Pp -.Dl "gvinum mirror -s -n data /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4" -.Dl "newfs /dev/gvinum/data" -.Pp -To create a raid5 array on disks /dev/ada1 /dev/ada2 and /dev/ada3, -with stripesize 493k you can use the raid5 command: -.Pp -.Dl "gvinum raid5 -s 493k /dev/ada1 /dev/ada2 /dev/ada3" -.Pp -Then the volume will be created automatically. -Afterwards, you have to initialize the volume: -.Pp -.Dl "gvinum start myraid5vol" -.Pp -The initialization will start, and the states will be updated when it's -finished. -The list command will give you information about its progress. -.Pp -Imagine that one of the drives fails, and the output of 'printconfig' looks -something like this: -.Pp -.Dl "drive gvinumdrive1 device /dev/ada2" -.Dl "drive gvinumdrive2 device /dev/???" -.Dl "drive gvinumdrive0 device /dev/ada1" -.Dl "volume myraid5vol" -.Dl "plex name myraid5vol.p0 org raid5 986s vol myraid5vol" -.Dl "sd name myraid5vol.p0.s2 drive gvinumdrive2 len 32538s driveoffset 265s" -.Dl "plex myraid5vol.p0 plexoffset 1972s" -.Dl "sd name myraid5vol.p0.s1 drive gvinumdrive1 len 32538s driveoffset 265s" -.Dl "plex myraid5vol.p0 plexoffset 986s" -.Dl "sd name myraid5vol.p0.s0 drive gvinumdrive0 len 32538s driveoffset 265s" -.Dl "plex myraid5vol.p0 plexoffset 0s" -.Pp -Create a new drive with this configuration: -.Pp -.Dl "drive gdrive4 device /dev/ada4" -.Pp -Then move the stale subdisk to the new drive: -.Pp -.Dl "gvinum move gdrive4 myraid5vol.p0.s2" -.Pp -Then, initiate the rebuild: -.Pp -.Dl "gvinum start myraid5vol.p0" -.Pp -The plex will go up from degraded mode after the rebuild is finished. -The plex can still be used while the rebuild is in progress, although requests -might be delayed. -.Pp -Given the configuration as in the previous example, growing a RAID-5 or STRIPED -array is accomplished by using the grow command: -.Pp -.Dl "gvinum grow myraid5vol.p0 /dev/ada4" -.Pp -If everything went ok, the plex state should now be set to growable. -You can then start the growing with the -.Ic start -command: -.Pp -.Dl "gvinum start myraid5vol.p0" -.Pp -As with rebuilding, you can watch the progress using the -.Ic list -command. -.Pp -For a more advanced usage and detailed explanation of gvinum, the -handbook is recommended. -.Sh SEE ALSO -.Xr geom 4 , -.Xr geom 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 5.3 . -The -.Nm vinum -utility, on which -.Nm -is based, was written by -.An "Greg Lehey" . -.Pp -The -.Nm -utility -was written by -.An "Lukas Ertl" . -The -.Ic move -and -.Ic rename -commands and -documentation were added by -.An "Chris Jones" -through the 2005 Google Summer -of Code program. -A partial rewrite of gvinum was done by -.An "Lukas Ertl" -and -.An "Ulf Lilleengen" -through the 2007 Google Summer of Code program. -The documentation have been updated to reflect the new functionality. -.Sh AUTHORS -.An Lukas Ertl Aq Mt le@FreeBSD.org -.An Chris Jones Aq Mt soc-cjones@FreeBSD.org -.An Ulf Lilleengen Aq Mt lulf@FreeBSD.org -.Sh BUGS -Currently, -.Nm -does not rename devices in -.Pa /dev/gvinum -until reloaded. -.Pp -The -.Fl S -initsize flag to -.Ic start -is ignored. -.Pp -Moving subdisks that are not part of a mirrored or RAID-5 volume will -destroy data. -It is perhaps a bug to permit this. -.Pp -Plexes in which subdisks have been moved do not automatically sync or -rebuild parity. -This may leave data unprotected and is perhaps unwise. -.Pp -Currently, -.Nm -does not yet fully implement all of the functions found in -.Nm vinum . -Specifically, the following commands from -.Nm vinum -are not supported: -.Bl -tag -width indent -.It Ic debug -Cause the volume manager to enter the kernel debugger. -.It Ic debug Ar flags -Set debugging flags. -.It Ic dumpconfig Op Ar drive ... -List the configuration information stored on the specified drives, or all -drives in the system if no drive names are specified. -.It Ic info Op Fl vV -List information about volume manager state. -.It Ic label Ar volume -Create a volume label. -.It Ic resetstats Oo Fl r Oc Op Ar volume | plex | subdisk -Reset statistics counters for the specified objects, or for all objects if none -are specified. -.It Ic setdaemon Op Ar value -Set daemon configuration. -.El diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c deleted file mode 100644 index c391f5d61c65..000000000000 --- a/sbin/gvinum/gvinum.c +++ /dev/null @@ -1,1450 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2004 Lukas Ertl - * Copyright (c) 2005 Chris Jones - * Copyright (c) 2007 Ulf Lilleengen - * All rights reserved. - * - * Portions of this software were developed for the FreeBSD Project - * by Chris Jones thanks to the support of Google's Summer of Code - * program and mentoring by Lukas Ertl. - * - * 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 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 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 -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gvinum.h" - -static void gvinum_attach(int, char * const *); -static void gvinum_concat(int, char * const *); -static void gvinum_create(int, char * const *); -static void gvinum_detach(int, char * const *); -static void gvinum_grow(int, char * const *); -static void gvinum_help(void); -static void gvinum_list(int, char * const *); -static void gvinum_move(int, char * const *); -static void gvinum_mirror(int, char * const *); -static void gvinum_parityop(int, char * const * , int); -static void gvinum_printconfig(int, char * const *); -static void gvinum_raid5(int, char * const *); -static void gvinum_rename(int, char * const *); -static void gvinum_resetconfig(int, char * const *); -static void gvinum_rm(int, char * const *); -static void gvinum_saveconfig(void); -static void gvinum_setstate(int, char * const *); -static void gvinum_start(int, char * const *); -static void gvinum_stop(int, char * const *); -static void gvinum_stripe(int, char * const *); -static void parseline(int, char * const *); -static void printconfig(FILE *, const char *); - -static char *create_drive(const char *); -static void create_volume(int, char * const * , const char *); -static char *find_name(const char *, int, int); -static const char *find_pattern(char *, const char *); -static void copy_device(struct gv_drive *, const char *); -#define find_drive() \ - find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) - -int -main(int argc, char **argv) -{ - int tokens; - char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; - - /* Load the module if necessary. */ - if (modfind(GVINUMMOD) < 0) { - if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0) - err(1, GVINUMKLD ": Kernel module not available"); - } - - /* Arguments given on the command line. */ - if (argc > 1) { - argc--; - argv++; - parseline(argc, argv); - - /* Interactive mode. */ - } else { - for (;;) { - inputline = readline("gvinum -> "); - if (inputline == NULL) { - if (ferror(stdin)) { - err(1, "can't read input"); - } else { - printf("\n"); - exit(0); - } - } else if (*inputline) { - add_history(inputline); - strcpy(buffer, inputline); - free(inputline); - tokens = gv_tokenize(buffer, token, GV_MAXARGS); - if (tokens) - parseline(tokens, token); - } - } - } - exit(0); -} - -/* Attach a plex to a volume or a subdisk to a plex. */ -static void -gvinum_attach(int argc, char * const *argv) -{ - struct gctl_req *req; - const char *errstr; - int rename; - off_t offset; - - rename = 0; - offset = -1; - if (argc < 3) { - warnx("usage:\tattach [rename] " - "[]\n" - "\tattach [rename]"); - return; - } - if (argc > 3) { - if (!strcmp(argv[3], "rename")) { - rename = 1; - if (argc == 5) - offset = strtol(argv[4], NULL, 0); - } else - offset = strtol(argv[3], NULL, 0); - } - req = gctl_get_handle(); - gctl_ro_param(req, "class", -1, "VINUM"); - gctl_ro_param(req, "verb", -1, "attach"); - gctl_ro_param(req, "child", -1, argv[1]); - gctl_ro_param(req, "parent", -1, argv[2]); - gctl_ro_param(req, "offset", sizeof(off_t), &offset); - gctl_ro_param(req, "rename", sizeof(int), &rename); - errstr = gctl_issue(req); - if (errstr != NULL) - warnx("attach failed: %s", errstr); - gctl_free(req); -} - -static void -gvinum_create(int argc, char * const *argv) -{ - struct gctl_req *req; - struct gv_drive *d; - struct gv_plex *p; - struct gv_sd *s; - struct gv_volume *v; - FILE *tmp; - int drives, errors, fd, flags, i, line, plexes, plex_in_volume; - int sd_in_plex, status, subdisks, tokens, undeffd, volumes; - const char *errstr; - char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *sdname; - const char *ed; - char original[BUFSIZ], tmpfile[20], *token[GV_MAXARGS]; - char plex[GV_MAXPLEXNAME], volume[GV_MAXVOLNAME]; - - tmp = NULL; - flags = 0; - for (i = 1; i < argc; i++) { - /* Force flag used to ignore already created drives. */ - if (!strcmp(argv[i], "-f")) { - flags |= GV_FLAG_F; - /* Else it must be a file. */ - } else { - if ((tmp = fopen(argv[i], "r")) == NULL) { - warn("can't open '%s' for reading", argv[i]); - return; - } - } - } - - /* We didn't get a file. */ - if (tmp == NULL) { - snprintf(tmpfile, sizeof(tmpfile), "/tmp/gvinum.XXXXXX"); - - if ((fd = mkstemp(tmpfile)) == -1) { - warn("temporary file not accessible"); - return; - } - if ((tmp = fdopen(fd, "w")) == NULL) { - warn("can't open '%s' for writing", tmpfile); - return; - } - printconfig(tmp, "# "); - fclose(tmp); - - ed = getenv("EDITOR"); - if (ed == NULL) - ed = _PATH_VI; - - snprintf(commandline, sizeof(commandline), "%s %s", ed, - tmpfile); - status = system(commandline); - if (status != 0) { - warn("couldn't exec %s; status: %d", ed, status); - return; - } - - if ((tmp = fopen(tmpfile, "r")) == NULL) { - warn("can't open '%s' for reading", tmpfile); - return; - } - } - - req = gctl_get_handle(); - gctl_ro_param(req, "class", -1, "VINUM"); - gctl_ro_param(req, "verb", -1, "create"); - gctl_ro_param(req, "flags", sizeof(int), &flags); - - drives = volumes = plexes = subdisks = 0; - plex_in_volume = sd_in_plex = undeffd = 0; - plex[0] = '\0'; - errors = 0; - line = 1; - while ((fgets(buf, BUFSIZ, tmp)) != NULL) { - - /* Skip empty lines and comments. */ - if (*buf == '\0' || *buf == '#') { - line++; - continue; - } - - /* Kill off the newline. */ - buf[strlen(buf) - 1] = '\0'; - - /* - * Copy the original input line in case we need it for error - * output. - */ - strlcpy(original, buf, sizeof(original)); - - tokens = gv_tokenize(buf, token, GV_MAXARGS); - if (tokens <= 0) { - line++; - continue; - } - - /* Volume definition. */ - if (!strcmp(token[0], "volume")) { - v = gv_new_volume(tokens, token); - if (v == NULL) { - warnx("line %d: invalid volume definition", - line); - warnx("line %d: '%s'", line, original); - errors++; - line++; - continue; - } - - /* Reset plex count for this volume. */ - plex_in_volume = 0; - - /* - * Set default volume name for following plex - * definitions. - */ - strlcpy(volume, v->name, sizeof(volume)); - - snprintf(buf1, sizeof(buf1), "volume%d", volumes); - gctl_ro_param(req, buf1, sizeof(*v), v); - volumes++; - - /* Plex definition. */ - } else if (!strcmp(token[0], "plex")) { - p = gv_new_plex(tokens, token); - if (p == NULL) { - warnx("line %d: invalid plex definition", line); - warnx("line %d: '%s'", line, original); - errors++; - line++; - continue; - } - - /* Reset subdisk count for this plex. */ - sd_in_plex = 0; - - /* Default name. */ - if (strlen(p->name) == 0) { - snprintf(p->name, sizeof(p->name), "%s.p%d", - volume, plex_in_volume++); - } - - /* Default volume. */ - if (strlen(p->volume) == 0) { - snprintf(p->volume, sizeof(p->volume), "%s", - volume); - } - - /* - * Set default plex name for following subdisk - * definitions. - */ - strlcpy(plex, p->name, sizeof(plex)); - - snprintf(buf1, sizeof(buf1), "plex%d", plexes); - gctl_ro_param(req, buf1, sizeof(*p), p); - plexes++; - - /* Subdisk definition. */ - } else if (!strcmp(token[0], "sd")) { - s = gv_new_sd(tokens, token); - if (s == NULL) { - warnx("line %d: invalid subdisk " - "definition:", line); - warnx("line %d: '%s'", line, original); - errors++; - line++; - continue; - } - - /* Default name. */ - if (strlen(s->name) == 0) { - if (strlen(plex) == 0) { - sdname = find_name("gvinumsubdisk.p", - GV_TYPE_SD, GV_MAXSDNAME); - snprintf(s->name, sizeof(s->name), - "%s.s%d", sdname, undeffd++); - free(sdname); - } else { - snprintf(s->name, sizeof(s->name), - "%s.s%d",plex, sd_in_plex++); - } - } - - /* Default plex. */ - if (strlen(s->plex) == 0) - snprintf(s->plex, sizeof(s->plex), "%s", plex); - - snprintf(buf1, sizeof(buf1), "sd%d", subdisks); - gctl_ro_param(req, buf1, sizeof(*s), s); - subdisks++; - - /* Subdisk definition. */ - } else if (!strcmp(token[0], "drive")) { - d = gv_new_drive(tokens, token); - if (d == NULL) { - warnx("line %d: invalid drive definition:", - line); - warnx("line %d: '%s'", line, original); - errors++; - line++; - continue; - } - - snprintf(buf1, sizeof(buf1), "drive%d", drives); - gctl_ro_param(req, buf1, sizeof(*d), d); - drives++; - - /* Everything else is bogus. */ - } else { - warnx("line %d: invalid definition:", line); - warnx("line %d: '%s'", line, original); - errors++; - } - line++; - } - - fclose(tmp); - unlink(tmpfile); - - if (!errors && (volumes || plexes || subdisks || drives)) { - gctl_ro_param(req, "volumes", sizeof(int), &volumes); - gctl_ro_param(req, "plexes", sizeof(int), &plexes); - gctl_ro_param(req, "subdisks", sizeof(int), &subdisks); - gctl_ro_param(req, "drives", sizeof(int), &drives); *** 1112 LINES SKIPPED *** From nobody Thu Jan 23 16:21:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m25BKCz5l8KL; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m22nj1z3snt; Thu, 23 Jan 2025 16:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cdwRJ15mmupKNV2CWa8LYt/RqDvWRysb6itBIJsHwJc=; b=s2kBPZk1ATXZVXZPe1/jNzygagKm1QYS9oSJb1RI3d9zhyO5vP8cWvqtLSgmPb+MsQIsGb d5OoGppmbiAKimvsZqjhm4wR93kB87o6lf1zWjvTdRp9aSemPU912Z4mdES5wxoru0w4yg g5xNJddGdh+holZ7QRMZLfYhG6yvVLbDJh/8isBVlU3hml1tKcewxJ24EyQUcGvhaKeTHj ss43C+6JI8r+EDHkwE+4xK4gf+whw0cSKBqfHB3vh+kzEACIzfWsN+lMgzi4JAozV+X2+4 WHAl8afjy/PqFrK8+lqpzV4ulUNfxGRzazACwQHUtfPUBDWgutpCeESCJXwGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cdwRJ15mmupKNV2CWa8LYt/RqDvWRysb6itBIJsHwJc=; b=WKhbGFC6sASZfn/2EL2uj5DkJN/aHk39OUNifiQJMmdvZqPQXieme0Ke4nt8RBhKENWC0t ZUVJYCO3g1d3Xr9N+/puIFaOZESZsLlOGAiN4y3ViQ41z1rCs7h3c47s2viZa6ApakE76g DZKHBG8SZmdkOKIU5pMA2PujwpzphurUSSzLT+7pre8Ji6HcZHvO6aJZlQWU+K/Pl3XoS6 UKVMloJQXKOaaIkun65zmkN+aWm+sJRK7wLBp7zL+oNOYkbUD9+bm1KRdNPQZnci5Qr5Mn ucaFhe+fY5ik43hf8CKZ5cAAbCZdbz8HOpEXX0/vdPgemLRqh3OJHnyoBVHHOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649266; a=rsa-sha256; cv=none; b=thyu7kTj5CCQvXTs/WaEmI9yFgHXKqI5wBggMEceZ5ludEuWCRE4iIlgvvlFEjFvq9flaT GA5Zyw0CmJ7EvQ2WBomEnXYoNzTbgsnzJboe+XP6b5YqfC/z+izmJcpE7nEv7KwT6WTwUE mD15k/itbzU3t243jxVUDhIDj/amRfOsK2RsBrupeTbsU02vm7kXTHzH4E9sSdIGp3SXug 4Sl+IAeXwmj21aXOlzKb7wP2lsLF1AKN/L/TnXlpFJNBjVoIgxREVI2NhPog9KUhc5WgXc jvZcptBTGBwf79Zj49Q2qeqh8h7TBX0ZpjqjKJ4a8y2F+db4J068pll0kBaFuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m22FDjzmkk; Thu, 23 Jan 2025 16:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL6ib001093; Thu, 23 Jan 2025 16:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL62S001090; Thu, 23 Jan 2025 16:21:06 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:06 GMT Message-Id: <202501231621.50NGL62S001090@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: 2b12e6676a00 - main - fdisk: Remove support for vinum volumes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 2b12e6676a00a9360844d39516692753bf776e94 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2b12e6676a00a9360844d39516692753bf776e94 commit 2b12e6676a00a9360844d39516692753bf776e94 Author: John Baldwin AuthorDate: 2025-01-23 15:33:10 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:43 +0000 fdisk: Remove support for vinum volumes Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48537 --- sbin/fdisk/fdisk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index a2e1cdb76c6a..925cc68932d7 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1472,7 +1472,6 @@ sanitize_partition(struct dos_partition *partp) * The following choices are considered: * /dev/ad0s1a => /dev/ad0 * /dev/da0a => /dev/da0 - * /dev/vinum/root => /dev/vinum/root * A ".eli" part is removed if it exists (see geli(8)). * A ".journal" ending is removed if it exists (see gjournal(8)). */ @@ -1489,7 +1488,7 @@ get_rootdisk(void) if (statfs("/", &rootfs) == -1) err(1, "statfs(\"/\")"); - if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$", + if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?(\\.journal)?$", REG_EXTENDED)) != 0) errx(1, "regcomp() failed (%d)", rv); strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); From nobody Thu Jan 23 16:21:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m35Sh6z5l8RM; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m33Wphz3slZ; Thu, 23 Jan 2025 16:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f7Gj+hEhjPN/j+YhZWOHWfa8Oj7vWQV/RfRt+zBpqJs=; b=uUNqowIMGNIio84IlsPVPH/i4l10ZSXxYiOeHgp/v/pWfFZxYOqgNb9QnHjF1DqVOmNeZE X9zj9nXzu8Pt3Q8u8ZUjC8oATuJcrbHrnh9kIwtIRjOTcIFAuNFu45DC/2OTh6vLmhLH8O kdgRjJaQZX27QddX7Tj+5ZCTmtOCZGPuRAAZ7uqhFvIcIti/ypTJsSoKVyB2E1aXA5acbK Li8bPt9V1HTeja3q2z5GKDWd69gaXkHar/4X4cidV+1FZhUXKMI94jwaADKyrWPntx9sLV BX4wtbNIdI7OnBWUz/X6PoN1bsaOeUKlm3r6s0/dUuaOkSER3oi5+QwvG24JnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f7Gj+hEhjPN/j+YhZWOHWfa8Oj7vWQV/RfRt+zBpqJs=; b=cWHbnXSK8VbbhRR2AQu/xv/B2NEotV7NUODI8h3nsI01Esr7fm3Ml9k34VUATB8Z8RusOX qxVKu5hdYbvkt0IcsSD7Hyzl1f2oY4lbVaU3iy2WuzPTLoVu0J6OzvA3vzPAJ0Mm8UXD1y sEXR58CjqJYE4H0CD42FkoLJUeNbgxZX/5fF0bkPYt9NLQrAe22Lwyeq+FbN28SPPaeaED uR0qAcY2eV14OhjGjEltx3yy5efF2b/pEwYVe51JLc6XTeYOjP6+mS8Th4vGfuj+L5lxLp w7C+mIsKtAWEXKCUCntcDgSJLo5EGce2zmqyUyf3uOIxilfTVBODfeq8dQZb1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649267; a=rsa-sha256; cv=none; b=YyzqGTCfe9wFnqjGhYlU/Cx/mZQ7OVxEqOMkdPDrxSDZ2FZ5pCdQmweTV8/iu2EDCwiYq2 SQq1JmWhPqC8Iljr4UktQaATaXwE2hkPMLPDFxNzH6+snwDo6FVRXouy8G89uBP28th35F 1uElSlhDJnwmQ5U85ZRcwVOrvZelag6m3QS9F5Hhb7rzzDFE/1SsnA5+y8D1731JpyFkzk tKVRNsquAAy+Gc23UAN6S5v53vVq8l/WYyQfuZE0YdyYerWHJYd3GWp2b6oJWV9eoqAlmG 2wmI6KUMeRKn5tspMn2Eeyv5djlcDLhwHaoMls6igRK/Z04ktGq4giEBbDtHHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m32rpVzm0H; Thu, 23 Jan 2025 16:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL76t001136; Thu, 23 Jan 2025 16:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL7we001133; Thu, 23 Jan 2025 16:21:07 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:07 GMT Message-Id: <202501231621.50NGL7we001133@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: 719747125bbb - main - ffsinfo: Remove support for vinum volumes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 719747125bbbc91039ead3177a4360f502c8b1e0 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=719747125bbbc91039ead3177a4360f502c8b1e0 commit 719747125bbbc91039ead3177a4360f502c8b1e0 Author: John Baldwin AuthorDate: 2025-01-23 15:33:21 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:43 +0000 ffsinfo: Remove support for vinum volumes Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48538 --- sbin/ffsinfo/ffsinfo.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sbin/ffsinfo/ffsinfo.c b/sbin/ffsinfo/ffsinfo.c index f2b25e582bda..842d5c20bad0 100644 --- a/sbin/ffsinfo/ffsinfo.c +++ b/sbin/ffsinfo/ffsinfo.c @@ -186,27 +186,18 @@ main(int argc, char **argv) * No path prefix was given, so try in this order: * /dev/r%s * /dev/%s - * /dev/vinum/r%s - * /dev/vinum/%s. * - * FreeBSD now doesn't distinguish between raw and block + * FreeBSD now doesn't distinguish between raw and block * devices any longer, but it should still work this way. */ - len = strlen(device) + strlen(_PATH_DEV) + 2 + strlen("vinum/"); + len = strlen(device) + strlen(_PATH_DEV) + 2; special = (char *)malloc(len); if (special == NULL) errx(1, "malloc failed"); snprintf(special, len, "%sr%s", _PATH_DEV, device); if (stat(special, &st) == -1) { + /* For now this is the 'last resort' */ snprintf(special, len, "%s%s", _PATH_DEV, device); - if (stat(special, &st) == -1) { - snprintf(special, len, "%svinum/r%s", - _PATH_DEV, device); - if (stat(special, &st) == -1) - /* For now this is the 'last resort' */ - snprintf(special, len, "%svinum/%s", - _PATH_DEV, device); - } } device = special; } From nobody Thu Jan 23 16:21:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m5176Rz5l8cp; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m45fRKz3slm; Thu, 23 Jan 2025 16:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPJdRF8nMsbKbV/AjEocOdokri4EOaKy9ghCQfMYPqM=; b=GAWegc8WUSJy4Rh/ErpSd/5P/EsOsivnIXCyFb+4+T4FwRqpAIfOAGhKCqpe3jipfZdH8C 5q6HEGhCRs1MaZjX+LH2Nsw+ot2sk/AX+GQEqe4OqzqgRXyklaTEClyG0x0jdAzy/P6fHU odnXlLNjQna+CDtmGjMurw+842iNRNKPDK9McstT9yhGWFJUgPDwV8a8kEGa5YKF5JySPN /h3QDq1KfqPTDRGk0lAdaqvB4ydeXksClQtHEp16HUmwUNzjkzS4N2HzIu4EBzGvvb44sU GJVnuQPAbYoSR1hmQXvDSABtqipqlnbxhdV57+jPyY736Sy8eTjD9WkVmjHiGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPJdRF8nMsbKbV/AjEocOdokri4EOaKy9ghCQfMYPqM=; b=YlQNgOk7ftRd2siqu0T7XmcAZu3nIvJNP92SVstjsi8btuodVszsIAxWypvsOEl/GMoqhS gMHiHIEZsGJimK6P+BV+yTDyn4PL9EZ0bZAF+akvbuDV52dFls77rW2h7S21OcMJYu9436 8gUjY6RuCT+KRcc2fJIxC0OHsWRqku/6ZdnyWLqn9YqblIrplN/QPZNiykYrcUvKwjT+R2 0dAgdQhghUX9CX7TpHRycKOCpUmCcpw0b2UlwwmVb5VHVH07sVGyMB/a4Kth8D/HJDPyUo qlz1kfr+BN1Qz0Nrus6hAhj2ySLSLiDrtXNgfWHTRHLnzzP9h+/kBug6dExYZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649268; a=rsa-sha256; cv=none; b=wTqnxzQKV5T+SMPdsZw6ulOR2AtpPwimleVzg+mnQc5BMxSc0VjAs1813AxNaWti38LqG6 AQYqT2ddN1ZbZSzgx96jOUZ+qt4zR5CLfkIdcbfRcVy6IqMjB0d289CxZdPm2DBgKjljQU gqQOGx7IQkIrfbKQO/C6SmqbNtg317ODkXsdx+UutwaJ2kLwYKeLsu0/oM470yhxgUGlZv D2FcW6qyXw2n/SDz7A+0qXF5/qFJxarjCHyb6VZ4gkmbhZ0RcooSbxna4SmPjjYXsizffH 0jxFvSxm6R8MVBbG33SrRD3nqEmxWTnhdWBSR5XabqbHgVfbbh2Q2dwhkK/rVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m43X7lzmfZ; Thu, 23 Jan 2025 16:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL8LR001168; Thu, 23 Jan 2025 16:21:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL84t001165; Thu, 23 Jan 2025 16:21:08 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:08 GMT Message-Id: <202501231621.50NGL84t001165@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: 63d7fcf2a0f4 - main - bsdlabel.8: Don't document how to create vinum partitions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 63d7fcf2a0f48ea2510e46bb1347dbdd107fde69 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=63d7fcf2a0f48ea2510e46bb1347dbdd107fde69 commit 63d7fcf2a0f48ea2510e46bb1347dbdd107fde69 Author: John Baldwin AuthorDate: 2025-01-23 16:19:09 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:43 +0000 bsdlabel.8: Don't document how to create vinum partitions Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48539 --- sbin/bsdlabel/bsdlabel.8 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index dcf8c7ccace7..abea59756aea 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 25, 2024 +.Dd January 23, 2025 .Dt BSDLABEL 8 .Os .Sh NAME @@ -324,8 +324,6 @@ file systems and .Xr ccd 4 partitions, use type .Cm 4.2BSD . -For Vinum drives, use type -.Cm vinum . Other common types are .Cm swap and From nobody Thu Jan 23 16:21:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf5m60kDSz5l8KM; Thu, 23 Jan 2025 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf5m559x6z3sZC; Thu, 23 Jan 2025 16:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tkJ8TbVrF8biIfwJCXAnkDUSQsrVFQxGinNM4LS8/I4=; b=gnNzTPwwfBD3oTP87/x/K15n4dDmgXjs4madxQ+QfDENzKI5DZS9+S+Kk6whKh4rxM/dcD Z2rEs1/60/TOD8RtSE/nXcTYFCvHIlrJPUTPxkvNRFf2Di9s9mXLUgGXX+nKTcm7e/1Ld9 gCiGYCXVbLE/qnojoIIsBFRvGkNz9xFLYLRl+LrJW4OXfGNFjxJha5DbG6LoOWt4uH5q7S LnJ6/tVTHSjUxjELxB0mt4aYNEE7T45MCFMe5MSc13n4YSxDbMVzh5NSde8h1ZJ+hmPwMx Du0QUBApfDcq27dPjqI6o3stQoDTknHWwrgdo0RE6VTkSdZWjfjkKsEI9QZFtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tkJ8TbVrF8biIfwJCXAnkDUSQsrVFQxGinNM4LS8/I4=; b=C/XTZDNDhQKv+6tnf1SR8mxbCyWCjHHTv2E/QBSUorJcEwXICk9FeVO3Utl0pnoGusUgSs A1LAM9HjORFGgc1OQvBixVyoJrksxIIIR4SKeaNoTCAtmTRkr5br1q+LHzi2yY2Nh8P5ep SQD8ZDss6SDPYA6ageB4GcjWqa5uTekrVHU/FWRpIu1QF5vEUjOhKAAM2UkvCZi6S2KuXr cpBtu/rRcFF7glhUyQXS9kYm/7iImyoV7Y+2NBW4W2QFREkktPg3tvApjYn+RhIGPAPp94 daQ++8Xnxy4RnOkFZQmiVGRFkXRCq2PLpqHGth7Ro53D0tIV4Mwdn4HpsU93pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649269; a=rsa-sha256; cv=none; b=FScG2HCP3plp2LQWdFMpbo+2VLK9m+dy1qLww8cuK+kRL2LlYJ7nyV4YWG7oJGwx9TV/9C 1rQqYgCH78mEtmAoL8QFAgCiyLzY0Ok6xBY044GBMlXvJBRcANnAfM4WclALRNHgpeTo4t TF92Ni29i0oLABJy1aU/yx86zmwG0iUvX9N9Z8gIWaQdFuJ1Dc842JzN8SvQl6IhuEAPFi ml/a569dKKoBsdc1rTVxuE0fuSUq4JyfZZJbgq9fqn4oJWO2VSog+YJg4HJPVAWYOVfZuF dm/gU1d2ZXUfYFm0TLKHSxxCbf+EvZr70nhNfcQ9KiZ0FK3yap1TP5IwJW2MAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf5m54mwhzm0J; Thu, 23 Jan 2025 16:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGL9ca001200; Thu, 23 Jan 2025 16:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGL9Be001197; Thu, 23 Jan 2025 16:21:09 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:21:09 GMT Message-Id: <202501231621.50NGL9Be001197@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: 8432ddac21b3 - main - ccdconfig.8: Bump Dd for gvinum removal List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8432ddac21b3da5fa45b4f934e90e80deaa9cabf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8432ddac21b3da5fa45b4f934e90e80deaa9cabf commit 8432ddac21b3da5fa45b4f934e90e80deaa9cabf Author: John Baldwin AuthorDate: 2025-01-23 16:20:01 +0000 Commit: John Baldwin CommitDate: 2025-01-23 16:20:43 +0000 ccdconfig.8: Bump Dd for gvinum removal --- sbin/ccdconfig/ccdconfig.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 55cda5b2b356..52bbfef20af6 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -27,7 +27,7 @@ .\" .\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" -.Dd March 22, 2024 +.Dd January 23, 2025 .Dt CCDCONFIG 8 .Os .Sh NAME From nobody Thu Jan 23 16:32:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf61Q4Dw0z5l95K; Thu, 23 Jan 2025 16:32: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf61Q25Lhz3vlx; Thu, 23 Jan 2025 16:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZqq5zRIXmBnDS8CaY2/R2ZQRtQdF1Y8IE3uRGKIxzE=; b=lz9mzXygSDrm9a76AD0Cs7bkzzn6t2fc+U57rmv/MqkAi7qCpVp/T4sSLSlmW8W/J9elyl IFyTvzdTerSNPyXHyPsbi4mmIlb6g0jnYMpbl+QrcOtDDi4B280U8+CzYYRorx9F6VmQM3 4Mglb549ycOU1NbP6B18+GgR7wzkTpOhtvL9lUU5kvVZt8Y76jUUyxN5KXZDcmqyvOiBgg REQO0vbJuyzx5ubytmw6pPHAg6Dnwj2ubdDBHs5Q6O/gd1Vr3xbMIP4rpUz/szw9krNgLC ZjoByJgAkRDZh3J3A7cfhpUTzyG6pvqQr8YPkzLqQP0eQBW1vuzMoFa1XD0hjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737649962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZqq5zRIXmBnDS8CaY2/R2ZQRtQdF1Y8IE3uRGKIxzE=; b=cWpfRsEyQslb8fD+b5jVxBlFyjetQlltqC/ZkD6jTh3W2zKgagl7yjKDEmP1eqJQHr7zjL fHSV8e3al7OVujDldCLM6ndi7Rvj+vrkQhOSUcFiXU0xJvF/Xg3T/XbKtmcAj+c9Xv7Hpf ocg5+zQqhAL5sUAX9VLvn+gw/3qZhofy7+EVmPxYhzgBnZbVbC56OA3d8xO7hhkKs3kcWF OyXeMNWJEyU+6vXsffR6613lMLsI6CSyrvsXLNFTqzWBKIFNgvMzjnWx9f7pDjP+6mrY5X 1Mvhwof1fhmSevtVC570rt6XeVDFZTb8yRpWwIW0ZGv92IyscbpIW9/cPK7ShA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737649962; a=rsa-sha256; cv=none; b=OR1MlaqYnMRBqZVSkLH/PlZuEUEWaOB6cmKP68sAwkHTGc2PTC2csV/yUVI2SQhQrGfSnw 48EuCFJerPcL5HoUPKu5P11ACwpdB7Rg/StWcB7GkC/j5G3rvjvPQUfK9FrqfZ+IFjE9t3 GikxyM9M+/5w6KP4gNDCexZYclEd6JreMJI5A995iAsZLg2gP+o0tMUKcU+13NRamMFIHF C36JGu96sMjaJIHh01iO1N3nKI9nhnd9u+0Dx2h+MAM+Y2HnVv7R9ZsT5SBO1fW2AMmUXb O94oSg0SnpgD7C+la+r65yX0bNY6g+28bKlfBhy9o++g/J7M0oA0TPdSi1WPxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf61Q1TmJzn8v; Thu, 23 Jan 2025 16:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGWgCP026143; Thu, 23 Jan 2025 16:32:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGWgHd026140; Thu, 23 Jan 2025 16:32:42 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:32:42 GMT Message-Id: <202501231632.50NGWgHd026140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 0e4167514fe3 - main - development.7: Add example for just kernel modules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e4167514fe3894b288457f9c1edd8fb3237dfb8 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0e4167514fe3894b288457f9c1edd8fb3237dfb8 commit 0e4167514fe3894b288457f9c1edd8fb3237dfb8 Author: Alexander Ziaee AuthorDate: 2025-01-17 22:56:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-23 16:32:03 +0000 development.7: Add example for just kernel modules Reported by: christos Reviewed by: carlavilla, christos Accepted by: christos (src), carlavilla (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48507 --- share/man/man7/development.7 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index eb5a57a464fc..1b875fb14bda 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 7, 2024 +.Dd January 19, 2025 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -152,6 +152,13 @@ cd src/bin/ls make clean all install .Ed .Pp +Rebuild and reinstall a single loadable kernel module, in this case +.Xr sound 4 : +.Bd -literal -offset indent +cd src/sys/modules/sound +make all install clean cleandepend KMODDIR=/boot/kernel +.Ed +.Pp Quickly rebuild and reinstall the kernel, only recompiling the files changed since last build; note that this will only work if the full kernel build has been completed in the past, not on a fresh source tree: From nobody Thu Jan 23 16:59:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf6ct202bz5lC06; Thu, 23 Jan 2025 16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf6ct1Vl7z40V5; Thu, 23 Jan 2025 16:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737651598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zKQcFNeq/Mntua+AZEA9vLoCllQw/M8MXnEAPi6Xts=; b=B5raekGqhQAPjM14Muqzj+JY9cuf3P+oOuMbOw+mFtf2jVLlpgjZwqZ/ZpZYr+2dR9d30Q C5QwdiZ0FXMRH/C9G1Xe8r+ZsgiAESaSG1O6Vn6lsTaQzvkR+VdO8QSYVUHw2l/IkCbOmB XAbNnNdnrR4ml7bNSoSfOkPg7n1ULuPU1wZR0NUP+MfktCC8gUVg18qDV3+BUy/xpR3+4o RlBlY6Ur4acHXMSNucALCJxh+3zUYiNyYd70ErQ/E9oqQ/a1Hiodu1/wPLZ2rGNvfQmNfm waeeHrz6NNhQwjMlUjEWdLEx/99jesRgbKMPKUjEmxXuggXxgznqxjuskVGmLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737651598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8zKQcFNeq/Mntua+AZEA9vLoCllQw/M8MXnEAPi6Xts=; b=BCzsGT8SNz4xil/zAxjYuxhOV3HI61AeTHJaxJAzE+YKU/YUToir23eHvb3klkgcTVEVb9 j9O9gxKIz4WK6ye1yQg/wJFVRdrpJX/g3wSRwl2ZhHoK2zoL4o0ALd70wQHhjZ/6FFRZRJ 3faKOFIX7+hnzDZyrmeIGkiPaszF99P1nogxKFsaEHWukCl1gce8AwEOtfeOk56F+SqpBA kO+fp1o15OmV2c4vA4zM9X/hkKTg6VfimjiLqOY1LcHc8axnqSk/a9DTKBQy+I5H3JFbn9 JYwqcF3OpeOh9MO7zRwj1YSjHSPS/i4c5DX0JzFLYlOVaQmOuMckhpdARtv0WQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737651598; a=rsa-sha256; cv=none; b=kiiOXXOkCv2fpUwmP3Wn6xror0mtAgR43QLShlT6el4DVnGLxbiCT3RBWwBQnGpz+Hc8wh uer4QPzG3YXad+1LhLDqATMBUufI2YGwa0S33CTJVWLy2V18d+Q2uqfxTiysZSj8o1Dub8 7tuSc4R6Q9kzDEzIrVhpZHzB+R10417pEuuG0hASaDM4sb4On8trD9D/oHqfZ1OBPXaBkH Jcp+ZciO7nB+wEcCIaUUB/CfY+UyyY0UMOUBTChBUATv4o1K3vE0nM+UBl46AbBT7oujf8 9st0/HhgxVCUIBc6+ZH8psbNyD1IeNDvQmsxfWJ1eY4yUc4wHp0nA6+9tmxiPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf6ct13bZznCn; Thu, 23 Jan 2025 16:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NGxw45065510; Thu, 23 Jan 2025 16:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NGxwM0065507; Thu, 23 Jan 2025 16:59:58 GMT (envelope-from git) Date: Thu, 23 Jan 2025 16:59:58 GMT Message-Id: <202501231659.50NGxwM0065507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 18c47eab727c - main - Revert "vm_phys: reduce touching of page->pool fields". Pho reports, and I have verified, that it sometimes crashes the kernel on the mmap41.sh stress test. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18c47eab727c6ac6505cca981175b2a7a6e9630b Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=18c47eab727c6ac6505cca981175b2a7a6e9630b commit 18c47eab727c6ac6505cca981175b2a7a6e9630b Author: Doug Moore AuthorDate: 2025-01-23 16:57:23 +0000 Commit: Doug Moore CommitDate: 2025-01-23 16:57:23 +0000 Revert "vm_phys: reduce touching of page->pool fields". Pho reports, and I have verified, that it sometimes crashes the kernel on the mmap41.sh stress test. This reverts commit c669b08bd834553ec056e3987693f247b2ec0433. --- sys/vm/vm_kern.c | 2 +- sys/vm/vm_page.c | 97 ++++++++++++++++++++---------------------- sys/vm/vm_phys.c | 123 +++++++++++++++++++++++++---------------------------- sys/vm/vm_phys.h | 6 +-- sys/vm/vm_reserv.c | 35 +++++++-------- 5 files changed, 123 insertions(+), 140 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 2b85dbde1dd6..86ab2529e27f 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -953,7 +953,7 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); - vm_phys_free_pages(m, m->pool, 0); + vm_phys_free_pages(m, 0); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 961b32da6599..ba22c7f97f2f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -572,7 +572,6 @@ vm_page_startup(vm_offset_t vaddr) #if defined(__i386__) && defined(VM_PHYSSEG_DENSE) long ii; #endif - int pool; #ifdef VM_FREEPOOL_LAZYINIT int lazyinit; #endif @@ -652,8 +651,6 @@ vm_page_startup(vm_offset_t vaddr) dump_add_page(pa); pa += PAGE_SIZE; } -#else - (void)pa; #endif /* * Compute the number of pages of memory that will be available for @@ -758,12 +755,9 @@ vm_page_startup(vm_offset_t vaddr) */ vm_phys_init(); - pool = VM_FREEPOOL_DEFAULT; #ifdef VM_FREEPOOL_LAZYINIT lazyinit = 1; TUNABLE_INT_FETCH("debug.vm.lazy_page_init", &lazyinit); - if (lazyinit) - pool = VM_FREEPOOL_LAZYINIT; #endif /* @@ -783,27 +777,48 @@ vm_page_startup(vm_offset_t vaddr) seg = &vm_phys_segs[segind]; /* - * Initialize pages not covered by phys_avail[], since they - * might be freed to the allocator at some future point, e.g., - * by kmem_bootstrap_free(). + * If lazy vm_page initialization is not enabled, simply + * initialize all of the pages in the segment. Otherwise, we + * only initialize: + * 1. Pages not covered by phys_avail[], since they might be + * freed to the allocator at some future point, e.g., by + * kmem_bootstrap_free(). + * 2. The first page of each run of free pages handed to the + * vm_phys allocator, which in turn defers initialization + * of pages until they are needed. + * This avoids blocking the boot process for long periods, which + * may be relevant for VMs (which ought to boot as quickly as + * possible) and/or systems with large amounts of physical + * memory. */ - startp = seg->start; - for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (startp >= seg->end) - break; - if (phys_avail[i + 1] < startp) - continue; - if (phys_avail[i] <= startp) { - startp = phys_avail[i + 1]; - continue; +#ifdef VM_FREEPOOL_LAZYINIT + if (lazyinit) { + startp = seg->start; + for (i = 0; phys_avail[i + 1] != 0; i += 2) { + if (startp >= seg->end) + break; + + if (phys_avail[i + 1] < startp) + continue; + if (phys_avail[i] <= startp) { + startp = phys_avail[i + 1]; + continue; + } + + m = vm_phys_seg_paddr_to_vm_page(seg, startp); + for (endp = MIN(phys_avail[i], seg->end); + startp < endp; startp += PAGE_SIZE, m++) { + vm_page_init_page(m, startp, segind, + VM_FREEPOOL_DEFAULT); + } } - m = vm_phys_seg_paddr_to_vm_page(seg, startp); - for (endp = MIN(phys_avail[i], seg->end); - startp < endp; startp += PAGE_SIZE, m++) { - vm_page_init_page(m, startp, segind, + } else +#endif + for (m = seg->first_page, pa = seg->start; + pa < seg->end; m++, pa += PAGE_SIZE) { + vm_page_init_page(m, pa, segind, VM_FREEPOOL_DEFAULT); } - } /* * Add the segment's pages that are covered by one of @@ -820,30 +835,16 @@ vm_page_startup(vm_offset_t vaddr) if (pagecount == 0) continue; - /* - * If lazy vm_page initialization is not enabled, simply - * initialize all of the pages in the segment covered by - * phys_avail. Otherwise, initialize only the first - * page of each run of free pages handed to the vm_phys - * allocator, which in turn defers initialization of - * pages until they are needed. - * - * This avoids blocking the boot process for long - * periods, which may be relevant for VMs (which ought - * to boot as quickly as possible) and/or systems with - * large amounts of physical memory. - */ m = vm_phys_seg_paddr_to_vm_page(seg, startp); - vm_page_init_page(m, startp, segind, pool); - if (pool == VM_FREEPOOL_DEFAULT) { - for (int j = 1; j < pagecount; j++) { - vm_page_init_page(&m[j], - startp + ptoa(j), segind, pool); - } +#ifdef VM_FREEPOOL_LAZYINIT + if (lazyinit) { + vm_page_init_page(m, startp, segind, + VM_FREEPOOL_LAZYINIT); } +#endif vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); - vm_phys_enqueue_contig(m, pool, pagecount); + vm_phys_enqueue_contig(m, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; @@ -2340,7 +2341,6 @@ found: m->flags = flags; m->a.flags = 0; m->oflags = (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; - m->pool = VM_FREEPOOL_DEFAULT; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; else if ((req & VM_ALLOC_SBUSY) != 0) @@ -2558,7 +2558,6 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, m->ref_count = 1; m->a.act_count = 0; m->oflags = oflags; - m->pool = VM_FREEPOOL_DEFAULT; if (vm_page_iter_insert(&pages, m, object, pindex, mpred)) { if ((req & VM_ALLOC_WIRED) != 0) vm_wire_sub(npages); @@ -2656,7 +2655,6 @@ found: m->flags = (m->flags & PG_ZERO) | flags; m->a.flags = 0; m->oflags = VPO_UNMANAGED; - m->pool = VM_FREEPOOL_DIRECT; m->busy_lock = VPB_UNBUSIED; if ((req & VM_ALLOC_WIRED) != 0) { vm_wire_add(1); @@ -2805,7 +2803,6 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, m->ref_count = 1; m->a.act_count = 0; m->oflags = VPO_UNMANAGED; - m->pool = VM_FREEPOOL_DIRECT; /* * Zero the page before updating any mappings since the page is @@ -2884,7 +2881,7 @@ vm_page_zone_release(void *arg, void **store, int cnt) vm_domain_free_lock(vmd); for (i = 0; i < cnt; i++) { m = (vm_page_t)store[i]; - vm_phys_free_pages(m, pgcache->pool, 0); + vm_phys_free_pages(m, 0); } vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, cnt); @@ -3269,7 +3266,7 @@ unlock: do { MPASS(vm_page_domain(m) == domain); SLIST_REMOVE_HEAD(&free, plinks.s.ss); - vm_phys_free_pages(m, m->pool, 0); + vm_phys_free_pages(m, 0); cnt++; } while ((m = SLIST_FIRST(&free)) != NULL); vm_domain_free_unlock(vmd); @@ -4274,7 +4271,7 @@ vm_page_free_toq(vm_page_t m) return; } vm_domain_free_lock(vmd); - vm_phys_free_pages(m, m->pool, 0); + vm_phys_free_pages(m, 0); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, 1); } diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index a8b40b004d86..cf1ed5818b2f 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -187,7 +187,7 @@ SYSCTL_INT(_vm, OID_AUTO, ndomains, CTLFLAG_RD, static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end); static void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, - int order, int pool, int tail); + int order, int tail); static bool __diagused vm_phys_pool_valid(int pool) @@ -391,12 +391,10 @@ sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS) #endif static void -vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int pool, - int tail) +vm_freelist_add(struct vm_freelist *fl, vm_page_t m, int order, int tail) { m->order = order; - m->pool = pool; if (tail) TAILQ_INSERT_TAIL(&fl[order].pl, m, listq); else @@ -689,7 +687,7 @@ vm_phys_register_domains(int ndomains __numa_used, */ static __inline void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, - int pool, int tail) + int tail) { vm_page_t m_buddy; @@ -699,20 +697,19 @@ vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl, int order, KASSERT(m_buddy->order == VM_NFREEORDER, ("vm_phys_split_pages: page %p has unexpected order %d", m_buddy, m_buddy->order)); - vm_freelist_add(fl, m_buddy, oind, pool, tail); + vm_freelist_add(fl, m_buddy, oind, tail); } } static void -vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int pool, - int tail) +vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int tail) { KASSERT(order >= 0 && order < VM_NFREEORDER, ("%s: invalid order %d", __func__, order)); - vm_freelist_add(fl, m, order, pool, tail); + vm_freelist_add(fl, m, order, tail); #ifdef VM_FREEPOOL_LAZYINIT - if (__predict_false(pool == VM_FREEPOOL_LAZYINIT)) { + if (__predict_false(m->pool == VM_FREEPOOL_LAZYINIT)) { vm_page_t m_next; vm_paddr_t pa; int npages; @@ -741,8 +738,7 @@ vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int pool, * The physical page m's buddy must not be free. */ static void -vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, - int tail) +vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) { int order; @@ -758,7 +754,7 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, order = ilog2(npages); KASSERT(order < VM_NFREEORDER, ("%s: order %d is out of range", __func__, order)); - vm_phys_enq_chunk(fl, m, order, pool, tail); + vm_phys_enq_chunk(fl, m, order, tail); m += 1 << order; npages -= 1 << order; } @@ -778,8 +774,7 @@ vm_phys_enq_beg(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, * parameter m. Otherwise, the physical page m's buddy must not be free. */ static vm_page_t -vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, - int tail) +vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail) { int order; @@ -793,7 +788,7 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, ("vm_phys_enq_range: page %p has unexpected order %d", m, m->order)); order = ffs(npages) - 1; - vm_phys_enq_chunk(fl, m, order, pool, tail); + vm_phys_enq_chunk(fl, m, order, tail); m += 1 << order; npages -= 1 << order; } @@ -801,30 +796,33 @@ vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int pool, } /* - * Complete initialization of a contiguous, power of two-sized set of physical - * pages. + * Set the pool for a contiguous, power of two-sized set of physical pages. * * If the pages currently belong to the lazy init pool, then the corresponding * page structures must be initialized. In this case it is assumed that the * first page in the run has already been initialized. */ static void -vm_phys_finish_init(vm_page_t m, int order) +vm_phys_set_pool(int pool, vm_page_t m, int order) { #ifdef VM_FREEPOOL_LAZYINIT if (__predict_false(m->pool == VM_FREEPOOL_LAZYINIT)) { vm_paddr_t pa; int segind; + m->pool = pool; + TSENTER(); pa = m->phys_addr + PAGE_SIZE; segind = m->segind; for (vm_page_t m_tmp = m + 1; m_tmp < &m[1 << order]; m_tmp++, pa += PAGE_SIZE) - vm_page_init_page(m_tmp, pa, segind, VM_NFREEPOOL); + vm_page_init_page(m_tmp, pa, segind, pool); TSEXIT(); - } + } else #endif + for (vm_page_t m_tmp = m; m_tmp < &m[1 << order]; m_tmp++) + m_tmp->pool = pool; } /* @@ -835,8 +833,7 @@ vm_phys_finish_init(vm_page_t m, int order) * The returned pages may not be physically contiguous. However, in contrast * to performing multiple, back-to-back calls to vm_phys_alloc_pages(..., 0), * calling this function once to allocate the desired number of pages will - * avoid wasted time in vm_phys_split_pages(). The allocated pages have no - * valid pool field set. + * avoid wasted time in vm_phys_split_pages(). * * The free page queues for the specified domain must be locked. */ @@ -872,8 +869,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * Return excess pages to fl. Its order * [0, oind) queues are empty. */ - vm_phys_enq_range(m, avail - i, fl, - pool, 1); + vm_phys_enq_range(m, avail - i, fl, 1); return (npages); } } @@ -885,7 +881,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) while ((m = TAILQ_FIRST(&alt[oind].pl)) != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_finish_init(m, oind); + vm_phys_set_pool(pool, m, oind); avail = i + (1 << oind); end = imin(npages, avail); while (i < end) @@ -897,7 +893,7 @@ vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]) * are empty. */ vm_phys_enq_range(m, avail - i, - fl, pool, 1); + fl, 1); return (npages); } } @@ -944,7 +940,7 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) if (m != NULL) { vm_freelist_rem(fl, m, oind); /* The order [order, oind) queues are empty. */ - vm_phys_split_pages(m, oind, fl, order, pool, 1); + vm_phys_split_pages(m, oind, fl, order, 1); return (m); } } @@ -961,9 +957,9 @@ vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order) m = TAILQ_FIRST(&alt[oind].pl); if (m != NULL) { vm_freelist_rem(alt, m, oind); - vm_phys_finish_init(m, oind); + vm_phys_set_pool(pool, m, oind); /* The order [order, oind) queues are empty. */ - vm_phys_split_pages(m, oind, fl, order, pool, 1); + vm_phys_split_pages(m, oind, fl, order, 1); return (m); } } @@ -1202,12 +1198,11 @@ vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end) /* * Free a contiguous, power of two-sized set of physical pages. - * The pool field in the first page determines the destination pool. * * The free page queues must be locked. */ void -vm_phys_free_pages(vm_page_t m, int pool, int order) +vm_phys_free_pages(vm_page_t m, int order) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1215,12 +1210,13 @@ vm_phys_free_pages(vm_page_t m, int pool, int order) vm_page_t m_buddy; KASSERT(m->order == VM_NFREEORDER, - ("%s: page %p has unexpected order %d", - __func__, m, m->order)); - KASSERT(vm_phys_pool_valid(pool), - ("%s: unexpected pool param %d", __func__, pool)); + ("vm_phys_free_pages: page %p has unexpected order %d", + m, m->order)); + KASSERT(vm_phys_pool_valid(m->pool), + ("vm_phys_free_pages: page %p has unexpected pool %d", + m, m->pool)); KASSERT(order < VM_NFREEORDER, - ("%s: order %d is out of range", __func__, order)); + ("vm_phys_free_pages: order %d is out of range", order)); seg = &vm_phys_segs[m->segind]; vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); if (order < VM_NFREEORDER - 1) { @@ -1234,14 +1230,15 @@ vm_phys_free_pages(vm_page_t m, int pool, int order) break; fl = (*seg->free_queues)[m_buddy->pool]; vm_freelist_rem(fl, m_buddy, order); - vm_phys_finish_init(m_buddy, order); + if (m_buddy->pool != m->pool) + vm_phys_set_pool(m->pool, m_buddy, order); order++; pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1); m = vm_phys_seg_paddr_to_vm_page(seg, pa); } while (order < VM_NFREEORDER - 1); } - fl = (*seg->free_queues)[pool]; - vm_freelist_add(fl, m, order, pool, 1); + fl = (*seg->free_queues)[m->pool]; + vm_freelist_add(fl, m, order, 1); } #ifdef VM_FREEPOOL_LAZYINIT @@ -1293,13 +1290,12 @@ vm_phys_lazy_init_domain(int domain, bool locked) VM_ALLOC_NORMAL, 1 << oind); if (unlocked) vm_domain_free_unlock(vmd); - vm_phys_finish_init(m, oind); + vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); if (unlocked) { vm_domain_freecnt_inc(vmd, 1 << oind); vm_domain_free_lock(vmd); } - vm_phys_free_pages(m, VM_FREEPOOL_DEFAULT, - oind); + vm_phys_free_pages(m, oind); } } } @@ -1348,12 +1344,12 @@ SYSINIT(vm_phys_lazy_init, SI_SUB_SMP, SI_ORDER_ANY, vm_phys_lazy_sysinit, /* * Free a contiguous, arbitrarily sized set of physical pages, without - * merging across set boundaries. Assumes no pages have a valid pool field. + * merging across set boundaries. * * The free page queues must be locked. */ void -vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) +vm_phys_enqueue_contig(vm_page_t m, u_long npages) { struct vm_freelist *fl; struct vm_phys_seg *seg; @@ -1367,15 +1363,14 @@ vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) */ vm_domain_free_assert_locked(vm_pagequeue_domain(m)); seg = &vm_phys_segs[m->segind]; - fl = (*seg->free_queues)[pool]; + fl = (*seg->free_queues)[m->pool]; m_end = m + npages; /* Free blocks of increasing size. */ lo = atop(VM_PAGE_TO_PHYS(m)); if (m < m_end && (diff = lo ^ (lo + npages - 1)) != 0) { order = min(ilog2(diff), VM_NFREEORDER - 1); - m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, - pool, 1); + m = vm_phys_enq_range(m, roundup2(lo, 1 << order) - lo, fl, 1); } /* Free blocks of maximum size. */ @@ -1384,22 +1379,20 @@ vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages) KASSERT(seg == &vm_phys_segs[m->segind], ("%s: page range [%p,%p) spans multiple segments", __func__, m_end - npages, m)); - vm_phys_enq_chunk(fl, m, order, pool, 1); + vm_phys_enq_chunk(fl, m, order, 1); m += 1 << order; } /* Free blocks of diminishing size. */ - vm_phys_enq_beg(m, m_end - m, fl, pool, 1); + vm_phys_enq_beg(m, m_end - m, fl, 1); } /* * Free a contiguous, arbitrarily sized set of physical pages. - * Assumes that every page but the first has no valid pool field. - * Uses the pool value in the first page if valid, otherwise default. * * The free page queues must be locked. */ void -vm_phys_free_contig(vm_page_t m, int pool, u_long npages) +vm_phys_free_contig(vm_page_t m, u_long npages) { vm_paddr_t lo; vm_page_t m_start, m_end; @@ -1423,11 +1416,11 @@ vm_phys_free_contig(vm_page_t m, int pool, u_long npages) * end of the range last. */ if (m_start < m_end) - vm_phys_enqueue_contig(m_start, pool, m_end - m_start); + vm_phys_enqueue_contig(m_start, m_end - m_start); if (order_start < max_order) - vm_phys_free_pages(m, pool, order_start); + vm_phys_free_pages(m, order_start); if (order_end < max_order) - vm_phys_free_pages(m_end, pool, order_end); + vm_phys_free_pages(m_end, order_end); } /* @@ -1481,15 +1474,15 @@ vm_phys_unfree_page(vm_paddr_t pa) struct vm_phys_seg *seg; vm_paddr_t pa_half; vm_page_t m, m_set, m_tmp; - int order, pool; + int order; seg = vm_phys_paddr_to_seg(pa); vm_domain_free_assert_locked(VM_DOMAIN(seg->domain)); -#ifdef VM_FREEPOOL_LAZYINIT /* * The pages on the free lists must be initialized. */ +#ifdef VM_FREEPOOL_LAZYINIT vm_phys_lazy_init_domain(seg->domain, true); #endif @@ -1522,8 +1515,7 @@ vm_phys_unfree_page(vm_paddr_t pa) * is larger than a page, shrink "m_set" by returning the half * of "m_set" that does not contain "m" to the free lists. */ - pool = m_set->pool; - fl = (*seg->free_queues)[pool]; + fl = (*seg->free_queues)[m_set->pool]; order = m_set->order; vm_freelist_rem(fl, m_set, order); while (order > 0) { @@ -1535,7 +1527,7 @@ vm_phys_unfree_page(vm_paddr_t pa) m_tmp = m_set; m_set = vm_phys_seg_paddr_to_vm_page(seg, pa_half); } - vm_freelist_add(fl, m_tmp, order, pool, 0); + vm_freelist_add(fl, m_tmp, order, 0); } KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); return (true); @@ -1676,8 +1668,7 @@ vm_phys_find_queues_contig( * alignment of the first physical page in the set. If the given value * "boundary" is non-zero, then the set of physical pages cannot cross * any physical address boundary that is a multiple of that value. Both - * "alignment" and "boundary" must be a power of two. Sets the pool - * field to DEFAULT in the first allocated page. + * "alignment" and "boundary" must be a power of two. */ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, @@ -1736,12 +1727,12 @@ vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, fl = (*queues)[m->pool]; oind = m->order; vm_freelist_rem(fl, m, oind); - vm_phys_finish_init(m, oind); + if (m->pool != VM_FREEPOOL_DEFAULT) + vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, oind); } /* Return excess pages to the free lists. */ fl = (*queues)[VM_FREEPOOL_DEFAULT]; - vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, - VM_FREEPOOL_DEFAULT, 0); + vm_phys_enq_range(&m_run[npages], m - &m_run[npages], fl, 0); /* Return page verified to satisfy conditions of request. */ pa_start = VM_PAGE_TO_PHYS(m_run); diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index 046fe26b476d..43d94a9420f2 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -64,15 +64,15 @@ vm_page_t vm_phys_alloc_contig(int domain, u_long npages, vm_paddr_t low, int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); -void vm_phys_enqueue_contig(vm_page_t m, int pool, u_long npages); +void vm_phys_enqueue_contig(vm_page_t m, u_long npages); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); vm_page_t vm_phys_fictitious_to_vm_page(vm_paddr_t pa); int vm_phys_find_range(vm_page_t bounds[], int segind, int domain, u_long npages, vm_paddr_t low, vm_paddr_t high); -void vm_phys_free_contig(vm_page_t m, int pool, u_long npages); -void vm_phys_free_pages(vm_page_t m, int pool, int order); +void vm_phys_free_contig(vm_page_t m, u_long npages); +void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); vm_page_t vm_phys_paddr_to_vm_page(vm_paddr_t pa); vm_page_t vm_phys_seg_paddr_to_vm_page(struct vm_phys_seg *seg, vm_paddr_t pa); diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index 0bedca54d3da..ad513962d50d 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -480,8 +480,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int index) if (rv->popcnt == 0) { vm_reserv_remove(rv); vm_domain_free_lock(vmd); - vm_phys_free_pages(rv->pages, VM_FREEPOOL_DEFAULT, - VM_LEVEL_0_ORDER); + vm_phys_free_pages(rv->pages, VM_LEVEL_0_ORDER); vm_domain_free_unlock(vmd); counter_u64_add(vm_reserv_freed, 1); } @@ -944,7 +943,7 @@ static void vm_reserv_break(vm_reserv_t rv) { vm_page_t m; - int pool, pos, pos0, pos1; + int hi, lo, pos; vm_reserv_assert_locked(rv); CTR5(KTR_VM, "%s: rv %p object %p popcnt %d inpartpop %d", @@ -955,27 +954,23 @@ vm_reserv_break(vm_reserv_t rv) for (; m < rv->pages + VM_LEVEL_0_NPAGES; m += VM_SUBLEVEL_0_NPAGES) #endif m->psind = 0; - pool = VM_FREEPOOL_DIRECT; - pos0 = bit_test(rv->popmap, 0) ? -1 : 0; - pos1 = -1 - pos0; - for (pos = 0; pos < VM_LEVEL_0_NPAGES; ) { - /* Find the first different bit after pos. */ - bit_ff_at(rv->popmap, pos + 1, VM_LEVEL_0_NPAGES, - pos1 < pos0, &pos); - if (pos == -1) - pos = VM_LEVEL_0_NPAGES; - if (pos0 < pos1) { - /* Set pool for pages from pos1 to pos. */ - pos0 = pos1; - while (pos0 < pos) - rv->pages[pos0++].pool = pool; + hi = lo = -1; + pos = 0; + for (;;) { + bit_ff_at(rv->popmap, pos, VM_LEVEL_0_NPAGES, lo != hi, &pos); + if (lo == hi) { + if (pos == -1) + break; + lo = pos; continue; } - /* Free unused pages from pos0 to pos. */ - pos1 = pos; + if (pos == -1) + pos = VM_LEVEL_0_NPAGES; + hi = pos; vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_enqueue_contig(&rv->pages[pos0], pool, pos1 - pos0); + vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); vm_domain_free_unlock(VM_DOMAIN(rv->domain)); + lo = hi; } bit_nclear(rv->popmap, 0, VM_LEVEL_0_NPAGES - 1); rv->popcnt = 0; From nobody Thu Jan 23 17:12:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf6vH4bMYz5lCwh; Thu, 23 Jan 2025 17:12: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf6vH4Jddz42Kg; Thu, 23 Jan 2025 17:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737652347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xe3ANYWFAWv5ZEPXUDftgxz6Ec9g57TkO5Df+Un1yqc=; b=fMb3/JHaVNn4zRDg66T8fHHdIHa/L6+degBZENyXM92HIF6QwslMwBPjT+5TzeaFj2HnvR sgRnrd0VBxRyFYX99R6of++XiNbtUl0b9bwbiw9q+lbWXU/HA8dDOCKYnMp23kRfJ42lFt s/DJQ0I5fzIxgPFXzlp8+8LfHZaWgP33Ob028KjKbf9BYtzBuPnDRCkh7pYwqr/VQbiRJD LLhVr/lMPkKLOLT0xVPR1a2fRc7GCyolPBH7+v4pkijzrCSXHkmh/bM9HM0OQJGzRDPf4H 8ivUhdkAbISA6RkY03Ck+1Ss/B+PpNC7RNAk1iVz+LkKOMxVcGNYKFlF9R1OYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737652347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xe3ANYWFAWv5ZEPXUDftgxz6Ec9g57TkO5Df+Un1yqc=; b=DtXS2uNcxLlgpb4zcXJPEpTWZbCMn0Hu4e0DFqDetO6E8bF30eG2UoDeVegomC+TGjjNx+ kW4EpMPqMDVs+USJlxjbiOKTcOgAaTYdgvNrg3JZpqpJn2jlKe04pyWaC0k41i4+5TeHnV TknqK+lMmiDsn+EZxO7mIui1ONFBwQeLbW5YCTqWwv40Tx6CgcbQ80H6Agr15r0KX9KGS9 ejfeSGLO+fHNyJMxcTQqp1CRRz2dePfLcMDOfX2IGUZfeKe9eBfkGvrKK0qySKlU+loCyp RCFcqi0vF7yXNqMANv7EpbOVYASirZpQLIsfMK7ZEu0OLYauo2SkzZ2AOrhilw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737652347; a=rsa-sha256; cv=none; b=Hi7qIYFQE13eZVMp1udc0j/1tvE0wCGPBsW0AjYxzGDw0MyY3cbp9vlxQWQ6Tlw8IeYGsG QcK6WsGbd02pz55u/6LikPqjVbUjRetkd9KTON6OK44xu2SrpTTTs16WlauKtzZ8CnT1au wRRAUpk/OH70Vvz98wWin1f9pS64WEz4IQSiPJV2CbMdJJ/ggtNV60nIJ0ejY90bhW7xdO oAySgML3GnxxeH8fF7CJAI6H+dD93LrUp2QxbKg/qj3V7SUAkOzb7piHmlLjXtiPp+9L8g 2DGv1+B+WL1mQ5rd2P5Yk1/0EqK1aeYN+kcdrBUNIKh2t4vN47Qle8tuFDnE+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf6vH3f20zpDH; Thu, 23 Jan 2025 17:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHCRSA000267; Thu, 23 Jan 2025 17:12:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHCRFW000247; Thu, 23 Jan 2025 17:12:27 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:12:27 GMT Message-Id: <202501231712.50NHCRFW000247@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: 7cbb6b6e28db - main - inpcb: Close some SO_REUSEPORT_LB races, part 2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 7cbb6b6e28db33095a1cf7a8887921a5ec969824 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbb6b6e28db33095a1cf7a8887921a5ec969824 commit 7cbb6b6e28db33095a1cf7a8887921a5ec969824 Author: Mark Johnston AuthorDate: 2025-01-23 17:00:11 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 17:12:10 +0000 inpcb: Close some SO_REUSEPORT_LB races, part 2 Suppose a thread is adds a socket to an existing TCP lbgroup that is actively accepting connections. It has to do the following operations: 1. set SO_REUSEPORT_LB on the socket 2. bind() the socket to the shared address/port 3. call listen() Step 2 makes the inpcb visible to incoming connection requests. However, at this point the inpcb cannot accept new connections. If in_pcblookup() matches it, the remote end will see ECONNREFUSED even when other listening sockets are present in the lbgroup. This means that dynamically adding inpcbs to an lbgroup (e.g., by starting up new workers) can trigger spurious connection failures for no good reason. (A similar problem exists when removing inpcbs from an lbgroup, but that is harder to fix and is not addressed by this patch; see the review for a bit more commentary.) Fix this by augmenting each lbgroup with a linked list of inpcbs that are pending a listen() call. When adding an inpcb to an lbgroup, keep the inpcb on this list if listen() hasn't been called, so it is not yet visible to the lookup path. Then, add a new in_pcblisten() routine which makes the inpcb visible within the lbgroup now that it's safe to let it handle new connections. Add a regression test which verifies that we don't get spurious connection errors while adding sockets to an LB group. Reviewed by: glebius MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48544 --- sys/kern/uipc_domain.c | 2 +- sys/netinet/in_pcb.c | 131 ++++++++++++++++++++-------- sys/netinet/in_pcb.h | 7 +- sys/netinet/tcp_usrreq.c | 4 + sys/sys/socketvar.h | 2 + tests/sys/netinet/Makefile | 2 + tests/sys/netinet/so_reuseport_lb_test.c | 143 +++++++++++++++++++++++++++++++ 7 files changed, 252 insertions(+), 39 deletions(-) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 43bdd44a09bf..c5296f12ba94 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -109,7 +109,7 @@ pr_disconnect_notsupp(struct socket *so) return (EOPNOTSUPP); } -static int +int pr_listen_notsupp(struct socket *so, int backlog, struct thread *td) { return (EOPNOTSUPP); diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 11bc68a3915a..c50e39f20c16 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -263,6 +263,7 @@ in_pcblbgroup_alloc(struct ucred *cred, u_char vflag, uint16_t port, grp = malloc(bytes, M_PCB, M_ZERO | M_NOWAIT); if (grp == NULL) return (NULL); + LIST_INIT(&grp->il_pending); grp->il_cred = crhold(cred); grp->il_vflag = vflag; grp->il_lport = port; @@ -285,11 +286,45 @@ in_pcblbgroup_free_deferred(epoch_context_t ctx) static void in_pcblbgroup_free(struct inpcblbgroup *grp) { + KASSERT(LIST_EMPTY(&grp->il_pending), + ("local group %p still has pending inps", grp)); CK_LIST_REMOVE(grp, il_list); NET_EPOCH_CALL(in_pcblbgroup_free_deferred, &grp->il_epoch_ctx); } +static struct inpcblbgroup * +in_pcblbgroup_find(struct inpcb *inp) +{ + struct inpcbinfo *pcbinfo; + struct inpcblbgroup *grp; + struct inpcblbgrouphead *hdr; + + INP_LOCK_ASSERT(inp); + + pcbinfo = inp->inp_pcbinfo; + INP_HASH_LOCK_ASSERT(pcbinfo); + KASSERT((inp->inp_flags & INP_INLBGROUP) != 0, + ("inpcb %p is not in a load balance group", inp)); + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; + CK_LIST_FOREACH(grp, hdr, il_list) { + struct inpcb *inp1; + + for (unsigned int i = 0; i < grp->il_inpcnt; i++) { + if (inp == grp->il_inp[i]) + goto found; + } + LIST_FOREACH(inp1, &grp->il_pending, inp_lbgroup_list) { + if (inp == inp1) + goto found; + } + } +found: + return (grp); +} + static void in_pcblbgroup_insert(struct inpcblbgroup *grp, struct inpcb *inp) { @@ -298,14 +333,24 @@ in_pcblbgroup_insert(struct inpcblbgroup *grp, struct inpcb *inp) grp->il_inpcnt)); INP_WLOCK_ASSERT(inp); - inp->inp_flags |= INP_INLBGROUP; - grp->il_inp[grp->il_inpcnt] = inp; + if (inp->inp_socket->so_proto->pr_listen != pr_listen_notsupp && + !SOLISTENING(inp->inp_socket)) { + /* + * If this is a TCP socket, it should not be visible to lbgroup + * lookups until listen() has been called. + */ + LIST_INSERT_HEAD(&grp->il_pending, inp, inp_lbgroup_list); + } else { + grp->il_inp[grp->il_inpcnt] = inp; - /* - * Synchronize with in_pcblookup_lbgroup(): make sure that we don't - * expose a null slot to the lookup path. - */ - atomic_store_rel_int(&grp->il_inpcnt, grp->il_inpcnt + 1); + /* + * Synchronize with in_pcblookup_lbgroup(): make sure that we + * don't expose a null slot to the lookup path. + */ + atomic_store_rel_int(&grp->il_inpcnt, grp->il_inpcnt + 1); + } + + inp->inp_flags |= INP_INLBGROUP; } static struct inpcblbgroup * @@ -329,6 +374,8 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, grp->il_inp[i] = old_grp->il_inp[i]; grp->il_inpcnt = old_grp->il_inpcnt; CK_LIST_INSERT_HEAD(hdr, grp, il_list); + LIST_SWAP(&old_grp->il_pending, &grp->il_pending, inpcb, + inp_lbgroup_list); in_pcblbgroup_free(old_grp); return (grp); } @@ -412,6 +459,7 @@ in_pcbremlbgrouphash(struct inpcb *inp) struct inpcbinfo *pcbinfo; struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; + struct inpcb *inp1; int i; pcbinfo = inp->inp_pcbinfo; @@ -427,13 +475,11 @@ in_pcbremlbgrouphash(struct inpcb *inp) if (grp->il_inp[i] != inp) continue; - if (grp->il_inpcnt == 1) { + if (grp->il_inpcnt == 1 && + LIST_EMPTY(&grp->il_pending)) { /* We are the last, free this local group. */ in_pcblbgroup_free(grp); } else { - KASSERT(grp->il_inpcnt >= 2, - ("invalid local group count %d", - grp->il_inpcnt)); grp->il_inp[i] = grp->il_inp[grp->il_inpcnt - 1]; @@ -446,17 +492,22 @@ in_pcbremlbgrouphash(struct inpcb *inp) inp->inp_flags &= ~INP_INLBGROUP; return; } + LIST_FOREACH(inp1, &grp->il_pending, inp_lbgroup_list) { + if (inp == inp1) { + LIST_REMOVE(inp, inp_lbgroup_list); + inp->inp_flags &= ~INP_INLBGROUP; + return; + } + } } - KASSERT(0, ("%s: did not find %p", __func__, inp)); + __assert_unreachable(); } int in_pcblbgroup_numa(struct inpcb *inp, int arg) { struct inpcbinfo *pcbinfo; - struct inpcblbgrouphead *hdr; - struct inpcblbgroup *grp; - int err, i; + int error; uint8_t numa_domain; switch (arg) { @@ -472,33 +523,20 @@ in_pcblbgroup_numa(struct inpcb *inp, int arg) numa_domain = arg; } - err = 0; pcbinfo = inp->inp_pcbinfo; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(pcbinfo); - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; - CK_LIST_FOREACH(grp, hdr, il_list) { - for (i = 0; i < grp->il_inpcnt; ++i) { - if (grp->il_inp[i] != inp) - continue; - - if (grp->il_numa_domain == numa_domain) { - goto abort_with_hash_wlock; - } - - /* Remove it from the old group. */ - in_pcbremlbgrouphash(inp); - - /* Add it to the new group based on numa domain. */ - in_pcbinslbgrouphash(inp, numa_domain); - goto abort_with_hash_wlock; - } + if (in_pcblbgroup_find(inp) != NULL) { + /* Remove it from the old group. */ + in_pcbremlbgrouphash(inp); + /* Add it to the new group based on numa domain. */ + in_pcbinslbgrouphash(inp, numa_domain); + error = 0; + } else { + error = ENOENT; } - err = ENOENT; -abort_with_hash_wlock: INP_HASH_WUNLOCK(pcbinfo); - return (err); + return (error); } /* Make sure it is safe to use hashinit(9) on CK_LIST. */ @@ -1437,6 +1475,25 @@ in_pcbdisconnect(struct inpcb *inp) } #endif /* INET */ +void +in_pcblisten(struct inpcb *inp) +{ + struct inpcblbgroup *grp; + + INP_WLOCK_ASSERT(inp); + + if ((inp->inp_flags & INP_INLBGROUP) != 0) { + struct inpcbinfo *pcbinfo; + + pcbinfo = inp->inp_pcbinfo; + INP_HASH_WLOCK(pcbinfo); + grp = in_pcblbgroup_find(inp); + LIST_REMOVE(inp, inp_lbgroup_list); + in_pcblbgroup_insert(grp, inp); + INP_HASH_WUNLOCK(pcbinfo); + } +} + /* * inpcb hash lookups are protected by SMR section. * diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 0cf5ca017963..f00629266c58 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -167,7 +167,10 @@ struct inpcbpolicy; struct m_snd_tag; struct inpcb { /* Cache line #1 (amd64) */ - CK_LIST_ENTRY(inpcb) inp_hash_exact; /* hash table linkage */ + union { + CK_LIST_ENTRY(inpcb) inp_hash_exact; /* hash table linkage */ + LIST_ENTRY(inpcb) inp_lbgroup_list; /* lb group list */ + }; CK_LIST_ENTRY(inpcb) inp_hash_wild; /* hash table linkage */ struct rwlock inp_lock; /* Cache line #2 (amd64) */ @@ -428,6 +431,7 @@ SYSUNINIT(prot##_inpcbstorage_uninit, SI_SUB_PROTO_DOMAIN, \ */ struct inpcblbgroup { CK_LIST_ENTRY(inpcblbgroup) il_list; + LIST_HEAD(, inpcb) il_pending; /* PCBs waiting for listen() */ struct epoch_context il_epoch_ctx; struct ucred *il_cred; uint16_t il_lport; /* (c) */ @@ -671,6 +675,7 @@ int in_pcbinshash(struct inpcb *); int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *); int in_pcblbgroup_numa(struct inpcb *, int arg); +void in_pcblisten(struct inpcb *); struct inpcb * in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index acc3e2ea2942..3e73e448a9f7 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -391,6 +391,8 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) } SOCK_UNLOCK(so); + if (error == 0) + in_pcblisten(inp); if (tp->t_flags & TF_FASTOPEN) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); @@ -448,6 +450,8 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) } SOCK_UNLOCK(so); + if (error == 0) + in_pcblisten(inp); if (tp->t_flags & TF_FASTOPEN) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index fda8d23f5649..e818fd3fc757 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -596,6 +596,8 @@ SYSCTL_DECL(_net_inet_accf); int accept_filt_generic_mod_event(module_t mod, int event, void *data); #endif +int pr_listen_notsupp(struct socket *so, int backlog, struct thread *td); + #endif /* _KERNEL */ /* diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index 9fac7152e137..6faaf8ac1df1 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -27,6 +27,8 @@ ATF_TESTS_SH= arp \ ATF_TESTS_PYTEST+= carp.py ATF_TESTS_PYTEST+= igmp.py +LIBADD.so_reuseport_lb_test= pthread + # Some of the arp tests look for log messages in the dmesg buffer, so run them # serially to avoid problems with interleaved output. TEST_METADATA.arp+= is_exclusive="true" diff --git a/tests/sys/netinet/so_reuseport_lb_test.c b/tests/sys/netinet/so_reuseport_lb_test.c index 64fe0b53618d..3ce09fcf5794 100644 --- a/tests/sys/netinet/so_reuseport_lb_test.c +++ b/tests/sys/netinet/so_reuseport_lb_test.c @@ -28,12 +28,16 @@ */ #include +#include #include #include +#include #include #include +#include +#include #include #include @@ -235,10 +239,149 @@ ATF_TC_BODY(basic_ipv6, tc) } } +struct concurrent_add_softc { + struct sockaddr_storage ss; + int socks[128]; + int kq; +}; + +static void * +listener(void *arg) +{ + for (struct concurrent_add_softc *sc = arg;;) { + struct kevent kev; + ssize_t n; + int error, count, cs, s; + uint8_t b; + + count = kevent(sc->kq, NULL, 0, &kev, 1, NULL); + ATF_REQUIRE_MSG(count == 1, + "kevent() failed: %s", strerror(errno)); + + s = (int)kev.ident; + cs = accept(s, NULL, NULL); + ATF_REQUIRE_MSG(cs >= 0, + "accept() failed: %s", strerror(errno)); + + b = 'M'; + n = write(cs, &b, sizeof(b)); + ATF_REQUIRE_MSG(n >= 0, "write() failed: %s", strerror(errno)); + ATF_REQUIRE(n == 1); + + error = close(cs); + ATF_REQUIRE_MSG(error == 0 || errno == ECONNRESET, + "close() failed: %s", strerror(errno)); + } +} + +static void * +connector(void *arg) +{ + for (struct concurrent_add_softc *sc = arg;;) { + ssize_t n; + int error, s; + uint8_t b; + + s = socket(sc->ss.ss_family, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(s >= 0, "socket() failed: %s", strerror(errno)); + + error = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (int[]){1}, + sizeof(int)); + + error = connect(s, (struct sockaddr *)&sc->ss, sc->ss.ss_len); + ATF_REQUIRE_MSG(error == 0, "connect() failed: %s", + strerror(errno)); + + n = read(s, &b, sizeof(b)); + ATF_REQUIRE_MSG(n >= 0, "read() failed: %s", + strerror(errno)); + ATF_REQUIRE(n == 1); + ATF_REQUIRE(b == 'M'); + error = close(s); + ATF_REQUIRE_MSG(error == 0, + "close() failed: %s", strerror(errno)); + } +} + +/* + * Run three threads. One accepts connections from listening sockets on a + * kqueue, while the other makes connections. The third thread slowly adds + * sockets to the LB group. This is meant to help flush out race conditions. + */ +ATF_TC_WITHOUT_HEAD(concurrent_add); +ATF_TC_BODY(concurrent_add, tc) +{ + struct concurrent_add_softc sc; + struct sockaddr_in *sin; + pthread_t threads[4]; + int error; + + sc.kq = kqueue(); + ATF_REQUIRE_MSG(sc.kq >= 0, "kqueue() failed: %s", strerror(errno)); + + error = pthread_create(&threads[0], NULL, listener, &sc); + ATF_REQUIRE_MSG(error == 0, "pthread_create() failed: %s", + strerror(error)); + + sin = (struct sockaddr_in *)&sc.ss; + memset(sin, 0, sizeof(*sin)); + sin->sin_len = sizeof(*sin); + sin->sin_family = AF_INET; + sin->sin_port = htons(0); + sin->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + for (size_t i = 0; i < nitems(sc.socks); i++) { + struct kevent kev; + int s; + + sc.socks[i] = s = socket(AF_INET, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(s >= 0, "socket() failed: %s", strerror(errno)); + + error = setsockopt(s, SOL_SOCKET, SO_REUSEPORT_LB, (int[]){1}, + sizeof(int)); + ATF_REQUIRE_MSG(error == 0, + "setsockopt(SO_REUSEPORT_LB) failed: %s", strerror(errno)); + + error = bind(s, (struct sockaddr *)sin, sizeof(*sin)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + + error = listen(s, 5); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + + EV_SET(&kev, s, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0); + error = kevent(sc.kq, &kev, 1, NULL, 0, NULL); + ATF_REQUIRE_MSG(error == 0, "kevent() failed: %s", + strerror(errno)); + + if (i == 0) { + socklen_t slen = sizeof(sc.ss); + + error = getsockname(sc.socks[i], + (struct sockaddr *)&sc.ss, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE(sc.ss.ss_family == AF_INET); + + for (size_t j = 1; j < nitems(threads); j++) { + error = pthread_create(&threads[j], NULL, + connector, &sc); + ATF_REQUIRE_MSG(error == 0, + "pthread_create() failed: %s", + strerror(error)); + } + } + + usleep(20000); + } +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, basic_ipv4); ATF_TP_ADD_TC(tp, basic_ipv6); + ATF_TP_ADD_TC(tp, concurrent_add); return (atf_no_error()); } From nobody Thu Jan 23 17:27:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DS6JpCz5lDH4; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DS5r5mz43Fb; Thu, 23 Jan 2025 17:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKxWLL/wrDAnK8vXafmJ7RTzIqv6E+kHBkPWWEoh0G8=; b=Qs7y2DwOf/lzSCYAUdVIUMQ7hijXIgLyvu8wZ38ijhGRiQnyKS7ikE+QcwMzcMbHf60o0o T1ytzctE10OvKtqQPOimdTQgjAAKJC2X9vylRgPXJkrf1TKV38/ABpffe30gN/0DqYt8yO FnXFBWn1XCPrLjGANxcG4nXIMirg2i7UYuwArgFxEkA89d7p1cqvqWimJPCW33RzP3fb64 zQ83nXVND0sYxHNL7Wb8NQzAQUu/i86eyIKjDLdWbiFEaUZk+j/mBp77H1aOnqEJQ0v0Ho MxHD79X07vz/cZsu/alumyBhPdmoyW2P+cuSEIGuygAYR8OCUHmeHsSEfrlCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKxWLL/wrDAnK8vXafmJ7RTzIqv6E+kHBkPWWEoh0G8=; b=urp7Eh2GYip3gP21wx+uczkdAzzL1V+iJaO3IvPkHhvHjzg69sWsiOdCOCeF6+mRTDoHUX IcYUP7XEkkdHRLZJ9KMUddHhGjgSJOx7bAliQdBNDYxpIaZF2nGp55W3pppscS/JEXO6W3 ulqkr1J3qRoDGy65nhF772cI1mNsE3lK0YV6nEPFttqax3TJFpMTriPvAaEfD1oJ0uJAbF JBOMqxq0RLyNPNr7DiNiL+uhsU00n/V/09de1otmTcd1T6Jj66YCjzKVGKui4luAaUDZSM bIz20idDBXbSnoETWGXofo//DwrQBLPMyc4ovm6Nj12yikEjdyJUKUl4yeqmrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653240; a=rsa-sha256; cv=none; b=Hw+ixL2VfF2zh2AEOav+kMVdpBAcbExV8IrSaNbKLNSMuP8U1I3Pg8NxtjYZh7N1lg5EPW FxK0loYOuEnJbbhhNiWk7oVLzfyZw2pVBNUE5eHPkXpwlBENBI/bpPBUYU1euZQ3lU/zBp zRD7PfGrD4+oPTO1eIkHY6XwNjCMsuJHnj31n30sJ9pPN5pHdvoYWGj9hCBtXUrbdmsx+p DP6g0nVPHM7iWMgK8fTd1LJBp6CUPrW3/hFpnZ0QGUdVvCunZT6XcXkeC7bqdKZLywd6cO KKYzxXace+j6e34pu0x0cPSqeyqOCGxHwEZk1ygu2oZDEhs10I2yXzoWebyvmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DS5Q5rzpYm; Thu, 23 Jan 2025 17:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRKsi022246; Thu, 23 Jan 2025 17:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRKUY022243; Thu, 23 Jan 2025 17:27:20 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:20 GMT Message-Id: <202501231727.50NHRKUY022243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 23f025e24b6e - main - scmi: Fix the scmi_shmem module name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23f025e24b6e5d47aecb9a6d061f7b17c34c1aa5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=23f025e24b6e5d47aecb9a6d061f7b17c34c1aa5 commit 23f025e24b6e5d47aecb9a6d061f7b17c34c1aa5 Author: Andrew Turner AuthorDate: 2025-01-10 14:25:32 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:24 +0000 scmi: Fix the scmi_shmem module name This fixes the "module scmi already present" message on boot. Sponsored by: Arm Ltd --- sys/dev/firmware/arm/scmi_shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/firmware/arm/scmi_shmem.c b/sys/dev/firmware/arm/scmi_shmem.c index 4a5516abfb4b..9bab4bc4004e 100644 --- a/sys/dev/firmware/arm/scmi_shmem.c +++ b/sys/dev/firmware/arm/scmi_shmem.c @@ -326,4 +326,4 @@ DEFINE_CLASS_1(shmem, shmem_driver, shmem_methods, sizeof(struct shmem_softc), EARLY_DRIVER_MODULE(shmem, mmio_sram, shmem_driver, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); -MODULE_VERSION(scmi, 1); +MODULE_VERSION(scmi_shmem, 1); From nobody Thu Jan 23 17:27:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DV2pgXz5lDH5; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DV05sfz43LX; Thu, 23 Jan 2025 17:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=57qQaFJdG+hWw2SHHIqTZatjX+YRif4pY9hBWHoV1ac=; b=WY/UfxbY5aims2wmBzW42Qz0ER2V9mjDCZvvDvR6VlID3RzZ3fYUILZZ6j/2IrZg83Ozis 62KXCxS8qK5IeRVEkrPch6NslVR4LNb8iFDmnsvCOdzN16GEmcdE9Bdfve29rF5HwB7+Ks aAt0sS3GA6F4ALntqiA1gzJ8OElCICwRqMkRKmWkns2He4QCVh0CWGkMqC3Bxlb2rwywMG KXgQMGCmHSC8t9Y/zs6VngOSCU6grFS/qw0qpNXfF4Aq4pyAEnpPTbN4sRvqIcMpWZiYpL /DJHDh+PTIOokW1MSr8S5CbnDyaG3ydyJTJSMo6KaxyGF6Bkht09NB39gN7dgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=57qQaFJdG+hWw2SHHIqTZatjX+YRif4pY9hBWHoV1ac=; b=Vdk4fSHy2KGSlsWnM77P3CEoCnpHjE5qB85wyVP8WH6oGq92DBvOXNEINj+n/uNYfV7Jd2 Vzamm6xDH18BIZ4N1qMYEXOn8HBPHPU3NuKCp5PsdGKvp4DzvTa9zhJqbLbRfwJ9EmEOri i3+oezGZTI1HpGUrt8q52OIBLjgPvRmNPEn1nmM2xz+EQYEHqe88IhOExJrOgAhrhoTIxt NRdK1HR9oGv3uVcw7xVVuUeCCkS7khnGaekfjRoivN8HkfKzosgtGC+a1PBGB+edFXxMFv 9HfuvlLy3FeFJeib+6DT+Exy0UFOg+4Z35cZUEBk14VSof8B5W3gNcTl0VHyOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653242; a=rsa-sha256; cv=none; b=p+isWFcjhVaOY0dvqkW2cGj2MjdMzbFefjyF/PA3VsG1brUufx5ySV3ozcXPqDQwI8ewYL Q39IUoxdiZIxBThMWHWQI5vaYIc+KWv4YfUEbPoMmcRo44r6iTBz2AjN7zQqS3wV+AiLi1 ImUjEAWoYW4thWEZnVASi7ta9oWEye00CvMTieZuHmKWXNDr/k2pd/SXy3LWJeSTwbq90d 5OiGF85JSWvx8hxqxYnwZL0Po+t9h7Ulj7ehSOm62zul71Aw7YuNjz01DX+Mi7UZqBUGF8 cAHm4oTiopqYpvXeTSF9voI+17LY9xKdYPkek+gsN5Ql/+mBQNcKdNObcDkOpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DT6dw5zpF5; Thu, 23 Jan 2025 17:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRLQn022279; Thu, 23 Jan 2025 17:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRLUK022276; Thu, 23 Jan 2025 17:27:21 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:21 GMT Message-Id: <202501231727.50NHRLUK022276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 80defb51b2bc - main - depend-cleanup: Add a regex for files that moved List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80defb51b2bcaee74458355d7eef734d18bfc9e2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=80defb51b2bcaee74458355d7eef734d18bfc9e2 commit 80defb51b2bcaee74458355d7eef734d18bfc9e2 Author: Andrew Turner AuthorDate: 2025-01-23 17:10:29 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 depend-cleanup: Add a regex for files that moved When a file is moved or copied to a new directory the depend-cleanup script may incorrectly remove the .depend file as the generated regex will pass. Fix this by passing in a new regex for the arm64 files that have the same name as a generic implementation we were previously using. While here add memchr.S. It has moved from a generated file to one in the source tree with the same name. Reviewed by: emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48519 --- tools/build/depend-cleanup.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index b7695370f1dd..8e2968b3061b 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -252,10 +252,10 @@ if [ $MACHINE_ARCH = aarch64 ]; then clean_dep lib/libc strcspn c # 20250110 89b3872376cb add optimized strpbrk & strsep implementations - clean_dep lib/libc strpbrk c + clean_dep lib/libc strpbrk c "libc.string.strpbrk.c" # 20250110 79287d783c72 strcat enable use of SIMD - clean_dep lib/libc strcat c + clean_dep lib/libc strcat c "libc.string.strcat.c" # 20250110 756b7fc80837 add strlcpy SIMD implementation clean_dep lib/libc strlcpy c @@ -268,10 +268,11 @@ if [ $MACHINE_ARCH = aarch64 ]; then clean_dep lib/libc memccpy c # 20250110 3dc5429158cf add strncat SIMD implementation - clean_dep lib/libc strncat c + clean_dep lib/libc strncat c "libc.string.strncat.c" # 20250110 bea89d038ac5 add strlcat SIMD implementation, and move memchr - clean_dep lib/libc strlcat c + clean_dep lib/libc strlcat c "libc.string.strlcat.c" + clean_dep lib/libc memchr S "[[:space:]]memchr.S" run rm -f "$OBJTOP"/lib/libc/memchr.S # 20250110 3863fec1ce2d add strlen SIMD implementation @@ -279,8 +280,8 @@ if [ $MACHINE_ARCH = aarch64 ]; then run rm -f "$OBJTOP"/lib/libc/strlen.S # 20250110 79e01e7e643c add bcopy & bzero wrapper - clean_dep lib/libc bcopy c - clean_dep lib/libc bzero c + clean_dep lib/libc bcopy c "libc.string.bcopy.c" + clean_dep lib/libc bzero c "libc.string.bzero.c" # 20250110 f2c98669fc1b add ASIMD-enhanced timingsafe_bcmp implementation clean_dep lib/libc timingsafe_bcmp c From nobody Thu Jan 23 17:27:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DY03V8z5lDWb; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DX1Nn6z43Ss; Thu, 23 Jan 2025 17:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ihmISmaq9iLNNGSKQ5bGKDgCg4Z7VvjPNPurETercsw=; b=VtCbbeOEcjDUgIbMraf7lhsG+5WU24cqSBO9j9gvTBB5auqPZnUe/1mrCYDWBL1zPx6lvw q4eXHjm4MDIuSFq8EisjIgQDuCcbNm0V9vZzZxey96UXRi7D/hDNa1Sv7hca0LihXTm44b cpj3CSY3ivB86EIOZVuhgRCYBV7F3c4l4We+nQ0wwQiKussj5nXgD0rwl/IMXhPTDk4TS5 3qJdRzifGLXVdKWGBO4vTVznDYp4K3yKgYOeFMy2wKYuoZunqV2a6oTZMWYv7e98B6RczG Eyw0Pl8McDiBZOZkYc6rze6wRBx1MiUIZvWfQZUh+nUVBrxpi1dPCrOzk9LuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ihmISmaq9iLNNGSKQ5bGKDgCg4Z7VvjPNPurETercsw=; b=XGv5BdwA82u55ksOE8ZUzeGzfi6H6eg1s6uL9EaE6mT3Y6RArajmFpKFbQIGla2lhMQBt8 9fgE1/jqhV+9CTkCoJmdp3gFPY0c9FQf/hlPzYCq6odYsiCym0fncTyi52aC/y/hUZ9Qvy pg2U6gaDny9//b5fpZxSlix9kVb/M4vK5fFqMJbucPXR4h8c44gPKsfukex1ctHcyZ2JLE qaC1JYzVmZrjGOJwALoYdczH3i2mvTasYhs8hKtzat0b8bRI39Kg0qZoVROUAF9QvKnk/3 NNXoz88q8fJMUeg+lfSPYG0epd841Iwb5W1x32A0SnIR9rk3sks8paXzNZW6kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653244; a=rsa-sha256; cv=none; b=E4Ue8VwZlKkPOUiv3z6w0o8PRBCFRQP9lGG4eC2VbOQZdiZjUL3QFZkVhOGzg26LaQWEC3 iTf4OBqxbvkdYkXILV0q40ri1tMQOfyv82IbZw+Y/wzK6AhU2S/uMfY6agxc+LrKIcZUjd /TX/RqBMdRHJ2Sur/3i2a1uKMZm+UbV4SjGcNtr1dVFieEpwit4yGbG75upJenj6oQs70c xpqW9Rvy4vwDWOrwzcMnNbm0Dn1RUNa4Ngu0zLSYcHQ06giNJC/cxvO/UquXU2gmQcK1pG ZGA9fe7zl4TlYuz6qhiTWuFjtLvt0qDQfSQYBYd3kmFwS4XwC0/BL0Jw//gCIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DX0ySfzp0q; Thu, 23 Jan 2025 17:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHROPd022346; Thu, 23 Jan 2025 17:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRO8b022343; Thu, 23 Jan 2025 17:27:24 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:24 GMT Message-Id: <202501231727.50NHRO8b022343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 038457dde93c - main - stand/efi: Add more pl011-like uarts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 038457dde93c395cee7746f1f2a484056ab60703 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=038457dde93c395cee7746f1f2a484056ab60703 commit 038457dde93c395cee7746f1f2a484056ab60703 Author: Andrew Turner AuthorDate: 2025-01-23 17:11:04 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 stand/efi: Add more pl011-like uarts The Arm SBSA uarts are handled by the pl011 driver. Add them to the list of pl011 uarts. Reviewed by: manu, imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48526 --- stand/efi/loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 6dcdb4cb3334..76e02e461aa8 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -802,6 +802,8 @@ acpi_uart_type(UINT8 t) [0x01] = "ns8250", /* DBGP Rev 1 16550 subset */ [0x03] = "pl011", /* Arm PL011 */ [0x05] = "ns8250", /* Nvidia 16550 */ + [0x0d] = "pl011", /* Arm SBSA 32-bit width */ + [0x0e] = "pl011", /* Arm SBSA generic */ [0x12] = "ns8250", /* 16550 defined in SerialPort */ }; From nobody Thu Jan 23 17:27:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DW3yMWz5lDKy; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DW0jQxz43Sd; Thu, 23 Jan 2025 17:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PjpFMXlJildRisZnN+U4nrAYOWZ5Jh/fo1A47qyf4ec=; b=gGuSPuzR7xodxEC4wsJG1iFcocDeTznImSn4iq8Bzl7fZEeGwVbyTV3VcE+eDOk9+8XExS PsHHmE+Eq+Y7hQIq9KxbysYD0373J+IJb3j6LEYH4/9HbFLumTBs63bBH45GqWDvSmXTv7 33W4Bd9HKAiHmdUEj8OcjlEswGUcRWmUxYdIWksBzDbnwQEWFFjVDog8vwJ+XSOhA2REub W9WljiQa9tOVG2iMmKXkywzD8QlHY8gb1HIblAzvT3yg3f5X9Zuf9xZzYsA9IajfULWW6d 18t5vM8ZM/xbt7DKSK7VDjFC167wbTsfgnLYpzsRJltJoMgZWjqRh+CvyE3t5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PjpFMXlJildRisZnN+U4nrAYOWZ5Jh/fo1A47qyf4ec=; b=CHJuhp7QiCaJaDjCMdIgJQnsyV12PDWdSBhcPvWrtyzwxfGiUzW3CT2Lyx7j+Q52WRMH2T jkTO3drPkC+uS/wi32iJ+nZCiQTVPMPUjMGS6RvUIY3yhK0CWroTivvEh8S21WqsTENHAJ TiD+O/7PDtJ5OG97YWCxKpxo+HZzgAMIP86xGB+PuOc+DPhxoyqNzWNVGj0Td4wEF1j9qZ m2tSJILoeEDLkYnHkno1zK/kEe6N8sqOxKDZR8XyzVKGOWI72wWAYzXLDLdznpe0MRd/ed 2nkeatP26qcWK0bAvO4MO1G57YAPNWDQ+zcI5Y4sKBS7pPhX4YOlYwB35qk7Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653243; a=rsa-sha256; cv=none; b=RN9UzDbafIuLFGqchiz+L2M9UaX1Jfpk5H+685f3s2lqxQ/QdnTZgAit4IiGpQiZd8XzrT LWkIavQ/TVBDMD1+Rfjl+OxLhupoLMivNWp0u0rXWJQee/n0k2NVy1KLafnfZieDVzLvMR x3Px5vdie0oJMGSz36cu3pvl1o66l5awqGP1TKluuUXESYpXsfdQCBirQr0VSxt9YOeGik jjBkGRPNrjE4QIvWHcxlAuqsk2mMqnL+YyZ2aeXwFbc3t2PBUjJ6oopmm/cVzDz52rBjEc oAefu947pGCt0h5wNJsTxdMo0ps10r9Jvv5gSqcj5AFV1ogcBr8RzvxtreWLhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DW0B7CzpWd; Thu, 23 Jan 2025 17:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRMfP022312; Thu, 23 Jan 2025 17:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRMAn022309; Thu, 23 Jan 2025 17:27:22 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:22 GMT Message-Id: <202501231727.50NHRMAn022309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 7eb3273a7b58 - main - stand/efi: Use hex values to get the uart type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7eb3273a7b5854bcd4b1ff727d50e22774122987 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7eb3273a7b5854bcd4b1ff727d50e22774122987 commit 7eb3273a7b5854bcd4b1ff727d50e22774122987 Author: Andrew Turner AuthorDate: 2025-01-23 17:10:54 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 stand/efi: Use hex values to get the uart type To keep the SPCR uart type to name map aligned always use the hex value as an index in the types array. Reviewed by: manu, imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48525 --- stand/efi/loader/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index 213089961704..6dcdb4cb3334 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -798,10 +798,10 @@ static const char * acpi_uart_type(UINT8 t) { static const char *types[] = { - [0] = "ns8250", /* Full 16550 */ - [1] = "ns8250", /* DBGP Rev 1 16550 subset */ - [3] = "pl011", /* Arm PL011 */ - [5] = "ns8250", /* Nvidia 16550 */ + [0x00] = "ns8250", /* Full 16550 */ + [0x01] = "ns8250", /* DBGP Rev 1 16550 subset */ + [0x03] = "pl011", /* Arm PL011 */ + [0x05] = "ns8250", /* Nvidia 16550 */ [0x12] = "ns8250", /* 16550 defined in SerialPort */ }; From nobody Thu Jan 23 17:27:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DZ024Cz5lDTg; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DY1zx2z43W8; Thu, 23 Jan 2025 17:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=suombRB3Vr/ARADGzGFG36wxk+VCCa/Jls1L3B6J+pU=; b=WqstHFWTievKDt/6026vO3q5x+v0MlqWcgV6bhjfj3qafCsPqY0f6mmtkKErR76suPC7Qa B6xr6ocJ0GjLPJu35pxjEYTHafci0ihBUfXfIsBoHfj9E/GIaKOTEktlraEbCbilJwORB6 WJg1teZmnHzAzY344iNtc/FGC/hKkxdolym5jGs+A6ZNzE8pUeEczmDvpxeAk0k8otaV/x v7vSvzPWRBYhSUdRasMA4fqxmRZiZW1y6+EGKDA5BmQQZKxlyEEyFu9ZYqff6BgQKOO4wE 8GPLFAwOGnsqUBCPTBaWEicWSwiyXY2sOV+LbTkCdGEP+1dXy55plP+6Jvb3YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=suombRB3Vr/ARADGzGFG36wxk+VCCa/Jls1L3B6J+pU=; b=wbr+nnAJo4dTpU63+S6k+b4tabdZZrNfQLerzLAOD3YtO8qBjo06EYNZXXYvLGxfengYq4 r/JbCh6e6kFlLMWJCZ4vquVGYNEYCTeJlU2pLPIPkn6ppM5oZeQtbj71+2NrGp4bf1qS0W YbPwwr8vQUZPqWrdyCtESUz4HbaewlPTR0XZyYuzrPFIfzy9jJkVfrpHTHMKh9YTpyvzy1 ZbHM4t59g2CiJoIzjGxiA0SaU1/T/vJzYkVG0YCYSM+5RdTIu1XiRbrzIcWDugw0IviUrH KOsX+V+fdKDqp/hR/lCG3jS07erOqlc0LFsnXsL8ChqUY9Bv7edzPSL/NsnFtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653245; a=rsa-sha256; cv=none; b=xcyPWwfeUHClQgzvXuA+Lvn1AmvwqEVmCn+Tt4E19xC8IB6V+uVV0rRXHP1bqb+9Xj4HrF Z0jtB92py+bafwE9iC1lfNVwu4WdRo1ufT4vEK+7kG6XGqABncrsYxHTJeHykjkd5O4KCj /81uNLY10Wb4/7zWkEPoAg04Wk1zTADt4sp1tx6IRVBkkVReapO9hOlSRS9PYZFwoxt7x3 G/LO/Ps0darGBItoK4n0dkDmx8tebGqp8W/0ee0xOrR3IbK5NdCbnrgWoLYV12ExzJxUi/ 4ldAUoyIsU9g+WWl9VaOXrPf8TIxmp3dHPfoct9OUU5ZKnz10r4BzZIKuU7dkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DY1bYfzpjy; Thu, 23 Jan 2025 17:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRP9d022386; Thu, 23 Jan 2025 17:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRPfH022383; Thu, 23 Jan 2025 17:27:25 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:25 GMT Message-Id: <202501231727.50NHRPfH022383@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4e3831c66d00 - main - arm64: fix ID_AA64ISAR2_WFxT_IMPL value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e3831c66d00db6b2aae17bea200ba9dc7720cad Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4e3831c66d00db6b2aae17bea200ba9dc7720cad commit 4e3831c66d00db6b2aae17bea200ba9dc7720cad Author: Harry Moulton AuthorDate: 2025-01-23 12:23:09 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 arm64: fix ID_AA64ISAR2_WFxT_IMPL value Bits 3:0 of ID_AA64ISAR2_EL1 are reserved for FEAT_WFxT in ARMv8.7, with bit 1 used to determine whether the feature is supported. The macro, ID_AA64ISAR2_WFxT_IMPL can be used to check if this bit is set, however it is currently incorrectly set to check bit 0. This has now been corrected. Reviewed by: andrew Sponsored by: Arm Ltd Signed-off-by: Harry Moulton Differential Revision: https://reviews.freebsd.org/D48577 --- sys/arm64/include/armreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index e955f3f4a5c0..d586d3568bd7 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -1124,7 +1124,7 @@ #define ID_AA64ISAR2_WFxT_MASK (UL(0xf) << ID_AA64ISAR2_WFxT_SHIFT) #define ID_AA64ISAR2_WFxT_VAL(x) ((x) & ID_AA64ISAR2_WFxT_MASK) #define ID_AA64ISAR2_WFxT_NONE (UL(0x0) << ID_AA64ISAR2_WFxT_SHIFT) -#define ID_AA64ISAR2_WFxT_IMPL (UL(0x1) << ID_AA64ISAR2_WFxT_SHIFT) +#define ID_AA64ISAR2_WFxT_IMPL (UL(0x2) << ID_AA64ISAR2_WFxT_SHIFT) #define ID_AA64ISAR2_RPRES_SHIFT 4 #define ID_AA64ISAR2_RPRES_WIDTH 4 #define ID_AA64ISAR2_RPRES_MASK (UL(0xf) << ID_AA64ISAR2_RPRES_SHIFT) From nobody Thu Jan 23 17:27:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dc1Z7vz5lDWd; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Db4Pc8z43R0; Thu, 23 Jan 2025 17:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxfipjERwRnVh/++WHeSYkZxmA8spQ1sQkLYCMRCybg=; b=mtBAZRVY13oDGR8y8NO3dYCEWBI+x+5++WPzPMBLBsAsn7r1PNqtV9H1wz5DhFKna96zpz 6MhrqDhBlnYoIVBJGKDBQuAASG2zpRoc9kmvLnf0AUZZPCbmSEwZ/pTNKfglSE50WN2Wqd pmi5uxR1h2cz+tGUEvwuoGVB/rsnEib3J24d5Q1ibkd91gDOoyceioPN4ACbS+4ftaChYa wiVuUTzGelPwtIp1BsRqMoAS5ild4MpGJAAucnwhADluXw7AfW8s330pMlIznHSdcURyrf btwyLQWGRXqxOyUjCJwvIl1D47gRKEM0vpe7+w6KBwy6Q3CIZUp72A2qbFTxmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxfipjERwRnVh/++WHeSYkZxmA8spQ1sQkLYCMRCybg=; b=RlsBW+JLDINUDDvxOcr+H+5Rm/yIydeBon87kPbdWVxfbfPENvVYbQEl/l6wOUwGd7+ryK 6VCp5PJ3+xSL4zC4288ofhOOzIrBZ6bN0RqkNtyCD2IIwAFXUC+sHbx+dfBBJhav+biH0O LtaYbtQfRUuXBEePuG6iyETUIzOisJXMYh7Ee8rZGnCskJPF4mvTV0m2SMedFqM178qCc1 qrz13MFFLGeNtknXBgmVXgo9Avg1Pf1yIcUfDrWODeHOxSlOhio1vVwVeRkxQnrWAgthW6 vU9DiZddCqOeBsG3evH9KG8C+5stzAN0k+s+Mh5bha38gIbo/x0pv8Qj+MWN4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653247; a=rsa-sha256; cv=none; b=ZdFVBrcAZxObr2DPVwOIufMIPUz2+tNxiGXT/yz6y6diK11BmfuRzZbtiWdIupo5BNyoP4 DrL3sOTUh4HKUHOVg94IXwp9KvXGLBqejBSstEyVqaTC83DkbV8FF64C8BMLxF9lHU99j8 6TvJw+iJUBsubc01FXV47Vks0rxt1KdZsIXa95kztpzsPojtd/7FgvKNGBGq9oQJTEfuCl iAqMgVK5EcX+anEvbQ/sOtkbu6oXH172s1NmUoCvJoyPCA27E6TZ7WC/Wkc8ztQKIEwSh6 mp7cr/t0wxb+P2RQIwcaH7V8p/ZcU36filu5AFfsDjVUjv6B/GzBL7XKdmLovw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Db3mswzpBH; Thu, 23 Jan 2025 17:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRRxX022453; Thu, 23 Jan 2025 17:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRRQX022450; Thu, 23 Jan 2025 17:27:27 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:27 GMT Message-Id: <202501231727.50NHRRQX022450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e1c77d783206 - main - arm64: add inline functions for FEAT_WFxT instructions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1c77d783206bceee1f8d5fcbb0b3df214b4b282 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e1c77d783206bceee1f8d5fcbb0b3df214b4b282 commit e1c77d783206bceee1f8d5fcbb0b3df214b4b282 Author: Harry Moulton AuthorDate: 2025-01-23 12:27:28 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 arm64: add inline functions for FEAT_WFxT instructions This adds inline functions for WFET/WFIT instructions introduced with ARMv8.7 FEAT_WFxT. These instructions allow for regular WFE/WFI instructions to be bound by a timeout. Once the value of CNTVCT_EL0 reaches, or exceeds, that of the timeout value, the WFE/WFI state will be exited and the PE will continue. These instructions are implemented as inline functions, with a write to the corresponding system register acting as an alias for the two instructions. Writing to these registers is only valid on ARMv8.7 and above, therefore the use of these functions must be guarded by a feature check. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48579 Signed-off-by: Harry Moulton --- sys/arm64/include/cpufunc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/arm64/include/cpufunc.h b/sys/arm64/include/cpufunc.h index ba712f48b262..c948799eb7b9 100644 --- a/sys/arm64/include/cpufunc.h +++ b/sys/arm64/include/cpufunc.h @@ -160,6 +160,26 @@ invalidate_local_icache(void) "isb \n"); } +static __inline void +wfet(uint64_t val) +{ + __asm __volatile( + "msr s0_3_c1_c0_0, %0\n" + : + : "r" ((val)) + : "memory"); +} + +static __inline void +wfit(uint64_t val) +{ + __asm __volatile( + "msr s0_3_c1_c0_1, %0\n" + : + : "r" ((val)) + : "memory"); +} + extern bool icache_aliasing; extern bool icache_vmid; From nobody Thu Jan 23 17:27:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7DZ5NGpz5lDDM; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7DZ3MHhz43TT; Thu, 23 Jan 2025 17:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZAo0DJrD0DfdVdzIaa/kW9bF1i1hprreaIq2eSDRyqo=; b=OxSb2pUj4V0PknA1ZCjVUzvz0DAcr5ry4nDwjAzKUcUx97gSWGCyJ/UodBTYSYK6QTYz2g 37DBzEn9aeVGhzWOSV9BG6YT1Mw/S9D0Ovrla+i91/MlYUJYlJZKDR3G+XIJfAWIRJEpJ6 mj4E5etyOWR+c1R1ez/AovZ40zXK3xW378WVT492hAoI9B+jukoDVrdK8ZRAkC0tt4Ycqh 43lgXjPbZjOcBha1GeLLn5pQorbpdncWHMu7Q/KT1RyPUNHmpjerwlaoTfMmVfgA7QF+dG tsu8M4YT8pSZ23HU3qOT6IA/zacqfjsVJDfuJq4bOf829tAyNoafyEVIdkTrOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZAo0DJrD0DfdVdzIaa/kW9bF1i1hprreaIq2eSDRyqo=; b=ES1q1cu6Zp+dU0rqSLo7xscldotA72bwHxBxx9luWUvV0mzoPKeTIMwai+tejZ5RrAfgRf EKRlLIgbP0dl5ZpQYTXh8x7Ep1h6VWhuMmqwjtFdWQAEIOqqindLCqBpE9/kLM6acw9qC/ oGghtYQBJUhU6mL9TBMO/UEV4gXroAGPfmNvN9svu+mmsf2rwQNIr5Kpo8LgViRGoBruMW Pq00/ecLLXwbgB6B7pAOQyuCBQ+AJ1CVHW8NKDWw08PYsHkuV0QOX8BedJZsSRbcQmm6x/ entkPG6L5Pv+c7eY9ZFXyhnVbXvJhukmx+JFc0CW8vVwnb4YbIj7cy4ZGKTPgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653246; a=rsa-sha256; cv=none; b=AeU5EnU530ybwQdi8iK0MVyZsByavj3LnFF91J3kFvWUl2CmgCsHeWJ/REyWrbS04shvtu IJPDRy/B4RJVNrizhBF3jAiyGmx5JUVR5JUNHKx2p98zn/20yZfCiJxGcCTU3Z2bXnhJnP s1kgC6AT1TA/43QOgYtm//SV4EkKVZzYtyXtbrOAjw5GbeCfApjWsQzeRwJDXVrC5NixpS EJqPZPgowIu40fTw3B3sWaQumVEsbSXmAb4+nnb8RTN1wj0hrlZ3DQVGWHjRwm+vn88U0n 5AmHxeq851nM5hGRH+EO5yTI89Vh5H6cVseghmVYwp5OJ7ccevnIP34Zn6SAIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7DZ2wybznrF; Thu, 23 Jan 2025 17:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRQJE022420; Thu, 23 Jan 2025 17:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRQDB022417; Thu, 23 Jan 2025 17:27:26 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:26 GMT Message-Id: <202501231727.50NHRQDB022417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: aa1279d817a7 - main - arm64: add HWCAP for FEAT_WFxT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa1279d817a75d0ada3178f596d7ea984ebfe184 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aa1279d817a75d0ada3178f596d7ea984ebfe184 commit aa1279d817a75d0ada3178f596d7ea984ebfe184 Author: Harry Moulton AuthorDate: 2025-01-23 12:26:23 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:25 +0000 arm64: add HWCAP for FEAT_WFxT Add the HWCAP for ARMv8.7 FEAT_WFxT. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48578 Signed-off-by: Harry Moulton --- sys/arm64/arm64/identcpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 646d10d5ae1a..d430dc649e0b 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1048,6 +1048,11 @@ static const struct mrs_field_value id_aa64isar2_wfxt[] = { MRS_FIELD_VALUE_END, }; +static const struct mrs_field_hwcap id_aa64isar2_wfxt_caps[] = { + MRS_HWCAP(2, HWCAP2_WFXT, ID_AA64ISAR2_WFxT_IMPL), + MRS_HWCAP_END +}; + static const struct mrs_field id_aa64isar2_fields[] = { MRS_FIELD(ID_AA64ISAR2, PAC_frac, false, MRS_LOWER, 0, id_aa64isar2_pac_frac), @@ -1059,7 +1064,8 @@ static const struct mrs_field id_aa64isar2_fields[] = { id_aa64isar2_gpa3, id_aa64isar2_gpa3_caps), MRS_FIELD_HWCAP(ID_AA64ISAR2, RPRES, false, MRS_LOWER, MRS_USERSPACE, id_aa64isar2_rpres, id_aa64isar2_rpres_caps), - MRS_FIELD(ID_AA64ISAR2, WFxT, false, MRS_LOWER, 0, id_aa64isar2_wfxt), + MRS_FIELD_HWCAP(ID_AA64ISAR2, WFxT, false, MRS_LOWER, 0, + id_aa64isar2_wfxt, id_aa64isar2_wfxt_caps), MRS_FIELD_END, }; From nobody Thu Jan 23 17:27:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dd23Xgz5lDDN; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dc5Pz6z43fb; Thu, 23 Jan 2025 17:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgCFgZGdpmaroX601qUfNSBmoEgHIJ5u6uf+beXZKvw=; b=P/Rss7LMH9Hv+KgBVfkoyDQO2IXsotv6hfa/gWmpgDYIeKkrztDMDzMvz9cT0WyclelYHJ 6opSa9xhbhdghyRmCUWsgFDRLQENjKc+scvfdiMqY9+BD/gOfh85gTksQpf1Qubg7dmvL3 qHpz7MZ9ZAejEWAut06Pq4TWNdJ9AD8QjByRAbwTlFydjCrw1o9+stRJXa/LDIM+PjTjd9 p4wiyVvUQHiSkZlesdE0uFrPDy6+XHFjWdBfWpLfrfp4zzG0eul2lUld3wmSedCg0W6Qx6 4wx+TWtzORT83Ni6akCEPqEcjC73lubD7IywvmVIzLp0ucErSxS3TaDoNejadQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jgCFgZGdpmaroX601qUfNSBmoEgHIJ5u6uf+beXZKvw=; b=sNSEjAtKDjnbRXlg2EjzBkhYr2VyqHLqu0+dEN5+76Wpq7tH7zQ4CUQ/VTIUu3eiFnBG88 /CcIokdRsy1fnATjKawWvm9rsHonXXZRdoPSsbKV/Jrd2Xs7aZiTLSLJobIJcxqU7EekTX lzYoD+kowCGZb39KaZYgnQ66XT6ZPL04r/gEhgWURJm4zBHPTJEuifUEX2FjFkXBndniPy Ydzr7ub/T42cVrXsAAe0DhaSx9Yn3wEKQ/qDcQJsKkufzJsgjHTePbpEr0aoussp8uMyrw F8fElbjOAFPqt0RYFApmQfbBsbz0Ll5ZnS5lQQxUUGtlLcimBs8V8lzJKEFGig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653248; a=rsa-sha256; cv=none; b=dEROk4C6rltG4XDwaIftkyfzrypPmamV6JNPhXgQkgZlaQ8prPhaLIcePXyx8azP/HQPQh N4xDEKRDo/G/OSwsJwVEcRdt0Y4h7tcK/Sa5UIHCfFvo9M/924pkaxkwMq71x6nikpWsgw J7Q1C7s36SRjm5aS2hQ1wbYxsonLw5PcHStoqaMl5D0bYPjfYQkbkUTysskKI2I2Rbr5uq wNGZd+MVFgn5Zlc4jEgsdSUYvAmV2XoLKxYthen3peWy9+7RfzeoX7K4FEpfGrDdMfIOvl LVuh9AwOlNGgqTmsCnfSf43B0hMnNtYw0gzlzKuOU+hMrE9F7W4yqHV1KSak3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dc4kX9zpBJ; Thu, 23 Jan 2025 17:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRSl1022486; Thu, 23 Jan 2025 17:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRSjq022483; Thu, 23 Jan 2025 17:27:28 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:28 GMT Message-Id: <202501231727.50NHRSjq022483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4d1acfb132a5 - main - arm64: add HCRX_EL2 register List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d1acfb132a5e6f31fc7786ea22c3239c2573b8c Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4d1acfb132a5e6f31fc7786ea22c3239c2573b8c commit 4d1acfb132a5e6f31fc7786ea22c3239c2573b8c Author: Harry Moulton AuthorDate: 2025-01-23 12:28:28 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 arm64: add HCRX_EL2 register HCRX_EL2 is the Extended Hypervisor Configuration Register introduced with FEAT_HCX in ARMv8.7. All fields in this register are used for features in ARMv8.7 and above. Initially zero the register, incase firmware has not properly configured it. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48583 Signed-off-by: Harry Moulton --- sys/arm64/arm64/locore.S | 19 ++++++++++++++++--- sys/arm64/include/hypervisor.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index e721092455e8..f3b846eee412 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -351,7 +351,6 @@ LENTRY(enter_kernel_el) isb mrs x4, hcr_el2 - /* Load the Virtualization Process ID Register */ mrs x2, midr_el1 msr vpidr_el2, x2 @@ -400,6 +399,20 @@ LENTRY(enter_kernel_el) /* Set the return PSTATE */ msr spsr_el2, x5 + /* + * Configure the Extended Hypervisor register. This is only valid if + * FEAT_HCX is enabled. + */ + mrs x2, id_aa64mmfr1_el1 + ubfx x2, x2, #ID_AA64MMFR1_HCX_SHIFT, #ID_AA64MMFR1_HCX_WIDTH + cbz x2, 2f + + /* Extended Hypervisor Configuration */ + mov x2, xzr + msr HCRX_EL2_REG, x2 + isb +2: + /* Don't trap to EL2 for CP15 traps */ msr hstr_el2, xzr @@ -414,13 +427,13 @@ LENTRY(enter_kernel_el) /* Extract GIC bits from the register */ ubfx x2, x2, #ID_AA64PFR0_GIC_SHIFT, #ID_AA64PFR0_GIC_BITS /* GIC[3:0] != 0000 - GIC CPU interface via special regs. supported */ - cbz x2, 2f + cbz x2, 3f mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ orr x2, x2, #ICC_SRE_EL2_SRE /* Enable system registers */ msr icc_sre_el2, x2 -2: +3: /* Set the address to return to our return address */ msr elr_el2, x30 diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index e3bdd83e8a29..15fc36014626 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -132,6 +132,41 @@ #define HCR_TWEDEn (UL(0x1) << 59) #define HCR_TWEDEL_MASK (UL(0xf) << 60) +/* HCRX_EL2 - Extended Hypervisor Configuration Register */ +#define HCRX_EL2_REG MRS_REG_ALT_NAME(HCRX_EL2) +#define HCRX_EL2_op0 3 +#define HCRX_EL2_op1 4 +#define HCRX_EL2_CRn 1 +#define HCRX_EL2_CRm 2 +#define HCRX_EL2_op2 2 + +#define HCRX_EnAS0 (UL(0x1) << 0) +#define HCRX_EnALS (UL(0x1) << 1) +#define HCRX_EnASR (UL(0x1) << 2) +#define HCRX_FnXS (UL(0x1) << 3) +#define HCRX_FGTnXS (UL(0x1) << 4) +#define HCRX_SMPME (UL(0x1) << 5) +#define HCRX_TALLINT (UL(0x1) << 6) +#define HCRX_VINMI (UL(0x1) << 7) +#define HCRX_VFNMI (UL(0x1) << 8) +#define HCRX_CMOW (UL(0x1) << 9) +#define HCRX_MCE2 (UL(0x1) << 10) +#define HCRX_MSCEn (UL(0x1) << 11) +/* Bits 12 & 13 are reserved */ +#define HCRX_TCR2En (UL(0x1) << 14) +#define HCRX_SCTLR2En (UL(0x1) << 15) +#define HCRX_PTTWI (UL(0x1) << 16) +#define HCRX_D128En (UL(0x1) << 17) +#define HCRX_EnSNERR (UL(0x1) << 18) +#define HCRX_TMEA (UL(0x1) << 19) +#define HCRX_EnSDERR (UL(0x1) << 20) +#define HCRX_EnIDCP128 (UL(0x1) << 21) +#define HCRX_GCSEn (UL(0x1) << 22) +#define HCRX_EnFPM (UL(0x1) << 23) +#define HCRX_PACMEn (UL(0x1) << 24) +/* Bit 25 is reserved */ +#define HCRX_SRMASKEn (UL(0x1) << 26) + /* HPFAR_EL2 - Hypervisor IPA Fault Address Register */ #define HPFAR_EL2_FIPA_SHIFT 4 #define HPFAR_EL2_FIPA_MASK 0xfffffffff0 From nobody Thu Jan 23 17:27:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dh1sF5z5lDHB; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dh0Ct5z43S3; Thu, 23 Jan 2025 17:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWxMESMBPAA/syNsiQLA5Ha9w9DjN1ePshmBVcAd2K0=; b=KT/ZvQqvSnOFDi2Bz+DhEIgZMjzGJ8t5dUxDuiySLKZfTXXNeROdLQ9CN+Xqt5N1b8ONL1 UmXy8Cg3xYhTj+2GhEc8ZL7md47ABuh7Aszg+JobuKASEcfT2CP2hFSCSU5UkBdCsHpycR U9uERDf5zm+LFl3c+YyQGOCGCge99u8JmPvcCIW7sSBCg2oxplYB8eXcdnwpb7tHfIYJsd qdg5Bduv6akiGO9x1NanmNvyyVhV/+GtMRHH9SWp9thdRLECUmxmvIa3YzUSB66Bhy1iyD XokYEOtqzTr3V3esTy89RMPPPHMK0B1w2fl0O2lIaWVWfjj+bXHSY6VRKcpgMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWxMESMBPAA/syNsiQLA5Ha9w9DjN1ePshmBVcAd2K0=; b=lOybuI+Mgr9NbTpLJMRxg8zfuOZVdooBgow8BwNqDaH8U7qKJ7eT9H+eoNOLBOUbCEl3Ik 3Cvc/FgDxwE+JrZZTKGE1vIYMI2MZDRjOPxWnK1Dz0YYSbdgFDULs4j3iciQRCkrEqwWWT T8TBDLzt7JvK+DySf6XNfivaqcDZ2EE+HT3o60d0b47LN+IrJjVzK7OPr/R7vW2CTwdgrg +LNjYz1uGs+1nnwdZLshypaWDgpoRo/TSnsV8/TIa0INDUFxXNvcnroSOdlJxWbHtES62c UGJkyYnSx3GSBN1W8nQ1GiPV8IFnYhPeiNUKqetGuFEweLlZEwE8TpkPmKYJ1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653252; a=rsa-sha256; cv=none; b=fpnYcZ9g/N6JWIZdKh8LxCRejo21c8mX5BYxIOVEBEaUse1Y0LnDj7CHsvdW3IgGlfxEjp WaVQN2WYCp2AI8os0m6dQvOSDo1WdqxtC17dooX9wQ3O8VDeaMlgPsLIZGhqcwhFQlAWLK w2VxbwCwXzwNHjvdlCL7giIgvCix/iHSY05gir7v8BA03rPCugsFxpM2yWgc1fHJ5b1xw0 P2X9UsUT6d19QB8bdQcyQF+ikc+ImjE9vYsXUHH1VRX7oq93/tBunEezsHZ2jMNQiQeIUD 7v8nmxck5K+obpsdTkQqKx8/NQjtv7zdeMrFZbol7rVlLp04IU8aj5nDHVCpZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dg6l9zzpk0; Thu, 23 Jan 2025 17:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRVsK022595; Thu, 23 Jan 2025 17:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRVig022592; Thu, 23 Jan 2025 17:27:31 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:31 GMT Message-Id: <202501231727.50NHRVig022592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9342829d578e - main - scmi: Make transports report the effective length of the received messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9342829d578e26f10a5cbc26e2b9e66cfd9864c4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9342829d578e26f10a5cbc26e2b9e66cfd9864c4 commit 9342829d578e26f10a5cbc26e2b9e66cfd9864c4 Author: Cristian Marussi AuthorDate: 2025-01-23 12:49:02 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 scmi: Make transports report the effective length of the received messages Once a message is received that fits into the RX buffer, update the msg.rx_len field with the effective length of the message received. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://reviews.freebsd.org/D47420 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 10 ++++++---- sys/dev/firmware/arm/scmi.h | 2 +- sys/dev/firmware/arm/scmi_mailbox.c | 10 +++++----- sys/dev/firmware/arm/scmi_shmem.c | 22 +++++++++------------- sys/dev/firmware/arm/scmi_shmem.h | 6 +++--- sys/dev/firmware/arm/scmi_smc.c | 4 ++-- sys/dev/firmware/arm/scmi_virtio.c | 5 ++--- 7 files changed, 28 insertions(+), 31 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 37496136c828..00a229762414 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -146,7 +146,8 @@ static struct scmi_req *scmi_req_lookup_inflight(struct scmi_softc *, uint32_t); static int scmi_wait_for_response(struct scmi_softc *, struct scmi_req *, void **); -static void scmi_process_response(struct scmi_softc *, uint32_t); +static void scmi_process_response(struct scmi_softc *, uint32_t, + unsigned int); int scmi_attach(device_t dev) @@ -469,7 +470,7 @@ scmi_req_lookup_inflight(struct scmi_softc *sc, uint32_t hdr) } static void -scmi_process_response(struct scmi_softc *sc, uint32_t hdr) +scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) { bool timed_out = false; struct scmi_req *req; @@ -484,6 +485,7 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr) mtx_lock_spin(&req->mtx); req->done = true; + req->msg.rx_len = rx_len; if (!req->timed_out) { /* * Consider the case in which a polled message is picked @@ -512,7 +514,7 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr) } void -scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr) +scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) { struct scmi_softc *sc; @@ -524,7 +526,7 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr) return; } - scmi_process_response(sc, hdr); + scmi_process_response(sc, hdr, rx_len); } static int diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 345ae6eeb03a..5ad7b0db3f5f 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -75,7 +75,7 @@ void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); int scmi_request(device_t dev, void *in, void **); -void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr); +void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); diff --git a/sys/dev/firmware/arm/scmi_mailbox.c b/sys/dev/firmware/arm/scmi_mailbox.c index 858b81f68845..d7b642b69b85 100644 --- a/sys/dev/firmware/arm/scmi_mailbox.c +++ b/sys/dev/firmware/arm/scmi_mailbox.c @@ -70,14 +70,14 @@ static void scmi_mailbox_a2p_callback(void *arg) { struct scmi_mailbox_softc *sc; - uint32_t msg_header; + uint32_t msg_header, rx_len; int ret; sc = arg; - ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header); + ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header, &rx_len); if (ret == 0) - scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header); + scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header, rx_len); } static int @@ -154,7 +154,7 @@ scmi_mailbox_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) sc = device_get_softc(dev); do { - if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr)) + if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr, &msg->rx_len)) break; DELAY(SCMI_MBOX_POLL_INTERVAL_MS * 1000); } while (tmo_loops--); @@ -171,7 +171,7 @@ scmi_mailbox_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_shmem.c b/sys/dev/firmware/arm/scmi_shmem.c index 9bab4bc4004e..a63d96b64cb5 100644 --- a/sys/dev/firmware/arm/scmi_shmem.c +++ b/sys/dev/firmware/arm/scmi_shmem.c @@ -247,7 +247,7 @@ scmi_shmem_clear_channel(device_t dev) } int -scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) +scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, unsigned int *rx_len) { uint32_t length, header; @@ -256,6 +256,7 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) if (le32toh(length) < sizeof(header)) return (EINVAL); + *rx_len = le32toh(length); /* Read header. */ scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, &header, SMT_SIZE_MSG_HEADER); @@ -266,14 +267,11 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) } int -scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len) +scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len) { - uint32_t length, payld_len; - - /* Read length. */ - scmi_shmem_read(dev, SMT_OFFSET_LENGTH, &length, SMT_SIZE_LENGTH); - payld_len = le32toh(length) - SCMI_MSG_HDR_SIZE; + uint32_t payld_len; + payld_len = rx_len - SCMI_MSG_HDR_SIZE; if (payld_len > buf_len) { device_printf(dev, "RX payload %dbytes exceeds buflen %dbytes. Truncate.\n", @@ -296,7 +294,7 @@ scmi_shmem_tx_complete(device_t dev) scmi_shmem_release_channel(sc); } -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header) +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len) { uint32_t status; bool ret; @@ -306,12 +304,10 @@ bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header) ret = (status & (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR | SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)); + if (ret == 0) + return (ret); - if (ret) - scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, msg_header, - SMT_SIZE_MSG_HEADER); - - return (ret); + return (scmi_shmem_read_msg_header(dev, msg_header, rx_len)); } static device_method_t shmem_methods[] = { diff --git a/sys/dev/firmware/arm/scmi_shmem.h b/sys/dev/firmware/arm/scmi_shmem.h index ed8763d5c145..bc8284502129 100644 --- a/sys/dev/firmware/arm/scmi_shmem.h +++ b/sys/dev/firmware/arm/scmi_shmem.h @@ -63,9 +63,9 @@ struct scmi_smt_header { device_t scmi_shmem_get(device_t sdev, phandle_t node, int index); int scmi_shmem_prepare_msg(device_t dev, uint8_t *msg, uint32_t tx_len, bool polling); -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header); -int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header); -int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len); +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len); +int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, uint32_t *rx_len); +int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len); void scmi_shmem_tx_complete(device_t); void scmi_shmem_clear_channel(device_t); diff --git a/sys/dev/firmware/arm/scmi_smc.c b/sys/dev/firmware/arm/scmi_smc.c index 9f0d899233fa..81c66ad7bb46 100644 --- a/sys/dev/firmware/arm/scmi_smc.c +++ b/sys/dev/firmware/arm/scmi_smc.c @@ -122,7 +122,7 @@ scmi_smc_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo) * Nothing to poll since commands are completed as soon as smc * returns ... but did we get back what we were poling for ? */ - scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr); + scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr, &msg->rx_len); return (0); } @@ -136,7 +136,7 @@ scmi_smc_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 12cbb9ecefd5..8714fee2ec87 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -76,7 +76,7 @@ scmi_virtio_callback(void *msg, unsigned int len, void *priv) } hdr = le32toh(*((uint32_t *)msg)); - scmi_rx_irq_callback(sc->base.dev, msg, hdr); + scmi_rx_irq_callback(sc->base.dev, msg, hdr, len); } static void * @@ -225,7 +225,6 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) } rx_msg = hdr_to_msg(rx_buf); - rx_msg->rx_len = rx_len; /* Complete the polling on any poll path */ if (rx_msg->polling) atomic_store_rel_int(&rx_msg->poll_done, 1); @@ -242,7 +241,7 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) rx_msg->hdr, rx_msg->polling); if (!rx_msg->polling) - scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr); + scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr, rx_len); } return (tmo_loops > 0 ? 0 : ETIMEDOUT); From nobody Thu Jan 23 17:27:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dk4MSKz5lDDQ; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dk1VgJz43k5; Thu, 23 Jan 2025 17:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiyC0B9IMtCCmKRZsnCqjhNuzi+bUEaPQwsBon+3AlA=; b=xvvyBB+K1cjdGAukuaEbOTf2zzPQIPAyVeWhUdrMdIJLyyaj0WBKfuEteVMBEB0dswZdac DBRGQyDQrshd0oYGyYgxaNN1634OvyRTXA8TjQdwawedKON/x1cbmmL0qwvJUgj5MU9mNZ r8zYoejBWxuJ5GjDm1OS0Bqml7Asqgx5TmJnobf3uOh0nrJtA0QketlOV+sGG1DqkxvJrW G99vS6PTQs1mWrE84Cuf5mQA81owA1eg3b+NAUAOiW3IRKw4xAZpo7HwaEy95ia//z3oSd +TdutZuUOU8462v64JH1NHF4jrMhBpfG4Bv7iBFelnQvq7W96Ma1mB7prnhvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiyC0B9IMtCCmKRZsnCqjhNuzi+bUEaPQwsBon+3AlA=; b=T1djLZrW9CMt6lUO4NYc4NUbS3o5TZxSXwiI3baCIaGwb6Klm8FSb21yZYEdoPE1RdIAP9 cjNH6Wp01M6mMM/gSo0w9DqLJ2dht/5NL7i35ddRvPxo3Cu8bSX5HZoEKgnFjeEtWTvtIt 7kkFgI56WlUd2M40qzwdxI4Fh8iFBCM5GGJNZOvqkH/v2AiWZ2U88tPzuFoey4xQahfWkB yYcUdwbcC6sEYWDX/hcbhT3LSJW3mikW3pjTd0nGdJOqpflgGbs3+k2W8oKRe5+4Gyt6r1 LcB7qlcadl1vLLaSYzHNCM7+7NEYxyIEUCqeF30hFXDoHolK4C+5FROd/kFjIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653254; a=rsa-sha256; cv=none; b=pYLJ9lT5YEmtx6QS9bcC1KZeqgIPMlMQKP1djKlh+kMXJulKoHHdXHqHGyDifI7MhfFBRA NkQ7C+ChZSNpk359Kl2wdCvTVAvKAmNpAOYFpCko02HXpYkvKVVraVZIpAdVFDXhaDUuBf s+xyL+DNLiuc4XkgdUSsoSdiSE1Vy6qJNGGAAb6FqbFCZyLNhi5h7IrO+qtEpQ8xwxSjir eQ6zLFfDOpZ4hx2VOuHDzutOdd+TMlmkmIPUPhiYNqqK3IcD3cMjQ11zyk6sQZLvqc7mBi vZv8RoUrzBP62tm+pII3vaJ9076FdFGs8gsbk0qqvh3yyVxlQNDDlA+OTJZ1Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dk15hgzp0t; Thu, 23 Jan 2025 17:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRYiX022667; Thu, 23 Jan 2025 17:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRYKq022662; Thu, 23 Jan 2025 17:27:34 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:34 GMT Message-Id: <202501231727.50NHRYKq022662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 103ea03e6713 - main - scmi: Add devicetree transport properties List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 103ea03e6713a0f3bb874472fbd9fd81e2278805 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=103ea03e6713a0f3bb874472fbd9fd81e2278805 commit 103ea03e6713a0f3bb874472fbd9fd81e2278805 Author: Cristian Marussi AuthorDate: 2025-01-23 13:01:26 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 scmi: Add devicetree transport properties SCMI transport characteristics can be optionally described in the devicetree to override the default build-time values. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47422 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 52 +++++++++++++++++++++++++------------- sys/dev/firmware/arm/scmi.h | 14 +++++++--- sys/dev/firmware/arm/scmi_virtio.c | 12 ++++----- 3 files changed, 51 insertions(+), 27 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 00a229762414..cf5a678370fd 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -127,7 +127,8 @@ struct scmi_transport { struct mtx mtx; }; -static int scmi_transport_init(struct scmi_softc *); +static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); +static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); @@ -165,12 +166,12 @@ scmi_attach(device_t dev) simplebus_init(dev, node); - error = scmi_transport_init(sc); + error = scmi_transport_init(sc, node); if (error != 0) return (error); - device_printf(dev, "Transport reply timeout initialized to %dms\n", - sc->trs_desc.reply_timo_ms); + device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", + SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); /* * Allow devices to identify. @@ -248,29 +249,42 @@ scmi_reqs_pool_free(struct scmi_reqs_pool *rp) free(rp, M_DEVBUF); } +static void +scmi_transport_configure(struct scmi_transport_desc *td, phandle_t node) +{ + if (OF_getencprop(node, "arm,max-msg", &td->max_msg, sizeof(td->max_msg)) == -1) + td->max_msg = SCMI_DEF_MAX_MSG; + + if (OF_getencprop(node, "arm,max-msg-size", &td->max_payld_sz, + sizeof(td->max_payld_sz)) == -1) + td->max_payld_sz = SCMI_DEF_MAX_MSG_PAYLD_SIZE; +} + static int -scmi_transport_init(struct scmi_softc *sc) +scmi_transport_init(struct scmi_softc *sc, phandle_t node) { + struct scmi_transport_desc *td = &sc->trs_desc; struct scmi_transport *trs; int ret; trs = malloc(sizeof(*trs), M_DEVBUF, M_ZERO | M_WAITOK); + scmi_transport_configure(td, node); + BIT_FILL(SCMI_MAX_TOKEN, &trs->avail_tokens); mtx_init(&trs->mtx, "tokens", "SCMI", MTX_SPIN); - trs->inflight_ht = hashinit(SCMI_MAX_MSG, M_DEVBUF, - &trs->inflight_mask); + trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -286,8 +300,13 @@ scmi_transport_init(struct scmi_softc *sc) return (ret); } + /* Use default transport timeout if not overridden by OF */ + OF_getencprop(node, "arm,max-rx-timeout-ms", &td->reply_timo_ms, + sizeof(td->reply_timo_ms)); + return (0); } + static void scmi_transport_cleanup(struct scmi_softc *sc) { @@ -355,7 +374,7 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { - bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE); + bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } mtx_unlock_spin(&req->mtx); @@ -532,13 +551,13 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) static int scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) { + unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; if (req->msg.polling) { bool needs_drop; - ret = SCMI_POLL_MSG(sc->dev, &req->msg, - sc->trs_desc.reply_timo_ms); + ret = SCMI_POLL_MSG(sc->dev, &req->msg, reply_timo_ms); /* * Drop reference to successfully polled req unless it had * already also been processed on the IRQ path. @@ -557,8 +576,7 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) le32toh(req->msg.hdr), le32toh(req->header)); } } else { - ret = tsleep(req, 0, "scmi_wait4", - (sc->trs_desc.reply_timo_ms * hz) / 1000); + ret = tsleep(req, 0, "scmi_wait4", (reply_timo_ms * hz) / 1000); /* Check for lost wakeups since there is no associated lock */ mtx_lock_spin(&req->mtx); if (ret != 0 && req->done) @@ -591,8 +609,8 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, sc = device_get_softc(dev); - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE) { + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { device_printf(dev, "Unsupported payload size. Drop.\n"); return (NULL); } @@ -606,7 +624,7 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE; + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); return (&req->msg.payld[0]); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 73b49f099ad8..135b49c3b05b 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -34,10 +34,14 @@ #include "scmi_if.h" -#define SCMI_MAX_MSG 32 -#define SCMI_MAX_MSG_PAYLD_SIZE 128 -#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) +#define SCMI_DEF_MAX_MSG 32 +#define SCMI_DEF_MAX_MSG_PAYLD_SIZE 128 + +#define SCMI_MAX_MSG_PAYLD_SIZE(sc) ((sc)->trs_desc.max_payld_sz + sizeof(uint32_t)) +#define SCMI_MAX_MSG_REPLY_SIZE(sc) (SCMI_MAX_MSG_PAYLD_SIZE((sc)) + sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE(sc) (SCMI_MAX_MSG_REPLY_SIZE(sc) + sizeof(uint32_t)) +#define SCMI_MAX_MSG(sc) ((sc)->trs_desc.max_msg) +#define SCMI_MAX_MSG_TIMEOUT_MS(sc) ((sc)->trs_desc.reply_timo_ms) enum scmi_chan { SCMI_CHAN_A2P, @@ -47,6 +51,8 @@ enum scmi_chan { struct scmi_transport_desc { bool no_completion_irq; + unsigned int max_msg; + unsigned int max_payld_sz; unsigned int reply_timo_ms; }; diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 8714fee2ec87..5252ad9cf9a4 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -83,19 +83,19 @@ static void * scmi_virtio_p2a_pool_init(device_t dev, unsigned int max_msg) { struct scmi_virtio_softc *sc; + unsigned int max_msg_sz; void *pool; uint8_t *buf; int i; sc = device_get_softc(dev); + max_msg_sz = SCMI_MAX_MSG_SIZE(&sc->base); + pool = mallocarray(max_msg, max_msg_sz, M_DEVBUF, M_ZERO | M_WAITOK); - pool = mallocarray(max_msg, SCMI_MAX_MSG_SIZE, M_DEVBUF, - M_ZERO | M_WAITOK); - - for (i = 0, buf = pool; i < max_msg; i++, buf += SCMI_MAX_MSG_SIZE) { + for (i = 0, buf = pool; i < max_msg; i++, buf += max_msg_sz) { /* Feed platform with pre-allocated P2A buffers */ virtio_scmi_message_enqueue(sc->virtio_dev, - VIRTIO_SCMI_CHAN_P2A, buf, 0, SCMI_MAX_MSG_SIZE); + VIRTIO_SCMI_CHAN_P2A, buf, 0, max_msg_sz); } device_printf(dev, @@ -111,7 +111,7 @@ scmi_virtio_clear_channel(device_t dev, void *msg) sc = device_get_softc(dev); virtio_scmi_message_enqueue(sc->virtio_dev, VIRTIO_SCMI_CHAN_P2A, - msg, 0, SCMI_MAX_MSG_SIZE); + msg, 0, SCMI_MAX_MSG_SIZE(&sc->base)); } static int From nobody Thu Jan 23 17:27:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dg1KJ8z5lDTh; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Df6wy6z43VS; Thu, 23 Jan 2025 17:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/uWVTTbXF1H8L8cExaPB905oE+Ssz1kc3b80Xa3ahA=; b=v+pXFmpv2mVHGbPzVQbiP4/B1/gilJuHfkNVQviXfMExIWSJNOOmwuZA7j8VDpEcKKrUCR gvBujiwSWX9QwTJmcPyoeeSFhCc6BYAjozbc9savrnxyTqXJQYDBQ11w01JIwlGnHV4Gvf PKCYLALEbRyR494AO8oSyP6p4sAIfEZQCMoINvAL4tvKNTyWP4E1S5BPNrCi4neHDfnxy1 xCoD1k3gM1toBbNepUpZjRVEzEWlKskoUk/JI0HCVkgBY7gTWcqVzUfynB6vFYjRq6P/cc b+ByBKOl0VJRGZkSOrFcQ9KwoHXCR1xhKubV4XoIkRS7I/low9btj2JG7FtIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/uWVTTbXF1H8L8cExaPB905oE+Ssz1kc3b80Xa3ahA=; b=rL5UqVZzZasjQ1rej1LqQPpRix6Fo5etYDes4SRx9x1Wg7oPOpYas6NYbACaEmzdkTHl+2 v5PTygDnfeHP34uvHG+Eob+CLlBTKw9TUL0J94QHqsBVWMIIm1x7zfvzVYflkeVzxfJ9DR 6ryhCwapgena9rZdRzDz6JzU6vQdlAbW7towzbR0Phg2LEdaUJmGXP80BRlAK4CZQD1QVT xkLwy0VElKEghceg2ATo45CjNbBzf53Ch5RSP5MHvN816SlxxjE/UOaRmCv6Vpz8kETsFg bUk/MNcBX1GLph04SE2LXCxdBmdPPmJh4fNJ8Uffd8IFTX7Oh4n4+LteVojFZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653251; a=rsa-sha256; cv=none; b=rYrBASr2J+DRvs9OVhoUPkgkMT35SBCuloWK4HbB7q2I2kZNxhGDuULraJytHTKANUhkIB JsDI3gyNEtGn1X92fknSTHiRaH/BNDdQZied65DkHl2ExOJdOGGeg3swI83kuzpgtyXr7I XpGho/GPvLVWJAaQVfTAJ3lZU38YHb2Yz3DO33Ygtgo9BgJflBJ+m9nqAxdhnbD0Ak+d24 SBg8tn7ORRtTyFZcynhYTaHK/UMy2kAlroKd6+p99ZVSM6HEXoYooi5/T3zs6Qni+SfAKY f7Egxg47gFS8fyJAnNAT7HqXAjZmG6ScLjBb/a5yXSzZxYiefpamAkV8gggdDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Df6M53zp0r; Thu, 23 Jan 2025 17:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRUqK022559; Thu, 23 Jan 2025 17:27:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRU2H022556; Thu, 23 Jan 2025 17:27:30 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:30 GMT Message-Id: <202501231727.50NHRU2H022556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c56e586f0f02 - main - scmi: Fix race on timed out transmissions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c56e586f0f029fec4a0fee844f83ff62da20e4b6 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c56e586f0f029fec4a0fee844f83ff62da20e4b6 commit c56e586f0f029fec4a0fee844f83ff62da20e4b6 Author: Cristian Marussi AuthorDate: 2025-01-23 12:46:38 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 scmi: Fix race on timed out transmissions When a waited-for outstanding request is determined to have timed out, mark such request immediately as such, so as to avoid any possible race on the IRQ path with code path evaluating that same timed out condition. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47419 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index c2585d8d9637..37496136c828 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -545,6 +545,7 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) */ mtx_lock_spin(&req->mtx); needs_drop = (ret == 0) && !req->done; + req->timed_out = ret != 0; mtx_unlock_spin(&req->mtx); if (needs_drop) scmi_req_drop_inflight(sc, req); @@ -560,6 +561,7 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) mtx_lock_spin(&req->mtx); if (ret != 0 && req->done) ret = 0; + req->timed_out = ret != 0; mtx_unlock_spin(&req->mtx); } @@ -569,9 +571,6 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) ret = req->msg.payld[0]; *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; } else { - mtx_lock_spin(&req->mtx); - req->timed_out = true; - mtx_unlock_spin(&req->mtx); device_printf(sc->dev, "Request for token 0x%X timed-out.\n", req->token); } From nobody Thu Jan 23 17:27:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dj64Qjz5lD8K; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dj0Zxkz43SC; Thu, 23 Jan 2025 17:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V1vBVrDwFi07KvxblE3WaQLORnBUVv5kZzS8nT20Ejg=; b=P/XIW9WI/JVJ4zZuGLAIekTEpsHl8MtAgo5QiXhCocJunLV1x1QssjQ+saVUhzWa13TRom 2Oa4S3C8PjgjYB0GY7yBCavcLRcV37BCEPMC/magse3Jyp6uN4Wj803cH8j+M5PSWrmWX2 Px9fqPFfdL+I6YmfTk6+WwgLDskWquq591jhzjSALiWihbPFqb/10vzAg626k54uZRO3AM HSPbEOHQtt26jlCNXEVt25u7e/hXdYGAWlnYssiK0lV07nlQ6Er3Tb5AZjI7FOlSdAOXSb Q+TVhzkg2E3f6CDeZZqtupg3xE1r/h7kgYGlN0PGSH75866weiiRnm2HeNG3oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V1vBVrDwFi07KvxblE3WaQLORnBUVv5kZzS8nT20Ejg=; b=G3H0KAkKbxgbEuVKdJ9wVv+Sh+3umK+zOJFdNOKLwGouc7p74UpgtuCOZlDYPRtCNsO/BE bS8JOLWt0+ARkX/Dj3KyPB/zp+7xm6al6Fhf1NNzkg8Ai5ZeIokU/4RdFC4qcWI5AtgXu1 XoujEW43LWeJiAsOUW1l51FtixWnv5uL98f92qHPu9HOHbfGhl1JcfE5Ht7xcT5RCyZZfk 2shf50PtzjBLHQjCSDXn1zTf5IcPZ7Lv41zSaj9DXjLB15BgEaa63ZZWrhKD/IemHY59Np Q6LJVoALJ+vB6ndJRHPgkh/dJ+83A5Cg3rChZW+OMLx401unUCgl1UNOuVDB8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653253; a=rsa-sha256; cv=none; b=x6tDcP29xTYP92tDSO0UIGOQoeQvCMOC5J5zZxDZ2cfr3RymSh4hUKdOBQp8aSKMzwiX2Q sGqDWiiNUi/OvEQq8KDkN+Ye9eA/Jhbc+gQwMuYTYBtByDRWDT7o2os9mA1s+xFFL103Q8 CDKPZT3QHdh50DOHp3ylyOwpdMaHRRuDb6+BfyqsuaxWAnRFKaHpUZP2UwiiDJkHJPQAUx 7/brG4kG81XXtVclttfDDjT3vh4kPeHiYLDwo8LPhcHOZTAGwUxFepcma/tniAXZ4s909y DHOHWhwtYpLaa3IvBhuPDu61OpvzDRWDGOLjnpiZ9t4D76B/Mg1eEGuz5S/+mQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dj0Bbfzp0s; Thu, 23 Jan 2025 17:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRWgS022629; Thu, 23 Jan 2025 17:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRWt4022626; Thu, 23 Jan 2025 17:27:32 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:32 GMT Message-Id: <202501231727.50NHRWt4022626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f02162394925 - main - scmi: Redefine max message payload size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0216239492579022982d94e04090f1333fee5a5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f0216239492579022982d94e04090f1333fee5a5 commit f0216239492579022982d94e04090f1333fee5a5 Author: Cristian Marussi AuthorDate: 2025-01-23 12:49:41 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 scmi: Redefine max message payload size The defined maximum payload size should not include header and status field. Fix the definition accordingly, so that it matches the definitions as can be found in the Linux SCMI stack. The semantic of this define is important since it will then be possible to override such values from devicetree, like in Linux. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47421 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 5ad7b0db3f5f..73b49f099ad8 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -36,8 +36,8 @@ #define SCMI_MAX_MSG 32 #define SCMI_MAX_MSG_PAYLD_SIZE 128 -#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE - sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) enum scmi_chan { SCMI_CHAN_A2P, From nobody Thu Jan 23 17:27:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dl40QMz5lDYY; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dl2Clbz43dJ; Thu, 23 Jan 2025 17:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MBbrMuv/TVoDGKqdIr562aTQjW2Uk2K1QU5qqmrjPM=; b=eoAdBEqTkrGUUDMvo3DiQnFOO5DVFBeXaLNx4A9Db0oybYnXNFsRT9EdZMDlKulFmmfg8x +cfUXpDJRM/yXu42UHL/6xDQGrLkzFDmIjea9yPpUUpHl7VFrjNArgIqnDHQzU/P0RiJnq NgjX/bjD2ONbTE69NN6Dlfo4yFIc/9M5u7a92CuWEjwhcDoLE8Xuxg+nAsNFpcgqusvKnW +xrdw/9oqc8lvrpVCPgL0vGONQurhhP4WshkV1GDAg+QnH9Au60F2midqjA9N0r9dHNaf7 wbT0DvrGtnYBV3i0Ytv3o/4GEBLW4iAjxqlNPfzU5slnPVqmVdcfDjqRHb0+6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MBbrMuv/TVoDGKqdIr562aTQjW2Uk2K1QU5qqmrjPM=; b=p/qREQu5MRrEbSmChOgP8kcBdoZCfGisTyTCaLJ02WmyuCCww3RIF8XgchVMeZBa5QoE1Y up7uPCVw0T3+7WH5Qo4bfaNHKGUD/CwUQPYQ3/jf5WnfCk5s+HoT7MzGK1fcpQ0KW7sNL7 9IOBxZ8jzcVTHDG1BZ0ue56vR06KGfOmLytb/x5NjK6fONlGn3w+XHEr9EXE5+wpT/p26E yz2hX9iGVz+XiGEgu272Co3YlL1Hv/yDNtUDn4uTIWL5yK9FC6t3GmKeOA96esfFUzW3ss hTbCOaV7ISpBIJN5+P0i7TUcVl5v1FoNJKcqa9igtrYdxuGRR/ttaVB6I4ZiBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653255; a=rsa-sha256; cv=none; b=P06K7BYYhETSqxfxxK3BJSI0Sw6tIkqtzYmoNjedNMEUTrEHOFMJ+v9hkSSJYV0xaFv4UV qvBNx55n+VbxAB5khUPZQY4HzfqXxYafjr07gQnguaagZiPoOSZ5RqpghysJYnDcBNFoNN gERSjwfI/tfg+aYqAmg9Fum2L7AJf7OhAIAmpHHLotJDikWMB6fibBr2vgpw2QpYf3fJaM xCDQl70oG3KrRV27eX+XNTJ60fy/HQmCKVWvXiuFtCF7k66m/I3xP5iadZmFQy74cgINDM mREQwqVIliOrtXxEJLLBHRdEViLEmSXDy01AK4DbQV2JzDEmytSX5uhnTVbHig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dl1qF8zpWf; Thu, 23 Jan 2025 17:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRZAS022701; Thu, 23 Jan 2025 17:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRZRT022698; Thu, 23 Jan 2025 17:27:35 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:35 GMT Message-Id: <202501231727.50NHRZRT022698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e887179d4bc0 - main - scmi: Add helper to manipulate scmi_msg descriptors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e887179d4bc032e79d0334371d613c5841989a41 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e887179d4bc032e79d0334371d613c5841989a41 commit e887179d4bc032e79d0334371d613c5841989a41 Author: Cristian Marussi AuthorDate: 2025-01-23 13:23:28 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:26 +0000 scmi: Add helper to manipulate scmi_msg descriptors Refactor allocation logic for scmi_req and introduce new helpers to be able to obtain an scmi_msg reference to a freshly allocated request. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47423 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 77 +++++++++++++++++++++++++++++++++++---------- sys/dev/firmware/arm/scmi.h | 2 ++ 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index cf5a678370fd..8104f4e10429 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -132,9 +132,10 @@ static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); -static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); +static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); +static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); static void scmi_req_free_unlocked(struct scmi_softc *, - enum scmi_chan, struct scmi_req *); + enum scmi_chan, struct scmi_req *); static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); @@ -319,6 +320,32 @@ scmi_transport_cleanup(struct scmi_softc *sc) free(sc->trs, M_DEVBUF); } +static struct scmi_req * +scmi_req_initialized_alloc(device_t dev, int tx_payld_sz, int rx_payld_sz) +{ + struct scmi_softc *sc; + struct scmi_req *req; + + sc = device_get_softc(dev); + + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { + device_printf(dev, "Unsupported payload size. Drop.\n"); + return (NULL); + } + + /* Pick one from free list */ + req = scmi_req_alloc(sc, SCMI_CHAN_A2P); + if (req == NULL) + return (NULL); + + req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; + req->msg.rx_len = rx_payld_sz ? + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); + + return (req); +} + static struct scmi_req * scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) { @@ -374,6 +401,10 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { + req->protocol_id = 0; + req->message_id = 0; + req->token = 0; + req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } @@ -604,27 +635,15 @@ void * scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payld_sz, int rx_payld_sz) { - struct scmi_softc *sc; struct scmi_req *req; - sc = device_get_softc(dev); - - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { - device_printf(dev, "Unsupported payload size. Drop.\n"); - return (NULL); - } - - /* Pick one from free list */ - req = scmi_req_alloc(sc, SCMI_CHAN_A2P); + /* Pick a pre-built req */ + req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); if (req == NULL) return (NULL); req->protocol_id = protocol_id & SCMI_HDR_PROTOCOL_ID_BF; req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; - req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; - req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); return (&req->msg.payld[0]); } @@ -641,6 +660,32 @@ scmi_buf_put(device_t dev, void *buf) scmi_req_put(sc, req); } +struct scmi_msg * +scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) +{ + struct scmi_req *req; + + /* Pick a pre-built req */ + req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); + if (req == NULL) + return (NULL); + + return (&req->msg); +} + +void +scmi_msg_put(device_t dev, struct scmi_msg *msg) +{ + struct scmi_softc *sc; + struct scmi_req *req; + + sc = device_get_softc(dev); + + req = msg_to_req(msg); + + scmi_req_put(sc, req); +} + int scmi_request(device_t dev, void *in, void **out) { diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 135b49c3b05b..f6aa072caeca 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -80,6 +80,8 @@ struct scmi_msg { void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); +struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); +void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); From nobody Thu Jan 23 17:27:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dq1W2mz5lDWp; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dp4G6bz43dT; Thu, 23 Jan 2025 17:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2oYWOYcTuGxVLU9DNWW9OWsTSwxXmJt5yDpZHQ1Qkw=; b=SAob/+KUKhcwjcETWxC/vpy380OvmLbuSD+DtbgHL9M2ZOONH9xjOFyZXJzujEihdidA85 9sbMXSPfZ+58URONOT0tTUMJUbhymF/TmXA62OGJyeA1fz+RUDarNt0ny5NMV9Koq/3fMA KiX25bPwSh3PZCkzo9CkFLEdq6YHuKaSqvwXq7TG5vAWgeVJx8Tpik8Dv7ehs/RobWD/gh dNN3oNM0A4M/Fj3t7kLx+4o+M+bJZMJqhrb14phHIIxZt8wjd+e5wtkUvTCPgvNfyt46wf ioBJ5+7yN+7gtoafYHFct6fo0LEHfvcH1XSB/Cj+UFpGcwQZJZo76mu8ibjvQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2oYWOYcTuGxVLU9DNWW9OWsTSwxXmJt5yDpZHQ1Qkw=; b=uUKYIJyxhKKm9OJGigtPpzTYayFLA0k+RymsH3RN7UE8u+aQiIdo3dze8fXWzVJLqIXq0d I3BxdOJ2KN9Om9AVe89C+IkojnjcLgIGWmbts0cyuWjVb70uLrexLBgzK26j6GURzb9oFG EkkUDWkE77UtuUrjb3oP2hi7iXG3glbEIDGKW2+nWaQpvZaIh+1XA9+lmJYzL6aXS/rtzQ 5e1T+AQxdex3lMvHApA8aJGOb/iOYnYHD8mT04wAVHrTUw2AQ89uWnkuqyZOpZsPYPdiY2 2cevxtmuSR635t4Ybtx93gQg4fcWHiBF7VvrQ5niKbKSUZPQDjrdi3NvPkEVTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653258; a=rsa-sha256; cv=none; b=VVdzRaQkaaaIAn4Y3QWkJCxWGXsIvWHqNBEDMSgPW3m2DyJiAyAMYlUVQceYaimcLlFXyv 8xNi5z8Cqs8r3XiAsB5oDqYgOZxZBD0ml5OtQDRCOU9goqi0W0ggdw7RtR8GqO5DaL8+rv jxs7rC7vFcAlDEYpmcSH1tpqSc8AZK/TkkzSfW4+6fudaQteRiqbjKj1puvIwB8HpGKoP2 NBwutwJSCbU7Q/xsiMx6f9o6KQ/ej+Qxmyp5EcGblsQxUJniEf0rNdOBob2ArS91WKxsYg E8o5jlhYVo6baxSdz9B9jeU/qNQAppi86oggugU6vm8YCYJL/t8jpe3dk3JFUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dp3ph3zp0w; Thu, 23 Jan 2025 17:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRcxL022812; Thu, 23 Jan 2025 17:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRchQ022809; Thu, 23 Jan 2025 17:27:38 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:38 GMT Message-Id: <202501231727.50NHRchQ022809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b802926b7b14 - main - scmi: Add optional asynchronous handling of replies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b802926b7b145d7cfe2465ac4e19f062a9eb6e6d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b802926b7b145d7cfe2465ac4e19f062a9eb6e6d commit b802926b7b145d7cfe2465ac4e19f062a9eb6e6d Author: Cristian Marussi AuthorDate: 2025-01-23 13:26:12 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Add optional asynchronous handling of replies Add the core logic to handle the replies to pending command in an asynchronous manner. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47426 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 46 ++++++++++++++++++++++++++++++++++++++++----- sys/dev/firmware/arm/scmi.h | 1 + 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 950bbf94eeb6..0b165e413674 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,8 @@ struct scmi_req { bool use_polling; bool done; bool is_raw; + device_t dev; + struct task tsk; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -103,6 +106,7 @@ struct scmi_req { struct scmi_msg msg; }; +#define tsk_to_req(t) __containerof((t), struct scmi_req, tsk) #define buf_to_msg(b) __containerof((b), struct scmi_msg, payld) #define msg_to_req(m) __containerof((m), struct scmi_req, msg) #define buf_to_req(b) msg_to_req(buf_to_msg(b)) @@ -131,7 +135,9 @@ struct scmi_transport { static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); -static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); +static void scmi_req_async_waiter(void *, int); +static struct scmi_reqs_pool *scmi_reqs_pool_allocate(device_t, const int, + const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); @@ -217,7 +223,7 @@ DRIVER_MODULE(scmi, simplebus, scmi_driver, 0, 0); MODULE_VERSION(scmi, 1); static struct scmi_reqs_pool * -scmi_reqs_pool_allocate(const int max_msg, const int max_payld_sz) +scmi_reqs_pool_allocate(device_t dev, const int max_msg, const int max_payld_sz) { struct scmi_reqs_pool *rp; struct scmi_req *req; @@ -229,6 +235,10 @@ scmi_reqs_pool_allocate(const int max_msg, const int max_payld_sz) req = malloc(sizeof(*req) + max_payld_sz, M_DEVBUF, M_ZERO | M_WAITOK); + req->dev = dev; + req->tsk.ta_context = &req->tsk; + req->tsk.ta_func = scmi_req_async_waiter; + mtx_init(&req->mtx, "req", "SCMI", MTX_SPIN); LIST_INSERT_HEAD(&rp->head, req, next); } @@ -280,14 +290,14 @@ scmi_transport_init(struct scmi_softc *sc, phandle_t node) trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -648,7 +658,8 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_COLLECT_REPLY(sc->dev, &req->msg); if (req->msg.payld[0] != 0) ret = req->msg.payld[0]; - *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; + if (out != NULL) + *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; } else { device_printf(sc->dev, "Request for token 0x%X timed-out.\n", req->token); @@ -703,6 +714,20 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) return (&req->msg); } +static void +scmi_req_async_waiter(void *context, int pending) +{ + struct task *ta = context; + struct scmi_softc *sc; + struct scmi_req *req; + + req = tsk_to_req(ta); + sc = device_get_softc(req->dev); + scmi_wait_for_response(sc, req, NULL); + + scmi_msg_put(req->dev, &req->msg); +} + void scmi_msg_put(device_t dev, struct scmi_msg *msg) { @@ -763,3 +788,14 @@ scmi_request(device_t dev, void *in, void **out) return (scmi_wait_for_response(sc, req, out)); } + +int +scmi_msg_async_enqueue(struct scmi_msg *msg) +{ + struct scmi_req *req; + + req = msg_to_req(msg); + + return taskqueue_enqueue_flags(taskqueue_thread, &req->tsk, + TASKQUEUE_FAIL_IF_PENDING | TASKQUEUE_FAIL_IF_CANCELING); +} diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f5b4173272bb..990759237964 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -84,6 +84,7 @@ struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); int scmi_request_tx(device_t dev, void *in); +int scmi_msg_async_enqueue(struct scmi_msg *msg); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Thu Jan 23 17:27:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dr1PrCz5lDdh; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dq5LPsz43hd; Thu, 23 Jan 2025 17:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FphtWkOWhjTvRgcXCqGnFNHObm4ubKeYJ6RfpefhF24=; b=mvYI0O2MYhT+3YHbk1aHJwa7zLQUIzWRZ+8bKop9s1ewjnxpXA8UGsfhhamI9NqT5uR3Iz f3ERBEzgXwVEM4+5EA0WEuyVwl8tzQ7aJOAyy/ehrH3raG32s+4XykzbiNQ+bCeBEz2wfY Or0+cPM9dJKxccmw627M3It3YJP5fFUOsukmHKI7Mc+VVkvPdAyYWSgSyk+1pAOouNwa45 hUgg8Pi7pvTKvmnIdWvsLNX2IPq9oWM/q7J+oEb7JIRZ90C9Px0gxJM2OOv1npwx9Q08tG IGmNhLkf2C+mtG+dBUbbwpJLv9VWvw0cjwJO885htc/m0yBdi9YkOb3Tw2DZHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FphtWkOWhjTvRgcXCqGnFNHObm4ubKeYJ6RfpefhF24=; b=dRyF6JRQBv06u3XkOclID8PNqKh0sGfD4uTTZUevfPMVxq1EXAooyh7tJ/TnOtoDA1nbCq KCcEhubj2NDhT3biegdCrZ7I5M42qZ9689TKgAjoeZJah7YNqUA3Ea3/MeUw5pP6gLb6Hw FkdPyz4coU/DDKAAz0jwBLX5QpsTL0tzO1gwQB1aAG4lE4Dxh5fuxj0uMLxeSBUZOAKDpd Eh6evN/LzuXypfhJTJGgUuslgEfmDz0hSZKh5b3rdo1rrtNWL4LRcPew04V5KEHyNDFE8r Q/Rrw4KgB3k8udO9+HWYYQONcrSs+9ZzSF//3pIqnx1atwCRNGJWiQddvfCTuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653259; a=rsa-sha256; cv=none; b=aZPWi3+7z1LltH4eEEo1/CteWotI44lCYllFXUhTyUQAvHbONb6/UgAzVmjb64ZB+eTH7R NtkAMl2tGJVrXidN4PkzHqrrdrI/IIw1S6nuQ35sfbUV9/PkZmXpYBJfeqt4anAg7ySSlV /9Mcmm7t8zsFHiZvldiIRi/EAUao3EI6IRScIuE05CINIZMtBl/prhpYlpcoNEeR5qj+kR cfRBCyym7ZUybWMOLvwsoQMpvZILf/zxlSBpSCwKkJYSLRmBTrkPka1XgeKdKJWZippK3j iJMkIzNawlTSuvsArz6vPA8/Kj8PiDvR0av7iNMP1E+kfs5HbQ5E163/IdEU0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dq4ndxzpWg; Thu, 23 Jan 2025 17:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRd2E022848; Thu, 23 Jan 2025 17:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRdPe022845; Thu, 23 Jan 2025 17:27:39 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:39 GMT Message-Id: <202501231727.50NHRdPe022845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 984f9fb81a9d - main - scmi: Add SDT traces to the core stack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 984f9fb81a9dfb9780c9bcc99607ad7cac3a72dd Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=984f9fb81a9dfb9780c9bcc99607ad7cac3a72dd commit 984f9fb81a9dfb9780c9bcc99607ad7cac3a72dd Author: Cristian Marussi AuthorDate: 2025-01-23 13:26:41 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Add SDT traces to the core stack Add a few basic traces to track SCMI messages lifecycle. Tested on: Arm Morello Board Reviewed by: Andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47427 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 0b165e413674..2d9f6fa89d4b 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,26 @@ #include "scmi.h" #include "scmi_protocols.h" +SDT_PROVIDER_DEFINE(scmi); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_alloc, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_free_unlocked, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_get, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_put, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, func, scmi_request_tx, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, entry, scmi_wait_for_response, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, exit, scmi_wait_for_response, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE2(scmi, func, scmi_rx_irq_callback, hdr_dump, + "int", "int"); +SDT_PROBE_DEFINE5(scmi, func, scmi_process_response, xfer_track, + "int", "int", "int", "int", "int"); + #define SCMI_MAX_TOKEN 1024 #define SCMI_HDR_TOKEN_S 18 @@ -88,6 +109,12 @@ #define SCMI_MSG_TOKEN(_hdr) \ (((_hdr) & SCMI_HDR_TOKEN_M) >> SCMI_HDR_TOKEN_S) +#define SCMI_MSG_PROTOCOL_ID(_hdr) \ + (((_hdr) & SCMI_HDR_PROTOCOL_ID_M) >> SCMI_HDR_PROTOCOL_ID_S) +#define SCMI_MSG_MESSAGE_ID(_hdr) \ + (((_hdr) & SCMI_HDR_MESSAGE_ID_M) >> SCMI_HDR_MESSAGE_ID_S) +#define SCMI_MSG_TYPE(_hdr) \ + (((_hdr) & SCMI_HDR_TYPE_ID_M) >> SCMI_HDR_TYPE_ID_S) struct scmi_req { int cnt; @@ -372,8 +399,11 @@ scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) } mtx_unlock_spin(&rp->mtx); - if (req != NULL) + if (req != NULL) { refcount_init(&req->cnt, 1); + SDT_PROBE3(scmi, func, scmi_req_alloc, req_alloc, + req, refcount_load(&req->cnt), -1); + } return (req); } @@ -392,6 +422,9 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); + + SDT_PROBE3(scmi, func, scmi_req_free_unlocked, req_alloc, + req, refcount_load(&req->cnt), -1); } static void @@ -406,6 +439,9 @@ scmi_req_get(struct scmi_softc *sc, struct scmi_req *req) if (!ok) device_printf(sc->dev, "%s() -- BAD REFCOUNT\n", __func__); + SDT_PROBE3(scmi, func, scmi_req_get, req_alloc, + req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); + return; } @@ -420,6 +456,9 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); + } else { + SDT_PROBE3(scmi, func, scmi_req_put, req_alloc, + req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); } mtx_unlock_spin(&req->mtx); } @@ -571,6 +610,10 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) return; } + SDT_PROBE5(scmi, func, scmi_process_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); + mtx_lock_spin(&req->mtx); req->done = true; req->msg.rx_len = rx_len; @@ -608,6 +651,8 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) sc = device_get_softc(dev); + SDT_PROBE2(scmi, func, scmi_rx_irq_callback, hdr_dump, hdr, rx_len); + if (SCMI_IS_MSG_TYPE_NOTIF(hdr) || SCMI_IS_MSG_TYPE_DRESP(hdr)) { device_printf(dev, "DRESP/NOTIF unsupported. Drop.\n"); SCMI_CLEAR_CHANNEL(dev, chan); @@ -623,6 +668,10 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; + SDT_PROBE5(scmi, entry, scmi_wait_for_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), reply_timo_ms); + if (req->msg.polling) { bool needs_drop; @@ -667,6 +716,10 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_TX_COMPLETE(sc->dev, NULL); + SDT_PROBE5(scmi, exit, scmi_wait_for_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); + return (ret); } @@ -769,6 +822,10 @@ scmi_request_tx(device_t dev, void *in) return (error); } + SDT_PROBE5(scmi, func, scmi_request_tx, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->msg.polling); + return (0); } From nobody Thu Jan 23 17:27:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dn1l5Cz5lDYd; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dm2r2vz43gp; Thu, 23 Jan 2025 17:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vU2yUHa+ePCct8czLydXqH1SU6DKVil0MNCdMDRfLQs=; b=yieXUp4To6rbST1ykTf+KOX6V3Dt2ABxb+G2Cz0CZhVT4nkuz1yu+G8sKagw5BohJnfITT LTYvWOy1Mxa2uivAtsrCF1e0021QJOVzZd9gSRHEDybs/7I9iMmti3OlQNGWT+jpgAxjvc /IVU74tEbIayPeKLQ22WSPwP+lUsgjJpR44YRVs4PQtrdyjsf7hk31rHk3SaYrk1vh2/Bw 09dwfmzucDFM/N7L9YI58ZAy3GKrt3fq/heUz700op6V1e7pyEKlp3n/pn7qezYqP1LhPT OkhBo2IBIueYRFEs/3Dem596YIQYepVOwEoCpkuPzRPj+U00QtwPAdIWcxfFTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vU2yUHa+ePCct8czLydXqH1SU6DKVil0MNCdMDRfLQs=; b=cpH4bFlwyr6iLqvSSwKf8+C+WdrRJgx02xxbzxLCZCVxPyWbevWj23/9YjFJBga08vBZGB /0RqI+za1Vy5GKnyPonC5WNOyXbsPd4Z/zMQyPYJVXG63Oq0p+0sY95kwVX6wkac6VenoC clUKJgBdnMLctI9X1iYS0PfbwWIjep9h8OjmPmzSQYUjimHfpQLKE+KX8zb+x7o21oRb3R 1I1+eeX8ypL/eMzccNKUpjsseMVzcZZC0WPhBOyu5Aw9rhf+HH/2KoAMEPZ4Y0PmShxYBQ VzEc9nOBN4moo0zru8D/PaDhiNFL6Ie1LwlCwUiBFQs6Rr01tCeqefrdTxRoZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653256; a=rsa-sha256; cv=none; b=Y7HLREFMjosBdweJSEIBeFoJcHdzizAGl66tgki+cPIod1CQcqIiqMFu+rJ3p1UYPP6lP4 PhcQ4UlJgo74XKbmWRHV8FktX0WP08iAudFWZWwDx8f/bxEjcDNDrYtP6cocgzffUBmwAo VgEpbn2mFRe1UqOxfTNbDKFzAihjV3o8XGdSitc0/No9jye6X7nlNvvqNGNihXKK8XfueT PMQ5c8dQnRseOzRJML1V5Cf3S++rq1sBEXY0E66mWuJUdLWQf3HXLYhhiBJL3rH4foglvq +5zNV2cA4WkMvQExcHP8TjlUhiYmCIxKXoh8LSA5FjjxDUHYL5Dirla58jeddA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dm2QkNzp0v; Thu, 23 Jan 2025 17:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRaMQ022738; Thu, 23 Jan 2025 17:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRabp022734; Thu, 23 Jan 2025 17:27:36 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:36 GMT Message-Id: <202501231727.50NHRabp022734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c508841dfc59 - main - scmi: Add scmi_token_reserve helper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c508841dfc5923ef81ed8ea61da364fb20616bbf Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c508841dfc5923ef81ed8ea61da364fb20616bbf commit c508841dfc5923ef81ed8ea61da364fb20616bbf Author: Cristian Marussi AuthorDate: 2025-01-23 13:24:06 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Add scmi_token_reserve helper During normal operation, the SCMI stack, upon each transmission attempt, takes care to automatically pick an appropriate, monotonically increasing, sequence number to fill-in the token field in the egressing message. This does not cope well with the alternative scenario in which, instead, a complete and fully formed message is provided upfront: in such a case the SCMI stack will have to use the already provided sequence number, embedded in the message, to track such transaction. Add a method to attempt to reserve a specific sequence number to be used when a fully firmed (raw) message is handled. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://reviews.freebsd.org/D47424 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 48 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 8104f4e10429..c24768a5668a 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -93,6 +93,7 @@ struct scmi_req { bool timed_out; bool use_polling; bool done; + bool is_raw; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -139,6 +140,7 @@ static void scmi_req_free_unlocked(struct scmi_softc *, static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); +static int scmi_token_reserve(struct scmi_softc *, uint16_t); static void scmi_token_release_unlocked(struct scmi_softc *, int); static int scmi_req_track_inflight(struct scmi_softc *, struct scmi_req *); @@ -376,6 +378,7 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, mtx_lock_spin(&rp->mtx); req->timed_out = false; req->done = false; + req->is_raw = false; refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); @@ -424,7 +427,6 @@ scmi_token_pick(struct scmi_softc *sc) */ next_msg_id = sc->trs->next_id++ & SCMI_HDR_TOKEN_BF; token = BIT_FFS_AT(SCMI_MAX_TOKEN, &sc->trs->avail_tokens, next_msg_id); - /* TODO Account for wrap-arounds and holes */ if (token != 0) BIT_CLR(SCMI_MAX_TOKEN, token - 1, &sc->trs->avail_tokens); mtx_unlock_spin(&sc->trs->mtx); @@ -440,6 +442,28 @@ scmi_token_pick(struct scmi_softc *sc) return ((int)(token - 1)); } +static int +scmi_token_reserve(struct scmi_softc *sc, uint16_t candidate) +{ + int token = -EBUSY, retries = 3; + + do { + mtx_lock_spin(&sc->trs->mtx); + if (BIT_ISSET(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens)) { + BIT_CLR(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens); + token = candidate; + sc->trs->next_id++; + } + mtx_unlock_spin(&sc->trs->mtx); + if (token == candidate || retries-- == 0) + break; + + pause("scmi_tk_reserve", hz); + } while (1); + + return (token); +} + static void scmi_token_release_unlocked(struct scmi_softc *sc, int token) { @@ -450,19 +474,23 @@ scmi_token_release_unlocked(struct scmi_softc *sc, int token) static int scmi_finalize_req(struct scmi_softc *sc, struct scmi_req *req) { - uint32_t header = 0; + if (!req->is_raw) + req->token = scmi_token_pick(sc); + else + req->token = scmi_token_reserve(sc, SCMI_MSG_TOKEN(req->msg.hdr)); - req->token = scmi_token_pick(sc); if (req->token < 0) return (EBUSY); - header = req->message_id; - header |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; - header |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; - header |= req->token << SCMI_HDR_TOKEN_S; + if (!req->is_raw) { + req->msg.hdr = req->message_id; + req->msg.hdr |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; + req->msg.hdr |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; + req->msg.hdr |= req->token << SCMI_HDR_TOKEN_S; + } - req->header = htole32(header); - req->msg.hdr = htole32(header); + /* Save requested header */ + req->header = req->msg.hdr; return (0); } @@ -670,6 +698,8 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) if (req == NULL) return (NULL); + req->is_raw = true; + return (&req->msg); } From nobody Thu Jan 23 17:27:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Dp0CW8z5lD8M; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dn3qj4z43rT; Thu, 23 Jan 2025 17:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgTYKRlP/iQGQ321pODW58ZjoTzn0OHIPldmToSqKiE=; b=NkO/nvXgcO8UdqwXD4ipAJuUrftDHcZ8RRTPKxJ5050D5cY4VZIOTFNdDhFmEUlbSWH0YS tujyK7VpP7Rwva6IlY4hvCpsSJgD4sKar9wrwFLis4LBgRMkTBIdVq92f2/zZK0xCx5Euo Dq4Z8SJRtANYbMj5QpVz3UtPdE9h82DWr3DrktEOkgT8O2SY+ZPhEFAZx2LsB2Qumf6P+3 foDn+T+XuM6Lh2+UCexxDhL0QcHAFWb2/jkHpUoR+u17pMN2oC1hNXlxdeEUShtwW/0JlC LBs2GGyqXyG745wQk/y/WsFcwYGa22qKBZqoWsxG/g5IjDcpu1KDRWlRNVKh3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UgTYKRlP/iQGQ321pODW58ZjoTzn0OHIPldmToSqKiE=; b=Nki0u9xoWFOwJ+nwUAsHdEJTIj6JzuAk9J0w2Ba11J1IQVlLOscsQPpNjcM1yzo9HFG12e GyJa+Zrxv7AzrETSH4twBmM2IfwfKFNEMJLkXZwq0+nnhNg+BtMUtCsiHuWvmIDUsXlfyy qDpyiJ3RJ20LXJLsGTsKBK0MXFx+0bD9Fqnuu1YpE8Ye/hHkBWN7ojVvDxk56I+XMpUJPZ 5Loue5yPN4QEzMt690SeD8Hj1BZ1V3sovPkezDNKaRuml9jr3LQYubvDFPJZqoHXza7u3U 0lMX2u1dtudfm9fC7gYgSOjFzUcOKUVGtSHI0Ihv3gm59XtXCen0L+MRI26/5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653257; a=rsa-sha256; cv=none; b=GfSxDiFWv0xfYM+cOl/ZTDRzdRo741Xiqv4wLsNLodtnifPE4MLrcFBLx0K73lGn2rkKyb AjcGBwIXDZ5IOaw/gIRu4bbxavouyTcwt/VNW8wVBDhvbArnQ6uNtebOG1tBt+tK0DyV4E ufwW0r0lPj1BmQ/eCAtMMfEYFoF+9b50NToHGyB8b6NOoKQ/BE5ee0YdIcxGMu4O+5OK2E Mu6Sfs+bn5W2DLxjJMSahezh4FcKmczUfzumJZKbDMJhnts06zLsy6BCYXJBEDbNu2Tgqu KPREGkomJJUu+ddYwr1nyCx7VpkaZTFVC89T6i2fU5cBj0kn+tnPa1YuiaaQlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dn36v1zpF7; Thu, 23 Jan 2025 17:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRbuw022778; Thu, 23 Jan 2025 17:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHRbMs022775; Thu, 23 Jan 2025 17:27:37 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:37 GMT Message-Id: <202501231727.50NHRbMs022775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 341d8fd90fa0 - main - scmi: Refactor scmi_request internal logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 341d8fd90fa084d074059051478657cb45e53402 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=341d8fd90fa084d074059051478657cb45e53402 commit 341d8fd90fa084d074059051478657cb45e53402 Author: Cristian Marussi AuthorDate: 2025-01-23 13:24:39 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Refactor scmi_request internal logic Split scmi_request internals into a TX and an RX phase, which will be called, anyway, in sequence as before when a normal transmission is requested. No functional change. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47425 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 24 ++++++++++++++++++++++-- sys/dev/firmware/arm/scmi.h | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index c24768a5668a..950bbf94eeb6 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -717,7 +717,7 @@ scmi_msg_put(device_t dev, struct scmi_msg *msg) } int -scmi_request(device_t dev, void *in, void **out) +scmi_request_tx(device_t dev, void *in) { struct scmi_softc *sc; struct scmi_req *req; @@ -732,8 +732,11 @@ scmi_request(device_t dev, void *in, void **out) /* Set inflight and send using transport specific method - refc-2 */ error = scmi_req_track_inflight(sc, req); - if (error != 0) + if (error != 0) { + device_printf(dev, "Failed to build req with HDR |%0X|\n", + req->msg.hdr); return (error); + } error = SCMI_XFER_MSG(sc->dev, &req->msg); if (error != 0) { @@ -741,5 +744,22 @@ scmi_request(device_t dev, void *in, void **out) return (error); } + return (0); +} + +int +scmi_request(device_t dev, void *in, void **out) +{ + struct scmi_softc *sc; + struct scmi_req *req; + int error; + + error = scmi_request_tx(dev, in); + if (error != 0) + return (error); + + sc = device_get_softc(dev); + req = buf_to_req(in); + return (scmi_wait_for_response(sc, req, out)); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f6aa072caeca..f5b4173272bb 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -83,6 +83,7 @@ void scmi_buf_put(device_t dev, void *buf); struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); +int scmi_request_tx(device_t dev, void *in); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Thu Jan 23 17:27:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Ds4m7fz5lDdj; Thu, 23 Jan 2025 17:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dr68wsz43q8; Thu, 23 Jan 2025 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aTYW/xXnXvQdivFvuLSA2blY2v/SttrFeXYsICg0cI=; b=pQSjMLhW5S599CUAzijCz7Z889fk/llBVCiCTSQZrJE3MU6wBFvDOD3OlairrudEMGjSTw WhhukP4cj4uj6Pd4phqr/GvMaqLnPUWES0Ys24LXlH0Geoq+8bFVYj3o0XxT2l4WiXCldH +JpI4oS+u78+5an9iTvat6DnuCRZ1pZiMQZ2RCOcXLcme1H9YQZtf5NChHhlcjrYxI0b8w e6mE63K3CbuXS/iYC6cZN/g2/ytx2A34tbh6b6qkI21XbR2Y7l4boPxepUfGa2alzKSRlh aWzyOL2zsKWHoBwJsO2sMpvL7lTacQlNkujNHpPCGQxg4QFMulDMKwSwDcsccA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aTYW/xXnXvQdivFvuLSA2blY2v/SttrFeXYsICg0cI=; b=NBXCL0k2mbeji2r9nNO0oBvldpwEG5vgfsdyR+9vTYW+a3Y56ySvVuTDU2LsPeyZVqR9WF enDKxLQs0R/RRPxKwjXDPshx5uP+F+beYXW+2J4AdG/zmLJtLUBYFFcLEuKpdyUIyuR4Xw Qx+/joA6xiPKhZhfYDESbKvBesAOA5qwuvKn0GIPPKOwm8UmWzNcsWMQdgGvamsjq9aiP/ +BjZG3y38HiArm7Jct0A3e7nLO0ui2B39bin3uxitxmdnvV8X0woby9W3//vcsNk5/1DU/ AQoQHHEdEk7JQtc1FLiAEcM2d8KJcAHbV3Ye/AFYdE6acWUKKagWYjkcrBEmCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653260; a=rsa-sha256; cv=none; b=Bsv3SN8xUuWjK47yy7kcMmREWc9l5uwUCfCfBgkkvvIoku2P65ooKwIcj/2ap6HjdDnsln hAJBXHoiDotBrGHO8L8hBzFlOMciid5HuvKRsTMebzT8OL9ddGjod8v0XGUB/0hkvdanje SZgelopJrOO9PYSFHSG/O58iE70MDIYJDj6hCDflY+lmklCJg39oUrUzTEwRlBFwZI/32r mmXDKoXAGRlRmi2hE7meHIr0OS5lvjAuSrBwx7gaUe03OkXjAomVVGaqGXTN+Nujw/0tQN 1wO05/AK5JGGPP2tdO9sL5z9TOF4uvqPiJF7UB54b9w/TgKqQDgIxe3ylYbSHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dr5jsdzpBK; Thu, 23 Jan 2025 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRes9022882; Thu, 23 Jan 2025 17:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHReAD022879; Thu, 23 Jan 2025 17:27:40 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:40 GMT Message-Id: <202501231727.50NHReAD022879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e6d0edd2fe8c - main - scmi: Add sysctl transport properties List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 commit e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 Author: Cristian Marussi AuthorDate: 2025-01-23 13:27:08 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Add sysctl transport properties Expose as read-only the configured transport properties. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47428 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 13 +++++++++++++ sys/dev/firmware/arm/scmi.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 2d9f6fa89d4b..b27f7211201e 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -189,6 +190,7 @@ static void scmi_process_response(struct scmi_softc *, uint32_t, int scmi_attach(device_t dev) { + struct sysctl_oid *sysctl_trans; struct scmi_softc *sc; phandle_t node; int error; @@ -209,6 +211,17 @@ scmi_attach(device_t dev) device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); + sc->sysctl_root = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw), + OID_AUTO, "scmi", CTLFLAG_RD, 0, "SCMI root"); + sysctl_trans = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(sc->sysctl_root), + OID_AUTO, "transport", CTLFLAG_RD, 0, "SCMI Transport properties"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg", + CTLFLAG_RD, &sc->trs_desc.max_msg, 0, "SCMI Max number of inflight messages"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg_size", + CTLFLAG_RD, &sc->trs_desc.max_payld_sz, 0, "SCMI Max message payload size"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_rx_timeout_ms", + CTLFLAG_RD, &sc->trs_desc.reply_timo_ms, 0, "SCMI Max message RX timeout ms"); + /* * Allow devices to identify. */ diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 990759237964..fc52732bd503 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -32,6 +32,8 @@ #ifndef _ARM64_SCMI_SCMI_H_ #define _ARM64_SCMI_SCMI_H_ +#include + #include "scmi_if.h" #define SCMI_DEF_MAX_MSG 32 @@ -64,6 +66,7 @@ struct scmi_softc { struct mtx mtx; struct scmi_transport_desc trs_desc; struct scmi_transport *trs; + struct sysctl_oid *sysctl_root; }; struct scmi_msg { From nobody Thu Jan 23 17:38:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7TW3NNSz5lFWr; Thu, 23 Jan 2025 17:38:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7TW1Zhfz4DWW; Thu, 23 Jan 2025 17:38:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3ce868498d3so3415265ab.3; Thu, 23 Jan 2025 09:38:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737653918; x=1738258718; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tm9UMgdwZcgqBSsMEEhj0G2tMokKzs+jn5Y+RPjtlvQ=; b=TonihdNU2WvTxIULiO2jnTGckJjD96Ps8oh/wimDvPoGv2ZcuMhuHQdkMEZEzCi8hp NMUSnYcodSfFSL/2ajV6Qbi7MM9Y+2JvlTSC36F6++VskQoQqWr9+Nn+7v8p9n3LEjYW OGUzVkJCrWA33V4A2YXZa8OHiy/aNIndW+06iF7PkSASZySW7p31NyadvpWtbSvQwg9u pco2rK/bpnkmfsF6Hy20lrxSqTzMQdPGlux+f/A7DAsPaKiIZiffalRlNDi187mkvMcE Ko483f4SsAfVib0o0fUTnV9+tV7/cURYwgRT758V+GLHxNQkZdCWPvJCg8ysUglkJN43 SueQ== X-Forwarded-Encrypted: i=1; AJvYcCU+1FNWZFBwtfolgoA1Ef6/1G+a49lr1TqU1FQybxcaS8jYgKPyK2NazDJyqhYHK6PlwgD7AOkqoqz9pAMLIm6mSgWL@freebsd.org, AJvYcCVv3hMsfqJsxNVBppAodr8HTqAMXtWRBaoHbFiivlSn6O+i5Gdk901tDUOsXd8d0tQnGMSC1C209KdVvdKinSzFk735HQM=@freebsd.org X-Gm-Message-State: AOJu0Yx859FtT4anREt7iBSVMnQLsMT/4BjksxsJpxgKhkyeIjcEVlJ9 +8en5ICj5gOmVKkAyAg5y68fwrjQ+wUeG1g5qHhbmfbO1TZpr+0YyWRxJ8ugX/3Ja6u/Qa0Sz5I BsVayHWAPSC9BO3ljmB+O5iVg643ZCg== X-Gm-Gg: ASbGncv4qqIMv4YP4+AajdJC8pHuaurOvxil9kfjkutoEJ2SPyWB/7lLmn50urgt+kc 0z4MOjftW4PXee4VMsFHKHuvNIWwrEbhfNC56MljgLXjD0SjygPkR8roE+MVmCpz/50VieP9+7H 2hqTZG+dPG2iRKWyF1p8ZO X-Google-Smtp-Source: AGHT+IGUM8cIp7hcEIDmjPWkh4md6PVvJoYboZYdE1UcgHwbsi7o8ojyAJTDA2MyKiNE+/KmKuANq8gOdJiZhHqosAg= X-Received: by 2002:a05:6e02:8d:b0:3cf:b9d3:95a7 with SMTP id e9e14a558f8ab-3cfb9d39641mr60480295ab.18.1737653917696; Thu, 23 Jan 2025 09:38:37 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202501231632.50NGWgHd026140@gitrepo.freebsd.org> In-Reply-To: <202501231632.50NGWgHd026140@gitrepo.freebsd.org> From: Ed Maste Date: Thu, 23 Jan 2025 12:38:26 -0500 X-Gm-Features: AbW1kvan0J1Och1D0qQBj-jfVOifMAdUWJFT02gekzGKJBy0pKDnuUdKE3dQPy8 Message-ID: Subject: Re: git: 0e4167514fe3 - main - development.7: Add example for just kernel modules To: Alexander Ziaee Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Yf7TW1Zhfz4DWW X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Thu, 23 Jan 2025 at 11:32, Alexander Ziaee wrote: > > The branch main has been updated by ziaee: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0e4167514fe3894b288457f9c1edd8fb3237dfb8 > > commit 0e4167514fe3894b288457f9c1edd8fb3237dfb8 > Author: Alexander Ziaee > AuthorDate: 2025-01-17 22:56:59 +0000 > Commit: Alexander Ziaee > CommitDate: 2025-01-23 16:32:03 +0000 > > development.7: Add example for just kernel modules > ... > +Rebuild and reinstall a single loadable kernel module, in this case > +.Xr sound 4 : > +.Bd -literal -offset indent > +cd src/sys/modules/sound > +make all install clean cleandepend KMODDIR=/boot/kernel It's great to have an example like this on this page, thank you. There's one issue with sound(4) as the example though, in that sound is included in the kernel already; in the context of a standard kernel configuration the sound module serves no purpose. Perhaps we should have example of configuring a custom kernel (which can be without sound support) as well? From nobody Thu Jan 23 18:12:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf8Dg4k2Dz5lHbF; Thu, 23 Jan 2025 18:12: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8Dg3yj1z4HHq; Thu, 23 Jan 2025 18:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737655955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khrQsYvGDV3BHqASDPHBud+jmT5UxwSY7l5ZJeEAcCM=; b=dhoK2TqV4felR1C3Tpg6FAzvRpzeN6qbzDUhLITzSYC+8ms7PZOTyfyMzNqTa+iniAAqmg /mdAAJys/4w1nMZI2bu5Nu0J76GKgZa2L+JAdw03TscC23NDYc4jQHH6iRQK7Xjy7h8xsD tqeOHVAudcjo4Rk9gYt3Udpx/ZQx2/IZDYKA2yRzgi0mqw/9R36zaTwKLv5vOGe+dsKySC p/DjNE9leohFqvQcVi2NV2Q6Dc2KnSwr5DEIkgK2ANpdTGf1vYVp02IEUOH0kC4IzD6KZZ jIvXXfYBgBWS+ojjehj4FwQHTdGFw3+sAItNfhdDeU70Ej3AqjzXLwgtTfgiSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737655955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khrQsYvGDV3BHqASDPHBud+jmT5UxwSY7l5ZJeEAcCM=; b=QwuKvTYdkkomeU9SqMdluu08i+mPSnRwkrNZYQnArg1n8IhNXcCinnEuRfYlNGWH5tRw1I vuk4HpfMXbtqnKispz/CUJxAyttTjEjl89k3EGntEMYxKidCgntXqDqDEIsTxmWWpxmWLe eyNYkQXkVUwJK8rxa40C8oshxoHJuJT2pCRcGFRt3ZygUaYXldV0B177YqkZX5RHP4HmAc X+ELzjORxVe9GATaEYjocZ6iA+JEW0llQ7T17gd7bqcf3eMzQF45cvzXOwixOmOkOpuO3G tMGFC0WwhnrKFGC4fU+5RB+Zsa64GOj7wtA2ZbMjW5gznveBAY+IH/FbENPXww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737655955; a=rsa-sha256; cv=none; b=PKv1s7zhCaQjslnUIamrh9DdYmCMBbLGH6lqAAA7XPhKyWyAI+PvBY/66YD5SayjrFWa+u DGPtdTOd1bNHotgy8IpcN671yPTkvR1hO/wtEMD2HLiysibwM1spckuS5DjjJOUAoP+13k eiR9StlY3Q/3fl2HU0G/+wEstFAp9LOvgHLv0szUQoXQgB416Ra5yCrYoKxjg3kcXbts5t DQ26a8Vny6cmde+3ytOh3ejC3Bjpnv67+sdgcV9P+rekBQYHRGubD0HSL8YXWjlrdYAdA5 0PKa1RPpckhMk572usYAg7VPml5QnJbzdX9N0d/UJqoeQTh08PwPqvvDZDAc9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf8Dg3Wv1zqYF; Thu, 23 Jan 2025 18:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NICZ82014878; Thu, 23 Jan 2025 18:12:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NICZuA014875; Thu, 23 Jan 2025 18:12:35 GMT (envelope-from git) Date: Thu, 23 Jan 2025 18:12:35 GMT Message-Id: <202501231812.50NICZuA014875@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: cda74c35cb37 - main - firewire: Add deprecation notice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: cda74c35cb37aa8ecb536aae8d93451eafec15df Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=cda74c35cb37aa8ecb536aae8d93451eafec15df commit cda74c35cb37aa8ecb536aae8d93451eafec15df Author: Ed Maste AuthorDate: 2025-01-22 20:51:45 +0000 Commit: Ed Maste CommitDate: 2025-01-23 18:12:27 +0000 firewire: Add deprecation notice This was originally discussed as part of FreeBSD 15 planning, but did not happen in time. Add the deprecation notice now, with an expectation that it will be removed before FreeBSD 16. Reviewed by: brooks, imp Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48598 --- share/man/man4/firewire.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/firewire.4 b/share/man/man4/firewire.4 index 8c4b65eb25bb..99aadb308fc3 100644 --- a/share/man/man4/firewire.4 +++ b/share/man/man4/firewire.4 @@ -29,7 +29,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 6, 2022 +.Dd January 23, 2025 .Dt FIREWIRE 4 .Os .Sh NAME @@ -49,6 +49,11 @@ module at boot time, place the following line in .Bd -literal -offset indent firewire_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed prior to +.Fx 16.0 . .Sh DESCRIPTION .Fx provides machine-independent bus support and raw drivers for From nobody Thu Jan 23 18:14:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf8HD6sTsz5lHpH; Thu, 23 Jan 2025 18:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8HD63Lfz4Hqr; Thu, 23 Jan 2025 18:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qyhWJCbQzc6vPLs/UENKjVCDSy970XZTIVyaaKksxfQ=; b=cZa2PDvhOm4PiFK1hNiDb5pJK6XrMu4LnTNUhbb4q/Q9Tj7eE+6aDtuqo6jOlB0aKG2a+5 hTubR7vZSWFBzkkJID0Jk074x75eQtMWwnUrOg3lg3DuHYdCPmSExshx1YczcLlTapJLJ8 1vvzTPma1tGkRQ4Tsq1ZNIPsCyHAmf9g5KLSOhwaaZm8sMrSyvOJHYyRWeHLCzeaxdGhsg v6yx/cXMR3Jpnto5iwBjxKsyw2ztryfNG8zUqv3VggHBm2Lv8Thv9L+QmqnBEKHMqkOg2X L7/cNvA5B8GTjKWzftts+JAtyIHIV477ElyYt8n036bQ3HLf7w/CHnWOBDps+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qyhWJCbQzc6vPLs/UENKjVCDSy970XZTIVyaaKksxfQ=; b=t/M31t24tiSsIvqtdQvAbNXYhEwdtkUDBR94bfNxu8u7ptKwtzPOxgiugXgxU2P9aaTFCk 9DRasD+adfDgot9bN7Ndurd7qsxxXVPtsDhfk85jHpBt9Mid6r/7oW6H1meVUlFMd2wcgZ 06z6+ucwb5NY0hW4FRah2FKKvXUxeDoNVfnipYn33pebcG3Vyw06+KlKg5XRwYsZ5jgrGB Uh9HDzeFHyvwv03x3JcDdHrJj+UpempXdjkHOq5piYLei0CN/ub11+MgwEwH9lNmfPU1fI psiaFTHWZhFb3FQqhsxDjvr0QuSWt5wF+PBqsjJHVmHMfR7jH0WfmTjVEh5HIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737656088; a=rsa-sha256; cv=none; b=JbhaK0VOd842dCREYgUtk9fqLmgQdIutC/6C6/p0ytAd/mUTb6Xws974xdR++7TxFBSpnm egpAZKruQn7xAIev748Hjm1YqOSmlSLH6hjUxmtlQAfspCTZ9eoA/ALdhUpBt/eSjCbKsP kViFl1UNUxZe8Cc7XXJZIenlCFWxHjsDNp8pbK7tmY41PAH1RlCpXL04Vq0tsxcQi6ogDR dpOq92g796NO6qD1IHB4u+WBpsMU8Hwyre8AmUYqs7KkQpvrRlUsMDRas6gIawP59Gv/vh z1IPl2kLPn17zbbjK5Ypv+7nWafv1f8Y23Z0NQqHvqUS4Jhfb20c8A65Mlh1Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf8HD5XP5zr1X; Thu, 23 Jan 2025 18:14:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NIEm6L015768; Thu, 23 Jan 2025 18:14:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NIEmM7015765; Thu, 23 Jan 2025 18:14:48 GMT (envelope-from git) Date: Thu, 23 Jan 2025 18:14:48 GMT Message-Id: <202501231814.50NIEmM7015765@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: 9dc8d7326d7f - stable/14 - gvinum(8): Fix a typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 commit 9dc8d7326d7fc0f3e15c7b4b11d350e04c0acdb1 Author: Che-Yu Chang AuthorDate: 2023-12-26 16:05:26 +0000 Commit: Ed Maste CommitDate: 2025-01-23 18:14:17 +0000 gvinum(8): Fix a typo On line 354, "go up from" is mistyped as "go up form". Event: Advanced UNIX Programming Course (Fall’23) at NTHU. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/951 (cherry picked from commit 2aa186b3b08bcf6e49b743329b2fa00897a1235f) --- sbin/gvinum/gvinum.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index 4176e6274a37..28e4cd7d76db 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -351,7 +351,7 @@ Then, initiate the rebuild: .Pp .Dl "gvinum start myraid5vol.p0" .Pp -The plex will go up form degraded mode after the rebuild is finished. +The plex will go up from degraded mode after the rebuild is finished. The plex can still be used while the rebuild is in progress, although requests might be delayed. .Pp From nobody Thu Jan 23 18:17:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf8Kp5s1Qz5lHfr; Thu, 23 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8Kp56Q9z4JsV; Thu, 23 Jan 2025 18:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqUjL5cc+VQqgLdPZxnAl4cVESWwWr9k8cBxgtm71HI=; b=e/BUiMdfRhMlXhIrCgKffwMEfjGOKg3UR+lzjOuHZy9ir6D9J9Qb38fOkFEf8kVEqo2VUV aQRdjDn4ogBCuqARF7sJvJeaZEoCTIiMCdmAgE44SFA+bvmbOk30JAoEpq0V+kk4GfdoQU ZY1J7wu7d9ML+L8DoT+Ro6OwZzVoKj5y0FDCwE049k/RE3x9k34nR2G8v5HqvQ/umBOpAL Ggel0VNrb/suX9pMIQmrcKrb7tgBGDG8FyI119i3//0VUpjnRHEQZXvWE3Pkpi2VRwqq0g gKgP0+IyLeru2WXaXbO8kTDORPAsQBpPGEt98vey5qztnrBYXo6FdUeNkjZFKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqUjL5cc+VQqgLdPZxnAl4cVESWwWr9k8cBxgtm71HI=; b=b9Dfg5/ITcBSzzrPuyqk2KWs1xFlPnUmg47m20/jiBdrvi7SR+NsrQpPfhgXV1tcIrB8hA DKsNo5YhGB4se1ADTiWlnBWT93evKcP+VnQ304NCuWHUXVrWnrCatIgB9cRtvSrnQB14mc JnNpWQR1m7thAZoMH4ykE9n9/Eb6/9WoABqn2SaxlC/HApMbFuJMnmX806LKn/jIPFQxzJ ekJUe58vWDUJcgpzzEtPipsEDeAAZGzNif/VPzxzMw9OLloiyLJPH53dnsuMxG2akN49G7 0zNZZCAxqEM+LdTa5VV4ZSxLCLDDScNNya08mBInX+FWyotAKazvyJ5WQXSCig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737656222; a=rsa-sha256; cv=none; b=ufZOichfAfF8Hz5oOu2m1AbB5IyfbmJ57KEh50lFK32qzjnoaRfFUJ2uKTzzUMomQ+yYGj UATNMH+cUITfVZ5vvz0dKwXv1hRU9fPxMaEFrrHP7lEE9OQiJWaqgIVY4gYoPjjc9Ex3C2 YqTJbf5TdNDPOelYkYWgL9xg0gdC8JSDUzfm/3WPjC8IAfPhiPUGO6dBmXc03nqKTxOXRE x8HHSVsFu+TtChxjHplQ+rSzIHI8Neu2xxJsp1x7168KJ1kZtBbj4MAnSM+vKpgHPrSNhP XsPKHpBI0ifGXLl3OTe9vNndd6jfDN4GaqRYRy6iH930FHRdkyLZBNLuSTI/Hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf8Kp4gMczqSG; Thu, 23 Jan 2025 18:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NIH2bb016601; Thu, 23 Jan 2025 18:17:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NIH2nD016598; Thu, 23 Jan 2025 18:17:02 GMT (envelope-from git) Date: Thu, 23 Jan 2025 18:17:02 GMT Message-Id: <202501231817.50NIH2nD016598@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: 27bd6c32bbb4 - main - Remove references to gvinum(8) in various manpages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 27bd6c32bbb49a592a0dfbec5f211a7c2fed31d6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=27bd6c32bbb49a592a0dfbec5f211a7c2fed31d6 commit 27bd6c32bbb49a592a0dfbec5f211a7c2fed31d6 Author: John Baldwin AuthorDate: 2025-01-23 18:16:47 +0000 Commit: John Baldwin CommitDate: 2025-01-23 18:16:47 +0000 Remove references to gvinum(8) in various manpages Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D48540 --- lib/geom/concat/gconcat.8 | 3 +-- lib/geom/mirror/gmirror.8 | 3 +-- lib/geom/raid/graid.8 | 5 ++--- lib/geom/raid3/graid3.8 | 3 +-- lib/geom/stripe/gstripe.8 | 3 +-- sbin/ffsinfo/ffsinfo.8 | 3 +-- sbin/growfs/growfs.8 | 4 +--- sbin/newfs/newfs.8 | 3 +-- share/man/man4/ccd.4 | 3 +-- share/man/man7/tuning.7 | 6 ++---- 10 files changed, 12 insertions(+), 24 deletions(-) diff --git a/lib/geom/concat/gconcat.8 b/lib/geom/concat/gconcat.8 index 55c05b469d4a..165f809ffba8 100644 --- a/lib/geom/concat/gconcat.8 +++ b/lib/geom/concat/gconcat.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 14, 2021 +.Dd January 23, 2025 .Dt GCONCAT 8 .Os .Sh NAME @@ -216,7 +216,6 @@ growfs /dev/concat/data .Xr loader.conf 5 , .Xr geom 8 , .Xr growfs 8 , -.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 , diff --git a/lib/geom/mirror/gmirror.8 b/lib/geom/mirror/gmirror.8 index 0d1bb4566d58..aeffb2d948b1 100644 --- a/lib/geom/mirror/gmirror.8 +++ b/lib/geom/mirror/gmirror.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2022 +.Dd January 23, 2025 .Dt GMIRROR 8 .Os .Sh NAME @@ -436,7 +436,6 @@ there. .Xr geom 4 , .Xr dumpon 8 , .Xr geom 8 , -.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr savecore 8 , diff --git a/lib/geom/raid/graid.8 b/lib/geom/raid/graid.8 index 50c0116ba22e..f722fd5c17bd 100644 --- a/lib/geom/raid/graid.8 +++ b/lib/geom/raid/graid.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 4, 2013 +.Dd January 23, 2025 .Dt GRAID 8 .Os .Sh NAME @@ -307,8 +307,7 @@ Enable taste for specific metadata or transformation module. Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO .Xr geom 4 , -.Xr geom 8 , -.Xr gvinum 8 +.Xr geom 8 .Sh HISTORY The .Nm diff --git a/lib/geom/raid3/graid3.8 b/lib/geom/raid3/graid3.8 index 0e8eebc2bd81..e1bcdac17f99 100644 --- a/lib/geom/raid3/graid3.8 +++ b/lib/geom/raid3/graid3.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 15, 2012 +.Dd January 23, 2025 .Dt GRAID3 8 .Os .Sh NAME @@ -236,7 +236,6 @@ graid3 insert -n 0 data da5 .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , -.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr umount 8 diff --git a/lib/geom/stripe/gstripe.8 b/lib/geom/stripe/gstripe.8 index 0282faf58b6d..6fd486355a2e 100644 --- a/lib/geom/stripe/gstripe.8 +++ b/lib/geom/stripe/gstripe.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2004 +.Dd January 23, 2025 .Dt GSTRIPE 8 .Os .Sh NAME @@ -227,7 +227,6 @@ for .Xr loader.conf 5 , .Xr ccdconfig 8 , .Xr geom 8 , -.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 , diff --git a/sbin/ffsinfo/ffsinfo.8 b/sbin/ffsinfo/ffsinfo.8 index 6daa9a79c9e9..2221b2fb63b6 100644 --- a/sbin/ffsinfo/ffsinfo.8 +++ b/sbin/ffsinfo/ffsinfo.8 @@ -36,7 +36,7 @@ .\" .\" $TSHeader: src/sbin/ffsinfo/ffsinfo.8,v 1.3 2000/12/12 19:30:55 tomsoft Exp $ .\" -.Dd November 19, 2024 +.Dd January 23, 2025 .Dt FFSINFO 8 .Os .Sh NAME @@ -125,7 +125,6 @@ with all available information. .Xr fsck 8 , .Xr gpart 8 , .Xr growfs 8 , -.Xr gvinum 8 , .Xr newfs 8 , .Xr tunefs 8 .Sh HISTORY diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index 9b619613f30e..f23817b0afbe 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -36,7 +36,7 @@ .\" .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" -.Dd October 3, 2023 +.Dd January 23, 2025 .Dt GROWFS 8 .Os .Sh NAME @@ -55,8 +55,6 @@ Before running .Nm the partition or slice containing the file system must be extended using .Xr gpart 8 . -If you are using volumes you must enlarge them by using -.Xr gvinum 8 . The .Nm utility extends the size of the file system on the specified special file. diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index daf568fe6a33..16bca26f7cd8 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 19, 2024 +.Dd January 23, 2025 .Dt NEWFS 8 .Os .Sh NAME @@ -362,7 +362,6 @@ on file systems that contain many small files. .Xr gjournal 8 , .Xr gpart 8 , .Xr growfs 8 , -.Xr gvinum 8 , .Xr makefs 8 , .Xr mount 8 , .Xr newfs_msdos 8 , diff --git a/share/man/man4/ccd.4 b/share/man/man4/ccd.4 index c44013dab11f..9727fb68064f 100644 --- a/share/man/man4/ccd.4 +++ b/share/man/man4/ccd.4 @@ -32,7 +32,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 9, 1995 +.Dd January 23, 2025 .Dt CCD 4 .Os .Sh NAME @@ -277,7 +277,6 @@ device special files .Xr config 8 , .Xr disklabel 8 , .Xr fsck 8 , -.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 .Sh HISTORY diff --git a/share/man/man7/tuning.7 b/share/man/man7/tuning.7 index 8cebfe62bb64..ebba551f65d0 100644 --- a/share/man/man7/tuning.7 +++ b/share/man/man7/tuning.7 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 25, 2024 +.Dd January 23, 2025 .Dt TUNING 7 .Os .Sh NAME @@ -151,8 +151,7 @@ Striping can also improve the performance of a file system by splitting I/O operations across two or more disks. The -.Xr gstripe 8 , -.Xr gvinum 8 , +.Xr gstripe 8 and .Xr ccdconfig 8 utilities may be used to create simple striped file systems. @@ -687,7 +686,6 @@ over services you export from your box (web services, email). .Xr gjournal 8 , .Xr gpart 8 , .Xr gstripe 8 , -.Xr gvinum 8 , .Xr ifconfig 8 , .Xr ipfw 8 , .Xr loader 8 , From nobody Thu Jan 23 18:17:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf8Kr35h0z5lHlh; Thu, 23 Jan 2025 18:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8Kq6f7mz4K1S; Thu, 23 Jan 2025 18:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLiah3FEBzSqVEQzJt3k02vXHqxhOZZr8sYX/rq5/Sc=; b=QJThNzfNWOlnbi/ZyzfL3DoqckWLZDuGI1yLNiaiiuxRI9IwxePaC/AhfBp1yZrPKDNzL5 NkQ0TLY5HLVPYLcNh3kgVFsavYPld9G81aH+LDVIljgj7aDLw9McYylNYApNKo2qAKz1k7 9ciUbypy1+GDyMNjitchS+1bnB7dlf1P1T+cK1hWmNljvSLS2p2EtgkDS0CiB0CJ6j4br+ wHV7hPesGPK7ILVQnfLQxtIoHScTrPxCCM6iwBfH2z6DtP3hJtcK2y2L8hlfKDhJ0OXrEu TegvgJU52oHE0CalRpltJPo6a1Yplc1p47TmedFAncxv3Ml7UA+IkKeC0LOmTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737656223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VLiah3FEBzSqVEQzJt3k02vXHqxhOZZr8sYX/rq5/Sc=; b=mvNacNRiKFipKVaAVBNS25ZYF4JbGNsETY+QAHQxBJFMC9+jGQ6NZzfj6Dn7KwT4hm5ftN QvaP80CjQjqkx1wM4hUL7aZZ9CuEQq7nTEoFEZkLrptpzsGHgq7tqnH0LdJ0ZO0RrdaZZB hDaf9MPeux7FLESgMGoubEsfYRaP+ZLETpQg26zpH7y/dFWtqFn6QUUUF1Fe7O7E3GBVXQ 3LbbPoZU8aA9vSpZsgNpuaoUTcZ62s2BX244vhi0AlUicCXbeoU2aeWl0x1O11ldZ08DC8 7xzFbXSeWSIMHsySKCUCY+u0zltI+XLqU/tm0kH3J0FsOCOK+DBEmsS/3mnknA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737656223; a=rsa-sha256; cv=none; b=acl6qHmvYmFr2tWaVS20Zjqj55R7QW632DzSbihH8CXk+u3w4Lq9Tlj0UHmUkODb3FYCqd oX+03jwfkI0hfbwjva9xxuiDhveM+6UuY8oZHDsr0F7LH34xqtJDzWYwmV+QUH4ia97T+o KfLnAhey84iWoq7eMFyYtDUOpFWnZDK5jgOc2wk0glpbB7o0uqXpoG3KX68rBQ566+QrQe gxDb0rtgrtlxRSH+P0TZUj+WIfKNs9Y76mANJlqyaWqlw1b5EYElO7ThU1cZwVT0tPGn1o FAzaurP8vbK3O4MFDCX+ON31wVmjcF0bjGYkED/rDGhcGnqIFcnike6NbGsnbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf8Kq5bY1zqHH; Thu, 23 Jan 2025 18:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NIH36v016638; Thu, 23 Jan 2025 18:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NIH3nJ016635; Thu, 23 Jan 2025 18:17:03 GMT (envelope-from git) Date: Thu, 23 Jan 2025 18:17:03 GMT Message-Id: <202501231817.50NIH3nJ016635@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: a9ffa9b3d4d0 - main - RELNOTES: Document removal of vinum support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: a9ffa9b3d4d00230a472148c5df7a37c927150cf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a9ffa9b3d4d00230a472148c5df7a37c927150cf commit a9ffa9b3d4d00230a472148c5df7a37c927150cf Author: John Baldwin AuthorDate: 2025-01-23 18:16:55 +0000 Commit: John Baldwin CommitDate: 2025-01-23 18:16:55 +0000 RELNOTES: Document removal of vinum support Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48644 --- RELNOTES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELNOTES b/RELNOTES index 515966f8ea08..12f5c20cf4d0 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +f87bb5967670, e51036fbf3f8: + Support for vinum volumes has been removed. + 8ae6247aa966, cf0ede720391d, 205659c43d87bd, 1ccbdf561f417, 4db1b113b151: The layout of NFS file handles for the tarfs, tmpfs, cd9660, and ext2fs file systems has changed. An NFS server that exports any of these file From nobody Thu Jan 23 18:45:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf8yg4w0qz5lKSH; Thu, 23 Jan 2025 18:45:31 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [IPv6:2a0c:5a00:149::26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf8yg2ZHlz4N8x; Thu, 23 Jan 2025 18:45:31 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1tb2Cl-007Itk-Mo; Thu, 23 Jan 2025 19:45:27 +0100 Received: from [10.9.9.129] (helo=rmmprod07.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1tb2Cl-00060b-5s; Thu, 23 Jan 2025 19:45:27 +0100 Received: from mail by rmmprod07.runbox with local (Exim 4.86_2) (envelope-from ) id 1tb2Cl-0004B8-4R; Thu, 23 Jan 2025 19:45:27 +0100 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Received: from [Authenticated alias (960477)] by runbox.com with http (RMM6); Thu, 23 Jan 2025 18:45:27 GMT From: "Alexander Ziaee" To: "Ed Maste" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" Subject: Re: git: 0e4167514fe3 - main - development.7: Add example for just kernel modules Date: Thu, 23 Jan 2025 18:45:27 +0000 (UTC) X-RMM-Aliasid: 960477 X-Mailer: RMM6 In-Reply-To: Message-Id: X-Rspamd-Queue-Id: 4Yf8yg2ZHlz4N8x X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:50304, ipnet:2a0c:5a00::/29, country:NO] On 2025-01-23 12:38 -05:00 EST, "Ed Maste" wrote: > On Thu, 23 Jan 2025 at 11:32, Alexander Ziaee wrote: >> >> The branch main has been updated by ziaee: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D0e4167514fe3894b288457f9c= 1edd8fb3237dfb8 >> >> commit 0e4167514fe3894b288457f9c1edd8fb3237dfb8 >> Author: Alexander Ziaee >> AuthorDate: 2025-01-17 22:56:59 +0000 >> Commit: Alexander Ziaee >> CommitDate: 2025-01-23 16:32:03 +0000 >> >> development.7: Add example for just kernel modules >> > ... >> +Rebuild and reinstall a single loadable kernel module, in this case >> +.Xr sound 4 : >> +.Bd -literal -offset indent >> +cd src/sys/modules/sound >> +make all install clean cleandepend KMODDIR=3D/boot/kernel >=20 > It's great to have an example like this on this page, thank you. > There's one issue with sound(4) as the example though, in that sound > is included in the kernel already; in the context of a standard kernel > configuration the sound module serves no purpose. Perhaps we should > have example of configuring a custom kernel (which can be without > sound support) as well? That would be wonderful! I'll draw that up and tag you for review. I wonder if that's why the patches I was testing didn't change anything? May I forward this to christos? Thanks, Alex= From nobody Thu Jan 23 19:04:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf9NR56wxz5lLLF; Thu, 23 Jan 2025 19:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf9NR4TdHz4PCQ; Thu, 23 Jan 2025 19:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WPCdrGD65jaFaBUAq55VOGBvj5iC1srI/68faIzLQeM=; b=l+jIoBZfLXecgO96caXvh0fChDbp1KnPL5E+XvoiY74pm9fwWLzkda9ysxd9VJ80pt36XX FSq675k2VqiDijunv2pHDe5ehntFomc/gD8LmLKRrmKS0mKobRfHYFpE5Leh+RPkx2iHwy ZSy0c0R3y3wkW9N5gTyomubIHQedSU5fB9CewWEE7zg+ZG/dhsHb2T9OzU5vBiDmpvLB2k jEKtX0QkDDYPARpAN2tVuQeSlFcRIWHEhpJLLpdgqQ4qvwakp/Q5TH/TGI2dD5NBQWFm4Z /aXlXAiEITuP09b6dbR3aDnuJ2Qy3FdBQ/Fzn+dMs3DDNKMtWo9XN64r5EtqSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WPCdrGD65jaFaBUAq55VOGBvj5iC1srI/68faIzLQeM=; b=Yrvft9JSPox3TMstqzlF6auUiFsYvnvag9wJzzB4zeZRRwYKZrEmlVCZKe9RCMJ426g7Q8 xQy3WP/cWYRtpJAzayOz74hmEdLnviCahW8bVsXmj2pGoRVOBbsq3wLGP9Q5jVpj7SAqe4 aZeknzusWJetvcuE2iQ0rwKpN5NoRj/vA0q9+rZksLHzGKss8nIrq0ZdbE68sKvycSBPj9 w7kxuv0DOvZOUfv7wTlTvQ/1Vj7raLhQswnAy1RhNbGnls7C4291aVA3+B2S7GCjAg6lh0 XgYHc3YnvSFI1FjpX7Z/HsfWFmX73YHEeWCUfiFLNyXJtPDu7WzwUcKbc66B1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737659063; a=rsa-sha256; cv=none; b=Se+bHMhoJ9TlxuZQr3YE9qz1ZsgGD9lrTO7hBF7CfB86n/8+4N2LelOkaNMgWz1j0Uv0TA 1MIpYsPoJml+CuCArsO8Vdkwy6gJxNo/Jlx4e+lHsZ9hq65Ht2YNypXZUhIDBIdH2YAVp/ fAfGOxKBTcmDzPqiFtN4VJ22gCeG1qAZS1Qz0qP46V7gFNXjT8OWh6UmOkLpqI/SnuRkna wOlOceqjlUFPtF1G3CJEGQvp3wI5bQisj1nEiXQ3K/FBr9ueK1mbs/vA+HR3AyfAFvUDau ZwQaXSwKrVQudADOD0sm4z++/nXOdNzyRgsYtzDF7q/Kzj3z1QmvUP2qKFh9LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf9NR3rPbzsJs; Thu, 23 Jan 2025 19:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NJ4Ntt009992; Thu, 23 Jan 2025 19:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NJ4NIk009989; Thu, 23 Jan 2025 19:04:23 GMT (envelope-from git) Date: Thu, 23 Jan 2025 19:04:23 GMT Message-Id: <202501231904.50NJ4NIk009989@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: ce52baebd3b3 - main - icmp6: Fix ICMP6 message type counters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ce52baebd3b37044e8a8e3f64ea4bc64d52c0a52 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ce52baebd3b37044e8a8e3f64ea4bc64d52c0a52 commit ce52baebd3b37044e8a8e3f64ea4bc64d52c0a52 Author: Mark Johnston AuthorDate: 2025-01-23 19:03:25 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 19:03:25 +0000 icmp6: Fix ICMP6 message type counters Previously this macro would always increment the first counter in the histogram array. PR: 279975 Fixes: 60d8dbbef075 ("netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters") Sponsored by: Klara, Inc. --- sys/netinet/icmp6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h index 9de8daaa3390..7845b682f3e4 100644 --- a/sys/netinet/icmp6.h +++ b/sys/netinet/icmp6.h @@ -652,7 +652,7 @@ VNET_PCPUSTAT_DECLARE(struct icmp6stat, icmp6stat); #define ICMP6STAT_INC2(name, type) \ do { \ MIB_SDT_PROBE2(icmp6, count, name, 1, type); \ - VNET_PCPUSTAT_ADD(struct icmp6stat, icmp6stat, name, 1); \ + VNET_PCPUSTAT_ADD(struct icmp6stat, icmp6stat, name[type], 1); \ } while (0) /* From nobody Thu Jan 23 19:04:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf9NS6DP1z5lLYZ; Thu, 23 Jan 2025 19:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf9NS4xZwz4PCR; Thu, 23 Jan 2025 19:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mObXD3L6D5xm94hkRtjjQI769hJMmFM3lAnws7qtNJE=; b=GtqXvU4D6DJCzF6JF8U3eofQEsnffnIhRXCoPEeOTV3qAbShFRnjZlQHTiruq5jcjzGJfJ B322AIOzhVkXjLhuSj1YJM/Ovebs/EJGS3BfBh9Aea+WwEq9hFiA4W8Q4nwdz5R+ysZ7Iq VKlBMtHJZIC3i/f40IG91UaqM408ftnnoAJMvPMZaNl/Q1iJBwKQgnO29mAsJbPGmlEXkC pVhKNFvPPnGnMf1jJpAUPj2sPwJsG/MVB2US4U5CDINdQefLZuNKxsSGZnE9n1fx0ChYV7 VIJIvDavOo3W+uRm2qX4Pzq6uMgeooYXFC622i1WnfJtAsCZRSHBy3/mW5Br9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mObXD3L6D5xm94hkRtjjQI769hJMmFM3lAnws7qtNJE=; b=NV/KE2kqPptWJemwAzCv+e1MqruK56Nrui6kJKcJjeXMsONYub4QrstpJLTZrR40sworvq AFyJ3TRTxGD4lwrfUpFPwWEloAvrDzGRewGwtcTB514+qrxXuPh03aVYAs/CNEyd0rmh5p KJ96gNeYAr6aKQK3leMpLNvjyVa7uKPWT4K4eSbHmlv0DPgU6/elgGeeK6kSvU6OmuRbC6 fPMz2dmw8E6mMA5gqTPKaMrcHX/sNMjVL4YFstNdnheSgy0V7/D6rtRxuEh9dRdKbStevB 1GgnJWEV/p34CT2A+Ht0yjp5zi1W8WIE/2olaUmPsykaZjJgvVPwUWYwTolHhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737659064; a=rsa-sha256; cv=none; b=RPSTPU28FVk1VyRlfxvRO08ad27+x4PK1JI6Qm3rcVEn6oNr+cCo4tVZIxdpWgKEoEHXrz vh+ztdry95/jZfJL8aLN0GQ2z8aUPnI4YYeyFUw3tPVO/RxL1aAALln54Rt/CJtkSOMdnx CHEB4dTzPSBV3Ga4yx9O3bVz7AIuzD8hEuX/VIkSi7NvKjS0qSj3VXITTU/wcDlru/kyib DBRuiiQ8Z10bvkGtdjk0oLWk+Nfhc+JApTCEEjZh8Ju6I9YcXri9xXjnz8VMUaaQ8Whzey 5gt96pcO8UtKxiwK7Yoo3K2697hvhUk4RreeRx2ayiruSCohgJEDDy26sUt+Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf9NS4SwNzs4j; Thu, 23 Jan 2025 19:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NJ4OAS010025; Thu, 23 Jan 2025 19:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NJ4OaC010022; Thu, 23 Jan 2025 19:04:24 GMT (envelope-from git) Date: Thu, 23 Jan 2025 19:04:24 GMT Message-Id: <202501231904.50NJ4OaC010022@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: 2f8a6bb08744 - main - divert tests: Stop skipping ipdivert_ip6_output_remote_success List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 2f8a6bb0874490bec20f383edeac4c304913eea2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2f8a6bb0874490bec20f383edeac4c304913eea2 commit 2f8a6bb0874490bec20f383edeac4c304913eea2 Author: Mark Johnston AuthorDate: 2025-01-23 19:03:29 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 19:03:29 +0000 divert tests: Stop skipping ipdivert_ip6_output_remote_success It passes after commit ce52baebd3b3 ("icmp6: Fix ICMP6 message type counters"). PR: 279975 Sponsored by: Klara, Inc. --- tests/sys/netinet6/divert.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/sys/netinet6/divert.sh b/tests/sys/netinet6/divert.sh index 3517c0f1777f..788f539dfe9a 100755 --- a/tests/sys/netinet6/divert.sh +++ b/tests/sys/netinet6/divert.sh @@ -45,11 +45,6 @@ ipdivert_ip6_output_remote_success_head() { } ipdivert_ip6_output_remote_success_body() { - - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/279975" - fi - ids=65530 id=`printf "%x" ${ids}` if [ $$ -gt 65535 ]; then From nobody Thu Jan 23 19:10:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf9W40nMzz5lLs3; Thu, 23 Jan 2025 19:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf9W407gnz4Q96; Thu, 23 Jan 2025 19:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfeSh10JeliURMk1jAIULrO5+QZBgzEhj9MrUCr1bos=; b=ZhTCiO2RYK6L9/DFH5TppMi+ttnURQmkjWR/lv/Z+iOspRhCpJpY/hjReYRQnf+IFLAzNM QVibDhjk4Ducn79uGBcvIo3Q3NkSu2898eOL+ZkakJwmOIXf7ZNAqz7GxoeJ+nL9hne/fB Vx27vjgA4MVpDGwwOLrns27GUww1mroCgc41TPc58aUrU5MxwLUxMA4sCJ9pENgAoDcrag 071lystVoh/0ddQfdLFNGLR2ogQyuv9Esh61MDkgi2TCtTzi6i9QDOx7Ho/un+tHQQXEMi TAGJ50eOOQgtNG/OSme/3s8Op0lpA/oZJ1gI7EaEmd4MC5tpxGwB6eDkVXE9hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OfeSh10JeliURMk1jAIULrO5+QZBgzEhj9MrUCr1bos=; b=SFEgZB/Zc0mgw2oyNfpk3RUXzYJfAfvvZ+KMfQIsAFTSNrlzZ1W8ow1YnEiedz8ZqsXmb2 3Ee2OZZq0EeXYPVv8RrIrWb3DnHn0rFPXG6Ru/Vo3mRmQZkE9TocZDi0lAmw0+YBfpIX/E TgxxQzekeT8CZkyeUjmYWJogDKWI4aHic+gzkRUeH0B3C3+7kqjNj2I+vFdRAV3ph3xcav tdxKOVeVYaHQlpyO2tN0fEhWlc9X6hhr5TvCw5GSDUaDNvdxhSn/sves67ieF9ojjhySl5 9YTtYBE2fW/5Jb4EmGjYSui3zylWwjwQss0hgZyeQ2pix7eDvAwwywLMvPt8jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737659408; a=rsa-sha256; cv=none; b=l9fLkWB6FFAhF2/4fBvzMzzcnbJebuAcdls6qMTFO6VjO2VM057b9s0fHANq47JNQxGQpX yGeVZ1QszNXiesvfkytyPgAapGUhOzL/aBjXpawOAO/647JkRrrId3MU3ySEr+RImGyHBK bj+THvvDhVmLoN+lHmhwoI0Hsp4MA6fx3yRDSbScAvECu5wdVcSbkx0s20nRndUIXNEOwX rtoDXSZECfVkH7ZJ32QsN02V8QAg8OtB3GP29wPm5tLXVYai7OiR+x7Ui0+77HHvKdgRm1 XX3TgBuuv8ljTQdL4HNcryyh047eidv92O7iRWtVQ8hp244jpGw81L9yxoS2Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf9W36jp0zrbX; Thu, 23 Jan 2025 19:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NJA7Ik015174; Thu, 23 Jan 2025 19:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NJA7c0015167; Thu, 23 Jan 2025 19:10:07 GMT (envelope-from git) Date: Thu, 23 Jan 2025 19:10:07 GMT Message-Id: <202501231910.50NJA7c0015167@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: ba9cff7aa2eb - main - dtrace: Use size_t instead of uintptr_t to represent buffer offsets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ba9cff7aa2eb62d84bead503cd606d1586ea8388 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ba9cff7aa2eb62d84bead503cd606d1586ea8388 commit ba9cff7aa2eb62d84bead503cd606d1586ea8388 Author: Mark Johnston AuthorDate: 2025-01-23 19:08:46 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 19:08:46 +0000 dtrace: Use size_t instead of uintptr_t to represent buffer offsets This eases porting of DTrace to CHERI, where uintptr_t and size_t aren't interchangeable. No functional change intended. Reviewed by: Domagoj Stolfa MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D48625 --- .../contrib/opensolaris/uts/common/dtrace/dtrace.c | 19 +++++++++---------- .../contrib/opensolaris/uts/common/sys/dtrace_impl.h | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 5f635cc088d7..608bff1d23ae 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -472,7 +472,7 @@ static kmutex_t dtrace_errlock; #define DT_MASK_LO 0x00000000FFFFFFFFULL #define DTRACE_STORE(type, tomax, offset, what) \ - *((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what); + *((type *)((uintptr_t)(tomax) + (size_t)offset)) = (type)(what); #if !defined(__x86) && !defined(__aarch64__) #define DTRACE_ALIGNCHECK(addr, size, flags) \ @@ -601,7 +601,7 @@ static uint64_t dtrace_helper(int, dtrace_mstate_t *, static dtrace_helpers_t *dtrace_helpers_create(proc_t *); static void dtrace_buffer_drop(dtrace_buffer_t *); static int dtrace_buffer_consumed(dtrace_buffer_t *, hrtime_t when); -static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, +static ssize_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); @@ -2548,7 +2548,7 @@ dtrace_aggregate(dtrace_aggregation_t *agg, dtrace_buffer_t *dbuf, caddr_t tomax, data, kdata; dtrace_actkind_t action; dtrace_action_t *act; - uintptr_t offs; + size_t offs; if (buf == NULL) return; @@ -2843,7 +2843,7 @@ dtrace_speculation_commit(dtrace_state_t *state, processorid_t cpu, dtrace_buffer_t *src, *dest; uintptr_t daddr, saddr, dlimit, slimit; dtrace_speculation_state_t curstate, new = 0; - intptr_t offs; + ssize_t offs; uint64_t timestamp; if (which == 0) @@ -6910,7 +6910,6 @@ dtrace_action_breakpoint(dtrace_ecb_t *ecb) char c[DTRACE_FULLNAMELEN + 80], *str; char *msg = "dtrace: breakpoint action at probe "; char *ecbmsg = " (ecb "; - uintptr_t mask = (0xf << (sizeof (uintptr_t) * NBBY / 4)); uintptr_t val = (uintptr_t)ecb; int shift = (sizeof (uintptr_t) * NBBY) - 4, i = 0; @@ -6951,9 +6950,9 @@ dtrace_action_breakpoint(dtrace_ecb_t *ecb) c[i++] = *ecbmsg++; while (shift >= 0) { - mask = (uintptr_t)0xf << shift; + size_t mask = (size_t)0xf << shift; - if (val >= ((uintptr_t)1 << shift)) + if (val >= ((size_t)1 << shift)) c[i++] = "0123456789abcdef"[(val & mask) >> shift]; shift -= 4; } @@ -8038,7 +8037,7 @@ dtrace_hash_str(const char *p) } static dtrace_hash_t * -dtrace_hash_create(uintptr_t stroffs, uintptr_t nextoffs, uintptr_t prevoffs) +dtrace_hash_create(size_t stroffs, size_t nextoffs, size_t prevoffs) { dtrace_hash_t *hash = kmem_zalloc(sizeof (dtrace_hash_t), KM_SLEEP); @@ -12316,11 +12315,11 @@ dtrace_buffer_drop(dtrace_buffer_t *buf) * mstate. Returns the new offset in the buffer, or a negative value if an * error has occurred. */ -static intptr_t +static ssize_t dtrace_buffer_reserve(dtrace_buffer_t *buf, size_t needed, size_t align, dtrace_state_t *state, dtrace_mstate_t *mstate) { - intptr_t offs = buf->dtb_offset, soffs; + ssize_t offs = buf->dtb_offset, soffs; intptr_t woffs; caddr_t tomax; size_t total; diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index cfb97c71f262..222f8e206da1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -149,9 +149,9 @@ typedef struct dtrace_hash { int dth_size; /* size of hash table */ int dth_mask; /* mask to index into table */ int dth_nbuckets; /* total number of buckets */ - uintptr_t dth_nextoffs; /* offset of next in probe */ - uintptr_t dth_prevoffs; /* offset of prev in probe */ - uintptr_t dth_stroffs; /* offset of str in probe */ + size_t dth_nextoffs; /* offset of next in probe */ + size_t dth_prevoffs; /* offset of prev in probe */ + size_t dth_stroffs; /* offset of str in probe */ } dtrace_hash_t; /* From nobody Thu Jan 23 19:10:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf9W51P4Cz5lLvR; Thu, 23 Jan 2025 19:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf9W50m67z4Q97; Thu, 23 Jan 2025 19:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7BkBZS3w901IwD4ueL2lVLuPYS0oHA5ajdcUQOeQHQ=; b=sRaNLK4hu2nrVdEY1zecX2ZxL8ydYwhgdp6Lqfm5/VwzuiKRyiqXLWmYVa3z5QhqYHJnYb yyUtU7O1h8a7cb6SpSsQfzUyKwKsAjHynpIG0/JrhzJGaUUWro6YiYJhrdtUOraL2J1npa lkTigmVjENDFU+/NgHVqyIGLH2UVMFNTx4mUPnDyH2tocOea33QdIqt/4U+gxD6iEaA86B NBFEZ7roL4+NkZKV+RRVitlMLzybWkUni18KW0ghZPs8viiYj4uizEDctYVngYNn+a0lY1 idqllfjo7t5TqximTNtwIpxLSnKuiBUIs0tyymW/C3hGOV0j0TqGdnoT1OVheA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737659409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7BkBZS3w901IwD4ueL2lVLuPYS0oHA5ajdcUQOeQHQ=; b=yJuYDSWsUQvv3kj0JrwFdrY0tmhNp8YzS2ty0OWjUMusbf4OJ4R5Jznpl/LRYpPPCXWd7q qcXb/4Xx65PnYT4Z4TDB1YB7OvA68rG6OisyNNPG1S2m+3xh4oj+xXoyiwoq/HX79nyUiV l5THfo3hMInPZbmXsWud1m+hQDeRdhVjwue3wf71YKfEQ+ZezNCe2n4pwe6aMnn4rs+sYn 02BxzjA0ZJzU1qiNYRsWhL+mn512Z1p/YiMCq1UiT2RIV2XTohjXNzrGcCvTZKuMTh/NZ4 bc6bNv0KY16rwbZvO9xa/NyMymyvBC6xwYOUlfMMrcj1By5P/pavyPVK+c4cPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737659409; a=rsa-sha256; cv=none; b=xJZATw2+k7gdi5JvVs6aFBDwcM4UpwQsuglKm5lm/wLSueU1Rexr2ULXh8KsTA9zdNZf96 bMwvtquQLTh6twoJyg6GOiq9JrIMmebfVijYJ+xc4rA5GIjiv/706SbUPs+AcxPu00fKqx yavjGIYpLpD5Ws797HO3fZ3+UFeLy3qxLlS08+JU17Xz9WFHgm4HFG0reAA0VLhp33tEpQ 8P8x3nNQ+UWA6XOB5Kjtm7DyyfNs5U4YVXfcvnUQT2Z/9aWIsJ4/ZnnSnRuDgKDHL4TsRZ wo2MwdH+r4QWLwz+viaRnRY2bzY/crETon0pHibu5E16j4d3IDjMrve4UG+xxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf9W50MZ8zsJw; Thu, 23 Jan 2025 19:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NJA8bj015497; Thu, 23 Jan 2025 19:10:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NJA8QG015492; Thu, 23 Jan 2025 19:10:08 GMT (envelope-from git) Date: Thu, 23 Jan 2025 19:10:08 GMT Message-Id: <202501231910.50NJA8QG015492@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: fed08c59b7bf - main - dtrace tests: Fix the ATF config variable name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: fed08c59b7bf2cb4d05bacadadde2dcef4dc6c46 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fed08c59b7bf2cb4d05bacadadde2dcef4dc6c46 commit fed08c59b7bf2cb4d05bacadadde2dcef4dc6c46 Author: Mark Johnston AuthorDate: 2025-01-23 19:09:56 +0000 Commit: Mark Johnston CommitDate: 2025-01-23 19:09:56 +0000 dtrace tests: Fix the ATF config variable name Fixes: 6e6a67e98652 ("dtrace tests: Avoid hard-coding paths to required programs") Sponsored by: Innovate UK --- cddl/usr.sbin/dtrace/tests/dtrace.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk index da7c3a440be0..54e2aec68dcc 100644 --- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk +++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk @@ -12,7 +12,7 @@ ${TESTGROUP}EXEPACKAGE= ${PACKAGE} TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} -TEST_METADATA.t_dtrace_contrib+= required_progs="ksh jq perl xmllint" +TEST_METADATA.t_dtrace_contrib+= required_programs="ksh jq perl xmllint" TEST_METADATA.t_dtrace_contrib+= required_user="root" GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh From nobody Thu Jan 23 20:30:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCHX1Xc9z5lRgX; Thu, 23 Jan 2025 20:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCHX0sM1z3LDC; Thu, 23 Jan 2025 20:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAXaEjEl0HSijU7L+RPIag4YguBx4yPqwl1hEsY4+cM=; b=UKnpYzEGJ55o0SdapLOuT84dDaAUjI7JS6YXbYJqgzyZmHBgpp/KOTKYEINN1k0sQg2aqK dUeTfHNHc1gO8g+J+8J425i8qgTGZgNYtTtKmem4iBARWdkXuFLiEJzrWMuqaOV7kVQrSY fWKnW4DQjxFJr/fkS2ATBuqdEzZyaIdEvmYYD7ooa8Wzw+2XwfmK80jWNDMPDxRpRzpiqQ /QKRXZpjALYex/T+eIlnIPGbm1GiTq8A1T6rjz6Vy57Y2xCfLi36xdW1OGgMKwhD3se0H9 7om+kmSJFJqmxLYBMGba1m09RpJ41ZgU4RiOzslf7+vFLOwL0hv4G3jAPPxJ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAXaEjEl0HSijU7L+RPIag4YguBx4yPqwl1hEsY4+cM=; b=pHDQIXMFwMqa3rjTt6QjvYNKJRqrZLW2+2zIjKx3FojnGJ4w9Uv4YBUEbUHsYM7L+AHJvK c3Iw3ET0RGYoK/sN0ZicTUHHWFY0KWXfrT23qiTd61qhj2UC+jFZBtyCmKTvdsoEFMiqfo Dk/SkJI2owGHab0Rrf7uZm/yNCTVwvJ0GUOrR9JzEI44L592d40AwzMSZh8ArodIPysT6t /vDGu40cGfpzmSRnyMFa4It1KhjbAgnKptwAegwKBPgzdOMsllSwj9wggmeAIhpJnsWTbI NTx4qrAISw9CM+Z4fUJIpTclF6DaZMF5eXQSVt4HjKbAt5uUwuomsphC5DpRfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664216; a=rsa-sha256; cv=none; b=uFh832x65mG4ogCs+XwhBhorFV1uQYVEsuIg34rH0sQ9Edh/6c4N2NlkUuWy91l51Afpco wmY/00mkyafvQR3hpWhlqC2wb79TZvTz+Tw31o+YY8b+GP+9Doj6rSOpIBO0AcVF7S3A8q TELUs77VI71DAqiitVBw4P3x5Pe5Qau50m3cHlei/BGiHNaulVK5P6FJS/Hog8J4yZbLDK 3uH+Pi+sMCY2bMFox9hqKjWwy6wDLONC/miSnM40RNmw8bjY+SGLFpFE36JLzlhrdllclA QIQbAun63uII/I5oI+/ghtNaPU/ZOQ2sRC3VJbtp6Xgch8C9Ho7JEqJyqjdAWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCHX0N63zvKW; Thu, 23 Jan 2025 20:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKUFGP068718; Thu, 23 Jan 2025 20:30:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKUFe9068709; Thu, 23 Jan 2025 20:30:15 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:30:15 GMT Message-Id: <202501232030.50NKUFe9068709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 6651a75af260 - main - ObsoleteFiles.inc: Remove bogus entries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6651a75af260a1c57b787a8146266de4cecd70cf Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=6651a75af260a1c57b787a8146266de4cecd70cf commit 6651a75af260a1c57b787a8146266de4cecd70cf Author: Joseph Mingrone AuthorDate: 2025-01-23 20:19:43 +0000 Commit: Joseph Mingrone CommitDate: 2025-01-23 20:27:54 +0000 ObsoleteFiles.inc: Remove bogus entries Reviewed by: emaste --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index eea25cc2e489..b406c3e281f1 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -754,11 +754,6 @@ OLD_FILES+=usr/tests/sys/netpfil/pf/divapp # 20240930: libmd bumped to version 7 OLD_LIBS+=lib/libmd.so.6 -# 20240914 libpcap upgrade from 1.10.4 to 1.10.5 -OLD_FILES+=contrib/libpcap/pcap-haiku.cpp -OLD_FILES+=contrib/libpcap/pcap-rpcap-int.h -OLD_FILES+=contrib/libpcap/pcap-usb-linux-common.c - # 20240827: retire fips.so OLD_LIBS+=usr/lib/ossl-modules/fips.so From nobody Thu Jan 23 20:31:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCJR49dNz5lRb0; Thu, 23 Jan 2025 20:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCJR3XbKz3LlB; Thu, 23 Jan 2025 20:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xlf07Wg1hVc0E3lk5C1LavsUACzww8fwVbP7U3cwzbE=; b=BJ4JPfDyl8Oavr4KQExtqvMAh/7aWPgkJA/b4ZXek4jlP3SD1vViZ3sy1ZQqfipg/pvtBL WovKOxxYJNNPXY+dDllJ3dP7MufwUov0fYFtEY3PruTIHzwSOThs4fQaBt4HZ6+o+9TA+Z WNnInArgCKAOpfwsyYBTXPjdQMndbEgqewqYXHn6Vjr2d2LP6HPlQxE235gKkYzPq3tglp kYlxqWrccBp5DZgEFaEs3asLaVM6c0nsVJbdRn8sjNZqYhHWZoH9CDBb9T2YZ9BO0U4s3y np0/BrFnQcvfmP4QePTvMNwpKRhZDQyHorssmoDv3GPXM9RxzI3oAnK8EOc9AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xlf07Wg1hVc0E3lk5C1LavsUACzww8fwVbP7U3cwzbE=; b=Mh85EzhpaH92zNuxGiv+tRl+OtLcW9lZeW2tm1cy8FyHT/c8ny24qNFo+hmdyFBFZy6+FM HL21d2gaJiqjyWoA5BLGROmpBa0zPUFiLLyrcTN7Pxvtp2YKYO5TckscZEJlhsp98VtVWt JznsMw4y1GpV/h//QzRpI/FUlX9pgTAh6ff0Mn0C5ULZ35YKzEhgVO0s0iBCUKLORbbB2b g5TFtjLLZfNll/J41wq18Q4TxRu+ibz9e7Nws/6Z4xqKwSeJ/AdvbE/qJgVfqftaNMh5Vp v+Nd4ivhFvdKOPGxbMut7f2/XsNJ8fUKI457Kn5VesjQQOgSFT2YcwhSSqdAqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664263; a=rsa-sha256; cv=none; b=Sy3FJBO8uhTc1C/lGWQxddw/v6cW9ZGzhBCnv/HwEC4evpnThtim1Ab8ZXlp4IIviC69na SLyTwe8Zqu78AxO8lZM4snlqVTbddbjFOIOgD5W7GKJ2d6MQgT1FeLwe05uGYHPD3rE1NV WQByj653BsaSdOuK3w1TOJSiB4KGXepRr0lGWr1tMnmQwvEuQddIX4abj9VxbJ3hZfqQ6h SXfqOB0Kx1C7zhIVt8zufEbyi9vPI0CIuirumYh6upvb18YE4USJvdopvskE89XBcC3un/ DRkBZX0vQRAI4nbsmXHmsXokzbukyIshc3zkX7LJtafbRXw1+TH/RaxmOoHONQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCJR381Zzthy; Thu, 23 Jan 2025 20:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKV3WQ074253; Thu, 23 Jan 2025 20:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKV3JJ074250; Thu, 23 Jan 2025 20:31:03 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:31:03 GMT Message-Id: <202501232031.50NKV3JJ074250@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: 5884fab46153 - main - pci: cleanup __PCI_REROUTE_INTERRUPTS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5884fab46153dee52bda660bcabca95c3cc97f44 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5884fab46153dee52bda660bcabca95c3cc97f44 commit 5884fab46153dee52bda660bcabca95c3cc97f44 Author: Mitchell Horne AuthorDate: 2025-01-20 15:51:27 +0000 Commit: Mitchell Horne CommitDate: 2025-01-23 20:30:31 +0000 pci: cleanup __PCI_REROUTE_INTERRUPTS This flag was used as a transition for differing pcib implementations. Today it is defined for all supported architectures, and can be removed. Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D48485 --- sys/amd64/include/param.h | 1 - sys/arm/include/param.h | 2 -- sys/arm64/include/param.h | 2 -- sys/dev/pci/pci.c | 4 ---- sys/i386/include/param.h | 1 - sys/powerpc/include/param.h | 3 --- sys/riscv/include/param.h | 2 -- 7 files changed, 15 deletions(-) diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 371128c6fe20..86f96ef15832 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -48,7 +48,6 @@ */ #define __HAVE_ACPI -#define __PCI_REROUTE_INTERRUPT #ifndef MACHINE #define MACHINE "amd64" diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 03131ebcb436..14cd32631a5f 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -49,8 +49,6 @@ #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) -#define __PCI_REROUTE_INTERRUPT - #ifndef MACHINE #define MACHINE "arm" #endif diff --git a/sys/arm64/include/param.h b/sys/arm64/include/param.h index c3f6990db79b..753035b7775e 100644 --- a/sys/arm64/include/param.h +++ b/sys/arm64/include/param.h @@ -43,8 +43,6 @@ #define STACKALIGNBYTES (16 - 1) #define STACKALIGN(p) ((uint64_t)(p) & ~STACKALIGNBYTES) -#define __PCI_REROUTE_INTERRUPT - #ifndef MACHINE #define MACHINE "arm64" #endif diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 0b02d873c5a1..30a95298a114 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -4094,7 +4094,6 @@ pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) pci_add_map(bus, dev, q->arg1, rl, force, 0); if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { -#ifdef __PCI_REROUTE_INTERRUPT /* * Try to re-route interrupts. Sometimes the BIOS or * firmware may leave bogus values in these registers. @@ -4102,9 +4101,6 @@ pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) * have. */ pci_assign_interrupt(bus, dev, 1); -#else - pci_assign_interrupt(bus, dev, 0); -#endif } if (pci_usb_takeover && pci_get_class(dev) == PCIC_SERIALBUS && diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 79b6eee9db69..177b4d9a168b 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -43,7 +43,6 @@ #define __HAVE_ACPI #define __HAVE_PIR -#define __PCI_REROUTE_INTERRUPT #ifndef MACHINE #define MACHINE "i386" diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index b40ada24ad11..e79e92f76ec2 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -46,9 +46,6 @@ #include -/* Needed to display interrupts on OFW PCI */ -#define __PCI_REROUTE_INTERRUPT - #ifndef MACHINE #define MACHINE "powerpc" #endif diff --git a/sys/riscv/include/param.h b/sys/riscv/include/param.h index ca9c91f3f981..32b0c7a1e34b 100644 --- a/sys/riscv/include/param.h +++ b/sys/riscv/include/param.h @@ -39,8 +39,6 @@ #define STACKALIGNBYTES (16 - 1) #define STACKALIGN(p) ((uint64_t)(p) & ~STACKALIGNBYTES) -#define __PCI_REROUTE_INTERRUPT - #ifndef MACHINE #define MACHINE "riscv" #endif From nobody Thu Jan 23 20:31:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCJS5BMbz5lRb1; Thu, 23 Jan 2025 20:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCJS4CkCz3Lfg; Thu, 23 Jan 2025 20:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRiO5AdPzbrREgevqfOcpQBTFIg7glYuIyVPUkzLI7M=; b=wMKW0iuSq9KPnc1QvUgWOv9unOdi5gSeRPhu7E25D+CPjCSyuEYKFBp9tRpWLZFLFpWN4j VQs+puNX/aQGqaovEZolxLX/pACn+55+38syho7TYug5r5Ann3FxrtUGJs3zjsUxorO2qY 75lUevcw84+1Ogk85Bjva/m//w9ZndFJqAgke0SMq/Wo7iM2gMkF/q53wNHycmgiu3jpYj YAS2jv/cJqMejv77VLHmra9Jp4+NvXZTv5P3JfRcJ/b8q4h8Iv+hXowKqgojQpzZTry9r0 vKPntXYv9PuJ3Qr2Cvc8TWf9nTKbOvnA8a362PtRe4AQuP2gB6BaO5yRPhvyOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRiO5AdPzbrREgevqfOcpQBTFIg7glYuIyVPUkzLI7M=; b=XP115Zm8PVTWL0XpQtRn7kq30mFEGYTgMfZiO4n+W80hBORDN8XdZ6+DEnvHbMrc/2Vric RdB0+xgAXtrv/tzNsj8C6yxH1AEfXvu7FFmU10n225FfuJfFUvb7xezBkbG17/m2zUV0eh nlR3BA1QrCqK6iJUNFc61i1NPQ8+tVOJuYraV3+hyhXHH0S7zNIlNt7BTUD8nB9FOw1OP8 8VNwynQJuH1ktifeux2pHYCtirf96KGk7s9cdtLVgAVBvg2TaSs37QvAdMREionlb2OMeZ ewKDWlD1LXbNW/39h8vkQJaDS5PmZJCpQq9tXlCfm7MolLSGAsN1AWKwNaTNkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664264; a=rsa-sha256; cv=none; b=uGa3gsjNx+pMT4S2dHZJy7je0jCSXjutKOvwrSMlP6yZ07V+bOF0ZQ4NoCudaY4pX4itYg fk0Gs7i7m5HfmWRK82W/3o0H/yjIbomRJYcQKqdTKYpoElRE6DE5Bsix6eZH4QJGru/Xt9 qKOUrolzp5T5nTxtFnrV07n0Ag3H7uC24sQJojg45oz2H68YP801QOkn5K8OW0UXxdUPOD wwecbatbHjSEtM04hT4yhmfqfxmP6RVqz8KeawIb21GEqc4cUuoUm5o/BAd1pRJ4dcLig0 T70TNzaBpOdVc8TOaSBPoLqyBRcqKybjPN/W5aN8kLi8h8JuejZ0tctz8X9OGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCJS3n7qzvKc; Thu, 23 Jan 2025 20:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKV4s2074292; Thu, 23 Jan 2025 20:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKV4dF074289; Thu, 23 Jan 2025 20:31:04 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:31:04 GMT Message-Id: <202501232031.50NKV4dF074289@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: 44bd0e89a1c4 - main - machine/param.h: drop __HAVE_ACPI define List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 44bd0e89a1c47c02639f3b2b6b9c7a5ca3aa84be Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=44bd0e89a1c47c02639f3b2b6b9c7a5ca3aa84be commit 44bd0e89a1c47c02639f3b2b6b9c7a5ca3aa84be Author: Mitchell Horne AuthorDate: 2025-01-23 20:26:27 +0000 Commit: Mitchell Horne CommitDate: 2025-01-23 20:30:31 +0000 machine/param.h: drop __HAVE_ACPI define It is no longer used anywhere (since 62508c531e0f), and not defined for arm64 which also supports ACPI. Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D48486 --- sys/amd64/include/param.h | 2 -- sys/i386/include/param.h | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 86f96ef15832..8db314fa034d 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -47,8 +47,6 @@ * Machine dependent constants for AMD64. */ -#define __HAVE_ACPI - #ifndef MACHINE #define MACHINE "amd64" #endif diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 177b4d9a168b..657dbcd879bd 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -41,7 +41,6 @@ * Machine dependent constants for Intel 386. */ -#define __HAVE_ACPI #define __HAVE_PIR #ifndef MACHINE From nobody Thu Jan 23 20:31:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCJV0h2Qz5lRjy; Thu, 23 Jan 2025 20:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCJT5KHcz3LnV; Thu, 23 Jan 2025 20:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Z0wZmh9MEHdsal9sqdmQlQTXdQboItR2l+66xWT7fg=; b=FcQ12vJa8MflawsvmIF6o6CzludCECMrCVIqaJKBrXVXh1aULACWGD6T24O+7cJ3erFRwI VgZFkKG9/oHQaF26QPVN2xAgTOBM0YEcAoAoeYAqOKGDYb+YfUe2FoSR/3ducDLTGrl7L7 pi0hjxyrZcRtnNhpB4ckf0XAuq99sAvmUVgSkS4fnREpfD5tV8w4TzRJKMVbPDpCGqZdH1 bxVFlBLTgZfLEyretl54m/yk0iHYis17nlCLUHNqDT502rk7XWI0shoB954oCLVUm8RWjP WlORCHBDChtiYWR1CAEaB3g0MjCtGA+tU+YcaGAnPUtpmz5XjoXzhb5Evk229g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Z0wZmh9MEHdsal9sqdmQlQTXdQboItR2l+66xWT7fg=; b=a16wu/2Zj/DpZkNF7vktgaCob0NqEl952oQdDUlG/k5Q/Ik/K4loSOLMlEv8okwexaBXAj YZDTuS28CVZlwRZbBKpIp4/e8v4rJTCAivlyZI0CG1JwDi525OwXoVgIVBZDhr36GlN+KP GTf22mV0NBwL1MM0KHYASLtcPLcAQdpuf2omjOQqqc6MiPhGe5ILDmI0lS4LvExE6jmtAC 1qfQ4Sf0zaVt3zlIrf15HQcMyCQDeHWHg01BP7TW9s9nXJd1syfcn9h8GMRWHn6vVRH/Et +EXdx9qR3+WVhn2JiOaU+0dMYinyUYYn758/3X9dwM/dFtQy8YEROdh2IAfVzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664265; a=rsa-sha256; cv=none; b=dsHHtjxqssupuzSkCUiZj0iZqbeKM1b4TkWD2vynJ199VeMchZD8SSe6QgYSWnrBdXbAHD 2Tz3QoByAzen5VkiCbkYKlM4rPMoOY3KUv/DeXCImJDzGzQH+rtKignKbYotPDQbEQ4fq6 2J/3lIzhOJBtRXYBijBUB6ZrdPmHC/b1IY4+vMqmqMae7N4YXkL0EpFyKNwZQk4CuA5XSD E3Q2KNAMtjy61CSmWLQ54HUdKSzQcoI7ssu6GEqD8mOKNRCwcPyK3eiluo0dTvohnV7JdQ c1jhCqiiMQ6yzslc2U/85KlG8zxHxjf1vYIKrqIQCLVO5mPpZL2gPvT7jwXZrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCJT4kjQzvKd; Thu, 23 Jan 2025 20:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKV5ee074326; Thu, 23 Jan 2025 20:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKV5tA074323; Thu, 23 Jan 2025 20:31:05 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:31:05 GMT Message-Id: <202501232031.50NKV5tA074323@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: f52902fdcf66 - main - bus.h: remove deprecated struct driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: f52902fdcf669a95fbd3b30591e2e2a82420ddce Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f52902fdcf669a95fbd3b30591e2e2a82420ddce commit f52902fdcf669a95fbd3b30591e2e2a82420ddce Author: Mitchell Horne AuthorDate: 2025-01-23 20:28:33 +0000 Commit: Mitchell Horne CommitDate: 2025-01-23 20:30:31 +0000 bus.h: remove deprecated struct driver Unused, and deprecated in 2003. Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D48487 --- sys/sys/bus.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 01031ae3ef28..14c9c3e8473f 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -308,16 +308,6 @@ enum cpu_sets { typedef int (*devop_t)(void); -/** - * @brief This structure is deprecated. - * - * Use the kobj(9) macro DEFINE_CLASS to - * declare classes which implement device drivers. - */ -struct driver { - KOBJ_CLASS_FIELDS; -}; - struct resource; /** From nobody Thu Jan 23 20:31:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCJW0yCfz5lRdn; Thu, 23 Jan 2025 20:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCJV6jy7z3Lnh; Thu, 23 Jan 2025 20:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M3a4eRwxJZZKe2STz7O5N7AGpOKWhgIqCrPP0TK3uf8=; b=HUVx4CZT6MRbko6ZmnRwWm8kOEQ1PxFWXM8BlCRzr6HBq3uBsCgKWElxWuhKNkIWjS4mci QTSEEqn9jCAL+J6ARKx1WDLG1xiCLIw70Ea458gmAn4qwlniLcN1alHIdI7g0eS1qDHSh0 pJSdTJXsXZKP2haXBR4iFzw/5Y3DLRLS0Ftx4Qp+xieWnH618GszjoJtYYgR1tWd8K7tWM 3QSyVfKBcPLabnflmOZljauevTotguNPSbJQlQFJlLBws+n0WbtoxFcZfWWd2ZIoH8RHFW Su7zKvHXFDOap5LfVV97McY8Ecwlk3lSEGVraPyFDeNmJJkiN9oW3vq/5JQQlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M3a4eRwxJZZKe2STz7O5N7AGpOKWhgIqCrPP0TK3uf8=; b=Zz/8bZuDA6DAbeMnMIfhJ0HCXI7cjKj/98ZpPEA6ssdMn+wQMmmZeFuFxCJczqzIHBOFmo Z9jJ0g+yznXa7BMaddX3uT1J5pUrVerBlWz7UExH4zc+R949HnXI/g8M7SI6eMKGsY6fS1 eZXfYimaNgw2n02BiPvWp0XzdTrV6srMzjvaGTzNepZYnIQL2LZydPxD1DxEDue5cZRzMI oN/2eFilpt9TvSpQHdWrFtJ3NJzfeyl+N9pPqAZJKoNI8SAv8fRVRbCXU3DECe3nb2r7zB b5ccyrAUhsiYADgqAo77yTz1RAAje4qJXtJKCLBaA/jNLDJNPFkIpbd9tXw4Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664267; a=rsa-sha256; cv=none; b=KMzvxB7h/RE6TZsVQusqWQ1PIPwPIdOV7j0xca4BSm/EIkISsxrUi6/cj+GpKw8TsTppI3 p3RSHCAJ2M8tCy09+Wf25iJSA5Fnj76xCJT1jCnrZsWWiOqyVcOdb9/5aDBwc7MW6oHGJl R+yknydWoyGjPCn49o/XNSW+vAVtn8Xym4TPQ1wRD0Oqre42q4KVlCbcoK8emRnF8XmCLp qlxKezoHo6l7jKNzuPf5YWSsL1I/CIENu9tuU0aL+HdhYg1ixXg+gqUZHb9kKgO0fdmBM/ cKKwEUAlGfr8lc2V59BXkeItob82AXElGRX64AludX02DwfplKR+v5i7bf7qgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCJV5cjdzv3x; Thu, 23 Jan 2025 20:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKV6pT074359; Thu, 23 Jan 2025 20:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKV6YY074356; Thu, 23 Jan 2025 20:31:06 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:31:06 GMT Message-Id: <202501232031.50NKV6YY074356@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: 5ec5d08489ba - main - bus.h: remove unused devop_t typedef List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5ec5d08489ba557f4f5868330c5ec3aa1f612236 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5ec5d08489ba557f4f5868330c5ec3aa1f612236 commit 5ec5d08489ba557f4f5868330c5ec3aa1f612236 Author: Mitchell Horne AuthorDate: 2025-01-23 20:29:15 +0000 Commit: Mitchell Horne CommitDate: 2025-01-23 20:30:31 +0000 bus.h: remove unused devop_t typedef Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D48488 --- sys/sys/bus.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 14c9c3e8473f..067868da4367 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -306,8 +306,6 @@ enum cpu_sets { INTR_CPUS }; -typedef int (*devop_t)(void); - struct resource; /** From nobody Thu Jan 23 20:31:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCJX2lPyz5lRb5; Thu, 23 Jan 2025 20:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCJW6km3z3Lnl; Thu, 23 Jan 2025 20:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzmwQMYmthe4wef2Y1LnoXlClutdTnwBu+T7GXly1iM=; b=Dfu3JUACLn+5sjS0KhsoaKv745XXL7/W1a2KhrZAjY9b8PcR/8m2X8Q/y1S6XNpy1l5XOg XZ8fH/jBtS6LR8Y4K8wDLKv0Hw1+Ss8RD+HFKBGUb45ZFvmMp7YrRt9v7z6qAEcefFK5Zk 64MMUzaf2GvX0TyJ/E3rs5XvTJg9d+rfHlgwLrUNsAmu6KPVTOt1h3OmDJmYD3lLjhf51/ NiKpBAEjS0Q/8pDNwS/V4SZ5I1JW1qi40sUO4K6SHmp3bRvopJ6zwSjmVgqyj1ht7vsTl3 cZM6bYR94ItFBX8Anaqrx2lv5yJcmf/zO28p0x3YKFf3ugsFtQWj287IJoiPIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737664268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzmwQMYmthe4wef2Y1LnoXlClutdTnwBu+T7GXly1iM=; b=riRdoFw9KSfCnkfBYFNHIWQHQRCAD9Xp9gqt7Gi++3AcF7ETtxYOt8YHHqc+N14gOTQaUW KBYrTH8KGzzvcVxPOc/lpgpd6tbNJiDE9EqBhjF2LHwEu3zGcAQoakqohrslln6AOuTJ9E bbr9L4aQRtOaf7wz2ud9M82hQc3f7t6gYxgT5lvRec1X/+DoxhC7B1Vmgh9xJTpZrXGCs+ 5T110aurjjYBKgiXjBkLlINBvgRy09it4hxXK3g5l4XWpRcwZ7Wyqx6q0LtBXKDB3iqbli hhThlVq84f/2KArA/Kzwp5sdY/F3t3shZjq9cKLMjf5oWNSoQ7a5RJ8CY8KPyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737664268; a=rsa-sha256; cv=none; b=H2ldygKbUChIykCHlFo4HiE36BL+fLWA6gGDSQ4XZZEaMNWExQ1IrhjBU4xysa9iQN/sKc VF2vgQXH4aU9CQ7IBj3DROdiDLpyrmjhvmCHhrUZoAmm1CIyqGjVJ128zgSmPCP1g/7uQg VFFo4gBDThSI7YF1hz1I9NZOq1rzQg9tNpgnYPA5iauHFlKOOVuQvoj1NrXna5R+ucqUsm RwD6e9xnJVcshP2tGzoen2VyFu50rYTwN40rFUB8vucMUcH4Nvs5mLJ97ivoEW47izBUB6 9e7kvrP9iL5chyT7FslIpo2M0I51tirIAdp9w/A7CTGLcxDl0vUZONxRPutjWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCJW6Km9zvHG; Thu, 23 Jan 2025 20:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKV7wu074392; Thu, 23 Jan 2025 20:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKV7kl074389; Thu, 23 Jan 2025 20:31:07 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:31:07 GMT Message-Id: <202501232031.50NKV7kl074389@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: db221468b09a - main - EARLY_DRIVER_MODULE: use designated initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: db221468b09ac8b57fa6ec8c142fdde8d5d4beeb Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=db221468b09ac8b57fa6ec8c142fdde8d5d4beeb commit db221468b09ac8b57fa6ec8c142fdde8d5d4beeb Author: Mitchell Horne AuthorDate: 2025-01-23 20:29:27 +0000 Commit: Mitchell Horne CommitDate: 2025-01-23 20:30:31 +0000 EARLY_DRIVER_MODULE: use designated initializers It helps the reader to parse the macro definition, with respect to how the arguments are mapped to the structure members. No functional change intended. Reviewed by: imp, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48489 --- sys/sys/bus.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 067868da4367..8b32e10f1285 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -851,24 +851,25 @@ struct driver_module_data { int dmd_pass; }; -#define EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, evh, arg, \ +#define EARLY_DRIVER_MODULE_ORDERED(_name, busname, driver, evh, arg, \ order, pass) \ \ -static struct driver_module_data name##_##busname##_driver_mod = { \ - evh, arg, \ - #busname, \ - (kobj_class_t) &driver, \ - NULL, \ - pass \ +static struct driver_module_data _name##_##busname##_driver_mod = { \ + .dmd_chainevh = evh, \ + .dmd_chainarg = arg, \ + .dmd_busname = #busname, \ + .dmd_driver = (kobj_class_t)&driver, \ + .dmd_devclass = NULL, \ + .dmd_pass = pass, \ }; \ \ -static moduledata_t name##_##busname##_mod = { \ - #busname "/" #name, \ - driver_module_handler, \ - &name##_##busname##_driver_mod \ +static moduledata_t _name##_##busname##_mod = { \ + .name = #busname "/" #_name , \ + .evhand = driver_module_handler, \ + .priv = &_name##_##busname##_driver_mod, \ }; \ -DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \ - SI_SUB_DRIVERS, order) +DECLARE_MODULE(_name##_##busname, _name##_##busname##_mod, \ + SI_SUB_DRIVERS, order) #define EARLY_DRIVER_MODULE(name, busname, driver, evh, arg, pass) \ EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, evh, arg, \ From nobody Thu Jan 23 20:55:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfCrj2r8nz5lSpx; Thu, 23 Jan 2025 20:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfCrj26l6z3QZF; Thu, 23 Jan 2025 20:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737665733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pw+kzlO19VXBP93VBZ9KyDZyYhMPXZBV7wSQgM87ik=; b=uIb0l/97ZuNJ1zMpbb1RDBXk2jmfJ0dXqEyhV5WVEhfQktUWRg33zJ01yN9369U1iTpIEP kZdq97L0tId1RDuYQoyBPbZ58oQIBeGKiqg2q8oIfaFE5etlncCCEsNAWTmLWeHutDtx/S RKAF9UfFksI/pfd1DcDsG8qsTwag+5/KTQI2FhWm3d6zmWaKCqGL1VTxJX1aClv32IWU7a lFGAv7rRn32RaWGT1YHOiKcMEU8IkIeyTTmnel+z0M87HhUeEowhP0ZZmL4uLKQyVTehmf SOkh9g/kCny1ULkK64w78ms0VBS8sEPCYUSeZRJ0NjKEJhoa5/+inEo0HTWz6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737665733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Pw+kzlO19VXBP93VBZ9KyDZyYhMPXZBV7wSQgM87ik=; b=B0lGg8mXoA2XW6lYdLDuBNevuZwpEXI49BXN4vM1zhDf752lKTeq5ySWvZyVkowNJquHo1 OgZTkBxsbkj6HvKYrEsubZMDdvU6OGvYcLCsAVwHbnrxE7HsyC1yiaa90ym8g4tCxNbNxA 938nr2GIDqOJExUlbQtsA6iNy24sRVJWmheYYs7GqacDdoQ3Xd8vwaPn28CRrU8s2rl9oy ts8436FBY6IsOqr3vAjGAgkg196skRikuAcut32N5h93URwrKP/6ZhU+p3f9wAO5PIv26m vRRd30p9XCsgxkGjZ3scEVHWm81lpj/n1OaCodo8kd9o1ZHnGmWEDNokCCx+ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737665733; a=rsa-sha256; cv=none; b=ZMPJW+wkF8k0zqYEySMXSi3a3bAMRKlhboRM2O+ktt+pNgxQ842KfxnvAeX4zPhGtIoyWd soi2fruYYh+4wPDyYUcCISm6Veuu2tFfhfLHCdox4huXPnOi06zkwUdupqv97n+gUuDqxH WzAWGz1ofy91Km/VWK9svl6SxnIRM7A6pAgoXtTyR40Jx5hpVMPREvFY0b9Z50TjLTrU/o ry6DU03M+LNEzIiVdui4T1VOxNePKH0l5EFRAbMB7OLcR+uS5ebCZo54VxooLwK/l5McWT VSM4jMnDq+sRPX7zr59p3HTCZsja7qaPOTjI/sh83MqeVmjdXQUntFPnxWZkvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfCrj1TdfzvSs; Thu, 23 Jan 2025 20:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NKtX7d016059; Thu, 23 Jan 2025 20:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NKtX3p016056; Thu, 23 Jan 2025 20:55:33 GMT (envelope-from git) Date: Thu, 23 Jan 2025 20:55:33 GMT Message-Id: <202501232055.50NKtX3p016056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone Subject: git: 75bca5af38f6 - stable/14 - ObsoleteFiles.inc: Remove bogus entries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75bca5af38f66871e2fe2c3631f8177f68bc0d93 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=75bca5af38f66871e2fe2c3631f8177f68bc0d93 commit 75bca5af38f66871e2fe2c3631f8177f68bc0d93 Author: Joseph Mingrone AuthorDate: 2025-01-23 20:19:43 +0000 Commit: Joseph Mingrone CommitDate: 2025-01-23 20:54:34 +0000 ObsoleteFiles.inc: Remove bogus entries Reviewed by: emaste (cherry picked from commit 6651a75af260a1c57b787a8146266de4cecd70cf) --- ObsoleteFiles.inc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 093fe4e91001..81f6f1110d3e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -525,11 +525,6 @@ OLD_FILES+=usr/include/c++/v1/__type_traits/is_trivially_move_constructible.h OLD_FILES+=usr/include/c++/v1/__type_traits/operation_traits.h OLD_FILES+=usr/include/c++/v1/experimental/__memory -# 20240914 libpcap upgrade from 1.10.4 to 1.10.5 -OLD_FILES+=contrib/libpcap/pcap-haiku.cpp -OLD_FILES+=contrib/libpcap/pcap-rpcap-int.h -OLD_FILES+=contrib/libpcap/pcap-usb-linux-common.c - # 20240827: retire fips.so OLD_LIBS+=usr/lib/ossl-modules/fips.so From nobody Thu Jan 23 22:53:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfGSP1QLPz5lZmr; Thu, 23 Jan 2025 22:53: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfGSP0grnz3dL7; Thu, 23 Jan 2025 22:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737672789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMaQuaHTa5Oe1JCWxRnrAucdQeXbhr7b1RN+Dfi8q0s=; b=Xv9avcC8TYfthQPVZPtxgeyf935+5P09K2lEsllXatiXxrBjxB/xdkAswZGUiqNcrM61fb GqZ1yuB7L1f+RH0WUpIG5puYmwPRkeHGNs5z+IRq0G4xRFzzAMEukvGnXpGgpv2P0yraGB BODX3rhIH7PPkInKoA4bcIrqx6B4d3qTz/FyX+6lP0Xr1g4NWyRdyloW4jQxROeDjJpmLg 2LnK+ynyxomrW2gNDLzPhkOq8KVto/YCINQMTl5V5rnaHphjya8QtP3ytwbRwK9DJ4xWZL PajrflCwTmDaYjaFozglGTV8WN/WNjuThMjjKzUxcFJdwU+ThWXaXSYBKtLUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737672789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMaQuaHTa5Oe1JCWxRnrAucdQeXbhr7b1RN+Dfi8q0s=; b=YQHOm5sej7Skyed/CbTdkapxk4krGPrq6Z5lQLl3+ona0oQtte99Wa3bZY5oi1g2zBwJ8N 7MT6RRIuRDSJ3Irh+0fMIwQxqw1MAAeuMLAYPdeZs1Cc7xsFtM0RXV470R+ARzVdEqm7wS xug2mEDjC6TU3vXZjrASu0mNbkmYEhlB0NwZw6PhzgbzaABF9zEhQZevT4QbBRGj/eBGPp c+93M6Vv+Hx6RIyDR7ORhmc9+Cv/cfv0f8Xi5y/HS8wtyCiEaYXBMYpT0ugbPVplQSOw1C 0uaO2dGEjPeAtauW+04f54MATOFrXWPNdhf2bjz/9Ogw1TtNoeXochJJBDu6kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737672789; a=rsa-sha256; cv=none; b=HEvk0zk8CulTt4Q5ovSUxCqq5Gu0dEl9kIaE7/42gXW8n/RcliMP5tPD72Y9+LaWBNxhbL AgVTgTlJRFq4b0g0Pf2MM14qr3pXDzIHkqcTBXQQ65daMhbd1CdwZIVsIP66nKn1SFqYra lvqI+Vcw0N0NOkXIK2cWMZgGthWdDAj1bb8zlE3+6/Oqppkj8aP89wYQK/tSnK0TOqmYS0 rueVHOv8U3H3xMa1mT5IBhTj0ixZx/7VvylVJkG6PWHgMUBZzxzvLjZyF9JxUihz7EeGsz 98j8RR12f8MHzc3YKqfjc07oPhtdc5pQfj8e1b5/PEmBK1JOufLjc095y7vjew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfGSN73NZzyw3; Thu, 23 Jan 2025 22:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NMr8Zj040173; Thu, 23 Jan 2025 22:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NMr8P7040170; Thu, 23 Jan 2025 22:53:08 GMT (envelope-from git) Date: Thu, 23 Jan 2025 22:53:08 GMT Message-Id: <202501232253.50NMr8P7040170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b937aac62254 - main - ziaee@ joins comitters-doc and calendar.freebsd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b937aac622540286267040628fffa69268eabaca Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b937aac622540286267040628fffa69268eabaca commit b937aac622540286267040628fffa69268eabaca Author: Alexander Ziaee AuthorDate: 2025-01-23 19:50:10 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-23 22:52:59 +0000 ziaee@ joins comitters-doc and calendar.freebsd Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48647 --- share/misc/committers-doc.dot | 4 ++++ usr.bin/calendar/calendars/calendar.freebsd | 1 + 2 files changed, 5 insertions(+) diff --git a/share/misc/committers-doc.dot b/share/misc/committers-doc.dot index 2c37a5f8ca6e..ba4c229bc658 100644 --- a/share/misc/committers-doc.dot +++ b/share/misc/committers-doc.dot @@ -107,6 +107,7 @@ ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"] salvadore [label="Lorenzo Salvadore\nsalvadore@FreeBSD.org\n2023/03/20"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/03/25"] ygy [label="Guangyuan Yang\nygy@FreeBSD.org\n2017/09/18"] +ziaee [label="Alexander Ziaee\nziaee@FreeBSD.org\n2024/12/30"] # Here are the mentor/mentee relationships. # Group together all the mentees for a particular mentor. @@ -144,6 +145,7 @@ carlavilla -> grahamperrin carlavilla -> lwhsu carlavilla -> pauamma carlavilla -> salvadore +carlavilla -> ziaee ceri -> brd ceri -> brueffer @@ -209,6 +211,8 @@ maxim -> taras mheinen -> jkois +mhorne -> ziaee + murray -> ceri murray -> delphij diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index 6135a5fdfa4c..0b1a37f43723 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -492,6 +492,7 @@ 12/19 Emmanuel Vadot born in Decines-Charpieu, France, 1983 12/20 Sean Bruno born in Monterey, California, United States, 1974 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 +12/21 Alexander Ziaee born in Columbus, Ohio, United States, 1995 12/22 Alan L. Cox born in Warren, Ohio, United States, 1964 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 From nobody Thu Jan 23 23:28:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfHDl6nXXz5lcYv; Thu, 23 Jan 2025 23:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfHDl5zhCz3k6G; Thu, 23 Jan 2025 23:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737674887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TgMQ2g4VX4UJLKckfJVbuEB8Pv6jfdAa6q17CMqGbw8=; b=ps6gWNRZkBtXL5YMeZ3xIX9O6mclDMCk1hGX9vjwuc0Pd0sDKTUgX7OMZ2nc3f+KcgwqQA AlQgRk/QckUD+0XBhsub70JxFjjg1/yta4SYdhgplhUviRgGhK0Im+p2qLz4IWQflX3wUn 51VFzOJ8fi4ms3vl/kDTOIqZW+Wiubb/uY3GEud3VKgDogTgUbR/cJ9D/YkWTet3hsdaf5 JrePjh+siPDjmQSyFnhWhafn9ecihfVEF+2WRxaufX6xUKhEz6MlK6diU9kRW+MmnBdCIc 6UlE7umJATDmThwJG7kGRqp2N0IgBHrrThvsEA48ZAg9Ty5PYricR4v/3hM8EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737674887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TgMQ2g4VX4UJLKckfJVbuEB8Pv6jfdAa6q17CMqGbw8=; b=pvqOq28rmlthQlI4L7M72xyMN8resLKwWtYnF+6O1XtrWeS25/al9CIbTnEcenOurrg21c Ee4apdGXezJxog5BHvBl2+ZfVHWgM/BvxikFrKR7HYscOboqwWG3P31Mnj/UaYnanC2C/X IcTw9Z1W4KGVqge5t7e4iQAVxw1U0cKE9tzHn8YENMgX4aF9lJIzcKRx6a7tAencVy78zB 2k/WcjJdWuztRAIcire/vIesftDv3bDamozSA3RuCghyakmrq3ke4UY0SrLjzFDRIT4K1T uhYOO6dX7WU0K/LDEcG3ALkd0lmagYTpvqxT2/q4iL+aXuPF391So7e67+F1mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737674887; a=rsa-sha256; cv=none; b=CPyu74pF8FtKzxVtvrnzSAwhc5zlj9nWDVI1VavRsCmn29Sh/RGgghE4BaqRLDYoelzc/R mIRz/ng5g4ulv6Vc5U4lVFPeCySOKdh0DR+LvH5LcFN0XTzG3SU+z/NDRUzMvuhthcku6Y lQ+kFaCgBg8LqIJ1PCIooK+rsBihzqhvzopzZQB3M4v/EFq3tNXVKUhJwGcksM8Gt/6NCd A3I56wj86EQYmWJwsr7nVZ9JEYgfuCUoeo4vC/Ky7orvgX45wZgNWibKqjHzX8O6QAx1lU m9a/RChcahNEEWz1ToXlc1uYoDq4Cp99xysOVBEKtKkynh3ajTodIV4hMv/6rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfHDl5Vmkz10v5; Thu, 23 Jan 2025 23:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NNS79N099222; Thu, 23 Jan 2025 23:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NNS7GG099219; Thu, 23 Jan 2025 23:28:07 GMT (envelope-from git) Date: Thu, 23 Jan 2025 23:28:07 GMT Message-Id: <202501232328.50NNS7GG099219@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: bf6c4ee6f0c8 - main - arm64 nexus: Remove support for I/O port resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: bf6c4ee6f0c8d0b9025207cde648427b749d8420 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=bf6c4ee6f0c8d0b9025207cde648427b749d8420 commit bf6c4ee6f0c8d0b9025207cde648427b749d8420 Author: John Baldwin AuthorDate: 2025-01-23 23:27:48 +0000 Commit: John Baldwin CommitDate: 2025-01-23 23:27:48 +0000 arm64 nexus: Remove support for I/O port resources arm64 doesn't natively support I/O port resources. PCI I/O port BARs are remapped to memory resources by PCI bridge drivers before the request is passed up to the nexus layer. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D48581 --- sys/arm64/arm64/nexus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 8d7489b844ae..2de996447edd 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -221,7 +221,6 @@ nexus_get_rman(device_t bus, int type, u_int flags) case SYS_RES_IRQ: return (&irq_rman); case SYS_RES_MEMORY: - case SYS_RES_IOPORT: return (&mem_rman); default: return (NULL); @@ -334,7 +333,6 @@ nexus_activate_resource_flags(device_t bus, device_t child, struct resource *r, * If this is a memory resource, map it into the kernel. */ switch (rman_get_type(r)) { - case SYS_RES_IOPORT: case SYS_RES_MEMORY: if ((err = rman_activate_resource(r)) != 0) return (err); @@ -390,9 +388,8 @@ nexus_map_resource(device_t bus, device_t child, struct resource *r, if ((rman_get_flags(r) & RF_ACTIVE) == 0) return (ENXIO); - /* Mappings are only supported on I/O and memory resources. */ + /* Mappings are only supported on memory resources. */ switch (rman_get_type(r)) { - case SYS_RES_IOPORT: case SYS_RES_MEMORY: break; default: @@ -422,7 +419,6 @@ nexus_unmap_resource(device_t bus, device_t child, struct resource *r, switch (rman_get_type(r)) { case SYS_RES_MEMORY: - case SYS_RES_IOPORT: pmap_unmapdev(map->r_vaddr, map->r_size); return (0); default: @@ -480,7 +476,6 @@ nexus_fdt_activate_resource(device_t bus, device_t child, struct resource *r) flags = 0; switch (rman_get_type(r)) { case SYS_RES_MEMORY: - case SYS_RES_IOPORT: /* * If the fdt parent has the nonposted-mmio property we * need to use non-posted IO to access the device. When From nobody Thu Jan 23 23:28:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfHDn0SZvz5lcZ0; Thu, 23 Jan 2025 23:28: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfHDn00l4z3k8F; Thu, 23 Jan 2025 23:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737674889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jf7NQjHgj90qpPpzqEox60AtL4Q6PV050JhBHjpBDkw=; b=BE+EAcH6c2G1ZJ0w4EgcuSp1TtNVZZXWO8ff7FAX0QC1YsOZ11eE4WifZqEtnsppJooPfW 23/AFZH30bgBfC8gX8X53z58S36ReUbvdPPfFXC6jcQC4oy3IHs0Rq2TwPinx8KL/t0Zef 9TPcWgSTP1Bahh0vrdUzw4GOA/sQ9UGQNj5P0Mk8fNew7SWChY+Tst1ntjCk+tkitIG947 NdDcBa4nPQkjjtqSLsxSMwpOMEagXu+iNdPRTjFrOnVNO0yO7eJekSIVKWbRc7KBqX8ay7 lV6XzOeG8cjsmkPVbgEJKFyQ/Z2feh0RS9RcaoS0Eo0TV2o6lsBdpZUgE9oO2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737674889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jf7NQjHgj90qpPpzqEox60AtL4Q6PV050JhBHjpBDkw=; b=eTnLeyISSQ03ejRPx+cnm8pTUAHz2PNrYcittPBGGfcU3XVGWGiqzmvVj44zLl3nheabNW ffKTGNM4L/n4AAPm8QSGdxGwwb0QIYqBwo28fjQVn6KoLHcVo3ifSKpUkyBgGzlw6vn66M 1AjYGi1jfAzzfOGHlQpNxVdY8YNcdVQ5KyKe92Qa0nbmeR4Un4QosofJt3YCW0BlvMtbh6 8DrpKau6qSx+32XBUBGc9BRjrtO4nJ8eA7m7r0DW+q5XTeeJ0gFfrQlFllzn711ALj40T9 h9elOSSc1Hc/wEDM+CSw/ZN/jMe1yRKuJJAbdu5xOsDppjgeis/+9uGLwHh3xQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737674889; a=rsa-sha256; cv=none; b=R1suznOoVsTe1++zJToAlOk8ewY434fCKJ+1dalbV9JHPlVTPRgtgx+hGKw5Hhvc2uWn6p d20zqzn/vwvwIQt9kwWTKWX/dbE1UxXFqVpAz3Yuv2Za8d514765ubXbpUw/absWNPNppy FXWIsgRD7Gf1xMy2H4bWKyBGVlRbY86tXFUSBw5+ZkIcJJhTfDzhlqmA75+OP6zl6GBHxl g/aDo3m0OZdQpdXyw6GDcIzoSa1EW1INVyggIaSmmK6cU4QO7k9EvFAkN9JLiakEvoAbhd LrCiBjuepPF4+qxCqS4Si5+tHUYAQN4EHHrstHbFeshG1wAhYTy5QnrD1qqVNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfHDm6jjqz106C; Thu, 23 Jan 2025 23:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NNS8Rk099254; Thu, 23 Jan 2025 23:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NNS8XA099251; Thu, 23 Jan 2025 23:28:08 GMT (envelope-from git) Date: Thu, 23 Jan 2025 23:28:08 GMT Message-Id: <202501232328.50NNS8XA099251@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: 2f51074c90ad - main - riscv nexus: Remove support for I/O port resources List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 2f51074c90ad28a9cc7715f5f9c4e9323609ab1b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2f51074c90ad28a9cc7715f5f9c4e9323609ab1b commit 2f51074c90ad28a9cc7715f5f9c4e9323609ab1b Author: John Baldwin AuthorDate: 2025-01-23 23:27:57 +0000 Commit: John Baldwin CommitDate: 2025-01-23 23:27:57 +0000 riscv nexus: Remove support for I/O port resources RISC-V doesn't natively support I/O port resources. PCI I/O port BARs are remapped to memory resources by PCI bridge drivers before the request is passed up to the nexus layer. Reviewed by: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D48582 --- sys/riscv/riscv/nexus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c index 6eb194f86390..836e1648edeb 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -214,7 +214,6 @@ nexus_get_rman(device_t bus, int type, u_int flags) case SYS_RES_IRQ: return (&irq_rman); case SYS_RES_MEMORY: - case SYS_RES_IOPORT: return (&mem_rman); default: return (NULL); @@ -308,7 +307,6 @@ nexus_activate_resource(device_t bus, device_t child, struct resource *r) int error; switch (rman_get_type(r)) { - case SYS_RES_IOPORT: case SYS_RES_MEMORY: error = bus_generic_rman_activate_resource(bus, child, r); break; @@ -343,7 +341,6 @@ nexus_deactivate_resource(device_t bus, device_t child, struct resource *r) int error; switch (rman_get_type(r)) { - case SYS_RES_IOPORT: case SYS_RES_MEMORY: error = bus_generic_rman_deactivate_resource(bus, child, r); break; @@ -372,9 +369,8 @@ nexus_map_resource(device_t bus, device_t child, struct resource *r, if ((rman_get_flags(r) & RF_ACTIVE) == 0) return (ENXIO); - /* Mappings are only supported on I/O and memory resources. */ + /* Mappings are only supported on memory resources. */ switch (rman_get_type(r)) { - case SYS_RES_IOPORT: case SYS_RES_MEMORY: break; default: @@ -403,7 +399,6 @@ nexus_unmap_resource(device_t bus, device_t child, struct resource *r, { switch (rman_get_type(r)) { case SYS_RES_MEMORY: - case SYS_RES_IOPORT: pmap_unmapdev(map->r_vaddr, map->r_size); return (0); default: From nobody Fri Jan 24 01:22:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfKmn3F2kz5ll4g; Fri, 24 Jan 2025 01:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfKmn2T5Yz3wlP; Fri, 24 Jan 2025 01:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737681753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S/iGF7WqHBSdMi8p05OkOGZe169LF8L9tm1l1v01WLw=; b=fUSwTSiE3cqDX9+5aE+nMwgS9oFE6jgCejXgrwCVolwGEd2Uktkcgo5a1MvqMjoC3J5uK/ a/oP4gR2DY22dqdxRTrUU2Fxrb3vWT78yUjMO2D728PVfKd7Uzd7bQHblx6JOPLvGHeoZH CTqcrVS3aI4sf0f2exU/yZqr+/kJWu413AHHCO1pcmWrK2ubeIiM23jKxmY/hF9pmbTMDa L9W08L0uRhFsXRsPbgF0/g4kxorJKfdXZwcdyBouLhoix0qb2CygVkaR3BCZNYeEOu+ZZY 1J6QKplRDOL1uvOXl8d7fEfwezMmtE2pkQbSngdJnQKPO1PLWJ9nEfr2ego2XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737681753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S/iGF7WqHBSdMi8p05OkOGZe169LF8L9tm1l1v01WLw=; b=ckiBGBFPWIiJint5gyjvwRmJ2URco5A3OC9BksavKEdxccsLdffwXvj4g08xy7XYLOjBCL gTXNoCmscARZdwsIrxw9XHJhXSAkxo9h/tQvmqtWZ73b/gej7kZ1uQkrT4MOsPMu69HviG 2jAAAivE2M0040RUA/FbFaNwNsvZIFTEP9DtE4DuzgNdwKbfFJWo6BnHUKQq86JIlrMLbj iyWhf2cBLE7nQWLA/TE+dwFezDq+BREY+XkH19gx8UezCeoLwDQdaZT+sTZxSX4aFc6i1a +xsDGZCs585aqR0z8br0GGkoGywqhzbvTBvWkBrdgZv7o+VxHVgfqSaLUbTPrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737681753; a=rsa-sha256; cv=none; b=p89q6bEDJFWdbLl6Ybfn2/3yntVWwFr8HqqcP/X599OT4HnikDShDIOZWcmvATWxecLmMc IziU8usxVx6pYvmR5GSOCJtl1y9TWmDi49xWdhCf4hplyvOW56zB3Eu88nLQ0S2MHZQllO kCRR+746a5FVSPN3A82tzomVh5HRw3NhPQmQVcKBcs80of7c4hfYez496XimFNWpRhbEGT 3kg6e0o0KSL1wLeseb2DJHRVqucDyvm8Qy3Tzqqjrwrpvl20IB42ctqCronV90L7d4s+xP 6Ax1Kdv2OUqArlTlLRvMcCF4AMOnEtqzD48ggm+gPcyaZQEntd2albhkc+jpBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfKmn20TPz133f; Fri, 24 Jan 2025 01:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O1MXmC023223; Fri, 24 Jan 2025 01:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O1MXX5023220; Fri, 24 Jan 2025 01:22:33 GMT (envelope-from git) Date: Fri, 24 Jan 2025 01:22:33 GMT Message-Id: <202501240122.50O1MXX5023220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 544ad91ef9f6 - stable/13 - Use ffs_sbget() to replace open-coded superblock reload. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 544ad91ef9f67430b955ce43456b6ffc97ab4c80 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=544ad91ef9f67430b955ce43456b6ffc97ab4c80 commit 544ad91ef9f67430b955ce43456b6ffc97ab4c80 Author: Kirk McKusick AuthorDate: 2025-01-15 21:08:42 +0000 Commit: Kirk McKusick CommitDate: 2025-01-24 01:20:50 +0000 Use ffs_sbget() to replace open-coded superblock reload. No functional change intended. Tested-by: Peter Holm (cherry picked from commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2) --- sys/ufs/ffs/ffs_vfsops.c | 87 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 433df476f563..d97f5413c647 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -607,8 +607,12 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) { return (error); + } else { + /* ffs_reload replaces the superblock structure */ + fs = ump->um_fs; + } if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -769,26 +773,20 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * Things to do to update the mount: * 1) invalidate all cached meta-data. * 2) re-read superblock from disk. - * 3) re-read summary information from disk. - * 4) invalidate all inactive vnodes. - * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary - * writers, if requested. - * 6) invalidate all cached file data. - * 7) re-read inode data for all active vnodes. + * 3) If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. + * 4) invalidate all cached file data. + * 5) re-read inode data for all active vnodes. */ int ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; - void *space; struct buf *bp; struct fs *fs, *newfs; struct ufsmount *ump; - ufs2_daddr_t sblockloc; - int i, blks, error; - uint64_t size; - int32_t *lp; + int error; ump = VFSTOUFS(mp); @@ -811,30 +809,21 @@ ffs_reload(struct mount *mp, int flags) /* * Step 2: re-read superblock from disk. */ - fs = VFSTOUFS(mp)->um_fs; - if ((error = bread(devvp, btodb(fs->fs_sblockloc), fs->fs_sbsize, - NOCRED, &bp)) != 0) + if ((error = ffs_sbget(devvp, &newfs, STDSB, M_UFSMNT, + ffs_use_bread)) != 0) return (error); - newfs = (struct fs *)bp->b_data; - if ((newfs->fs_magic != FS_UFS1_MAGIC && - newfs->fs_magic != FS_UFS2_MAGIC) || - newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs)) { - brelse(bp); - return (EINTEGRITY); - } /* - * Preserve the summary information, read-only status, and - * superblock location by copying these fields into our new - * superblock before using it to update the existing superblock. + * Replace our superblock with the new superblock. Preserve + * our read-only status. */ - newfs->fs_si = fs->fs_si; + fs = VFSTOUFS(mp)->um_fs; newfs->fs_ronly = fs->fs_ronly; - sblockloc = fs->fs_sblockloc; - bcopy(newfs, fs, (uint64_t)fs->fs_sbsize); - brelse(bp); + free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); + free(fs, M_UFSMNT); + fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); + ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -844,42 +833,10 @@ ffs_reload(struct mount *mp, int flags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - - /* - * Step 3: re-read summary information from disk. - */ - size = fs->fs_cssize; - blks = howmany(size, fs->fs_fsize); - if (fs->fs_contigsumsize > 0) - size += fs->fs_ncg * sizeof(int32_t); - size += fs->fs_ncg * sizeof(uint8_t); - free(fs->fs_csp, M_UFSMNT); - space = malloc(size, M_UFSMNT, M_WAITOK); - fs->fs_csp = space; - for (i = 0; i < blks; i += fs->fs_frag) { - size = fs->fs_bsize; - if (i + fs->fs_frag > blks) - size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); - if (error) - return (error); - bcopy(bp->b_data, space, (uint64_t)size); - space = (char *)space + size; - brelse(bp); - } /* - * We no longer know anything about clusters per cylinder group. + * Step 3: If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. */ - if (fs->fs_contigsumsize > 0) { - fs->fs_maxcluster = lp = space; - for (i = 0; i < fs->fs_ncg; i++) - *lp++ = fs->fs_contigsumsize; - space = lp; - } - size = fs->fs_ncg * sizeof(uint8_t); - fs->fs_contigdirs = (uint8_t *)space; - bzero(fs->fs_contigdirs, size); if ((flags & FFSR_UNSUSPEND) != 0) { MNT_ILOCK(mp); mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); From nobody Fri Jan 24 02:26:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfMBS4hZ0z5lpKL; Fri, 24 Jan 2025 02:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfMBS3nDBz42N5; Fri, 24 Jan 2025 02:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aPXzsgq5VeWSzxrGS1Q2aKgzwxUxU20/pL6NIp/BfDc=; b=WgAnTQF/IHgTXAFKVdqjzHyfJXKUdk7/4vrZOqIq9GZuFWTDUuxyv7Z7lNFLMoBzsVpgzb L8xqtqwlXv+gULpLMS1X2t+14c0oDnADCBsItguBeO88fQ91uXI85Vg85NL4FGt4Mrwdu8 D8Yb4OO++zRRXp8FwpDb18dCstFRlml+orkbdxY9Q2iF1JOAI1Qp7IY1PEi64/rQXuqOOu H5cnrvnUhkajScKNkjaGXJlLAarBhzTmwK1xVKfGItw91WXfSvLiKq/UWnQQG3xX+grLyw Txm1uqxFgjIK7Z6EWahwARE0W5XEZFfOHfItgnH9nK//heFOGjVfpp1ncrXbNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aPXzsgq5VeWSzxrGS1Q2aKgzwxUxU20/pL6NIp/BfDc=; b=B9N4EUyAQLDwsdBEIAyNvqBuBzTozLLpmQovuXnKF4PFhsqKxD0hldCRwG12yHhyM9oNZJ OMuCRYE7P0u+GUTR52rmj2HFsdx6JK4vFzw13Qp0bRy3ensy+mEd3UZ1cpr1A1jObT5Dtr xCMEc5+kN4dwAibeEF2lRaDbCMubiKwinc2rZbJqYzfbeip8NGZd1AB+/T8tGJQdTU3D/D BfGm5dzvZQinXQW2HBhRwtyEEDmgIrPhwpkwfbx5J1LtJGOscmxxPeYJacVW9MJ2gTsO4U +23txDfG2rt5ltWOF38h8jsBxnQjK80kXa1eO0AO7eTTyx6Zd0nlCpApnKBHGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737685584; a=rsa-sha256; cv=none; b=o0sf8cK7DUCvqTPyGQkE+enAnftE86VyQ23EkP8l+bP5L9HfVPPmaDac4v5/VYyLiNIe0L SxYGDYypOGOGWJc6hPwRm7S+SF/zxTXVu+KRYRXDyUEnAulLCD3BUCRztTqtLylQ2oNuMS cP/3bvR0kicF7yVU4uERppN7SldXZBrM/KIHLUCeyCtzOfHmjoRraaVxxTKEgYMpp6PWrv fIpyE/9K4jyKd4Dhon9LWjRdLF+OTk6RXQNsvNZgpqg4ny0YqjWSa+MnuNLEeZdsFKNiG+ 8UzbC2UKRGGyGMME4iwLsfpalCpwAVZical7XyAgGIr/GccrrgxOerM1RZ62Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfMBS2gt4z154X; Fri, 24 Jan 2025 02:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O2QOqs036903; Fri, 24 Jan 2025 02:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O2QOcN036900; Fri, 24 Jan 2025 02:26:24 GMT (envelope-from git) Date: Fri, 24 Jan 2025 02:26:24 GMT Message-Id: <202501240226.50O2QOcN036900@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: d7b69bb536f7 - stable/14 - nfscl: Fix a crash when a readdir entry has nul in it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: d7b69bb536f7dd4857f1aec86536737a2e94c68a Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d7b69bb536f7dd4857f1aec86536737a2e94c68a commit d7b69bb536f7dd4857f1aec86536737a2e94c68a Author: Rick Macklem AuthorDate: 2025-01-10 03:54:41 +0000 Commit: Rick Macklem CommitDate: 2025-01-24 02:25:10 +0000 nfscl: Fix a crash when a readdir entry has nul in it Commit 026cdaa3b3a9 added a check for a nul or "/" in a file name in a readdir reply. Unfortunately, the minimal testing done on it did not detect a bug that can cause the client to crash. This patch fixes the code so that it does not crash. Note that a NFS server will not normally return a file name in a readdir reply that has a nul or "/" in it, so the crash is unlikely. PR: 283965 (cherry picked from commit f9f0a1d61c7b97c705246c747baec385e0592966) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 7540893ce63c..76aa3b102962 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3397,6 +3397,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; u_int32_t rderr, *tl2 = NULL; size_t tresid; + bool validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3622,6 +3623,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); ncookie.lval[0] = *tl++; @@ -3701,6 +3703,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3738,7 +3741,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[0] = 0; ncookie.lval[1] = *tl++; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; @@ -3875,7 +3878,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, size_t tresid; u_int32_t *tl2 = NULL, rderr; struct timespec dctime, ts; - bool attr_ok; + bool attr_ok, validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -4086,6 +4089,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { ncookie.lval[0] = *tl++; @@ -4161,6 +4165,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -4217,7 +4222,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, goto nfsmout; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; From nobody Fri Jan 24 02:31:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfMJ92NvSz5lpPY; Fri, 24 Jan 2025 02: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfMJ91lDhz43SV; Fri, 24 Jan 2025 02:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BoN4HZtV+67st4m3IZknGuXtmuolJPEg3ZP2gCFkvqY=; b=Z/bD9RyQMdxJKqnk65nCWWnO9nFvQoGmjv+84F1JPwWEnEspAjjkyl9VVCutuMWZbF8/j8 QDuMxXc7eJsrNmoV7ihUkIXN0yOJVt/C7yGsxo0Avb1fiEjpK3QYP/OrQxwmoIFalXxJ2B Ma/QeGu0vHZESAN/YnItyqlZyWSFvtDyvJ5ID05QRb+SeYszAdwdF8Bn1hQFsk7jzKsfwc 2dGKvCOONop73Zdxsnkr3kDJtp1rhxAFwLnVX8yh9S5ljI+NKa+mfrVLNM3GdwPv9VSx5n 8CUH7sL1hmoJO2pesHrtIIoMf4Jtd2e2299E7A96vWBPL4DIN2xWP/wR0eccug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737685881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BoN4HZtV+67st4m3IZknGuXtmuolJPEg3ZP2gCFkvqY=; b=p1pMg0GTvtba2xZAH7j5HK8NWG6Yi1OGGeRe7VrDZbW0HdpDsUXq0g48qWDUyS8JoQwBbo VU+JUtqAuGMJxZlzCLR2itqdXNV4m70LBs/9jFZIiHmelEOS0aRrmBNMR0FEw616QX3nME WWSwj3MV49VKYd5fMKoSeQhLPpwQoGSP3JRHHP3k+cZvNmfzIoDR3ZVicXL9Yr5Zerd3n7 OU4DpTe4zWvg1oLQB0IgPeBPwvK4T05nUVQaAJRxNT30Pw49MeUKAbRR85/CNLxXMf8s9/ Jn//cu7rgOmyInHGB5XmhzSZAbLg3JdV/7SjkcmakrraF2N26DQV/IvfKfa6vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737685881; a=rsa-sha256; cv=none; b=LseGrYLslpisWxJ3sq3YEWCj9qqtn2XWSxB2ujJch5XLtJns5GD2e6SC/O3xAqSOJe4M35 aXy+IiuKDxXnG10j8ICfci0nC1i/Rn6n1+SbKEj8p4/QkIWMAZIaaan4+1Y50+YMft6RBY WVCzTAS7XyUNDZrVf9c55QLIL3sfcXjNNqhhnDko2302Qrf6aPjec8l21K8iTt/pKRjOnx /jBEnFWiNTztCFrDL/L5Fq/vTR7qFlh84fRlim5HgV/lyh3P0aFDgaRlf7D2Xyn3oa1ROf lyGf0USmiE4qFZoalw2tckmDng3Clot6p9WiVDu7W8l0GK86Ub/9Lt2o0Ndapg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfMJ91Hpxz15P7; Fri, 24 Jan 2025 02:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O2VLZD052426; Fri, 24 Jan 2025 02:31:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O2VLWq052423; Fri, 24 Jan 2025 02:31:21 GMT (envelope-from git) Date: Fri, 24 Jan 2025 02:31:21 GMT Message-Id: <202501240231.50O2VLWq052423@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: 968abc191ea1 - stable/13 - nfscl: Fix a crash when a readdir entry has nul in it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 968abc191ea145040f4c2105755d11b63ecb2427 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=968abc191ea145040f4c2105755d11b63ecb2427 commit 968abc191ea145040f4c2105755d11b63ecb2427 Author: Rick Macklem AuthorDate: 2025-01-10 03:54:41 +0000 Commit: Rick Macklem CommitDate: 2025-01-24 02:30:22 +0000 nfscl: Fix a crash when a readdir entry has nul in it Commit 026cdaa3b3a9 added a check for a nul or "/" in a file name in a readdir reply. Unfortunately, the minimal testing done on it did not detect a bug that can cause the client to crash. This patch fixes the code so that it does not crash. Note that a NFS server will not normally return a file name in a readdir reply that has a nul or "/" in it, so the crash is unlikely. PR: 283965 (cherry picked from commit f9f0a1d61c7b97c705246c747baec385e0592966) --- sys/fs/nfsclient/nfs_clrpcops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index b3062b5a5d88..f3ab2bda8f85 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3079,6 +3079,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, nfsattrbit_t attrbits, dattrbits; u_int32_t rderr, *tl2 = NULL; size_t tresid; + bool validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3305,6 +3306,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); ncookie.lval[0] = *tl++; @@ -3384,6 +3386,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3421,7 +3424,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ncookie.lval[0] = 0; ncookie.lval[1] = *tl++; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; @@ -3560,7 +3563,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, size_t tresid; u_int32_t *tl2 = NULL, rderr; struct timespec dctime, ts; - bool attr_ok; + bool attr_ok, validentry; KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, @@ -3771,6 +3774,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { + validentry = true; NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { ncookie.lval[0] = *tl++; @@ -3846,6 +3850,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_offset = savoff; uiop->uio_resid = savresid; blksiz = savblksiz; + validentry = false; } else { cp = uiop->uio_iov->iov_base; tlen -= len; @@ -3902,7 +3907,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, goto nfsmout; } - if (bigenough) { + if (bigenough && validentry) { if (nd->nd_flag & ND_NFSV4) { if (rderr) { dp->d_fileno = 0; From nobody Fri Jan 24 03:38:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfNnr01xgz5lt9s; Fri, 24 Jan 2025 03:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfNnq5XrWz3C8L; Fri, 24 Jan 2025 03:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737689919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDbBAFzKMAKIxi+k36AIzCNunBUZgZnYgsnCUe3B034=; b=mr3xn9Czz7hqY9bPOMCYU1cGZ6afRYpnlcUcKbJTwSNHd4sow9bVzHoX8sTkYmzgkWot4z y369c/oOcKocy4pdHGZg7fl5Slb8XsA0Rd3cjdm1Z2sgUWdiife9wvDMy0kjvPF/A+vagR h4vqdABosiqqVI73xhz/csEhUMGV0x3vZG7SeLjpa24LGKtO/jyqgRVtGXCF5VzO7rqHKb G+N1nM7FnYjS4aSKVsQyaINLedPMRRAKUCfQSu8WadV3YZRidSC8TqlM/CJGCiMwtTX25s VGHgP3UgrivfEg1jii0t0jfgUY3a3EozK+mdFZFPqeCS3CljVQ5+wpO/C7Q8Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737689919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDbBAFzKMAKIxi+k36AIzCNunBUZgZnYgsnCUe3B034=; b=bcjvpN4sZX8H/09jnhxtjAE245b04ehuW+kWfFlYHI+NqcJfQkog6LfNbCXnuzygqq6d3i 4BMEQQFlkZKhQFe9WJlJNEMiDDm6zFWTkaMMjIU5I8C1zdjdnAAGpZcLd1eWFa6dgMfpQy YVQDxN2Vp9Xr3lwQQ7MuPacXzCs3ghl7nusAM3HevHqwkvAATiRt5nkadLgWnkElfHZw1K TygeL5SF1I2PDROPKgieLj8UgZCDW7CPlgiM+btjl6jLcr/5P8Yu0mlbiXZmALQDI6pcT+ 9W17l1ySLmObDbJ/i++cl9YtcWe6uLK3MVIA8fBYzuHDgLq2uywvDgLsS+JpEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737689919; a=rsa-sha256; cv=none; b=P4lvw0nkOob8dd4nIoGKU1bkh/7Oy8ANR64mz32M1aRPMeG8VWafsOGxQeDwMAJd9RwNXf C2BFbt8PxTfBpCLk+RxkYM+aNK2jC8CN4UoukIPfjyCvt8la1Oy8uGBC8975gNDBgr8iWC 9D6yZPqicgOTLi4mpmOML4fRemwW9NX2eZLqPkVLSp4Dgw/MsbcrBE0USt3WExVLK+r1uv LhGeoCpdf+CtKh0r8/NVUBF0Z4L88PMXncU1GI7Q3ZWw7V8AqnYELSPjotwA6K4H0cSzSl QWG0/fyYSNAu94bs9kavvlZZ62kNU/OH4suktfA7BcdFjOw3RV9Pt/BIVKfr0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfNnq53q2z16yj; Fri, 24 Jan 2025 03:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O3cd9I070170; Fri, 24 Jan 2025 03:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O3cdtl070167; Fri, 24 Jan 2025 03:38:39 GMT (envelope-from git) Date: Fri, 24 Jan 2025 03:38:39 GMT Message-Id: <202501240338.50O3cdtl070167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 02816415a34a - stable/14 - kldstat.8: Polish options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 02816415a34aee8092c155ce53bec21126e2eb7f Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=02816415a34aee8092c155ce53bec21126e2eb7f commit 02816415a34aee8092c155ce53bec21126e2eb7f Author: Alexander Ziaee AuthorDate: 2025-01-21 19:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-24 03:36:03 +0000 kldstat.8: Polish options + Align and alphabetize options + -q: s/Only/Quietly/ for search + Tag SPDX MFC after: 3 days Reviewed by: gbe, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48325 (cherry picked from commit 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa) --- sbin/kldstat/kldstat.8 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8 index f7e7552625e3..09094da3741d 100644 --- a/sbin/kldstat/kldstat.8 +++ b/sbin/kldstat/kldstat.8 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Doug Rabson .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 19, 2016 +.Dd January 4, 2025 .Dt KLDSTAT 8 .Os .Sh NAME @@ -48,22 +50,22 @@ utility displays the status of any files dynamically linked into the kernel. .Pp The following options are available: -.Bl -tag -width indentXX +.Bl -tag -width "-n filename" +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl h Display the size field in a human-readable form, using unit suffixes instead of hex values. -.It Fl v -Be more verbose. -.It Fl d -Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. +.It Fl m Ar modname +Display the status of only the module with this modname. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if file is loaded or compiled into the kernel. -.It Fl m Ar modname -Display the status of only the module with this modname. +Quietly check if file is loaded or compiled into the kernel. +.It Fl v +Be more verbose. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jan 24 03:43:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfNvY12BTz5ltNT; Fri, 24 Jan 2025 03:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfNvX5M1Jz3CZG; Fri, 24 Jan 2025 03:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737690216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zv8UUqvFC7vBGl7gnAq+I3pt9dHhKWQIXeufW+sFqXU=; b=eEzkiCqS93qw5kDFOCVMCS1YpLcr03WN+t7pzvJ8F1ILRe8YsRKNcndGQeLFC9MqZRgDAK xsRA7c0Gm8ViT4GIaNFBu1lVgCYed0dVPXiXeVFPrskBuNpMEdHlo9MwM/19Ychk1lbMqg k6qDnd/GXfgMPlqrp9MvNFiP1N8F5fu42iyWdHNtsIx4JBH50elMedBtwPJwSESzHvyZgV ASzijvGUefsM6IZRKjhGQBsQK5zJkhFqD/D/P7yxXPh+29JOoux2QF7YWtra2Md6e2m2wF Kwdhf/faw0euXNKZ7QTWL3TVKvX2OVX/kcKJEuCHlOSOs12JcRwaplOuY9qrcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737690216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zv8UUqvFC7vBGl7gnAq+I3pt9dHhKWQIXeufW+sFqXU=; b=EBJazlBkd7PAMc7ur5G0/bjWQTMqCAmYtChlvbTFmQ4t1zeIVESkCTVVeA84Y25TB9ojco IooWDcO12y2Qd52QrVQPO0adloEh+kJy45tYUPJCQwcsAb/EIwO3UTwqaVWTj85u4Opx/O OS7DZWvzcYf+W8YyITEspeai9aHtHF9RXOSnC2+fr0tRA679BNMBqwx5i31GGQQIYdaSqP /AO+LjSBkLPDrQBEJ1q6Gq+i8vdd4dx6y9dI0hlqg9IKfomlYxziZUefx7zgXllzg13Wca j/Y3WzLTqQv3KbxGwZTnyKFo8MfJ2iMM3riH6h2JOqbmxkPrUmcU/lxU3mJdvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737690216; a=rsa-sha256; cv=none; b=hVjAnmBf6D6tPKq4io084+fYzX+LRYXTEfJ9B0RZRnMHYmlrTQukhDOLWrdiIbg2PBo4Tk Pvlql3jE7N8CoXFxM8Ddf7UrhezfCLgjAoWRLdrtAP6rmmJXd+FVqdATNfSdtyaLtfDDc3 ZNFiPdV3vXchmg3a00uQJrGb2GWYHTDTO3PQZv0VhKF6zgs3v6DjIm4Q/5KgPdTZjbTASV rzulebgAVxBLMQxaWSwj/WbSExQ9/gEuyE4lK+zlgWYkSzlPo+fQqdMWecbzsxSfGNHFKB ta5W0pAna7A2oflg+OUDkQ/iFIZFG5VTXaXsFO1N6BPDjw1lghU06rBQ8wHyMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfNvX4yHlz17kL; Fri, 24 Jan 2025 03:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O3ha3F087585; Fri, 24 Jan 2025 03:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O3haTV087582; Fri, 24 Jan 2025 03:43:36 GMT (envelope-from git) Date: Fri, 24 Jan 2025 03:43:36 GMT Message-Id: <202501240343.50O3haTV087582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: f68403f807a5 - stable/13 - kldstat.8: Polish options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f68403f807a53687478291fe4cc6352a5ef14e2b Auto-Submitted: auto-generated The branch stable/13 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f68403f807a53687478291fe4cc6352a5ef14e2b commit f68403f807a53687478291fe4cc6352a5ef14e2b Author: Alexander Ziaee AuthorDate: 2025-01-21 19:55:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-24 03:43:12 +0000 kldstat.8: Polish options + Align and alphabetize options + -q: s/Only/Quietly/ for search + Tag SPDX MFC after: 3 days Reviewed by: gbe, carlavilla, mhorne Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D48325 (cherry picked from commit 8d5d97372361aadb3d6cdfc5f5d1f8edcaa825aa) --- sbin/kldstat/kldstat.8 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/kldstat/kldstat.8 b/sbin/kldstat/kldstat.8 index f7e7552625e3..09094da3741d 100644 --- a/sbin/kldstat/kldstat.8 +++ b/sbin/kldstat/kldstat.8 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Doug Rabson .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 19, 2016 +.Dd January 4, 2025 .Dt KLDSTAT 8 .Os .Sh NAME @@ -48,22 +50,22 @@ utility displays the status of any files dynamically linked into the kernel. .Pp The following options are available: -.Bl -tag -width indentXX +.Bl -tag -width "-n filename" +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl h Display the size field in a human-readable form, using unit suffixes instead of hex values. -.It Fl v -Be more verbose. -.It Fl d -Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. +.It Fl m Ar modname +Display the status of only the module with this modname. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if file is loaded or compiled into the kernel. -.It Fl m Ar modname -Display the status of only the module with this modname. +Quietly check if file is loaded or compiled into the kernel. +.It Fl v +Be more verbose. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jan 24 05:22:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfR594BX4z5kmxm; Fri, 24 Jan 2025 05:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfR590Hbbz3L4Y; Fri, 24 Jan 2025 05:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YqAqlODNE4okaRYKubKb3dzqosvSC4yA/lyGCKKujU=; b=qLUL7rMQ2cNO7c8vYEkSqb2qUnLAPAaaHmgfxrfDuAscxwaHr2TqdpCQvg5N1O7Ax1pDuv Yn1wgx12vcERQuNAF2F6D2gS5H6TsqSQPxlignLi3pPsDTjIKH71VuXSEVzoEKTCrd6sqh LsMlf62prNDcD1hE5eckya6SdsjJdpM9fktv0I20koOaRnPSwnGYsA53yhUxq2NdG2kbHd OIVDnn9dw41kiXscErSPgYKsTjZx9WRNGeEkd8FyaVbIVY4ytnPM3amNxtQ7jpgmV9lYE4 2OI8+eIHjao2oA5MtBKUtTaN0yHS5JLNLTc5uDmoerPQI6hrm4ReM3nRJsrtgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YqAqlODNE4okaRYKubKb3dzqosvSC4yA/lyGCKKujU=; b=KQNxohix6GhgN9rOlNf9YrZta8Ra5XE/UDRp6JYtSnoyBoSkpnU1elr50SkeMQRPeX4vRp KZl7edmzGMcBwg9MqZRLhNsWBQNMNOL8bHS3WSgCyxmGUgpQF+gwh49RXghtER0JwJMRIl yAGdkWZ9njj1kDeQxLt21thEvYc7xvnWTXqVAYHoAjX5L3tmO1lvA+LXXnxzcFBkBSoZF9 ZhWcHwpfaBzgVhnkdJ8lVUULPAWX2iEC7quUmf/rDf0rEq5x3EWuedNbOxTMFCuN5oQ8tG 1MG3dzZoGeVrbqDNhfmxgAR94KX7EDQxAvCY2/9vvY3pVEpJG6AQcQXxtxH8PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737696125; a=rsa-sha256; cv=none; b=L9q8FBJGWWmpvTgbT/5jyZe/eQpBzgdth43VV0K9H4hVa5n6pLC5WnvuOzpI3xsc/tBUqo ynZw9gniUpFdAcUeELtn5q4rqDNaBOKgCxpiyhB7cp61Bi2LpuuTgit19UcY3ZTk+VIpEL SYZ2u1eTnhAfD96dDMEA0oCVPG9XjGUfskr/gshz1rgD3O1lYOF7DuZja6MDuJO5Rgqrfv 2MjetGI+qhaZiKHyhCNI5c5cbFMp78THe8Jzda6tT+Dr3nTIMFMsR2vb4clltufR5SfMAZ bwrnPDWC4c/Lv6J7jDXwDLhmP+FwQ2nfe8JooYimVessdAAcVGnC+PJ6rKjhEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfR5870tsz19yQ; Fri, 24 Jan 2025 05:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O5M4w1073007; Fri, 24 Jan 2025 05:22:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O5M4vt073004; Fri, 24 Jan 2025 05:22:04 GMT (envelope-from git) Date: Fri, 24 Jan 2025 05:22:04 GMT Message-Id: <202501240522.50O5M4vt073004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 13639d5f710b - stable/13 - 13.5: Update stable/13 to -PRERELEASE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13639d5f710b9a578543ac86efd03cbba546666c Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=13639d5f710b9a578543ac86efd03cbba546666c commit 13639d5f710b9a578543ac86efd03cbba546666c Author: Colin Percival AuthorDate: 2025-01-24 05:21:00 +0000 Commit: Colin Percival CommitDate: 2025-01-24 05:21:00 +0000 13.5: Update stable/13 to -PRERELEASE This marks the start of the FreeBSD 13.5 release cycle; the stable/13 tree is now in "code slush". Developers are encouraged to prioritize fixing bugs (and/or merging bug fixes from HEAD) over new features at this time. Commit approval from re@ is not required but if new features introduce problems they may be removed from the release. Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 4 ++-- usr.bin/yacc/config.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index b9f8da60411e..bc2cc8de1cf9 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -52,8 +52,8 @@ # TYPE="FreeBSD" -REVISION="13.4" -BRANCH="STABLE" +REVISION="13.5" +BRANCH="PRERELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/usr.bin/yacc/config.h b/usr.bin/yacc/config.h index d3b415df4366..f7df2f9a9ed2 100644 --- a/usr.bin/yacc/config.h +++ b/usr.bin/yacc/config.h @@ -86,7 +86,7 @@ #define STDC_HEADERS 1 /* Define to the system name. */ -#define SYSTEM_NAME "freebsd13.4" +#define SYSTEM_NAME "freebsd13.5" /* "Define to 1 if you want to use dbmalloc for testing." */ /* #undef USE_DBMALLOC */ From nobody Fri Jan 24 09:38:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfXnM02bPz5l7Sq; Fri, 24 Jan 2025 09:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfXnL6C19z3lJY; Fri, 24 Jan 2025 09:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737711526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGQvAX+gV5WRWkbetMqya076C9852EpYaxMZ/gkgoOs=; b=WKDYsltICRt15nwHAorJjAzkN1wCqXSDfFYa1I6VqxCQLtfakkjuXUo5eIxKjIJjjWch0J yP+8FJiFI41mIrhEU5DXvC9uql71eeWx741Bl/B+w1qv+HIVYVj5TTY0ffuJC4pLO+r9IW Ru6qZ2tWAwDwvToIqc06NmgLYrfuijF6vkHzfkMUn0d5hAn8UToXdh+psvLvtPPXbgjTBP D2g3mXslXZLoPUQtYE8wO9OL6muxSmno7oaLAt5K3Z1UyR2/MLkXGhs/0osGoJEl9jluaW yhXi6OGHxkSdsfeTnbIujGn3dNxkIDUpzPMoJfdJrW8B/la6FLMIkST0ISVZvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737711526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGQvAX+gV5WRWkbetMqya076C9852EpYaxMZ/gkgoOs=; b=w8Iw8VNn8iM24bnNyeyYFjio253sv78511IyYp+SBunCSdrIcq24g6YGw/PGGt5cT5tZ8d 8xOA3tCLBr2j7p8t1/hIMrmabuEA8kvAHipcY7af1F28H6WUrKnIzImyDAzktV4K8LtjNJ AiBKIeoM0e95fyU+UWpIG9A7Ns7kG8ZxRrnAX4TTSTeir/5PXkIsPtdGrxGnAvav30t/xE EjURsp+kRdsqca9qEbv8R8iItOU26JsZgVkJhoSZKG0yZAVDDfW3/a12WD42XojHMmSeOv AwBlCv4eYcaIj+JzZ9xYTlNbvMehPyXt+IJQTtcGH8CGWvB2lbTJu4mScHc9FQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737711526; a=rsa-sha256; cv=none; b=kgvw9X1nmaFLYL0CXgzVshQI3ohwgzWHRdv1LYMLzuKxhOK79GRqd99Jft+gHLy0w1AWv+ yPvdGrE+kOHbtsrVq7HRY131cfr0ojmCq6bDjXXuU5tKlwTB2FkKKyGYKTTphXPl1TWfxV cpQziUwJp3eH+L/yO5oK6crlj4wq/0tpnHXi6zpJbAsV3Bn52yAx8eeVvv06vEDhKtK4Ji 9GPVZfganppUwJiErFSPibzMV0IPG+8U3z1P6fdeyH978UWppMU+rncKxP33g74F7163OX 8uD9odF6WfxHTxhLmpxivdqJGd1bZetEdeVpifgxkt6fT0nILVX5u/lCjZGrNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfXnL5pJlz4Qv; Fri, 24 Jan 2025 09:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50O9ckvc044696; Fri, 24 Jan 2025 09:38:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50O9ckhK044693; Fri, 24 Jan 2025 09:38:46 GMT (envelope-from git) Date: Fri, 24 Jan 2025 09:38:46 GMT Message-Id: <202501240938.50O9ckhK044693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5e0dbbc238e2 - main - if_vxlan(4): Use static initializers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e0dbbc238e2e935c68e293314a90f2ce6e6ef16 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5e0dbbc238e2e935c68e293314a90f2ce6e6ef16 commit 5e0dbbc238e2e935c68e293314a90f2ce6e6ef16 Author: Zhenlei Huang AuthorDate: 2025-01-24 09:37:24 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 09:37:24 +0000 if_vxlan(4): Use static initializers MFC after: 1 week --- sys/net/if_vxlan.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index b7af304e3126..58285c632771 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -419,7 +419,8 @@ static struct mtx vxlan_list_mtx; #define VXLAN_LIST_LOCK() mtx_lock(&vxlan_list_mtx) #define VXLAN_LIST_UNLOCK() mtx_unlock(&vxlan_list_mtx) -static LIST_HEAD(, vxlan_socket) vxlan_socket_list; +static LIST_HEAD(, vxlan_socket) vxlan_socket_list = + LIST_HEAD_INITIALIZER(vxlan_socket_list); static eventhandler_tag vxlan_ifdetach_event_tag; @@ -3609,12 +3610,10 @@ vxlan_tunable_int(struct vxlan_softc *sc, const char *knob, int def) static void vxlan_ifdetach_event(void *arg __unused, struct ifnet *ifp) { - struct vxlan_softc_head list; + struct vxlan_softc_head list = LIST_HEAD_INITIALIZER(list); struct vxlan_socket *vso; struct vxlan_softc *sc, *tsc; - LIST_INIT(&list); - if (ifp->if_flags & IFF_RENAMING) return; if ((ifp->if_flags & IFF_MULTICAST) == 0) @@ -3642,7 +3641,6 @@ vxlan_load(void) { mtx_init(&vxlan_list_mtx, "vxlan list", NULL, MTX_DEF); - LIST_INIT(&vxlan_socket_list); vxlan_ifdetach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event, vxlan_ifdetach_event, NULL, EVENTHANDLER_PRI_ANY); From nobody Fri Jan 24 10:24:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpf3g6Cz5lBl7; Fri, 24 Jan 2025 10:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpf3M9mz3tGp; Fri, 24 Jan 2025 10:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1rznoBpvOGmdOnxezGQ7BxdSzs4pWt8HeC9kpbE3Cc=; b=ZNyQLJhwFJ5D0pDrXBC4aQRLdflW0TFnGVEdQ1r2qamH3RLFh1rCLfdoJAhP/aRfLP/O5L Do1rqTEPtDEyA74HKuCEl+t7e/ni9hPfd4jGEm1M6sIrbJ/59rJxciR7gVE+hc84RvtvSu /Bn0CTjppm5UO/XM6KFpxO9Nk65w79uhfzoAXPVRVgFmqYo3YrZZtt5xcZns0minI0GzUZ mVFMgTTJag0INPRKPal5QdkUIks7oI+7znaWla08qb6c2larDnimEJsdDinw0ry6WvW9+S a/VWm7fV9JE4HGzLm99HicpfyJL+X/JSMCdiOpBq4WiSAY6pF9y7ZRkVIukxew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1rznoBpvOGmdOnxezGQ7BxdSzs4pWt8HeC9kpbE3Cc=; b=OKPFWuBDrRowlpRWL5cHIdZvtnWtoXpnM7Mk5hJ69tefCwJcR7Tz84Rvq6GUoUblH1zoWp HX97PZgzqkcqaCgAVboSbRV0skqAxVyc1IDsxRSrw7CyvtBb7wyh2v+/UkgCIpyWM0ogHO xosob9jOQyqxMEc/BHPK9W2/dqF2/dINRwsExgZg4+hmKZ1n9TBG6Wm6oCkH1nkd/PzPYG VT2dL5arm2QzWQ83wIuLCOAu/tLxgaSqjm36OKyPREVQQ1kzYw02IhbJUmZ9Kcb9djW4Sx BJXzQ1dMxrDUjy76IU8c88CPJjDNRzwRGm8TMhFz6r0bHjhaR30L15ysa8jsLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714298; a=rsa-sha256; cv=none; b=B3AA4rltrrUUAIriPllg9QsrlbKlpgc9IRjCiTEn/zsmmCnt0J9Se69IWrluWBipfVpXX7 UzNc0i/G0LYNWd/Z777w29pCUnF6Lzcs2Gl1AIk/vm9I3vXeed+bfx60uebOA0h4gc5SCS N3UWFhs+feFfzAXOm2RH6kQQSOGcYnN+xNjAaSIMUcnk0+bkk424yMZXojipTZztHq0GnN UTQoBMRSjaDPcvjNKFUc70bXwrYYqqxnYjMRRh8O74dWm1DzafDVpGPQWb3sOoLGZscLC2 DfzbUmg1c2ikI2vD9vNFpyzbvIfqQVkeCb8GOBkyEz0AKXgBnDvr0mltibbdEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpf2vbyz5dB; Fri, 24 Jan 2025 10:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAOwLN038270; Fri, 24 Jan 2025 10:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAOwSB038267; Fri, 24 Jan 2025 10:24:58 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:24:58 GMT Message-Id: <202501241024.50OAOwSB038267@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: 096efeb658b5 - main - pfctl: follow rpool -> rdr rename List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 096efeb658b5a6d63068bd90f3c6508f74767bba Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=096efeb658b5a6d63068bd90f3c6508f74767bba commit 096efeb658b5a6d63068bd90f3c6508f74767bba Author: Kristof Provost AuthorDate: 2025-01-20 08:34:46 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:29 +0000 pfctl: follow rpool -> rdr rename In e11dacbf8484adc7bbb61b20fee3ab8385745925 the redirect pool was renamed from rpool to rdr. It included backwards compatibility support for libpfctl users, but didn't fully implement the rename in our own code. Do so now. No functional change. Sponsored by: Rubicon Communications, LLC ("Netgate") --- contrib/pf/ftp-proxy/filter.c | 6 ++-- contrib/pf/tftp-proxy/filter.c | 6 ++-- sbin/pfctl/parse.y | 80 +++++++++++++++++++++--------------------- sbin/pfctl/pfctl.c | 18 +++++----- sbin/pfctl/pfctl_optimize.c | 26 +++++++------- sbin/pfctl/pfctl_parser.c | 6 ++-- 6 files changed, 71 insertions(+), 71 deletions(-) diff --git a/contrib/pf/ftp-proxy/filter.c b/contrib/pf/ftp-proxy/filter.c index 7d6d3f1fa348..f29467c98d4c 100644 --- a/contrib/pf/ftp-proxy/filter.c +++ b/contrib/pf/ftp-proxy/filter.c @@ -107,8 +107,8 @@ add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); - pfrule.rpool.proxy_port[0] = nat_range_low; - pfrule.rpool.proxy_port[1] = nat_range_high; + pfrule.rdr.proxy_port[0] = nat_range_low; + pfrule.rdr.proxy_port[1] = nat_range_high; if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, pfticket, pfpool_ticket)) return (-1); @@ -141,7 +141,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); - pfrule.rpool.proxy_port[0] = rdr_port; + pfrule.rdr.proxy_port[0] = rdr_port; if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, pfticket, pfpool_ticket)) return (-1); diff --git a/contrib/pf/tftp-proxy/filter.c b/contrib/pf/tftp-proxy/filter.c index 8d5dcc21badc..d462d159d779 100644 --- a/contrib/pf/tftp-proxy/filter.c +++ b/contrib/pf/tftp-proxy/filter.c @@ -111,8 +111,8 @@ add_nat(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); - pfrule.rpool.proxy_port[0] = nat_range_low; - pfrule.rpool.proxy_port[1] = nat_range_high; + pfrule.rdr.proxy_port[0] = nat_range_low; + pfrule.rdr.proxy_port[1] = nat_range_high; if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, pfticket, pfpool_ticket)) return (-1); @@ -145,7 +145,7 @@ add_rdr(u_int32_t id, struct sockaddr *src, struct sockaddr *dst, if (ioctl(pfctl_fd(pfh), DIOCADDADDR, &pfp) == -1) return (-1); - pfrule.rpool.proxy_port[0] = rdr_port; + pfrule.rdr.proxy_port[0] = rdr_port; if (pfctl_add_rule_h(pfh, &pfrule, pfanchor, pfanchor_call, pfticket, pfpool_ticket)) return (-1); diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 4a7bd3125372..2bd8e16b535b 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -2737,9 +2737,9 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; } r.rt = $5.rt; - r.rpool.opts = $5.pool_opts; + r.rdr.opts = $5.pool_opts; if ($5.key != NULL) - memcpy(&r.rpool.key, $5.key, + memcpy(&r.rdr.key, $5.key, sizeof(struct pf_poolhashkey)); } if (r.rt) { @@ -2750,26 +2750,26 @@ pfrule : action dir logquick interface route af proto fromto "matching address family found."); YYERROR; } - if ((r.rpool.opts & PF_POOL_TYPEMASK) == + if ((r.rdr.opts & PF_POOL_TYPEMASK) == PF_POOL_NONE && ($5.host->next != NULL || $5.host->addr.type == PF_ADDR_TABLE || DYNIF_MULTIADDR($5.host->addr))) - r.rpool.opts |= PF_POOL_ROUNDROBIN; - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + r.rdr.opts |= PF_POOL_ROUNDROBIN; + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_table($5.host, "tables are only " "supported in round-robin routing pools")) YYERROR; - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_alias($5.host, "interface (%s) " "is only supported in round-robin " "routing pools")) YYERROR; if ($5.host->next != NULL) { - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN) { - yyerror("r.rpool.opts must " + yyerror("r.rdr.opts must " "be PF_POOL_ROUNDROBIN"); YYERROR; } @@ -4874,59 +4874,59 @@ natrule : nataction interface af proto fromto tag tagged rtable if (check_netmask($9->host, r.af)) YYERROR; - r.rpool.proxy_port[0] = ntohs($9->rport.a); + r.rdr.proxy_port[0] = ntohs($9->rport.a); switch (r.action) { case PF_RDR: if (!$9->rport.b && $9->rport.t && $5.dst.port != NULL) { - r.rpool.proxy_port[1] = + r.rdr.proxy_port[1] = ntohs($9->rport.a) + (ntohs( $5.dst.port->port[1]) - ntohs( $5.dst.port->port[0])); } else - r.rpool.proxy_port[1] = + r.rdr.proxy_port[1] = ntohs($9->rport.b); break; case PF_NAT: - r.rpool.proxy_port[1] = + r.rdr.proxy_port[1] = ntohs($9->rport.b); - if (!r.rpool.proxy_port[0] && - !r.rpool.proxy_port[1]) { - r.rpool.proxy_port[0] = + if (!r.rdr.proxy_port[0] && + !r.rdr.proxy_port[1]) { + r.rdr.proxy_port[0] = PF_NAT_PROXY_PORT_LOW; - r.rpool.proxy_port[1] = + r.rdr.proxy_port[1] = PF_NAT_PROXY_PORT_HIGH; - } else if (!r.rpool.proxy_port[1]) - r.rpool.proxy_port[1] = - r.rpool.proxy_port[0]; + } else if (!r.rdr.proxy_port[1]) + r.rdr.proxy_port[1] = + r.rdr.proxy_port[0]; break; default: break; } - r.rpool.opts = $10.type; - if ((r.rpool.opts & PF_POOL_TYPEMASK) == + r.rdr.opts = $10.type; + if ((r.rdr.opts & PF_POOL_TYPEMASK) == PF_POOL_NONE && ($9->host->next != NULL || $9->host->addr.type == PF_ADDR_TABLE || DYNIF_MULTIADDR($9->host->addr))) - r.rpool.opts = PF_POOL_ROUNDROBIN; - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + r.rdr.opts = PF_POOL_ROUNDROBIN; + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_table($9->host, "tables are only " "supported in round-robin redirection " "pools")) YYERROR; - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_alias($9->host, "interface (%s) " "is only supported in round-robin " "redirection pools")) YYERROR; if ($9->host->next != NULL) { - if ((r.rpool.opts & PF_POOL_TYPEMASK) != + if ((r.rdr.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN) { yyerror("only round-robin " "valid for multiple " @@ -4937,11 +4937,11 @@ natrule : nataction interface af proto fromto tag tagged rtable } if ($10.key != NULL) - memcpy(&r.rpool.key, $10.key, + memcpy(&r.rdr.key, $10.key, sizeof(struct pf_poolhashkey)); if ($10.opts) - r.rpool.opts |= $10.opts; + r.rdr.opts |= $10.opts; if ($10.staticport) { if (r.action != PF_NAT) { @@ -4949,17 +4949,17 @@ natrule : nataction interface af proto fromto tag tagged rtable "only valid with nat rules"); YYERROR; } - if (r.rpool.proxy_port[0] != + if (r.rdr.proxy_port[0] != PF_NAT_PROXY_PORT_LOW && - r.rpool.proxy_port[1] != + r.rdr.proxy_port[1] != PF_NAT_PROXY_PORT_HIGH) { yyerror("the 'static-port' option can't" " be used when specifying a port" " range"); YYERROR; } - r.rpool.proxy_port[0] = 0; - r.rpool.proxy_port[1] = 0; + r.rdr.proxy_port[0] = 0; + r.rdr.proxy_port[1] = 0; } if ($10.mape.offset) { @@ -4973,16 +4973,16 @@ natrule : nataction interface af proto fromto tag tagged rtable " can't be used 'static-port'"); YYERROR; } - if (r.rpool.proxy_port[0] != + if (r.rdr.proxy_port[0] != PF_NAT_PROXY_PORT_LOW && - r.rpool.proxy_port[1] != + r.rdr.proxy_port[1] != PF_NAT_PROXY_PORT_HIGH) { yyerror("the 'map-e-portset' option" " can't be used when specifying" " a port range"); YYERROR; } - r.rpool.mape = $10.mape; + r.rdr.mape = $10.mape; } o = keep_state_defaults; @@ -5170,13 +5170,13 @@ binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag YYERROR; } - TAILQ_INIT(&binat.rpool.list); + TAILQ_INIT(&binat.rdr.list); pa = calloc(1, sizeof(struct pf_pooladdr)); if (pa == NULL) err(1, "binat: calloc"); pa->addr = $13->host->addr; pa->ifname[0] = 0; - TAILQ_INSERT_TAIL(&binat.rpool.list, + TAILQ_INSERT_TAIL(&binat.rdr.list, pa, entries); free($13); @@ -5521,7 +5521,7 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) problems++; } } - if (r->rpool.opts & PF_POOL_STICKYADDR && !r->keep_state) { + if (r->rdr.opts & PF_POOL_STICKYADDR && !r->keep_state) { yyerror("'sticky-address' requires 'keep state'"); problems++; } @@ -5549,8 +5549,8 @@ rdr_consistent(struct pfctl_rule *r) yyerror("dst port only applies to tcp/udp/sctp"); problems++; } - if (r->rpool.proxy_port[0]) { - yyerror("rpool port only applies to tcp/udp/sctp"); + if (r->rdr.proxy_port[0]) { + yyerror("rdr port only applies to tcp/udp/sctp"); problems++; } } @@ -6320,7 +6320,7 @@ expand_rule(struct pfctl_rule *r, errx(1, "expand_rule: strlcpy"); } else pa->ifname[0] = 0; - TAILQ_INSERT_TAIL(&r->rpool.list, pa, entries); + TAILQ_INSERT_TAIL(&r->rdr.list, pa, entries); } TAILQ_INIT(&r->nat.list); for (h = nat_hosts; h != NULL; h = h->next) { diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index ca374ca3295d..9da13daee063 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1302,7 +1302,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, goto error; } - if (pfctl_get_pool(dev, &rule.rpool, + if (pfctl_get_pool(dev, &rule.rdr, nr, ri.ticket, PF_SCRUB, path, PF_RDR) != 0) goto error; @@ -1323,7 +1323,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, case PFCTL_SHOW_NOTHING: break; } - pfctl_clear_pool(&rule.rpool); + pfctl_clear_pool(&rule.rdr); } ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { @@ -1337,7 +1337,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, goto error; } - if (pfctl_get_pool(dev, &rule.rpool, + if (pfctl_get_pool(dev, &rule.rdr, nr, ri.ticket, PF_PASS, path, PF_RDR) != 0) goto error; @@ -1409,7 +1409,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, case PFCTL_SHOW_NOTHING: break; } - pfctl_clear_pool(&rule.rpool); + pfctl_clear_pool(&rule.rdr); } error: @@ -1498,7 +1498,7 @@ pfctl_show_nat(int dev, char *path, int opts, char *anchorname, int depth, warnc(ret, "DIOCGETRULE"); return (-1); } - if (pfctl_get_pool(dev, &rule.rpool, nr, + if (pfctl_get_pool(dev, &rule.rdr, nr, ri.ticket, nattype[i], path, PF_RDR) != 0) return (-1); if (pfctl_get_pool(dev, &rule.nat, nr, @@ -1755,8 +1755,8 @@ pfctl_append_rule(struct pfctl *pf, struct pfctl_rule *r, if ((rule = calloc(1, sizeof(*rule))) == NULL) err(1, "calloc"); bcopy(r, rule, sizeof(*rule)); - TAILQ_INIT(&rule->rpool.list); - pfctl_move_pool(&r->rpool, &rule->rpool); + TAILQ_INIT(&rule->rdr.list); + pfctl_move_pool(&r->rdr, &rule->rdr); TAILQ_INSERT_TAIL(rs->rules[rs_num].active.ptr, rule, entries); return (0); @@ -2057,7 +2057,7 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) errc(1, error, "DIOCBEGINADDRS"); } - if (pfctl_add_pool(pf, &r->rpool, r->af, PF_RDR)) + if (pfctl_add_pool(pf, &r->rdr, r->af, PF_RDR)) return (1); if (pfctl_add_pool(pf, &r->nat, r->naf ? r->naf : r->af, PF_NAT)) return (1); @@ -2085,7 +2085,7 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) printf(" -- rule was already present"); } path[len] = '\0'; - pfctl_clear_pool(&r->rpool); + pfctl_clear_pool(&r->rdr); return (0); } diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index a688fe484128..48b9a9caa82d 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -135,7 +135,7 @@ static struct pf_rule_field { PF_RULE_FIELD(return_ttl, BREAK), PF_RULE_FIELD(overload_tblname, BREAK), PF_RULE_FIELD(flush, BREAK), - PF_RULE_FIELD(rpool, BREAK), + PF_RULE_FIELD(rdr, BREAK), PF_RULE_FIELD(logif, BREAK), /* @@ -290,12 +290,12 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) if ((por = calloc(1, sizeof(*por))) == NULL) err(1, "calloc"); memcpy(&por->por_rule, r, sizeof(*r)); - if (TAILQ_FIRST(&r->rpool.list) != NULL) { - TAILQ_INIT(&por->por_rule.rpool.list); - pfctl_move_pool(&r->rpool, &por->por_rule.rpool); + if (TAILQ_FIRST(&r->rdr.list) != NULL) { + TAILQ_INIT(&por->por_rule.rdr.list); + pfctl_move_pool(&r->rdr, &por->por_rule.rdr); } else - bzero(&por->por_rule.rpool, - sizeof(por->por_rule.rpool)); + bzero(&por->por_rule.rdr, + sizeof(por->por_rule.rdr)); TAILQ_INSERT_TAIL(&opt_queue, por, por_entry); @@ -325,8 +325,8 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) if ((r = calloc(1, sizeof(*r))) == NULL) err(1, "calloc"); memcpy(r, &por->por_rule, sizeof(*r)); - TAILQ_INIT(&r->rpool.list); - pfctl_move_pool(&por->por_rule.rpool, &r->rpool); + TAILQ_INIT(&r->rdr.list); + pfctl_move_pool(&por->por_rule.rdr, &r->rdr); TAILQ_INSERT_TAIL( rs->rules[PF_RULESET_FILTER].active.ptr, r, entries); @@ -912,14 +912,14 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) memcpy(&por->por_rule, &rule, sizeof(por->por_rule)); rs = pf_find_or_create_ruleset(anchor_call); por->por_rule.anchor = rs->anchor; - if (TAILQ_EMPTY(&por->por_rule.rpool.list)) - memset(&por->por_rule.rpool, 0, - sizeof(por->por_rule.rpool)); + if (TAILQ_EMPTY(&por->por_rule.rdr.list)) + memset(&por->por_rule.rdr, 0, + sizeof(por->por_rule.rdr)); TAILQ_INSERT_TAIL(&queue, por, por_entry); - /* XXX pfctl_get_pool(pf->dev, &rule.rpool, nr, pr.ticket, + /* XXX pfctl_get_pool(pf->dev, &rule.rdr, nr, pr.ticket, * PF_PASS, pf->anchor) ??? - * ... pfctl_clear_pool(&rule.rpool) + * ... pfctl_clear_pool(&rule.rdr) */ } diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index af10bdcf7e4b..85f1797e58e1 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -942,7 +942,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer else if (r->rt == PF_DUPTO) printf(" dup-to"); printf(" "); - print_pool(&r->rpool, 0, 0, r->af, PF_PASS); + print_pool(&r->rdr, 0, 0, r->af, PF_PASS); } if (r->af) { if (r->af == AF_INET) @@ -1253,8 +1253,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer (r->action == PF_NAT || r->action == PF_BINAT || r->action == PF_RDR)) { printf(" -> "); - print_pool(&r->rpool, r->rpool.proxy_port[0], - r->rpool.proxy_port[1], r->af, r->action); + print_pool(&r->rdr, r->rdr.proxy_port[0], + r->rdr.proxy_port[1], r->af, r->action); } } From nobody Fri Jan 24 10:24:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpg5mg2z5lBbr; Fri, 24 Jan 2025 10:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpg3yx4z3tJQ; Fri, 24 Jan 2025 10:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F9Q6Z20ZIplYf4J8FN+ytqornOoqmTkC29gzdRkLfaI=; b=LsMjo1e0CaDrZu5wzMWx5SreJHhJlxasLw9CA0+s3IYsk8kTB7z6kzVjof3IxmyGjKR9E+ vyC5AqoGDxCn3tDA4jRNZriE4oYpXg+0ZU9vGIiirVl1nvue1Q3PxhAHsWm5/lEO5wP0DO BTVjpYozE5+RAtPIOiEXYGtnKKfoys1bPK+EnXEMeinYqEs/s6ZauIjkAIAVgjFAo8tAfG qIbUlYx6AZg1momWG84KFxUzmOedaCmZT6NmFEUCcHcq4t+Y5lf4zwHt47Zpb0g+2j4AwK PV8RL+Yy0B/55a6qlvC/GOwofxfiKSftOBqyDw/B2z6en3HrW2NneDAd0iK9kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F9Q6Z20ZIplYf4J8FN+ytqornOoqmTkC29gzdRkLfaI=; b=L/IFcnHdFpc2VN1vHu63dL0XEBlEYPWACQykiwsbGClhNPC5N7WX8CMLzx0+L+9EgEKk3S UawitAbaNRmLF/Gf0A3EUqh2DcfItOWug82jBrndQ1RT5ehzD/WHA45j0gwQ1U5HPihzQ/ bH8HvH1hOX0aNXV2EdQX+iJ5wLYXkq4OMjnn/LZHO36TlZcs4W+MtDSY4C+fQYcgnmifOJ Dr9PuvryMRVCrw9nfmwqodGdV2pzdIyCsnOGUxlYuj2pyvyfd3pY6cn7N24nW3Et0cDhVq Go9iIgeju8BULfR2V3VjSB+lfrfdeSMIR+T410gutYH8bnmcxGBWdCgLeQGQLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714299; a=rsa-sha256; cv=none; b=NVnuL4GjogrU+vnahvfw9TwFHr+ChgzDzcvp802T7f+zFeF1wckTLoEY0hbdcyXt/GsrTl avTUT2p4vBtyeBZZjSpx4x9Bk19Tt2ohXFVjrVD6ds2Nkm/tgCNFLkDPqyPRfw1DFsFD3L KgsK8L7M+zyeInnEeXBOEgvBlHJLYbF6EwxPtJ7px34GJ4lz70takqEnyRHw4Y2Kdm8eQ4 l1iaPk+SUn7wi1uANdivNMevabdei8axNRhfwi0mswBAQod9QpKYEDFBJY1Qu6sJTtFhVr cOXB0Nsyk/+Y98ThlEMgkKjJy828HjJYgyDMDeZuBYl2IJckn2jaYRX1D+WdnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpg3ZVGz64x; Fri, 24 Jan 2025 10:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAOxiU038305; Fri, 24 Jan 2025 10:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAOx0j038302; Fri, 24 Jan 2025 10:24:59 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:24:59 GMT Message-Id: <202501241024.50OAOx0j038302@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: 5cb08fddef99 - main - pfctl: improve NAT pool handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5cb08fddef998b5e6452df3f52474e00883e06c4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5cb08fddef998b5e6452df3f52474e00883e06c4 commit 5cb08fddef998b5e6452df3f52474e00883e06c4 Author: Kristof Provost AuthorDate: 2025-01-20 13:11:20 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:29 +0000 pfctl: improve NAT pool handling Ensure we always free the NAT pool (as well as the rdr pool) and actually handle it in the optimiser. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 1 + sbin/pfctl/pfctl.c | 5 +++++ sbin/pfctl/pfctl_optimize.c | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 2bd8e16b535b..e66d3cdd295e 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5171,6 +5171,7 @@ binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag } TAILQ_INIT(&binat.rdr.list); + TAILQ_INIT(&binat.nat.list); pa = calloc(1, sizeof(struct pf_pooladdr)); if (pa == NULL) err(1, "binat: calloc"); diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 9da13daee063..7b54bc1c7c7a 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1324,6 +1324,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, break; } pfctl_clear_pool(&rule.rdr); + pfctl_clear_pool(&rule.nat); } ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { @@ -1410,6 +1411,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, break; } pfctl_clear_pool(&rule.rdr); + pfctl_clear_pool(&rule.nat); } error: @@ -1757,6 +1759,8 @@ pfctl_append_rule(struct pfctl *pf, struct pfctl_rule *r, bcopy(r, rule, sizeof(*rule)); TAILQ_INIT(&rule->rdr.list); pfctl_move_pool(&r->rdr, &rule->rdr); + TAILQ_INIT(&rule->nat.list); + pfctl_move_pool(&r->nat, &rule->nat); TAILQ_INSERT_TAIL(rs->rules[rs_num].active.ptr, rule, entries); return (0); @@ -2086,6 +2090,7 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) } path[len] = '\0'; pfctl_clear_pool(&r->rdr); + pfctl_clear_pool(&r->nat); return (0); } diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 48b9a9caa82d..a97664e0c929 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -136,6 +136,7 @@ static struct pf_rule_field { PF_RULE_FIELD(overload_tblname, BREAK), PF_RULE_FIELD(flush, BREAK), PF_RULE_FIELD(rdr, BREAK), + PF_RULE_FIELD(nat, BREAK), PF_RULE_FIELD(logif, BREAK), /* @@ -296,7 +297,12 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) } else bzero(&por->por_rule.rdr, sizeof(por->por_rule.rdr)); - + if (TAILQ_FIRST(&r->nat.list) != NULL) { + TAILQ_INIT(&por->por_rule.nat.list); + pfctl_move_pool(&r->nat, &por->por_rule.nat); + } else + bzero(&por->por_rule.nat, + sizeof(por->por_rule.nat)); TAILQ_INSERT_TAIL(&opt_queue, por, por_entry); } @@ -327,6 +333,8 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) memcpy(r, &por->por_rule, sizeof(*r)); TAILQ_INIT(&r->rdr.list); pfctl_move_pool(&por->por_rule.rdr, &r->rdr); + TAILQ_INIT(&r->nat.list); + pfctl_move_pool(&por->por_rule.nat, &r->nat); TAILQ_INSERT_TAIL( rs->rules[PF_RULESET_FILTER].active.ptr, r, entries); @@ -915,6 +923,9 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks) if (TAILQ_EMPTY(&por->por_rule.rdr.list)) memset(&por->por_rule.rdr, 0, sizeof(por->por_rule.rdr)); + if (TAILQ_EMPTY(&por->por_rule.nat.list)) + memset(&por->por_rule.nat, 0, + sizeof(por->por_rule.nat)); TAILQ_INSERT_TAIL(&queue, por, por_entry); /* XXX pfctl_get_pool(pf->dev, &rule.rdr, nr, pr.ticket, From nobody Fri Jan 24 10:25:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpj2Yxkz5lBc6; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYph5t6Xz3t32; Fri, 24 Jan 2025 10:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f/ACxx4bRdzAbH1KGq0Xq4YXOP3/qw17D/h/drjRaMc=; b=jPBgWyE42k+j2ChQ10kpaLa3B7tIHzqkhOqB/0xTyn0wQ2qHCTtX9WOZZrA7b4nMKXixbv j+SmW+MyRHAomUe3bcAiLqmePRiM9lqcSfVgs1SD+R7mvzzbemG7k9ID/XeLKgTuFjknB5 nrovutUPJ5yNjpRQRG5K9+cHFCWcL47oDRYETCKvgZb4uH8qhVorEVxunKZBoAZGWz/FTj HfZWheBa8J5A9G37xSpDe2QAK9oySzuXAT73X354hk1T2WTZuJgRHK5EauiPqKAqLBL5lL fLBfSUq5F/oCHI6T//k4Z8NziuPt41UMFCCUXeOs7dfFUj9uHywpVjaVJYeHFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f/ACxx4bRdzAbH1KGq0Xq4YXOP3/qw17D/h/drjRaMc=; b=G2iNXTeQzv0ATV/lnRFGg0lhB1Wi6uYEF8OmgADyscMmPvnydgTQ/q2Ql00u3f3l+iO2TY gn5tOSrqOIf+Zzpc25wLqGa6DY4WsBNszUHHEI88MfWAx/A1p/lBsegu2SgxwG3t5x1xDU OM4hcL2siHiII3LRAmWVSehkrxyJLc1KEveXAJA31IdTsYQbpzngHWF0kJjjsLl7X3lFjh Lup3lzB28LyBQrzQCWlj69ht2ufllsEs1gqnUkfDjQW5/Xv7UV5prCC6h/6FHK8tm0a5Wa Gk4vBULEzf7VOJnF2NlCLjQY9+UMBUJ7BBI12AJxFmPe/lqy53JBV5VQ4rUPyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714300; a=rsa-sha256; cv=none; b=H53eFJj0q/+m0605VJbahbzHug5RUcKQPPwKVbvDjMSvMUBKiGMnWMD2JCK9ZmwwNtOSkL 3RpR49QgvUmbHEueGZTF2Pxs/YuZS0qYZWMSbs+IsKdKLBJVcC3dcB02uFOaVvWNaSTP/W FayIwLOSzqlefJKq/ZLb6goNujXn1DgDs/Pq+9DVuZk69M0+eVMTWtGGn7Qy5NiA4/tbig 2H4xAoHyBCTKNHW3D8cJQCvud6Zu3cdhi1d/SZmLHT7W7XIQjwy3mp8CVAKEAj6QZMPmX8 znrhi8Eiqbx5ba7C2dNarP6aizeTMntwsU5oGKASjfBCGRA8qjzike+fzTglwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYph4khjz5v0; Fri, 24 Jan 2025 10:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP03g038359; Fri, 24 Jan 2025 10:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP0tf038356; Fri, 24 Jan 2025 10:25:00 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:00 GMT Message-Id: <202501241025.50OAP0tf038356@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: 3331975ab18f - main - pf: check rather than assert pool type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3331975ab18f88a519b16e5c4781f5924b191eb7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3331975ab18f88a519b16e5c4781f5924b191eb7 commit 3331975ab18f88a519b16e5c4781f5924b191eb7 Author: Kristof Provost AuthorDate: 2025-01-20 16:19:22 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:30 +0000 pf: check rather than assert pool type These pool types are passed by userspace, so we must check rather than assert they are valid. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 188681329b43..d206a9f8da43 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2566,7 +2566,8 @@ pf_ioctl_add_addr(struct pf_nl_pooladdr *pp) struct pfi_kkif *kif = NULL; int error; - MPASS(pp->which == PF_RDR || pp->which == PF_NAT); + if (pp->which != PF_RDR && pp->which != PF_NAT) + return (EINVAL); #ifndef INET if (pp->af == AF_INET) @@ -2631,7 +2632,8 @@ pf_ioctl_get_addrs(struct pf_nl_pooladdr *pp) PF_RULES_RLOCK_TRACKER; - MPASS(pp->which == PF_RDR || pp->which == PF_NAT); + if (pp->which != PF_RDR && pp->which != PF_NAT) + return (EINVAL); pp->anchor[sizeof(pp->anchor) - 1] = 0; pp->nr = 0; @@ -2657,7 +2659,8 @@ pf_ioctl_get_addr(struct pf_nl_pooladdr *pp) struct pf_kpooladdr *pa; u_int32_t nr = 0; - MPASS(pp->which == PF_RDR || pp->which == PF_NAT); + if (pp->which != PF_RDR && pp->which != PF_NAT) + return (EINVAL); PF_RULES_RLOCK_TRACKER; From nobody Fri Jan 24 10:25:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpk1pbPz5lBjh; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpj5vV7z3tH3; Fri, 24 Jan 2025 10:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fz6Gv/mKJldSvwB8GoqxQl0UB619Pdp0O/nEyaZKgoE=; b=QvRlsJl0VRLQB1ZpraiEgryLIw2MLw/Oh7R7pguxjxE044iBH0IcN3EdKki0hEzprYhhSS xqLTzrCxToEcdwqBM+v/3BXAUCimoa7HXcXYluTf/zlreqxWtV0mR8Uk/ES4JRnox741O1 yp7nTJVliWpLEnEv/vJrp2rEjUNM/Gjh2oTHJjCu1ZmdOWlu7i/yKxMCQSCP7Hq7OPPTIE 9JGTVbNkqPgzXp4UrdihaKOTaXZ/Grm6S8WDedoMkbMRuQG2k2Vl5wIqR4p0rE6dUDqhUT yKrYzs4tTx+Wu2ednqhrURHHXY83qOUMNlaDgwmiuhTRAFW16R3DqJFf4Ru5GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fz6Gv/mKJldSvwB8GoqxQl0UB619Pdp0O/nEyaZKgoE=; b=HofCkRYGHxvlbBxmrDOyouYa11Ny3eBgXtLfT0j7vL8CUEGYu0X4PiJF50tDQlnaEUVPei 8jVXWJEfbG6objI2cVomkZD8nOn+Qq9U23g44moaKtT1QpDdqvSQSOhd11YFi6CF6+Si3d H4qrqhuQQqtV6/iBpC6c/MJpB6FivWqmwKsQcHHLEmwxXoBCdugPsQ/4KS/MRaZ+TaiSKf Lb/+U25HLRFpdy1Qr/ljRZzLj9DghFMowebLA+H1ZMcJ3dN1Lto6JLkTfFza4A45AFRclN jcH1fH58zD4aRw57RYqF39j3y4HKqtFjDEiajPANHXupudkR7NFbWgdENMe8xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714301; a=rsa-sha256; cv=none; b=UlNH9SQ0cFURVnRfjHgPCl0JxZsVcHqXB8l7crsAE2NU2n+yEVFgUR1++qoj3heMLX+mCr fP3luaArgvOFGkZoFWINUV/Tr42lzuAlMWX5D0nyOt1997/A0ZJklPqNdv/9mo5YmQENQ0 BTLDJM3ujd7617O/TSdL2TQAsfkLUnDu/doW6DDvvgvk7o+UDA7y3Sg2Df8OGcDt+iPacv wzIz6QV/DxvyBewmlGGXVinDTIcDJIhU61/+d2lOd3IV7c2I4Z+3hncmYaLi+7GU4YPdXE dCYx5FWeNQoCRzsd1BmwZbXxMTETXWY+yqpkNFqL+BDsjgdJMYYMc1rsEsI96A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpj5Pzmz5f7; Fri, 24 Jan 2025 10:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP1Qe038396; Fri, 24 Jan 2025 10:25:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP14W038393; Fri, 24 Jan 2025 10:25:01 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:01 GMT Message-Id: <202501241025.50OAP14W038393@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: af33f86e6aef - main - carp: don't unintentionally revert to multicast mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: af33f86e6aef6b15c8aa3da615167272aa7a3ee3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=af33f86e6aef6b15c8aa3da615167272aa7a3ee3 commit af33f86e6aef6b15c8aa3da615167272aa7a3ee3 Author: Kristof Provost AuthorDate: 2025-01-21 09:49:55 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:30 +0000 carp: don't unintentionally revert to multicast mode PR: 284140 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/ifconfig/carp.c | 4 ---- tests/sys/netinet/carp.sh | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index 36b5d85ab7b8..7c7398f92d48 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -292,10 +292,6 @@ static struct afswtch af_carp = { static __constructor void carp_ctor(void) { - /* Default to multicast. */ - setcarp_mcast(NULL, NULL, 0); - setcarp_mcast6(NULL, NULL, 0); - for (size_t i = 0; i < nitems(carp_cmds); i++) cmd_register(&carp_cmds[i]); af_register(&af_carp); diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 39cfad14907c..f9e47c70f492 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -202,8 +202,11 @@ unicast_v4_body() atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ ping -c 3 192.0.2.1 - jexec carp_uni_v4_two ifconfig - jexec carp_uni_v4_three ifconfig + # Check that we remain in unicast when tweaking settings + atf_check -s exit:0 -o ignore \ + jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 + atf_check -s exit:0 -o match:"peer 198.51.100.130" \ + jexec carp_uni_v4_two ifconfig ${epair_one}b } unicast_v4_cleanup() From nobody Fri Jan 24 10:25:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpl3h7Sz5lC1x; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpl1Th2z3t6h; Fri, 24 Jan 2025 10:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZJzBc7MWNUJhntcMos63TqZ7nNnBcgFa4QAJJGJG5h8=; b=dQXeQcRZOAmeaBulgSBLIQvJWiH+xskLFxwERfDiQWsgLEmkFuXrSulWx0Uy1LVt2oO7mE AbBXJzFcgFCX+7KZBDziPvM5V29cWM4eilKiNDcbxQWJr228KOBAtXmXMVXJavOBv3AjFx OwZqqmeAG9si5mdjogGgya6/zB6kX+cF0a/gP/6O0XDfW1fOL3UUIjD7IwMqucRV+x5Sx9 tOZ4cLBQky/xnMPXTx1qKNqIJ6DsuE62bmpkFVgA8GMCCgDHzQZIXJwa9V6MzCprfkTzEp 5P8gKFrzVtkqmSebGnVI60a1Z1mSkpWF9DxsHZkuIX8A50uOaqicDLgWg6W44w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZJzBc7MWNUJhntcMos63TqZ7nNnBcgFa4QAJJGJG5h8=; b=qEyE/45OYqwRHnF86K8QO9VHsFkpY7xP4h9v+2LMGi6/VIHJ3ogmbS0eVSRun+fVv5ZBjS 6RqcMKNGse3xrEAwIFhd/2nnMArgGXyUX7pKpROuLD91PVJRWwiB0Dp7A7ip1XVOShxzlL 8Sj8WmOmpqijZYaLt20XMd2sF9MxOV16iSWrlQJchVyD+51Q+o/zQVYdhDHk54t9+RAr/f hmadfXsjbh9wsc3E+3NJUPOKnK9UzcPxAQfiQfHT+VtYpmAov+eKXWS7VjF7+rzgOiNajn Iawy/vOBqk+xMEieeOggoiuoN5Jyh4qmCDEz1Blc2zEIsCyTjdR6SBYX4hSuTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714303; a=rsa-sha256; cv=none; b=pI0xy6EiUsT1EUiNmS7OfJSlt1Ap8j3O2JTFvkiVjrLQXSOlUmIKQwv1G6+21do63rg3Lx J+7IqDdCHj3L/3AxKN3pT4XwgL/YQF/NqlzSita0AO3JBYk97Y8liFnFfo9FWSrAEM+KAb GEuLtCRgzF78E/ypQeRt9qv2GgOUz9n/gNttVFvXBMDy5rbw+0gOwyJTgCMl6HupapQ4rC wsicNqzUmASr1CLTwrpNNuV6MVKPtrTZo5dxUcjVEVPeZBCI/LcI8phgV2PQfvxKP25hva xeK3em7T7SYTea8sMei4XWO7NdpPI6QJknqOYm/hH74qOYJgQjtja8nLO2X4vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpk6hKlz5WN; Fri, 24 Jan 2025 10:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP2lX038430; Fri, 24 Jan 2025 10:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP2FP038427; Fri, 24 Jan 2025 10:25:02 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:02 GMT Message-Id: <202501241025.50OAP2FP038427@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: 899e79760dcc - main - pfctl: allow an implicit address family for af-to rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 899e79760dcce8c9358caf2e2bddfe1ba3ad6dee Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=899e79760dcce8c9358caf2e2bddfe1ba3ad6dee commit 899e79760dcce8c9358caf2e2bddfe1ba3ad6dee Author: Kristof Provost AuthorDate: 2025-01-23 08:46:06 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:30 +0000 pfctl: allow an implicit address family for af-to rules If the address family can be determined by the "from" or "to" parameter in the matching part, it is no longer necessary to specify "inet" or "inet6" there. OK henning@ mikeb@ Obtained from: OpenBSD, bluhm , ff33038bc1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 17 +++++------------ sbin/pfctl/tests/files/pf1025.in | 1 + sbin/pfctl/tests/files/pf1025.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index e66d3cdd295e..ab74d2dd57ab 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -2422,19 +2422,8 @@ pfrule : action dir logquick interface route af proto fromto r.scrub_flags |= PFSTATE_SETPRIO; } - if ($9.marker & FOM_AFTO) { - if (!$6) { - yyerror("must indicate source address " - "family with af-to"); - YYERROR; - } - if ($6 == $9.nat.af) { - yyerror("incorrect address family " - "translation"); - YYERROR; - } + if ($9.marker & FOM_AFTO) r.rule_flag |= PFRULE_AFTO; - } r.af = $6; if ($9.tag) @@ -5465,6 +5454,10 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) yyerror("must indicate address family with icmp-type/code"); problems++; } + if (r->rule_flag & PFRULE_AFTO && r->af == r->naf) { + yyerror("must indicate different address family with af-to"); + problems++; + } if (r->overload_tblname[0] && r->max_src_conn == 0 && r->max_src_conn_rate.seconds == 0) { yyerror("'overload' requires 'max-src-conn' " diff --git a/sbin/pfctl/tests/files/pf1025.in b/sbin/pfctl/tests/files/pf1025.in new file mode 100644 index 000000000000..d4ad821a6899 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1025.in @@ -0,0 +1 @@ +pass in from 10.0.0.0/8 af-to inet6 from 2001:db8::1 diff --git a/sbin/pfctl/tests/files/pf1025.ok b/sbin/pfctl/tests/files/pf1025.ok new file mode 100644 index 000000000000..8f48c987c6a0 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1025.ok @@ -0,0 +1 @@ +pass in inet from 10.0.0.0/8 to any flags S/SA keep state af-to inet6 from 2001:db8::1 diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 62bb87e680d8..0a523386c16c 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -133,3 +133,4 @@ PFCTL_TEST(1021, "Endpoint-independent") PFCTL_TEST(1022, "Test received-on") PFCTL_TEST(1023, "Test match log(matches)") PFCTL_TEST(1024, "nat64") +PFCTL_TEST(1025, "nat64 with implicit address family") From nobody Fri Jan 24 10:25:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpn404mz5lC4L; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpn1t6qz3tQ3; Fri, 24 Jan 2025 10:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9KAx6rijQnYgq0biNz2aeberGigoRmxZIbDM/1/iyu0=; b=ODx3B0XAGczVsua83z9idV8q/FP+qzSbe/k3F0jYWHt7yHYdmxDmkDGrUwvQTzmGyLlavF kw7KYzqWIQCltBNljuRMpPSgxCXL/fISwcsgXkYLQihcpKXLzjcEZlZGR26gonsifyZZfg hJ9f4ZHpNFE3ye3Zua0AH5knnjX+oYXB40a48ZD9nXSTGpsVM23rf8dfUfeLUBuf/GuK5H KVnfJTZvkYayt7XMEVB979ayybAmnq9PHddTJhYXkQ73hdaQB1Py47ng14F0GIi4yHEYqZ jFPq/wQlwXuv4pOSqhSlJyzQJo9yzr2LATy+xtlf1FdHCE9zAI2tNYGkT51C3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9KAx6rijQnYgq0biNz2aeberGigoRmxZIbDM/1/iyu0=; b=pJ1q+SXfIB2Qgp+Mrs5e2YL+SibTGs0dm6p4V7T3r6pQ8YthL5EVlSs8PsFxtqplv+BUVB Ed3FtLAvIGiSdm72FtMmGy2DU13C65RUlmtJgM/vkpjmGStI2M9X2DO6ZpaPPrfh02tZF7 5Lges3G1/nkyeaj5n5iB44e5CTQMUtXFbUDisbWm+s1oGlq7HM+eRYHwaXtQta/L6d6l/J nXYa75RD93QPaGV9YkkL/35Mx77ocURk/dbY4NsOPUEcK50AK8cpIaivMvkyXSHPZQUXGs jy07TZY46y8Cx2z5b2YnXR78EyZ2MbMrnO/HtYrCHrhsND4/e4L0frGVSntiLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714305; a=rsa-sha256; cv=none; b=axJzCikYe6p0fHkQseQmIjszRPsmW4IsRV0qcGL5eDwbVkfPOzV2/lKY5LvtqpatVLGoCW cBwSRL+gG93S8PL4A6i34r0JtRX/+fE2GluJh6ZmDqlsAj8CgA7LnTDE/3MkZJUJfpbd2u c1WliS450jwx0sXshflQBhPAGQa4mW2L2GI3pLy9Eza009olnaT9R/ZXVbWCGC3T6AUBVu 7l7L4SGuLPFRCalj93qHqvkgfxTpNf9J4lwyDL2AKgvHwn0B7HFYgmQhm7HUE+QADeVYwL YBU/5wERama/wazw/XAhT9Mcos1orVzqEfs/zIQjDaP17hEXBILIZOTKJ3Fdhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpn1QVhz5dC; Fri, 24 Jan 2025 10:25:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP5uT038498; Fri, 24 Jan 2025 10:25:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP5wq038495; Fri, 24 Jan 2025 10:25:05 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:05 GMT Message-Id: <202501241025.50OAP5wq038495@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: ca0e69345320 - main - pf: cope with route-to on af-to rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ca0e69345320832c505ef6762b725391b3c41f50 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ca0e69345320832c505ef6762b725391b3c41f50 commit ca0e69345320832c505ef6762b725391b3c41f50 Author: Kristof Provost AuthorDate: 2025-01-13 14:29:53 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:30 +0000 pf: cope with route-to on af-to rules af-to uses pf_route() and pf_route6(), which caused issues when af-to and route-to were combined in a single rule. Extend the relevant functions to cope with this and add test cases. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 10 +++++++- sbin/pfctl/pfctl_parser.c | 3 ++- sbin/pfctl/tests/files/pf1026.in | 1 + sbin/pfctl/tests/files/pf1026.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + sys/netpfil/pf/pf.c | 26 ++++++++++++++++++-- tests/sys/netpfil/pf/nat64.sh | 47 ++++++++++++++++++++++++++++++++++++ 7 files changed, 85 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 830581c57f9c..7da200c91c22 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -2735,7 +2735,8 @@ pfrule : action dir logquick interface route af proto fromto } if (r.rt) { decide_address_family($5.host, &r.af); - remove_invalid_hosts(&$5.host, &r.af); + if (!(r.rule_flag & PFRULE_AFTO)) + remove_invalid_hosts(&$5.host, &r.af); if ($5.host == NULL) { yyerror("no routing address with " "matching address family found."); @@ -5503,6 +5504,13 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) "synproxy state or modulate state"); problems++; } + if (r->rule_flag & PFRULE_AFTO && r->rt) { + if (r->rt != PF_ROUTETO) { + yyerror("reply-to and dup-to " + "must not be used on af-to rules"); + problems++; + } + } /* match rules rules */ if (r->action == PF_MATCH) { if (r->divert.port) { diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index df76f8312cf3..8e88a2794e45 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -943,7 +943,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" dup-to"); printf(" "); print_pool(&r->rdr, 0, 0, r->af, PF_PASS); - print_pool(&r->route, 0, 0, r->af, PF_PASS); + print_pool(&r->route, 0, 0, + r->rule_flag & PFRULE_AFTO ? r->naf : r->af, PF_PASS); } if (r->af) { if (r->af == AF_INET) diff --git a/sbin/pfctl/tests/files/pf1026.in b/sbin/pfctl/tests/files/pf1026.in new file mode 100644 index 000000000000..3691d0947b39 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1026.in @@ -0,0 +1 @@ +pass in on epair2b route-to (epair0a 192.0.2.2) inet6 from any to 64:ff9b::/96 af-to inet from (epair0a) diff --git a/sbin/pfctl/tests/files/pf1026.ok b/sbin/pfctl/tests/files/pf1026.ok new file mode 100644 index 000000000000..5b849fe80bd3 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1026.ok @@ -0,0 +1 @@ +pass in on epair2b route-to (epair0a 192.0.2.2) inet6 from any to 64:ff9b::/96 flags S/SA keep state af-to inet from (epair0a) diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 0a523386c16c..95f26b18b8d6 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -134,3 +134,4 @@ PFCTL_TEST(1022, "Test received-on") PFCTL_TEST(1023, "Test match log(matches)") PFCTL_TEST(1024, "nat64") PFCTL_TEST(1025, "nat64 with implicit address family") +PFCTL_TEST(1026, "nat64 with route-to") diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 00d6583234c7..5fdda62481db 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8941,12 +8941,23 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } } else { - if ((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) { + if (((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) && + (pd->af == pd->naf)) { pf_dummynet(pd, s, r, m); if (s) PF_STATE_UNLOCK(s); return; } + + /* + * If we're actually doing route-to and af-to and are in the + * reply direction. + */ + if (pd->act.rt_kif && pd->act.rt_kif->pfik_ifp && + pd->af != pd->naf && r->naf != AF_INET) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } m0 = *m; } @@ -9201,12 +9212,23 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } } else { - if ((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) { + if (((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) && + (pd->af == pd->naf)) { pf_dummynet(pd, s, r, m); if (s) PF_STATE_UNLOCK(s); return; } + + /* + * If we're actually doing route-to and af-to and are in the + * reply direction. + */ + if (pd->act.rt_kif && pd->act.rt_kif->pfik_ifp && + pd->af != pd->naf && r->naf != AF_INET6) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } m0 = *m; } diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 913f90480e5d..41c1ae3d4522 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -671,6 +671,52 @@ gateway6_cleanup() pft_cleanup } +atf_test_case "route_to" "cleanup" +route_to_head() +{ + atf_set descr 'Test route-to on af-to rules' + atf_set require.user root +} + +route_to_body() +{ + pft_init + + epair_link=$(vnet_mkepair) + epair_null=$(vnet_mkepair) + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + route -6 add default 2001:db8::1 + + vnet_mkjail rtr ${epair}b ${epair_link}a ${epair_null}a + jexec rtr ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + jexec rtr ifconfig ${epair_null}a 192.0.2.3/24 up + jexec rtr ifconfig ${epair_link}a 192.0.2.1/24 up + + vnet_mkjail dst ${epair_link}b + jexec dst ifconfig ${epair_link}b 192.0.2.2/24 up + jexec dst route add default 192.0.2.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass in on ${epair}b route-to (${epair_link}a 192.0.2.2) inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" + + atf_check -s exit:0 -o ignore \ + ping6 -c 3 64:ff9b::192.0.2.2 +} + +route_to_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -687,4 +733,5 @@ atf_init_test_cases() atf_add_test_case "table_round_robin" atf_add_test_case "dummynet" atf_add_test_case "gateway6" + atf_add_test_case "route_to" } From nobody Fri Jan 24 10:25:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpm3RpRz5lC6s; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpm14CYz3tRm; Fri, 24 Jan 2025 10:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OmH2TApBYr2cvIXA1GaZW5EjxyW8SVn0jsESNDM+Qyo=; b=So7o0DFJwYn5KcfWZM3GJ/srK2w4SRNXHHILhxdztnNnClK3Vnz+E1vVnZJGSjNNY3jZLV 1LZqhflTFqbcIsVaNKvn5xVJWUl3StOvRzqTV8IE8YiSwHSp67PMwa2TZpXVWqxoIGo8Xd 5t8JhvLU9a0z8w5gDATQMSZG1dxKrzWjOCALj4GHRB4inLVYtsPvaMwghVh4BWT+kLQDh2 XUH60LVovfEdJcptf4J2ugGV567F6UM2I0Cpuyah1pHNgUhUNwjdMTV+VqLDYSYn5OALJF kLQKSuXiitj5WhlX9tA78gkiwRJolHm6GaGvW95Fae6nb4BMup2hc7U4ZNvzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OmH2TApBYr2cvIXA1GaZW5EjxyW8SVn0jsESNDM+Qyo=; b=bfUqkR7g+ZVkfBEUeQHopwQ9Q0qqT0PWVBzidlbbdLvr4ZgAWj8jJ9ChHLTrhKfAQ1pUbC TZ5EpagSV5ySSXefYQVq+Vosawc1xhmD8CJlL4vd0aULClzkzkHMP848CLU0CtevfBfvxd s4Qb1y3xz/ZhcHOHxoGCcJJ30QdawnC6p1LSMfE5nhtfi34d1To557aZVnmYZsj9HBsCsb peMPxoDT0VBLm+lETqr1k11YHCoeyB4kaN/VjRB7nq2Q12k9TSvQdgzJYrsjKUAZCgB2Zd eaiaeUousm5/lUS6FlR6Q3mcuwf8vXPLMiogzh4h7ZaUQ83NnPDmIhP2cuNV+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714304; a=rsa-sha256; cv=none; b=D6o33OwFDteiu4Cga9wC+mRv7EUYCabyAFopV9cqIzAr6VZoR9yiYYF4JDU2jBjh7wc4H5 IJ6SULK+Le2zTdRo5M7sdkwEiAB3hQ4nG9M5h3E/GPPlVygU4NhOS2RbhayAABcawQldwt Mfqz3RWmIkM7MXNYHgd4Km/z73iCt/dOd6uN7Qg+nJ8Pxx8lhIDyS3VeFj9jXKdpw5rGkK H3qYThnfzVrX08dq2gtuGSotwQdGR5CL322olSk5TY8AQYKEVh1UAO4ceGvSSfserD6375 yb3FS5QwJ1oSr4wJjJLsllJSZoRxwjozs6rBZGCVgDMj6O6qFu2iW1L0dqx23A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpm0QRXz5qP; Fri, 24 Jan 2025 10:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP3YY038465; Fri, 24 Jan 2025 10:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP3gf038462; Fri, 24 Jan 2025 10:25:03 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:03 GMT Message-Id: <202501241025.50OAP3gf038462@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: 0972294ef034 - main - pf: add a dedicated pf pool for route options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 0972294ef034d92f59857b8312dd2e1e3a7adc9c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0972294ef034d92f59857b8312dd2e1e3a7adc9c commit 0972294ef034d92f59857b8312dd2e1e3a7adc9c Author: Kristof Provost AuthorDate: 2025-01-20 17:25:37 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:30 +0000 pf: add a dedicated pf pool for route options As suggested by henning. Which unbreaks ie route-to after the recent pf changes. With much help debugging and pointing out of missing bits from claudio@ ok claudio@ "looks good" henning@ Obtained from: OpenBSD, jsg , 7fa5c09028 Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 2 + lib/libpfctl/libpfctl.h | 1 + sbin/pfctl/parse.y | 95 +++++++++++++++++++++++++++------------------ sbin/pfctl/pfctl.c | 16 ++++++++ sbin/pfctl/pfctl_optimize.c | 7 ++++ sbin/pfctl/pfctl_parser.c | 1 + sys/net/pfvar.h | 3 +- sys/netpfil/pf/if_pfsync.c | 8 +++- sys/netpfil/pf/pf.c | 11 +++++- sys/netpfil/pf/pf.h | 2 +- sys/netpfil/pf/pf_ioctl.c | 53 +++++++++++++++++++------ sys/netpfil/pf/pf_nl.c | 2 + sys/netpfil/pf/pf_nl.h | 1 + 13 files changed, 147 insertions(+), 55 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index f0708c8f0439..2297b24d37a0 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1227,6 +1227,7 @@ snl_add_msg_attr_pf_rule(struct snl_writer *nw, uint32_t type, const struct pfct snl_add_msg_attr_string(nw, PF_RT_OVERLOAD_TBLNAME, r->overload_tblname); snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_RDR, &r->rdr); snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_NAT, &r->nat); + snl_add_msg_attr_rpool(nw, PF_RT_RPOOL_RT, &r->route); snl_add_msg_attr_u32(nw, PF_RT_OS_FINGERPRINT, r->os_fingerprint); snl_add_msg_attr_u32(nw, PF_RT_RTABLEID, r->rtableid); snl_add_msg_attr_timeouts(nw, PF_RT_TIMEOUT, r->timeout); @@ -1661,6 +1662,7 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_MAX_SRC_CONN, .off = _OUT(r.max_src_conn), .cb = snl_attr_get_uint32 }, { .type = PF_RT_RPOOL_NAT, .off = _OUT(r.nat), .arg = &pool_parser, .cb = snl_attr_get_nested }, { .type = PF_RT_NAF, .off = _OUT(r.naf), .cb = snl_attr_get_uint8 }, + { .type = PF_RT_RPOOL_RT, .off = _OUT(r.route), .arg = &pool_parser, .cb = snl_attr_get_nested }, }; #undef _OUT SNL_DECLARE_PARSER(getrule_parser, struct genlmsghdr, snl_f_p_empty, ap_getrule); diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 14ea06fd151a..2532894ffa21 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -180,6 +180,7 @@ struct pfctl_rule { struct pfctl_pool rpool; struct pfctl_pool rdr; }; + struct pfctl_pool route; uint64_t evaluations; uint64_t packets[2]; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ab74d2dd57ab..830581c57f9c 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -304,6 +304,7 @@ static struct filter_opts { } divert; struct redirspec nat; struct redirspec rdr; + struct redirspec rroute; /* new-style scrub opts */ int nodf; int minttl; @@ -382,11 +383,12 @@ void expand_eth_rule(struct pfctl_eth_rule *, struct node_host *, struct node_host *, const char *, const char *); void expand_rule(struct pfctl_rule *, struct node_if *, - struct redirspec *, struct redirspec *, struct node_host *, - struct node_host *, struct node_proto *, struct node_os *, - struct node_host *, struct node_port *, struct node_host *, - struct node_port *, struct node_uid *, struct node_gid *, - struct node_if *, struct node_icmp *, const char *); + struct redirspec *, struct redirspec *, struct redirspec *, + struct node_host *, struct node_host *, struct node_host *, + struct node_proto *, struct node_os *, struct node_host *, + struct node_port *, struct node_host *, struct node_port *, + struct node_uid *, struct node_gid *, struct node_if *, + struct node_icmp *, const char *); int expand_altq(struct pf_altq *, struct node_if *, struct node_queue *, struct node_queue_bw bwspec, struct node_queue_opt *); @@ -1080,9 +1082,9 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto decide_address_family($8.src.host, &r.af); decide_address_family($8.dst.host, &r.af); - expand_rule(&r, $5, NULL, NULL, NULL, NULL, $7, $8.src_os, - $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, - $9.uid, $9.gid, $9.rcv, $9.icmpspec, + expand_rule(&r, $5, NULL, NULL, NULL, NULL, NULL, NULL, + $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, + $8.dst.port, $9.uid, $9.gid, $9.rcv, $9.icmpspec, pf->astack[pf->asd + 1] ? pf->alast->name : $2); free($2); pf->astack[pf->asd + 1] = NULL; @@ -1103,9 +1105,9 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto decide_address_family($6.src.host, &r.af); decide_address_family($6.dst.host, &r.af); - expand_rule(&r, $3, NULL, NULL, NULL, NULL, $5, $6.src_os, - $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, - 0, 0, 0, 0, $2); + expand_rule(&r, $3, NULL, NULL, NULL, NULL, NULL, NULL, + $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, + $6.dst.port, 0, 0, 0, 0, $2); free($2); } | RDRANCHOR string interface af proto fromto rtable { @@ -1145,9 +1147,9 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.dst.port_op = $6.dst.port->op; } - expand_rule(&r, $3, NULL, NULL, NULL, NULL, $5, $6.src_os, - $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, - 0, 0, 0, 0, $2); + expand_rule(&r, $3, NULL, NULL, NULL, NULL, NULL, NULL, + $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, + $6.dst.port, 0, 0, 0, 0, $2); free($2); } | BINATANCHOR string interface af proto fromto rtable { @@ -1468,9 +1470,9 @@ scrubrule : scrubaction dir logquick interface af proto fromto scrub_opts r.match_tag_not = $8.match_tag_not; r.rtableid = $8.rtableid; - expand_rule(&r, $4, NULL, NULL, NULL, NULL, $6, $7.src_os, - $7.src.host, $7.src.port, $7.dst.host, $7.dst.port, - NULL, NULL, NULL, NULL, ""); + expand_rule(&r, $4, NULL, NULL, NULL, NULL, NULL, NULL, + $6, $7.src_os, $7.src.host, $7.src.port, $7.dst.host, + $7.dst.port, NULL, NULL, NULL, NULL, ""); } ; @@ -1633,8 +1635,8 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { } if (h != NULL) - expand_rule(&r, j, NULL, NULL, NULL, NULL, NULL, NULL, h, - NULL, NULL, NULL, NULL, NULL, + expand_rule(&r, j, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ""); if ((i->ifa_flags & IFF_LOOPBACK) == 0) { @@ -1656,7 +1658,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { h = ifa_lookup(i->ifname, 0); if (h != NULL) expand_rule(&r, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, h, NULL, NULL, + NULL, NULL, NULL, NULL, h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ""); } else free(hh); @@ -2726,9 +2728,9 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; } r.rt = $5.rt; - r.rdr.opts = $5.pool_opts; + r.route.opts = $5.pool_opts; if ($5.key != NULL) - memcpy(&r.rdr.key, $5.key, + memcpy(&r.route.key, $5.key, sizeof(struct pf_poolhashkey)); } if (r.rt) { @@ -2739,26 +2741,26 @@ pfrule : action dir logquick interface route af proto fromto "matching address family found."); YYERROR; } - if ((r.rdr.opts & PF_POOL_TYPEMASK) == + if ((r.route.opts & PF_POOL_TYPEMASK) == PF_POOL_NONE && ($5.host->next != NULL || $5.host->addr.type == PF_ADDR_TABLE || DYNIF_MULTIADDR($5.host->addr))) - r.rdr.opts |= PF_POOL_ROUNDROBIN; - if ((r.rdr.opts & PF_POOL_TYPEMASK) != + r.route.opts |= PF_POOL_ROUNDROBIN; + if ((r.route.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_table($5.host, "tables are only " "supported in round-robin routing pools")) YYERROR; - if ((r.rdr.opts & PF_POOL_TYPEMASK) != + if ((r.route.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN && disallow_alias($5.host, "interface (%s) " "is only supported in round-robin " "routing pools")) YYERROR; if ($5.host->next != NULL) { - if ((r.rdr.opts & PF_POOL_TYPEMASK) != + if ((r.route.opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN) { - yyerror("r.rdr.opts must " + yyerror("r.route.opts must " "be PF_POOL_ROUNDROBIN"); YYERROR; } @@ -2833,7 +2835,8 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; } - expand_rule(&r, $4, &$9.nat, &$9.rdr, $5.host, $9.nat.rdr ? $9.nat.rdr->host : NULL, + expand_rule(&r, $4, &$9.nat, &$9.rdr, &$9.rroute, + NULL, $9.nat.rdr ? $9.nat.rdr->host : NULL, $5.host, $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, $9.uid, $9.gid, $9.rcv, $9.icmpspec, ""); } @@ -4989,8 +4992,9 @@ natrule : nataction interface af proto fromto tag tagged rtable o = o->next; } - expand_rule(&r, $2, NULL, NULL, $9 == NULL ? NULL : $9->host, - NULL, $4, $5.src_os, $5.src.host, $5.src.port, $5.dst.host, + expand_rule(&r, $2, NULL, NULL, NULL, + $9 == NULL ? NULL : $9->host, NULL, NULL, $4, + $5.src_os, $5.src.host, $5.src.port, $5.dst.host, $5.dst.port, 0, 0, 0, 0, ""); free($9); } @@ -6149,13 +6153,13 @@ expand_eth_rule(struct pfctl_eth_rule *r, void expand_rule(struct pfctl_rule *r, struct node_if *interfaces, struct redirspec *nat, - struct redirspec *rdr, struct node_host *rdr_hosts, - struct node_host *nat_hosts, - struct node_proto *protos, struct node_os *src_oses, - struct node_host *src_hosts, struct node_port *src_ports, - struct node_host *dst_hosts, struct node_port *dst_ports, - struct node_uid *uids, struct node_gid *gids, struct node_if *rcv, - struct node_icmp *icmp_types, const char *anchor_call) + struct redirspec *rdr, struct redirspec *route, + struct node_host *rdr_hosts, struct node_host *nat_hosts, + struct node_host *route_hosts, struct node_proto *protos, + struct node_os *src_oses, struct node_host *src_hosts, + struct node_port *src_ports, struct node_host *dst_hosts, + struct node_port *dst_ports, struct node_uid *uids, struct node_gid *gids, + struct node_if *rcv, struct node_icmp *icmp_types, const char *anchor_call) { sa_family_t af = r->af; int added = 0, error = 0; @@ -6331,6 +6335,21 @@ expand_rule(struct pfctl_rule *r, pa->ifname[0] = 0; TAILQ_INSERT_TAIL(&r->nat.list, pa, entries); } + TAILQ_INIT(&r->route.list); + for (h = route_hosts; h != NULL; h = h->next) { + pa = calloc(1, sizeof(struct pf_pooladdr)); + if (pa == NULL) + err(1, "expand_rule: calloc"); + pa->addr = h->addr; + if (h->ifname != NULL) { + if (strlcpy(pa->ifname, h->ifname, + sizeof(pa->ifname)) >= + sizeof(pa->ifname)) + errx(1, "expand_rule: strlcpy"); + } else + pa->ifname[0] = 0; + TAILQ_INSERT_TAIL(&r->route.list, pa, entries); + } r->nat.proxy_port[0] = PF_NAT_PROXY_PORT_LOW; r->nat.proxy_port[1] = PF_NAT_PROXY_PORT_HIGH; diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 7b54bc1c7c7a..ec07a5da999c 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1310,6 +1310,10 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, nr, ri.ticket, PF_SCRUB, path, PF_NAT) != 0) goto error; + if (pfctl_get_pool(dev, &rule.route, + nr, ri.ticket, PF_SCRUB, path, PF_RT) != 0) + goto error; + switch (format) { case PFCTL_SHOW_LABELS: break; @@ -1325,6 +1329,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, } pfctl_clear_pool(&rule.rdr); pfctl_clear_pool(&rule.nat); + pfctl_clear_pool(&rule.route); } ret = pfctl_get_rules_info_h(pfh, &ri, PF_PASS, path); if (ret != 0) { @@ -1346,6 +1351,10 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, nr, ri.ticket, PF_PASS, path, PF_NAT) != 0) goto error; + if (pfctl_get_pool(dev, &rule.route, + nr, ri.ticket, PF_PASS, path, PF_RT) != 0) + goto error; + switch (format) { case PFCTL_SHOW_LABELS: { bool show = false; @@ -1506,6 +1515,9 @@ pfctl_show_nat(int dev, char *path, int opts, char *anchorname, int depth, if (pfctl_get_pool(dev, &rule.nat, nr, ri.ticket, nattype[i], path, PF_NAT) != 0) return (-1); + if (pfctl_get_pool(dev, &rule.route, nr, + ri.ticket, nattype[i], path, PF_RT) != 0) + return (-1); if (dotitle) { pfctl_print_title("TRANSLATION RULES:"); @@ -1761,6 +1773,8 @@ pfctl_append_rule(struct pfctl *pf, struct pfctl_rule *r, pfctl_move_pool(&r->rdr, &rule->rdr); TAILQ_INIT(&rule->nat.list); pfctl_move_pool(&r->nat, &rule->nat); + TAILQ_INIT(&rule->route.list); + pfctl_move_pool(&r->route, &rule->route); TAILQ_INSERT_TAIL(rs->rules[rs_num].active.ptr, rule, entries); return (0); @@ -2065,6 +2079,8 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) return (1); if (pfctl_add_pool(pf, &r->nat, r->naf ? r->naf : r->af, PF_NAT)) return (1); + if (pfctl_add_pool(pf, &r->route, r->af, PF_RT)) + return (1); error = pfctl_add_rule_h(pf->h, r, anchor, name, ticket, pf->paddr.ticket); switch (error) { diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index a97664e0c929..7817bcfd284a 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -137,6 +137,7 @@ static struct pf_rule_field { PF_RULE_FIELD(flush, BREAK), PF_RULE_FIELD(rdr, BREAK), PF_RULE_FIELD(nat, BREAK), + PF_RULE_FIELD(route, BREAK), PF_RULE_FIELD(logif, BREAK), /* @@ -303,6 +304,12 @@ pfctl_optimize_ruleset(struct pfctl *pf, struct pfctl_ruleset *rs) } else bzero(&por->por_rule.nat, sizeof(por->por_rule.nat)); + if (TAILQ_FIRST(&r->route.list) != NULL) { + TAILQ_INIT(&por->por_rule.route.list); + pfctl_move_pool(&r->route, &por->por_rule.route); + } else + bzero(&por->por_rule.route, + sizeof(por->por_rule.route)); TAILQ_INSERT_TAIL(&opt_queue, por, por_entry); } diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 85f1797e58e1..df76f8312cf3 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -943,6 +943,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" dup-to"); printf(" "); print_pool(&r->rdr, 0, 0, r->af, PF_PASS); + print_pool(&r->route, 0, 0, r->af, PF_PASS); } if (r->af) { if (r->af == AF_INET) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 6e9418f59aef..e50fbc96a8ba 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -787,6 +787,7 @@ struct pf_krule { TAILQ_ENTRY(pf_krule) entries; struct pf_kpool nat; struct pf_kpool rdr; + struct pf_kpool route; struct pf_counter_u64 evaluations; struct pf_counter_u64 packets[2]; @@ -2217,7 +2218,7 @@ VNET_DECLARE(struct unrhdr64, pf_stateid); TAILQ_HEAD(pf_altqqueue, pf_altq); VNET_DECLARE(struct pf_altqqueue, pf_altqs[4]); #define V_pf_altqs VNET(pf_altqs) -VNET_DECLARE(struct pf_kpalist, pf_pabuf[2]); +VNET_DECLARE(struct pf_kpalist, pf_pabuf[3]); #define V_pf_pabuf VNET(pf_pabuf) VNET_DECLARE(u_int32_t, ticket_altqs_active); diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 60bfb05d1570..98a2367b79b0 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -574,6 +574,12 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) * from the local ruleset. */ if (r != &V_pf_default_rule) { + struct pf_kpool *pool = &r->route; + + /* Backwards compatibility. */ + if (TAILQ_EMPTY(&pool->list)) + pool = &r->rdr; + /* * The ruleset is identical, try to recover. If the rule * has a redirection pool with a single interface, there @@ -582,7 +588,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) * give up, as we can't be sure that we will pick the * same one as the pfsync peer did. */ - rpool_first = TAILQ_FIRST(&(r->rdr.list)); + rpool_first = TAILQ_FIRST(&(pool->list)); if ((rpool_first == NULL) || (TAILQ_NEXT(rpool_first, entries) != NULL)) { DPFPRINTF(PF_DEBUG_MISC, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 83eca735d2bb..00d6583234c7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -164,7 +164,7 @@ SDT_PROBE_DEFINE2(pf, purge, state, rowcount, "int", "size_t"); /* state tables */ VNET_DEFINE(struct pf_altqqueue, pf_altqs[4]); -VNET_DEFINE(struct pf_kpalist, pf_pabuf[2]); +VNET_DEFINE(struct pf_kpalist, pf_pabuf[3]); VNET_DEFINE(struct pf_altqqueue *, pf_altqs_active); VNET_DEFINE(struct pf_altqqueue *, pf_altq_ifs_active); VNET_DEFINE(struct pf_altqqueue *, pf_altqs_inactive); @@ -1267,6 +1267,7 @@ pf_initialize(void) TAILQ_INIT(&V_pf_altqs[3]); TAILQ_INIT(&V_pf_pabuf[0]); TAILQ_INIT(&V_pf_pabuf[1]); + TAILQ_INIT(&V_pf_pabuf[2]); V_pf_altqs_active = &V_pf_altqs[0]; V_pf_altq_ifs_active = &V_pf_altqs[1]; V_pf_altqs_inactive = &V_pf_altqs[2]; @@ -5900,6 +5901,12 @@ nextrule: if (r->rt) { struct pf_ksrc_node *sn = NULL; struct pf_srchash *snh = NULL; + struct pf_kpool *pool = &r->route; + + /* Backwards compatibility. */ + if (TAILQ_EMPTY(&pool->list)) + pool = &r->rdr; + /* * Set act.rt here instead of in pf_rule_to_actions() because * it is applied only from the last pass rule. @@ -5907,7 +5914,7 @@ nextrule: pd->act.rt = r->rt; /* Don't use REASON_SET, pf_map_addr increases the reason counters */ reason = pf_map_addr_sn(pd->af, r, pd->src, &pd->act.rt_addr, - &pd->act.rt_kif, NULL, &sn, &snh, &r->rdr); + &pd->act.rt_kif, NULL, &sn, &snh, pool); if (reason != 0) goto cleanup; } diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 5de85c1fe7ef..24249ead6ba2 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -49,7 +49,7 @@ enum { PF_INOUT, PF_IN, PF_OUT }; enum { PF_PASS, PF_DROP, PF_SCRUB, PF_NOSCRUB, PF_NAT, PF_NONAT, PF_BINAT, PF_NOBINAT, PF_RDR, PF_NORDR, PF_SYNPROXY_DROP, PF_DEFER, - PF_MATCH, PF_AFRT }; + PF_MATCH, PF_AFRT, PF_RT }; enum { PF_RULESET_SCRUB, PF_RULESET_FILTER, PF_RULESET_NAT, PF_RULESET_BINAT, PF_RULESET_RDR, PF_RULESET_MAX }; enum { PF_OP_NONE, PF_OP_IRG, PF_OP_EQ, PF_OP_NE, PF_OP_LT, diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index d206a9f8da43..340e7c25a501 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -436,7 +436,7 @@ pf_get_kpool(const char *anchor, u_int32_t ticket, u_int8_t rule_action, struct pf_krule *rule; int rs_num; - MPASS(which == PF_RDR || which == PF_NAT); + MPASS(which == PF_RDR || which == PF_NAT || which == PF_RT); ruleset = pf_find_kruleset(anchor); if (ruleset == NULL) @@ -470,10 +470,16 @@ pf_get_kpool(const char *anchor, u_int32_t ticket, u_int8_t rule_action, if (rule == NULL) return (NULL); - if (which == PF_NAT) - return (&rule->nat); - else + switch (which) { + case PF_RDR: return (&rule->rdr); + case PF_NAT: + return (&rule->nat); + case PF_RT: + return (&rule->route); + default: + panic("Unknow pool type %d", which); + } } static void @@ -612,6 +618,7 @@ pf_free_rule(struct pf_krule *rule) pf_kanchor_remove(rule); pf_empty_kpool(&rule->rdr.list); pf_empty_kpool(&rule->nat.list); + pf_empty_kpool(&rule->route.list); pf_krule_free(rule); } @@ -1832,6 +1839,7 @@ pf_krule_alloc(void) rule = malloc(sizeof(struct pf_krule), M_PFRULE, M_WAITOK | M_ZERO); mtx_init(&rule->nat.mtx, "pf_krule_nat_pool", NULL, MTX_DEF); mtx_init(&rule->rdr.mtx, "pf_krule_rdr_pool", NULL, MTX_DEF); + mtx_init(&rule->route.mtx, "pf_krule_route_pool", NULL, MTX_DEF); rule->timestamp = uma_zalloc_pcpu(pf_timestamp_pcpu_zone, M_WAITOK | M_ZERO); return (rule); @@ -1871,6 +1879,7 @@ pf_krule_free(struct pf_krule *rule) mtx_destroy(&rule->nat.mtx); mtx_destroy(&rule->rdr.mtx); + mtx_destroy(&rule->route.mtx); free(rule, M_PFRULE); } @@ -2106,6 +2115,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, rule->cpid = pid; TAILQ_INIT(&rule->rdr.list); TAILQ_INIT(&rule->nat.list); + TAILQ_INIT(&rule->route.list); PF_CONFIG_LOCK(); PF_RULES_WLOCK(); @@ -2203,7 +2213,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, (rule->set_prio[0] > PF_PRIO_MAX || rule->set_prio[1] > PF_PRIO_MAX)) error = EINVAL; - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 3; i++) { TAILQ_FOREACH(pa, &V_pf_pabuf[i], entries) if (pa->addr.type == PF_ADDR_TABLE) { pa->addr.p.tbl = pfr_attach_table(ruleset, @@ -2225,10 +2235,12 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, pf_mv_kpool(&V_pf_pabuf[0], &rule->nat.list); pf_mv_kpool(&V_pf_pabuf[1], &rule->rdr.list); + pf_mv_kpool(&V_pf_pabuf[2], &rule->route.list); if (((((rule->action == PF_NAT) || (rule->action == PF_RDR) || (rule->action == PF_BINAT)) && rule->anchor == NULL) || (rule->rt > PF_NOPFROUTE)) && - (TAILQ_FIRST(&rule->rdr.list) == NULL)) + (TAILQ_FIRST(&rule->rdr.list) == NULL && + TAILQ_FIRST(&rule->route.list) == NULL)) error = EINVAL; if (rule->action == PF_PASS && rule->rdr.opts & PF_POOL_STICKYADDR && @@ -2244,6 +2256,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, rule->nat.cur = TAILQ_FIRST(&rule->nat.list); rule->rdr.cur = TAILQ_FIRST(&rule->rdr.list); + rule->route.cur = TAILQ_FIRST(&rule->route.list); TAILQ_INSERT_TAIL(ruleset->rules[rs_num].inactive.ptr, rule, entries); ruleset->rules[rs_num].inactive.rcount++; @@ -2553,6 +2566,7 @@ pf_ioctl_begin_addrs(uint32_t *ticket) PF_RULES_WLOCK(); pf_empty_kpool(&V_pf_pabuf[0]); pf_empty_kpool(&V_pf_pabuf[1]); + pf_empty_kpool(&V_pf_pabuf[2]); *ticket = ++V_ticket_pabuf; PF_RULES_WUNLOCK(); @@ -2566,7 +2580,8 @@ pf_ioctl_add_addr(struct pf_nl_pooladdr *pp) struct pfi_kkif *kif = NULL; int error; - if (pp->which != PF_RDR && pp->which != PF_NAT) + if (pp->which != PF_RDR && pp->which != PF_NAT && + pp->which != PF_RT) return (EINVAL); #ifndef INET @@ -2613,8 +2628,17 @@ pf_ioctl_add_addr(struct pf_nl_pooladdr *pp) PF_RULES_WUNLOCK(); goto out; } - TAILQ_INSERT_TAIL(&V_pf_pabuf[pp->which == PF_RDR ? 1 : 0], - pa, entries); + switch (pp->which) { + case PF_NAT: + TAILQ_INSERT_TAIL(&V_pf_pabuf[0], pa, entries); + break; + case PF_RDR: + TAILQ_INSERT_TAIL(&V_pf_pabuf[1], pa, entries); + break; + case PF_RT: + TAILQ_INSERT_TAIL(&V_pf_pabuf[2], pa, entries); + break; + } PF_RULES_WUNLOCK(); return (0); @@ -2632,7 +2656,8 @@ pf_ioctl_get_addrs(struct pf_nl_pooladdr *pp) PF_RULES_RLOCK_TRACKER; - if (pp->which != PF_RDR && pp->which != PF_NAT) + if (pp->which != PF_RDR && pp->which != PF_NAT && + pp->which != PF_RT) return (EINVAL); pp->anchor[sizeof(pp->anchor) - 1] = 0; @@ -2659,7 +2684,8 @@ pf_ioctl_get_addr(struct pf_nl_pooladdr *pp) struct pf_kpooladdr *pa; u_int32_t nr = 0; - if (pp->which != PF_RDR && pp->which != PF_NAT) + if (pp->which != PF_RDR && pp->which != PF_NAT && + pp->which != PF_RT) return (EINVAL); PF_RULES_RLOCK_TRACKER; @@ -3652,6 +3678,7 @@ DIOCGETRULENV_error: newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0; TAILQ_INIT(&newrule->nat.list); TAILQ_INIT(&newrule->rdr.list); + TAILQ_INIT(&newrule->route.list); } #define ERROUT(x) ERROUT_IOCTL(DIOCCHANGERULE_error, x) @@ -3748,7 +3775,7 @@ DIOCGETRULENV_error: error = ENOMEM; if (pf_kanchor_setup(newrule, ruleset, pcr->anchor_call)) error = EINVAL; - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 3; i++) { TAILQ_FOREACH(pa, &V_pf_pabuf[i], entries) if (pa->addr.type == PF_ADDR_TABLE) { pa->addr.p.tbl = @@ -3772,6 +3799,7 @@ DIOCGETRULENV_error: pf_mv_kpool(&V_pf_pabuf[0], &newrule->nat.list); pf_mv_kpool(&V_pf_pabuf[1], &newrule->rdr.list); + pf_mv_kpool(&V_pf_pabuf[2], &newrule->route.list); if (((((newrule->action == PF_NAT) || (newrule->action == PF_RDR) || (newrule->action == PF_BINAT) || @@ -3792,6 +3820,7 @@ DIOCGETRULENV_error: } pf_empty_kpool(&V_pf_pabuf[0]); pf_empty_kpool(&V_pf_pabuf[1]); + pf_empty_kpool(&V_pf_pabuf[2]); if (pcr->action == PF_CHANGE_ADD_HEAD) oldrule = TAILQ_FIRST( diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 3e7a6965d387..c0f722b1fd18 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -736,6 +736,7 @@ static const struct nlattr_parser nla_p_rule[] = { { .type = PF_RT_MAX_SRC_CONN, .off = _OUT(max_src_conn), .cb = nlattr_get_uint32 }, { .type = PF_RT_RPOOL_NAT, .off = _OUT(nat), .arg = &pool_parser, .cb = nlattr_get_nested }, { .type = PF_RT_NAF, .off = _OUT(naf), .cb = nlattr_get_uint8 }, + { .type = PF_RT_RPOOL_RT, .off = _OUT(route), .arg = &pool_parser, .cb = nlattr_get_nested }, }; NL_DECLARE_ATTR_PARSER(rule_parser, nla_p_rule); #undef _OUT @@ -909,6 +910,7 @@ pf_handle_getrule(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_string(nw, PF_RT_OVERLOAD_TBLNAME, rule->overload_tblname); nlattr_add_pool(nw, PF_RT_RPOOL_RDR, &rule->rdr); nlattr_add_pool(nw, PF_RT_RPOOL_NAT, &rule->nat); + nlattr_add_pool(nw, PF_RT_RPOOL_RT, &rule->route); nlattr_add_u32(nw, PF_RT_OS_FINGERPRINT, rule->os_fingerprint); nlattr_add_u32(nw, PF_RT_RTABLEID, rule->rtableid); nlattr_add_timeout(nw, PF_RT_TIMEOUT, rule->timeout); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 8c0149891773..d749ef3ab99e 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -267,6 +267,7 @@ enum pf_rule_type_t { PF_RT_MAX_SRC_CONN = 74, /* u32 */ PF_RT_RPOOL_NAT = 75, /* nested, pf_rpool_type_t */ PF_RT_NAF = 76, /* u8 */ + PF_RT_RPOOL_RT = 77, /* nested, pf_rpool_type_t */ }; enum pf_addrule_type_t { From nobody Fri Jan 24 10:25:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpq0qJsz5lC24; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpp2h0Zz3tQG; Fri, 24 Jan 2025 10:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4w0AvluZKHeD+iVqdNHN+r83IqdILDChVAZibw9oGxg=; b=g6BfduqNqPzwir+VhGMr+LEZQmOERZfkeAjRggCFmyKnXBfUSvJkhxO6iWnyIWIlzmBxUQ tAosER3U/2EjH7bGFahXDu3bXFv9upJ0GX9B2BNRe9FG9O4ijpcaYgkYW4jThrhfuBveIZ NHNkUonbGfooiTmBqKJU+1TnSXJkx2ACaj74nbtNQo8BTzpb3/5F12b4i2qHW1AgZWxNMm jFVzo5s2bkG4Nj5HWV0u8XIlXyLiYZXay3hJVQ95n0pByq8s6rFT7AeKSBZ9f9CSzStZmh gyRRnnU8tkVNNe1CQHMj9UJZ93poPvGh5SeXP+hx3LMF7/Ucd/WSyhTgHvpwKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4w0AvluZKHeD+iVqdNHN+r83IqdILDChVAZibw9oGxg=; b=Kaechtt6t2HQQDSIpFAGiMkHA9HBBZjzLf37tbIAx0xtVjmK8k2FqdHTpUFj3JnpcWBVF2 8MunTM/5yFk2c+BlTm1cRu3ERFPa/3C/Mn4thvg93fGIFAtDW39WBZVD+XPqkT1oIogGe1 Y572qEmSlk0PtnhM+ssZeU4o0HVmW+diYB0rNUwozDgCUU0MF2CIzSSQwqHzI9bGiJTOaL 2sLyVKTjIUa3OC4jXDFDKccUip/5ZQIWVfwE7qJPruOppw+k3GVy0b75dGM2EezqJ6/IXe XQMDiLKz0RDrzZgr0orbd/vO8vsS7QYQok98ufIfBE8wa4X+2w2ccI6ZuMsY1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714306; a=rsa-sha256; cv=none; b=nJ2YGwCGuInq+xVa74SF4wzuoXJBlrA+oeKYNAKxMh6Br1xS1uZnVo0FCcCfrb0lF1jAws 3cOLydJo2ksm0UUGHeSJHSkgCGSSeBrvnAyk1YkVVSlCEVLe6Nv7C5gU+bQC2gW/a1ul4D /21gxbiCcfEnws0c6vmTWXiBgCjmRQMMO/dBTzteLYuFh/3dlpxrcLr4qkYBSDeQfsBqC1 DrdyxZhsNcfn1Jwh8dpXwR1o37D/aCyrXg1+0zXu8XL/OINIYPhDnwKO1OaxD/SfKOPrxt GwwJAi0CaJ5D/BJWnYq6hejvQTGZRYl5fq7fFsXeIpIbwb3yxX3nQu68HA/T6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpp2B5Nz64y; Fri, 24 Jan 2025 10:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP6mR038531; Fri, 24 Jan 2025 10:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP6Kw038528; Fri, 24 Jan 2025 10:25:06 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:06 GMT Message-Id: <202501241025.50OAP6Kw038528@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: 7a372bded812 - main - pf: make reply-to work with nat64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 7a372bded8126b41608fd0eac550606bafe57a11 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a372bded8126b41608fd0eac550606bafe57a11 commit 7a372bded8126b41608fd0eac550606bafe57a11 Author: Kristof Provost AuthorDate: 2025-01-22 16:49:22 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:31 +0000 pf: make reply-to work with nat64 Just like route-to reply-to is problematic when used in combination with nat64. In the normal (i.e. without nat64) flow we return immediately from pf_route(). However, with nat64 we need to continue and do a route lookup. In that case we should not make the extra pf_test(PF_OUT) call to remain similar to the non-nat64 flow. We also have to fix the interface binding. We can only bind to the interface after we've done the route lookup, not before. Add a funcional test case, and a test for pfctl's rule printing. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 4 +- sbin/pfctl/pfctl_parser.c | 3 +- sbin/pfctl/tests/files/pf1027.in | 1 + sbin/pfctl/tests/files/pf1027.ok | 1 + sbin/pfctl/tests/pfctl_test_list.inc | 1 + sys/netpfil/pf/pf.c | 88 ++++++++++++++++++++++-------------- tests/sys/netpfil/pf/nat64.sh | 45 ++++++++++++++++++ 7 files changed, 106 insertions(+), 37 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 7da200c91c22..efbd7cac18e8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5505,8 +5505,8 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) problems++; } if (r->rule_flag & PFRULE_AFTO && r->rt) { - if (r->rt != PF_ROUTETO) { - yyerror("reply-to and dup-to " + if (r->rt != PF_ROUTETO && r->rt != PF_REPLYTO) { + yyerror("dup-to " "must not be used on af-to rules"); problems++; } diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 8e88a2794e45..f32fe9024ff1 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -944,7 +944,8 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" "); print_pool(&r->rdr, 0, 0, r->af, PF_PASS); print_pool(&r->route, 0, 0, - r->rule_flag & PFRULE_AFTO ? r->naf : r->af, PF_PASS); + r->rule_flag & PFRULE_AFTO && r->rt != PF_REPLYTO ? r->naf : r->af, + PF_PASS); } if (r->af) { if (r->af == AF_INET) diff --git a/sbin/pfctl/tests/files/pf1027.in b/sbin/pfctl/tests/files/pf1027.in new file mode 100644 index 000000000000..3c5c24025e0a --- /dev/null +++ b/sbin/pfctl/tests/files/pf1027.in @@ -0,0 +1 @@ +pass in on epair2b reply-to (epair0a 2001:db8::1) inet6 from any to 64:ff9b::/96 af-to inet from (epair0a) diff --git a/sbin/pfctl/tests/files/pf1027.ok b/sbin/pfctl/tests/files/pf1027.ok new file mode 100644 index 000000000000..5a3f30ae1592 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1027.ok @@ -0,0 +1 @@ +pass in on epair2b reply-to (epair0a 2001:db8::1) inet6 from any to 64:ff9b::/96 flags S/SA keep state af-to inet from (epair0a) diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 95f26b18b8d6..7dd3a2af0eea 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -135,3 +135,4 @@ PFCTL_TEST(1023, "Test match log(matches)") PFCTL_TEST(1024, "nat64") PFCTL_TEST(1025, "nat64 with implicit address family") PFCTL_TEST(1026, "nat64 with route-to") +PFCTL_TEST(1027, "nat64 with reply-to") diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5fdda62481db..a0bc65e78430 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8891,6 +8891,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, uint16_t ip_len, ip_off; uint16_t tmp; int r_dir; + bool skip_test = false; KASSERT(m && *m && r && oifp, ("%s: invalid parameters", __func__)); @@ -8941,12 +8942,15 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } } else { - if (((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) && - (pd->af == pd->naf)) { - pf_dummynet(pd, s, r, m); - if (s) - PF_STATE_UNLOCK(s); - return; + if ((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) { + if (pd->af == pd->naf) { + pf_dummynet(pd, s, r, m); + if (s) + PF_STATE_UNLOCK(s); + return; + } else { + skip_test = true; + } } /* @@ -8954,9 +8958,15 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, * reply direction. */ if (pd->act.rt_kif && pd->act.rt_kif->pfik_ifp && - pd->af != pd->naf && r->naf != AF_INET) { - /* Un-set ifp so we do a plain route lookup. */ - ifp = NULL; + pd->af != pd->naf) { + if (pd->act.rt == PF_ROUTETO && r->naf != AF_INET) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } + if (pd->act.rt == PF_REPLYTO && r->naf != AF_INET6) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } } m0 = *m; } @@ -8970,13 +8980,6 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, dst.sin_addr.s_addr = pd->act.rt_addr.v4.s_addr; if (s != NULL){ - if (r->rule_flag & PFRULE_IFBOUND && - pd->act.rt == PF_REPLYTO && - s->kif == V_pfi_all) { - s->kif = pd->act.rt_kif; - s->orig_kif = oifp->if_pf_kif; - } - if (ifp == NULL && (pd->af != pd->naf)) { /* We're in the AFTO case. Do a route lookup. */ const struct nhop_object *nh; @@ -9002,6 +9005,13 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } + if (r->rule_flag & PFRULE_IFBOUND && + pd->act.rt == PF_REPLYTO && + s->kif == V_pfi_all) { + s->kif = pd->act.rt_kif; + s->orig_kif = oifp->if_pf_kif; + } + PF_STATE_UNLOCK(s); } @@ -9012,7 +9022,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, goto bad; } - if (pd->dir == PF_IN) { + if (pd->dir == PF_IN && !skip_test) { if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp, &pd->act) != PF_PASS) { SDT_PROBE1(pf, ip, route_to, drop, __LINE__); @@ -9162,6 +9172,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, struct ip6_hdr *ip6; struct ifnet *ifp = NULL; int r_dir; + bool skip_test = false; KASSERT(m && *m && r && oifp, ("%s: invalid parameters", __func__)); @@ -9212,12 +9223,15 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } } else { - if (((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) && - (pd->af == pd->naf)) { - pf_dummynet(pd, s, r, m); - if (s) - PF_STATE_UNLOCK(s); - return; + if ((pd->act.rt == PF_REPLYTO) == (r_dir == pd->dir)) { + if (pd->af == pd->naf) { + pf_dummynet(pd, s, r, m); + if (s) + PF_STATE_UNLOCK(s); + return; + } else { + skip_test = true; + } } /* @@ -9225,9 +9239,15 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, * reply direction. */ if (pd->act.rt_kif && pd->act.rt_kif->pfik_ifp && - pd->af != pd->naf && r->naf != AF_INET6) { - /* Un-set ifp so we do a plain route lookup. */ - ifp = NULL; + pd->af != pd->naf) { + if (pd->act.rt == PF_ROUTETO && r->naf != AF_INET6) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } + if (pd->act.rt == PF_REPLYTO && r->naf != AF_INET) { + /* Un-set ifp so we do a plain route lookup. */ + ifp = NULL; + } } m0 = *m; } @@ -9241,13 +9261,6 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, PF_ACPY((struct pf_addr *)&dst.sin6_addr, &pd->act.rt_addr, AF_INET6); if (s != NULL) { - if (r->rule_flag & PFRULE_IFBOUND && - pd->act.rt == PF_REPLYTO && - s->kif == V_pfi_all) { - s->kif = pd->act.rt_kif; - s->orig_kif = oifp->if_pf_kif; - } - if (ifp == NULL && (pd->af != pd->naf)) { const struct nhop_object *nh; nh = fib6_lookup(M_GETFIB(*m), &ip6->ip6_dst, 0, NHR_NONE, 0); @@ -9273,6 +9286,13 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, } } + if (r->rule_flag & PFRULE_IFBOUND && + pd->act.rt == PF_REPLYTO && + s->kif == V_pfi_all) { + s->kif = pd->act.rt_kif; + s->orig_kif = oifp->if_pf_kif; + } + PF_STATE_UNLOCK(s); } @@ -9293,7 +9313,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, goto bad; } - if (pd->dir == PF_IN) { + if (pd->dir == PF_IN && !skip_test) { if (pf_test(AF_INET6, PF_OUT, PFIL_FWD | PF_PFIL_NOREFRAGMENT, ifp, &m0, inp, &pd->act) != PF_PASS) { SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 41c1ae3d4522..9cc6aececc42 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -717,6 +717,50 @@ route_to_cleanup() pft_cleanup } +atf_test_case "reply_to" "cleanup" +reply_to_head() +{ + atf_set descr 'Test reply-to on af-to rules' + atf_set require.user root +} + +reply_to_body() +{ + pft_init + + epair_link=$(vnet_mkepair) + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + route -6 add default 2001:db8::1 + + vnet_mkjail rtr ${epair}b ${epair_link}a + jexec rtr ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + jexec rtr ifconfig ${epair_link}a 192.0.2.1/24 up + + vnet_mkjail dst ${epair_link}b + jexec dst ifconfig ${epair_link}b 192.0.2.2/24 up + jexec dst route add default 192.0.2.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass in on ${epair}b reply-to (${epair}b 2001:db8::2) inet6 from any to 64:ff9b::/96 af-to inet from 192.0.2.1" + + atf_check -s exit:0 -o ignore \ + ping6 -c 3 64:ff9b::192.0.2.2 +} + +reply_to_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -734,4 +778,5 @@ atf_init_test_cases() atf_add_test_case "dummynet" atf_add_test_case "gateway6" atf_add_test_case "route_to" + atf_add_test_case "reply_to" } From nobody Fri Jan 24 10:25:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYpq5Pm1z5lBnp; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpq3tHHz3tQM; Fri, 24 Jan 2025 10:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSqfhlIEexSaFdak9P281G222BiN/5QPemz3f25MEaY=; b=gScJWRE4DOloOgqt+VEyoTfJknI1GNfWA34mFtQzTBqVFX1dQAFCHN71+eErjf5M5+qWFA f0OCsfUpgICFFjtXkafLMr7qz5wHtHJwBvd3X1IZ+dfFKu6upXehsefziqJluNr0svWdYr z8ObOmmhIlJPJBleyezV6zFJFvSZ86/XqfPmoGzTWGhCz055aJ/NayqU6EAqY4pcTsqiK7 lPeOGcFzSgcLi+IC5m1WIrSxM5txLEuA5Ttn4udyP0i+Rl9lFZQAeEzMmpKZ3OdEo3XWJC qHD9pQHkdy51E2nCKEeKXVgDZ8Yprx0oCp1gRYEYZY9nF7srablvpMCxieSZ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSqfhlIEexSaFdak9P281G222BiN/5QPemz3f25MEaY=; b=l/FrVV4k0TyxLfIocLsJX8Or9wsidQSZEVsLpdcqVDp6k0iCnGAWtk3PEC388vrsM8i/4X +8DiNJ6mOylGMGe+90mq5oB/hT2eRREBNuov7uOGhhroXKp+Hk5FbOClTjAXs2A9zojzKJ FsMbwwEvRfzc0Fc85kYfjQRBUSFXjhXpq5GSrorxLEo0Ct112NhPELwOw9UzRNCWI3IDJP jeVZGqQ38yqV/6d4CJQT1rnt9WwSdPwSfO1B4lxiJVCSs9MUNb1SFL/0CpZl3Rty7jo7/o vdoY6idvCoFDWp3IbKAWsbT9ECIUEPIaYWDMuM+OTzri1gRj5qCgV1RmHRuwzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714307; a=rsa-sha256; cv=none; b=XEeN19GqCRqXVdpGi8uhGee+FkqPzGkusatVFLT6pB2+y+SxbEkVj7650vor+y2zEYXXX0 LXQ2xQDj1UopBKqrJQ9eAVstpRYJENw0zL6l4wTsB3FiExC3jsZbO0JfxJK6n2uar20uJn 9kjP9UiVcFV61/c0Bfk+aIXtMeZW0o+mDUPvOrJ/dFdRHwMso8u0IDY7BwpqFRSSGzpUhi bhlL/JKn4Io21LT/LIILfBQ518U2J128EmGqZjYkLo7DxpMQdJVqmasMg5iS9CUTSWEa77 XYzqzmaZvPRPkeyhby4z5z31/5/pcSUo0Xp2A9LF5j6xkc9la/QEDAGyE3cqZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpq3B70z65C; Fri, 24 Jan 2025 10:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP73b038570; Fri, 24 Jan 2025 10:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP7sE038567; Fri, 24 Jan 2025 10:25:07 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:07 GMT Message-Id: <202501241025.50OAP7sE038567@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: 06a6ec55fbd0 - main - pf: ignore/preserve ECN bits on ToS matching and scrubbing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 06a6ec55fbd01a372778870cb5039341bdea9e38 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=06a6ec55fbd01a372778870cb5039341bdea9e38 commit 06a6ec55fbd01a372778870cb5039341bdea9e38 Author: Kristof Provost AuthorDate: 2025-01-22 10:56:09 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:31 +0000 pf: ignore/preserve ECN bits on ToS matching and scrubbing The lower 2 bits of the tos-header are used for ECN. (http://tools.ietf.org/html/rfc2474#section-3) OK henning@, haesbaert@ Obtained from: OpenBSD, mpf , 60dfe711ee Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a0bc65e78430..0ebc813756f1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9986,7 +9986,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->dst = (struct pf_addr *)&h->ip_dst; pd->ip_sum = &h->ip_sum; pd->virtual_proto = pd->proto = h->ip_p; - pd->tos = h->ip_tos; + pd->tos = h->ip_tos & ~IPTOS_ECN_MASK; pd->ttl = h->ip_ttl; pd->tot_len = ntohs(h->ip_len); pd->act.rtableid = -1; From nobody Fri Jan 24 10:25:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfYps450Xz5lBns; Fri, 24 Jan 2025 10:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfYpr4GdMz3tKZ; Fri, 24 Jan 2025 10:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xFOou1JNL5n2nHClk2YCM0Y6ubqW5npPgDyvIm0ejRY=; b=rjrm3nJMGVFmgGtqo4yA3yT76Ty9/lAuzl5gF5uFV6mt6ASB5kJR7aKDQzhrb2WIQHG1ec 0jaMCJ8DN00eX71ymJDryYrXZIizjk0eJGS6K6WfQvxF/0/rAUf7ZaD11vtqyaeEQoRxLE vSIa0w5tx9YN8ZCdP+zzEWO3MUgWd8f0W8aoj30mgZccTPkXM26B/keDCZH0rdkLr1UjQM YAFLHHNEbYUi0Or3rL/6/8SfIt/b2AftuqbVozeZKr2yaSSoGj2ivKZ94GQahezdFzoQq6 +ammN2FStfGtM1UxyMyN7emL/dQai7SOvunU8ygsexF0Wn2qVTxGwD37La/tdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737714308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xFOou1JNL5n2nHClk2YCM0Y6ubqW5npPgDyvIm0ejRY=; b=FmOt3OvVDKjQdONpYZs+lGW34OR+cMk05SwKgYgeNJvvQBw6BPsAaUgjoJuAmGNcOhJeVb S6WXPAuduoiZQSyRZi/g38DCzZ2jWa8kW9Z51BT7ARqbXSKj+J6NePEZd03F5eEwbAQ7We sklCrIFAiksOYvdRaRuToxxSx4xC6QvHX5sz2iyNv2TpH3TAoIg0mJlZMoAvA9wk9OzDev nnf0yr+sjZ4vARVos40wu89lFYUVNF+IhzB82XAUC1wh/mUUbw6Oof5PH/iB1mn1heiUUO +ocxiVWpFaoW5VkZJpgbpCjiGS6MeTRoirXKnd3+MeAaybkMd2sOzckHPqK3Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737714308; a=rsa-sha256; cv=none; b=GVlGq7b8dzl9+bge896D31UoZn8auFJSEjkM8CB4sg7hay7y8s7k9n0CNwa1lGSC4VuJXR Fw0vTA5ixkpeSWW3N3gtCVjDyFts0HWu62m+O7eLsLOjYCyiRhoFiDDbKyx8fMOag8Dr95 JN00uy8ni+vA6hfxT2oz3zdpc0N8nrlQgUVN0o//eoVY9fRftK9q8H494ylqVchVB+u/F0 +xkPr5h3enLqWv4XnbCHCyWzhJVEGr7BvWkt0+3FquW/gSE5k7LZC1mcQRZ/usrXCEOrCF ioyobYuYsDcqg1WiDFMKbIAZ7shJg2qaaJqnzc6aAhhh3jJcRyBA49QhTDnlrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfYpr3qXTz5WP; Fri, 24 Jan 2025 10:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OAP8kL038603; Fri, 24 Jan 2025 10:25:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OAP8lH038600; Fri, 24 Jan 2025 10:25:08 GMT (envelope-from git) Date: Fri, 24 Jan 2025 10:25:08 GMT Message-Id: <202501241025.50OAP8lH038600@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: 3bf6554017b7 - main - pf: remove PFLOGIFS_MAX List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3bf6554017b78f03bb779a5a3115034243e5c6c7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3bf6554017b78f03bb779a5a3115034243e5c6c7 commit 3bf6554017b78f03bb779a5a3115034243e5c6c7 Author: Kristof Provost AuthorDate: 2025-01-22 15:55:19 +0000 Commit: Kristof Provost CommitDate: 2025-01-24 10:20:31 +0000 pf: remove PFLOGIFS_MAX There was a limit on the number of pflog interfaces - 16. remove that. mostly by dynamically allocating pflogifs instead of making that a static array. ok claudio zinke Obtained from: OpenBSD, henning , ab0a082ea6 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_pflog.h | 2 -- sys/netpfil/pf/if_pflog.c | 48 +++++++++++++++++++++++++++++++++++++---------- sys/netpfil/pf/pf_ioctl.c | 4 ---- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index 9734ca245eda..dc22c05cdea0 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -33,8 +33,6 @@ #include -#define PFLOGIFS_MAX 16 - #define PFLOG_RULESET_NAME_SIZE 16 struct pfloghdr { diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 3cd7cd1f2ddc..f325d0001799 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -88,6 +88,7 @@ static int pflogoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static void pflogattach(int); +static int pflogifs_resize(size_t); static int pflogioctl(struct ifnet *, u_long, caddr_t); static void pflogstart(struct ifnet *); static int pflog_clone_create(struct if_clone *, char *, size_t, @@ -99,36 +100,58 @@ static const char pflogname[] = "pflog"; VNET_DEFINE_STATIC(struct if_clone *, pflog_cloner); #define V_pflog_cloner VNET(pflog_cloner) -VNET_DEFINE(struct ifnet *, pflogifs[PFLOGIFS_MAX]); /* for fast access */ +VNET_DEFINE_STATIC(int, npflogifs) = 0; +#define V_npflogifs VNET(npflogifs) +VNET_DEFINE(struct ifnet **, pflogifs); /* for fast access */ #define V_pflogifs VNET(pflogifs) static void pflogattach(int npflog __unused) { - int i; - - for (i = 0; i < PFLOGIFS_MAX; i++) - V_pflogifs[i] = NULL; - struct if_clone_addreq req = { .create_f = pflog_clone_create, .destroy_f = pflog_clone_destroy, .flags = IFC_F_AUTOUNIT | IFC_F_LIMITUNIT, - .maxunit = PFLOGIFS_MAX - 1, }; V_pflog_cloner = ifc_attach_cloner(pflogname, &req); struct ifc_data ifd = { .unit = 0 }; ifc_create_ifp(pflogname, &ifd, NULL); } +static int +pflogifs_resize(size_t n) +{ + struct ifnet **p; + int i; + + if (n > SIZE_MAX / sizeof(struct ifnet *)) + return (EINVAL); + if (n == 0) + p = NULL; + else if ((p = malloc(n * sizeof(struct ifnet *), M_DEVBUF, + M_NOWAIT | M_ZERO)) == NULL) + return (ENOMEM); + for (i = 0; i < n; i++) { + if (i < V_npflogifs) + p[i] = V_pflogifs[i]; + else + p[i] = NULL; + } + + if (V_pflogifs) + free(V_pflogifs, M_DEVBUF); + V_pflogifs = p; + V_npflogifs = n; + + return (0); +} + static int pflog_clone_create(struct if_clone *ifc, char *name, size_t maxlen, struct ifc_data *ifd, struct ifnet **ifpp) { struct ifnet *ifp; - MPASS(ifd->unit < PFLOGIFS_MAX); - ifp = if_alloc(IFT_PFLOG); if_initname(ifp, pflogname, ifd->unit); ifp->if_mtu = PFLOGMTU; @@ -141,6 +164,11 @@ pflog_clone_create(struct if_clone *ifc, char *name, size_t maxlen, bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN); + if (ifd->unit + 1 > V_npflogifs && + pflogifs_resize(ifd->unit + 1) != 0) { + pflog_clone_destroy(ifc, ifp, IFC_F_FORCE); + return (ENOMEM); + } V_pflogifs[ifd->unit] = ifp; *ifpp = ifp; @@ -155,7 +183,7 @@ pflog_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags) if (ifp->if_dunit == 0 && (flags & IFC_F_FORCE) == 0) return (EINVAL); - for (i = 0; i < PFLOGIFS_MAX; i++) + for (i = 0; i < V_npflogifs; i++) if (V_pflogifs[i] == ifp) V_pflogifs[i] = NULL; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 340e7c25a501..a45db33f38dc 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2201,8 +2201,6 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, error = EINVAL; if (!rule->log) rule->logif = 0; - if (rule->logif >= PFLOGIFS_MAX) - error = EINVAL; if (pf_addr_setup(ruleset, &rule->src.addr, rule->af)) error = ENOMEM; if (pf_addr_setup(ruleset, &rule->dst.addr, rule->af)) @@ -3767,8 +3765,6 @@ DIOCGETRULENV_error: error = EINVAL; if (!newrule->log) newrule->logif = 0; - if (newrule->logif >= PFLOGIFS_MAX) - error = EINVAL; if (pf_addr_setup(ruleset, &newrule->src.addr, newrule->af)) error = ENOMEM; if (pf_addr_setup(ruleset, &newrule->dst.addr, newrule->af)) From nobody Fri Jan 24 12:11:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfc9v6RMqz5lKpD; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfc9v2bYCz47mv; Fri, 24 Jan 2025 12:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiWu0irlzU2KZ+8mtAH3///2SwovsXne73pDg8komhY=; b=xGG2ZeNpYlvTAW6OjOYqkL9QEtlY6HsS24g3/ml9AS8rqHkuEWBPgqkFZi/w7VZ/6Icqqb uBOV3jB5G9zLeJdzGej7pkcPqaYs/OgFoKuf5bqKxesq+KvDCfe3L9+1OgbjO1SWqSNJ5n Sm3jj7B/3wug4CySW5ccReH6HxKT5KZEQSKQgbuwe4blLxD9b4j92hLUduK1utSHefUzuM RJzcP5gjc3cu0zuyPArd5aq7Ajyeadbtg4VRtmWb4brjdCAovmxMOWM1E39unCJfPqKJfQ v+HV3my8oS3sBMBkcD1RKPsW01KQvADQYQXnRd1fj3kb1eVxnoBI1rnR0qJAOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiWu0irlzU2KZ+8mtAH3///2SwovsXne73pDg8komhY=; b=bwB9duKqBeEa2mLUH13zj5M/IAmj+SGAMgspW2eq7bRL5/ihqkzJgn7gPcJrtB+/tDxVIL kPOOcCKNjXTMAgHfpj2TQvw3gq3Aaw3YQH8WS66NPWKl3ez+AdzXx/SXJMOLdS2CIEITdi I71q6+GZfj4WjJCwelOZnOD1X/BFV2uN7axCiVQWoVmYG+n5U7EvVcCAeylFaVyDGUtfLC FACIW4xTTRv3/M5zfbgb6Cavt63YK3s/clFgyU8tXw1GKdJLLR9VGnAq3dIn+txQ1JzQmQ Ie1ioIYkJ3+qoSgpgl6l3aYWWwPdVQFM0WSKpakKSZeolvnUQqhUz578XBZhCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720707; a=rsa-sha256; cv=none; b=yLKFPFNxm+ZqoxTt99QtqlPMPT9VnV22JgEhKtMA1i8JIgFCfdYFwgYKcA/hkaS3cuZ5lt UNjr3Vx6ivsIAO2v0jMwSaQjDbnXUhqrWEOIK5lkLc1seKBSAh0VXViJshoEklvvPMM5QH 0VvcI20KSkwp52+7z0aFsXH3EEDJDudpcfio1Kutu3vABXEZC2/yFNKnPD8hF3QWGwMkND HEvsCjpEui3+I4s8MRKIrVLN7xhxxt6xYzYJ5XMwmM28dNP1efVH1I4yFyNxnYZE7yXtB0 QQ/3s5wD6xN1u92G8CCOkNvUP9XMKiRLV6HhZ2Df7fLAlaYLpXiSZd3jkU6UZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfc9v1y70z8jT; Fri, 24 Jan 2025 12:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBlb4040266; Fri, 24 Jan 2025 12:11:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBl47040263; Fri, 24 Jan 2025 12:11:47 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:47 GMT Message-Id: <202501241211.50OCBl47040263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3041b636463d - main - arm64: Support mapping a 52-bit physical adddress List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3041b636463d521e3c2bbea7673da6afceec34e5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3041b636463d521e3c2bbea7673da6afceec34e5 commit 3041b636463d521e3c2bbea7673da6afceec34e5 Author: Andrew Turner AuthorDate: 2025-01-24 11:36:18 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:27 +0000 arm64: Support mapping a 52-bit physical adddress When FEAT_LPA2 is enabled the physical address space increases from 48-bits to 52-bits. The top two address bits are moved to the now unused shareability field. Update the kernel to support this new larger address space. Reviewed by: alc, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46624 --- sys/arm64/arm64/pmap.c | 2 +- sys/arm64/include/armreg.h | 2 +- sys/arm64/include/hypervisor.h | 1 + sys/arm64/include/pmap.h | 2 ++ sys/arm64/include/pte.h | 52 ++++++++++++++++++++++++++++++++++++------ sys/arm64/vmm/vmm_arm64.c | 10 +++++--- 6 files changed, 57 insertions(+), 12 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 23eedff2e7cd..5c1e5bb63e4d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -355,7 +355,7 @@ static u_int physmap_idx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM/pmap parameters"); -static bool pmap_lpa_enabled __read_mostly = false; +bool pmap_lpa_enabled __read_mostly = false; pt_entry_t pmap_sh_attr __read_mostly = ATTR_SH(ATTR_SH_IS); #if PAGE_SIZE == PAGE_SIZE_4K diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index d586d3568bd7..2a2c8b23e0a4 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2066,7 +2066,7 @@ #define PAR_NS_SHIFT 9 #define PAR_NS_MASK (0x3 << PAR_NS_SHIFT) #define PAR_PA_SHIFT 12 -#define PAR_PA_MASK 0x0000fffffffff000 +#define PAR_PA_MASK 0x000ffffffffff000 #define PAR_ATTR_SHIFT 56 #define PAR_ATTR_MASK (0xff << PAR_ATTR_SHIFT) /* When PAR_F == 1 (aborted) */ diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 15fc36014626..a32e1000d911 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -281,6 +281,7 @@ #define VTCR_EL2_PS_42BIT (0x3UL << VTCR_EL2_PS_SHIFT) #define VTCR_EL2_PS_44BIT (0x4UL << VTCR_EL2_PS_SHIFT) #define VTCR_EL2_PS_48BIT (0x5UL << VTCR_EL2_PS_SHIFT) +#define VTCR_EL2_PS_52BIT (0x6UL << VTCR_EL2_PS_SHIFT) #define VTCR_EL2_DS_SHIFT 32 #define VTCR_EL2_DS (0x1UL << VTCR_EL2_DS_SHIFT) diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index d92069ee42fd..75de9e342c72 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -101,6 +101,8 @@ extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) #define pmap_kernel() kernel_pmap +extern bool pmap_lpa_enabled; + #define PMAP_ASSERT_LOCKED(pmap) \ mtx_assert(&(pmap)->pm_mtx, MA_OWNED) #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index 02eba21448ba..ae6a8694f6c4 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -54,13 +54,6 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) -#define BASE_MASK ~ATTR_MASK -#define BASE_ADDR(x) ((x) & BASE_MASK) - -#define PTE_TO_PHYS(pte) BASE_ADDR(pte) -/* Convert a phys addr to the output address field of a PTE */ -#define PHYS_TO_PTE(pa) (pa) - /* Bits 58:55 are reserved for software */ #define ATTR_SW_UNUSED1 (1UL << 58) #define ATTR_SW_NO_PROMOTE (1UL << 57) @@ -81,13 +74,35 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_CONTIGUOUS (1UL << 52) #define ATTR_DBM (1UL << 51) #define ATTR_S1_GP (1UL << 50) + +/* + * Largest possible output address field for a level 3 page. Block + * entries will use fewer low address bits, but these are res0 so + * should be safe to include. + * + * This is also safe to use for the next-level table address for + * table entries as they encode a physical address in the same way. + */ +#if PAGE_SIZE == PAGE_SIZE_4K +#define ATTR_ADDR UINT64_C(0x0003fffffffff000) +#elif PAGE_SIZE == PAGE_SIZE_16K +#define ATTR_ADDR UINT64_C(0x0003ffffffffc000) +#else +#error Unsupported page size +#endif + #define ATTR_S1_nG (1 << 11) #define ATTR_AF (1 << 10) +/* When TCR_EL1.DS == 0 */ #define ATTR_SH(x) ((x) << 8) #define ATTR_SH_MASK ATTR_SH(3) #define ATTR_SH_NS 0 /* Non-shareable */ #define ATTR_SH_OS 2 /* Outer-shareable */ #define ATTR_SH_IS 3 /* Inner-shareable */ +/* When TCR_EL1.DS == 1 */ +#define ATTR_OA_51_50_SHIFT 8 +#define ATTR_OA_51_50_MASK (3 << ATTR_OA_51_50_SHIFT) +#define ATTR_OA_51_50_DELTA (50 - 8) /* Delta from address to pte */ #define ATTR_S1_AP_RW_BIT (1 << 7) #define ATTR_S1_AP(x) ((x) << 6) @@ -124,6 +139,29 @@ typedef uint64_t pt_entry_t; /* page table entry */ */ #define ATTR_PROMOTE (ATTR_MASK & ~(ATTR_CONTIGUOUS | ATTR_AF)) +/* Read the output address or next-level table address from a PTE */ +#define PTE_TO_PHYS(x) ({ \ + pt_entry_t _pte = (x); \ + vm_paddr_t _pa; \ + _pa = _pte & ATTR_ADDR; \ + if (pmap_lpa_enabled) \ + _pa |= (_pte & ATTR_OA_51_50_MASK) << ATTR_OA_51_50_DELTA; \ + _pa; \ +}) + +/* + * Convert a physical address to an output address or next-level + * table address in a PTE + */ +#define PHYS_TO_PTE(x) ({ \ + vm_paddr_t _pa = (x); \ + pt_entry_t _pte; \ + _pte = _pa & ATTR_ADDR; \ + if (pmap_lpa_enabled) \ + _pte |= (_pa >> ATTR_OA_51_50_DELTA) & ATTR_OA_51_50_MASK; \ + _pte; \ +}) + #if PAGE_SIZE == PAGE_SIZE_4K #define L0_SHIFT 39 #define L1_SHIFT 30 diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index 80d985241c69..43b2ba7802d7 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -381,8 +381,6 @@ vmmops_modinit(int ipinum) * shareable */ el2_regs.vtcr_el2 = VTCR_EL2_RES1; - el2_regs.vtcr_el2 |= - min(pa_range_bits << VTCR_EL2_PS_SHIFT, VTCR_EL2_PS_48BIT); el2_regs.vtcr_el2 |= VTCR_EL2_IRGN0_WBWA | VTCR_EL2_ORGN0_WBWA; el2_regs.vtcr_el2 |= VTCR_EL2_T0SZ(64 - vmm_virt_bits); el2_regs.vtcr_el2 |= vmm_vtcr_el2_sl(vmm_pmap_levels); @@ -402,8 +400,14 @@ vmmops_modinit(int ipinum) * the shareability field changes to become address bits when this * is set. */ - if ((READ_SPECIALREG(tcr_el1) & TCR_DS) != 0) + if ((READ_SPECIALREG(tcr_el1) & TCR_DS) != 0) { el2_regs.vtcr_el2 |= VTCR_EL2_DS; + el2_regs.vtcr_el2 |= + min(pa_range_bits << VTCR_EL2_PS_SHIFT, VTCR_EL2_PS_52BIT); + } else { + el2_regs.vtcr_el2 |= + min(pa_range_bits << VTCR_EL2_PS_SHIFT, VTCR_EL2_PS_48BIT); + } smp_rendezvous(NULL, arm_setup_vectors, NULL, &el2_regs); From nobody Fri Jan 24 12:11:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfc9w4Qn2z5lJry; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfc9w3NY9z480s; Fri, 24 Jan 2025 12:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsaBTbWjzIIT+jH9XvfVTiDF6WY+F6LF5LsSjUknyB0=; b=pPUZ6/z9T8I6LRT/R3IsT1p61tGAsCG3GSiNNR4zsZ2BI37t64mOraswTwxa1pfvXxR9Og JnmAXQtnUt8EBkgndHF02DecAJZeIA0kwUgZaTg59xIT4/TG43FgV9JrJtzZVU9X9dxMlN GHJyok7ePhYcd6yw6JoF63u4AatW1deCe/9TzpksQsLKw6VEuLWVRbB4IdXjCusZ2Nvlew 7y8lL3rLUzyMgPqbLA//u1c6Cvm0xIf1QFhQI9ffgrLeNoIGPTvahtqLhnyLsdveodeRg0 VYZTVEIv0NbOv08Xjb+METDfLwVwxKqxhXOmtQhUsNpVYT/yzjwWYLYUqu/gVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsaBTbWjzIIT+jH9XvfVTiDF6WY+F6LF5LsSjUknyB0=; b=sm9/JdQEKbHphNNFR5OrDLGnWlwI6J5/WfLKr/7cFpThPIVaoPx4IanEjIWbqgqZkX0KvX 7hWnWMcwWXlOswpIqLKgwXUJKBYPdcqqPoMal1pef9XDUOLa8vHyDif5f03FNVqGMKuwLY aQnIxxBKFJ8C3RgRHIaY1oFGQQz8cH5C/OCuRUgZLwVrleju7SDlp2iWT6wUW1ggcehCJE jU4UNALehcmreF6JETt9Jl2i9N6hlDCvVIhCXXSa2TouDBj/pr03Ca70w4HApAt7q1Gmel JepCN8tPRCkq+4ZaNaCvwYqornb/fO1GGf22bUgijhS++X633XITaBgizLsVng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720708; a=rsa-sha256; cv=none; b=h2m4D133KWwLtFIqRTTupH3RGTVLmUVhOMdhCwRKdVNLT3m/B2z6zYn+CqUnLrTHZufkl/ 7MaCItI1s/Lo/AiGLs2reSXskAENTR7+VukhApwrCxAZwXAnwUxWMvPmDOngng7GYeYeSO RrzBwp1jJGlwEgyGre2UvGqOY1e63F7UNFn6Ff/dZ1lOiGJU7HdFdEB7ZuQJKrjIDG1z49 Pt4P9WrJTS2lIyqGj+XyGS6hc55rOTE7ZX3Y2DJ9mPfWlN6qRDG3l5zL5Z1umhrkXvf9Vg +1lsePnp+8yZa4pYa2/sI09z2hsc5tmTnWzBc7Li2n6BbD1YA7rXKlAanIU/uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfc9w2tMFz8x5; Fri, 24 Jan 2025 12:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBmZs040302; Fri, 24 Jan 2025 12:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBm8j040299; Fri, 24 Jan 2025 12:11:48 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:48 GMT Message-Id: <202501241211.50OCBm8j040299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d249bcb712db - main - stand/efi: Limit where we load the arm64 kernel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d249bcb712db38bf4f31b99087bd9c39e5178288 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d249bcb712db38bf4f31b99087bd9c39e5178288 commit d249bcb712db38bf4f31b99087bd9c39e5178288 Author: Andrew Turner AuthorDate: 2025-01-24 11:37:01 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 stand/efi: Limit where we load the arm64 kernel When FEAT_LPA2 is implemented the hardware supports increasing the physical address space from 48-bit to 52-bit. As older kernels only support a 48-bit physical address space limit where the kernel is loaded to this. Reviewed by: kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46625 --- stand/efi/loader/copy.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index 935db3a420ba..e4ad865a4acd 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -290,6 +290,17 @@ get_staging_max(void) res = copy_staging == COPY_STAGING_ENABLE ? G(1) : G(4); return (res); } +#define EFI_ALLOC_MAX_ADDR +#elif defined(__aarch64__) +/* + * Older kernels only support a 48-bit physical address space, and locore.S + * only supports a 50-bit space. Limit to 48 bits so older kernels can boot + * even if FEAT_LPA2 is supported by the hardware. + */ +#define get_staging_max() (1ul << 48) +#define EFI_ALLOC_MAX_ADDR +#endif +#ifdef EFI_ALLOC_MAX_ADDR #define EFI_ALLOC_METHOD AllocateMaxAddress #else #define EFI_ALLOC_METHOD AllocateAnyPages @@ -316,7 +327,7 @@ efi_copy_init(void) if (running_on_hyperv()) efi_verify_staging_size(&nr_pages); #endif -#if defined(__amd64__) || defined(__i386__) +#ifdef EFI_ALLOC_MAX_ADDR staging = get_staging_max(); #endif status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, @@ -424,7 +435,7 @@ expand: #if EFI_STAGING_2M_ALIGN nr_pages += M(2) / EFI_PAGE_SIZE; #endif -#if defined(__amd64__) || defined(__i386__) +#ifdef EFI_ALLOC_MAX_ADDR new_base = get_staging_max(); #endif status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderCode, From nobody Fri Jan 24 12:11:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfc9y4jSsz5lKVF; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfc9x73tDz480v; Fri, 24 Jan 2025 12:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2F+hYdGXpghUBWunAFgR8rYsxOltIPxIhVSX6Gmp/k=; b=sgXmvv3Htw2itfrRJFiiBbxx79tP7sWyzbGa4MVdwSunWeB0JSmeb30XbwyYj13IPvZUsS aLCopmxs+7TIT2r1l/hG1/PvI/qJaO2yoS9Bv4/ph+3fKzcdTu3LgUEl8FKhrayvAmbcYa 8nyJbIjWZYN4bveKljajF61ACxuudXyP3NNhNDpfOuUNADK+hZZ2jr+qP14jQVoXInTyGN 2Hw8jtX8o4zlU4kP7KQ9f++D6MtQ1tDtp7SsR3IoG7umXTdZSWmN+j/0lcZ0azFYCZzTbJ Wa+NTvr6zG74qvp/780bF8COprY9+BL/0vY/KI040Fl1iGCpA63qB1sl6ZaSNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X2F+hYdGXpghUBWunAFgR8rYsxOltIPxIhVSX6Gmp/k=; b=c9xPnL8M3hOS167n2GAtiOcZr57imER3ziP3MtAxr5pIdBNhqrBnc9cI+PHa9E2T26O1F+ l0B/ncIUUKnZHkLwRQKNBPrhLCFfzOSYiezOcmzdTWjtYrf+Di1Z9e7Qw9naH8NfAJ9ldb nYfjvFn8E9Ak2NHxZvEpncH+VNfzrw/+tFfC0kpxOV588ngs66sMkROKZBoQH0n7gtolsJ ItH69ECCZQQSXVz6cznkBEHGq834G2CwLKZNLqQyOIPPMAahROlcYFNP8hwX7vFs7IZh37 Vu5zRmsq/mlzIPRReDI+xRR1sEjlm4Kkqg5vijXD57I/p/X/+YSrl+vHPVuy6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720710; a=rsa-sha256; cv=none; b=ovb2+RTN4C8La5YW9oTA4q80nnUs8eqPLaoCJa/0Qp1t1mUhaNcFrWFNBVWZNtJEyzIlVM qUdxy2rRdPPyQL+ESq4/yfmawwAO3dxz1W1/+mthK4tuMEz7phOcZdVloNsL0l4OQbUtQO isEBeut6dg2FzJGpKbrdKZGhauiKLLLJejrXfrA6AnutDBwIrM3nP1wX/OY+lFNByjod1v XxI7Cn71sj35itBs+hAL2tv0ljaOBoSJjEQLy8kcZrYkvp1HTycTH+SameSUFxPDNlrYp7 44Px0UWcRaPHsL2l6GjP4dzPJ78pnlW2t77VH+lMS0iWVl9cdlyIZzrshykUPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfc9x3XYwz8t1; Fri, 24 Jan 2025 12:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBnVa040338; Fri, 24 Jan 2025 12:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBnuv040335; Fri, 24 Jan 2025 12:11:49 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:49 GMT Message-Id: <202501241211.50OCBnuv040335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ac4fa5838bb3 - main - arm64: Add a new CPU feature framework List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac4fa5838bb33f0c3ba05fce02d41164bd84a560 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ac4fa5838bb33f0c3ba05fce02d41164bd84a560 commit ac4fa5838bb33f0c3ba05fce02d41164bd84a560 Author: Andrew Turner AuthorDate: 2025-01-24 11:42:29 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 arm64: Add a new CPU feature framework This will be used to enable features that are discoverable on boot. It has support to check if a feature needs to be enabled, and if there is any errata associated with the feature that mean it shouldn't be enabled. It can also be used to enable errata workarounds that aren't associated with a specific feature, e.g. where we need to trap access to a register in userspace to emulate it. As some features need to be enabled early, while others can wait there are two options for when to enable a feature: * CPU_FEAT_EARLY_BOOT: The feature will be enabled early in the boot. On the boot CPU this is in initarm, while on secondary CPUs this is before signalling the CPU has started. * CPU_FEAT_AFTER_DEV: The feature will be enabled after devices have attached but before interrupts are enabled. There are also two scopes for where to enable the feature: * CPU_FEAT_PER_CPU: The feature will be checked and enabled on all CPU cores. * CPU_FEAT_SYSTEM: The feature will only be checked and enabled on a single core. It is expected the former will be used for most features, while the latter is for features that set a global variable to be checked. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47812 --- sys/arm64/arm64/cpu_feat.c | 119 +++++++++++++++++++++++++++++++++++++++++++ sys/arm64/arm64/machdep.c | 4 ++ sys/arm64/arm64/mp_machdep.c | 5 ++ sys/arm64/include/cpu_feat.h | 88 ++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 5 files changed, 217 insertions(+) diff --git a/sys/arm64/arm64/cpu_feat.c b/sys/arm64/arm64/cpu_feat.c new file mode 100644 index 000000000000..cc262394913d --- /dev/null +++ b/sys/arm64/arm64/cpu_feat.c @@ -0,0 +1,119 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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 +#include +#include + +#include +#include + +/* TODO: Make this a list if we ever grow a callback other than smccc_errata */ +static cpu_feat_errata_check_fn cpu_feat_check_cb = NULL; + +void +enable_cpu_feat(uint32_t stage) +{ + struct cpu_feat **featp, *feat; + uint32_t midr; + u_int errata_count, *errata_list; + cpu_feat_errata errata_status; + + MPASS((stage & ~CPU_FEAT_STAGE_MASK) == 0); + + midr = get_midr(); + SET_FOREACH(featp, cpu_feat_set) { + feat = *featp; + + /* Run the enablement code at the correct stage of boot */ + if ((feat->feat_flags & CPU_FEAT_STAGE_MASK) != stage) + continue; + + /* If the feature is system wide run on a single CPU */ + if ((feat->feat_flags & CPU_FEAT_SCOPE_MASK)==CPU_FEAT_SYSTEM && + PCPU_GET(cpuid) != 0) + continue; + + if (feat->feat_check != NULL && !feat->feat_check(feat, midr)) + continue; + + /* + * Check if the feature has any errata that may need a + * workaround applied (or it is to install the workaround for + * known errata. + */ + errata_status = ERRATA_NONE; + errata_list = NULL; + errata_count = 0; + if (feat->feat_has_errata != NULL) { + if (feat->feat_has_errata(feat, midr, &errata_list, + &errata_count)) { + /* Assume we are affected */ + errata_status = ERRATA_AFFECTED; + } + } + + if (errata_status == ERRATA_AFFECTED && + cpu_feat_check_cb != NULL) { + for (int i = 0; i < errata_count; i++) { + cpu_feat_errata new_status; + + /* Check if affected by this erratum */ + new_status = cpu_feat_check_cb(feat, + errata_list[i]); + if (new_status != ERRATA_UNKNOWN) { + errata_status = new_status; + errata_list = &errata_list[i]; + errata_count = 1; + break; + } + } + } + + /* Shouldn't be possible */ + MPASS(errata_status != ERRATA_UNKNOWN); + + feat->feat_enable(feat, errata_status, errata_list, + errata_count); + } +} + +static void +enable_cpu_feat_after_dev(void *dummy __unused) +{ + MPASS(PCPU_GET(cpuid) == 0); + enable_cpu_feat(CPU_FEAT_AFTER_DEV); +} +SYSINIT(enable_cpu_feat_after_dev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, + enable_cpu_feat_after_dev, NULL); + +void +cpu_feat_register_errata_check(cpu_feat_errata_check_fn cb) +{ + MPASS(cpu_feat_check_cb == NULL); + cpu_feat_check_cb = cb; +} diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 03f041851c8f..db223e011c67 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -77,6 +77,7 @@ #include #include +#include #include #include #include @@ -999,6 +1000,9 @@ initarm(struct arm64_bootparams *abp) panic("Invalid bus configuration: %s", kern_getenv("kern.cfg.order")); + /* Detect early CPU feature support */ + enable_cpu_feat(CPU_FEAT_EARLY_BOOT); + /* * Check if pointer authentication is available on this system, and * if so enable its use. This needs to be called before init_proc0 diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 636f26fba939..fe04e39edecc 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -224,6 +225,9 @@ init_secondary(uint64_t cpu) /* Ensure the stores in identify_cpu have completed */ atomic_thread_fence_acq_rel(); + /* Detect early CPU feature support */ + enable_cpu_feat(CPU_FEAT_EARLY_BOOT); + /* Signal the BSP and spin until it has released all APs. */ atomic_add_int(&aps_started, 1); while (!atomic_load_int(&aps_ready)) @@ -241,6 +245,7 @@ init_secondary(uint64_t cpu) pcpup->pc_curpmap = pmap0; install_cpu_errata(); + enable_cpu_feat(CPU_FEAT_AFTER_DEV); intr_pic_init_secondary(); diff --git a/sys/arm64/include/cpu_feat.h b/sys/arm64/include/cpu_feat.h new file mode 100644 index 000000000000..9fe6a9dd95d9 --- /dev/null +++ b/sys/arm64/include/cpu_feat.h @@ -0,0 +1,88 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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. + */ + +#ifndef _MACHINE_CPU_FEAT_H_ +#define _MACHINE_CPU_FEAT_H_ + +#include + +typedef enum { + ERRATA_UNKNOWN, /* Unknown erratum */ + ERRATA_NONE, /* No errata for this feature on this system. */ + ERRATA_AFFECTED, /* There is errata on this system. */ + ERRATA_FW_MITIGAION, /* There is errata, and a firmware */ + /* mitigation. The mitigation may need a */ + /* kernel component. */ +} cpu_feat_errata; + +#define CPU_FEAT_STAGE_MASK 0x00000001 +#define CPU_FEAT_EARLY_BOOT 0x00000000 +#define CPU_FEAT_AFTER_DEV 0x00000001 + +#define CPU_FEAT_SCOPE_MASK 0x00000010 +#define CPU_FEAT_PER_CPU 0x00000000 +#define CPU_FEAT_SYSTEM 0x00000010 + +struct cpu_feat; + +typedef bool (cpu_feat_check)(const struct cpu_feat *, u_int); +typedef bool (cpu_feat_has_errata)(const struct cpu_feat *, u_int, + u_int **, u_int *); +typedef void (cpu_feat_enable)(const struct cpu_feat *, cpu_feat_errata, + u_int *, u_int); + +struct cpu_feat { + const char *feat_name; + cpu_feat_check *feat_check; + cpu_feat_has_errata *feat_has_errata; + cpu_feat_enable *feat_enable; + uint32_t feat_flags; +}; +SET_DECLARE(cpu_feat_set, struct cpu_feat); + +/* + * Allow drivers to mark an erratum as worked around, e.g. the Errata + * Management ABI may know the workaround isn't needed on a given system. + */ +typedef cpu_feat_errata (*cpu_feat_errata_check_fn)(const struct cpu_feat *, + u_int); +void cpu_feat_register_errata_check(cpu_feat_errata_check_fn); + +void enable_cpu_feat(uint32_t); + +/* Check if an erratum is in the list of errata */ +static inline bool +cpu_feat_has_erratum(u_int *errata_list, u_int errata_count, u_int erratum) +{ + for (u_int i = 0; i < errata_count; i++) + if (errata_list[0] == erratum) + return (true); + + return (false); +} + +#endif /* _MACHINE_CPU_FEAT_H_ */ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index ed251b7ae0d7..c095bae42996 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -32,6 +32,7 @@ arm64/arm64/busdma_machdep.c standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard arm64/arm64/cpu_errata.c standard +arm64/arm64/cpu_feat.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb arm64/arm64/db_interface.c optional ddb From nobody Fri Jan 24 12:11:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfc9z1FC9z5lKpH; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfc9y51zgz480x; Fri, 24 Jan 2025 12:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LcV/VPDai+zgbf+kGHbdDwig+D1+1rPxoP/tYmBlXYg=; b=YwRK2P8jnD4o7hE7Bly8CoAuLegQBxWm41K8943aVCBtZpbwPhHyjKOpaLHlcXYj3gDgv7 0yEEqz/U48L7x2330DbJ+bsKEoyLFCa563Vq6DbMgS4qwqFqSqRrDWsDLkujigsvVBfQ3p aWEtJE2//Zn5NQ04EWmfr2UGiOMBpDYrVjwVG/La7QHlCSGISTpSDiZgObhkNNBqqqQEq6 yiAQeZUypNPfDOGFmJWbgaRFFtTClrUro12am8jKsJZ74QUV/cQqHBSi0xSBGoIa1ACxrO 5ix3bh4EBe3H9l8wa9OX2VOgTO30Mi0jjicuGr0OOOGytjzHcp5zs8gNUD9uhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LcV/VPDai+zgbf+kGHbdDwig+D1+1rPxoP/tYmBlXYg=; b=CbP8LcDPRG15D7DbE1qofwU98aS5mvcZExB9xoYlUzyL268LUx1uZRwXupnJTKppjhHm2y u/Zvmp/QCKElSX3EirwyaWU+UJAc06sgoqRbCjRNTz5BsaUtwTOg4yi3kfqTyZpTTzY0Ks Rr7HFKx3LH1jFMWM1e32euJgMGfSPw4AM85JrBa1FgXD0MX9agoX3Pry/8z/fU8gJzx8Vs 5WIrWr3MvfVRRnh2J2aPj2w+m6YP+cxvGawT2AdKyjW/ZWj3WaeeYKL+1Yy1/oG95R+s74 3DwtItR4w0nZvRYUAxkaEl4sucAsAGhWjna69n4+nqknfJnsnzOYlE8axwfjhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720710; a=rsa-sha256; cv=none; b=Bwt8zx6jQL6M8dsCL99SR8SsYWbqoDPmJzR8mxtCAbfmoQ+CCi4y+7XDrR0/SRdk76BfQh zmX8XJv/CA/OkWWOS7hXuv3Ed8x3yiybzLPvz04UOaEAuBLMLpBeBCFpH+gf1+ySnqws8e rgdinL7nYIr1aP8I2iVHN+qT2XIMXaQhcqGxE8agAycy/wnZKtBGqeyncds3pc5xWrV9e2 A+xuZv28RcVsas6j3XWIopz2PNfrkwO9590RwFf+WSVIA/zeg4lQwegB9jryQ+oCBHS3yJ IwkhKpszhFYZ7BArbOU/QXRD3V92V9tSfwC1rUpPBQ85Ex1+NYCfvMz3nI28oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfc9y4ZvYz8Sd; Fri, 24 Jan 2025 12:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBoLY040377; Fri, 24 Jan 2025 12:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBobw040374; Fri, 24 Jan 2025 12:11:50 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:50 GMT Message-Id: <202501241211.50OCBobw040374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b55a4854a483 - main - arm64: Add support for emulating CTR_EL0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b55a4854a48350e276911cf90905f863b61a69ea Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b55a4854a48350e276911cf90905f863b61a69ea commit b55a4854a48350e276911cf90905f863b61a69ea Author: Andrew Turner AuthorDate: 2025-01-24 11:42:37 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 arm64: Add support for emulating CTR_EL0 Emulate CTR_EL0 when it is either different on different cores or there is errata affecting the core that means we need to report a different value. This adds the kernel part of Arm Neoverse-N1 erratum 1542419. This depends on the firmware implementing part of the workaround. This is safe even if the firmware is missing the workaround as it is telling userspace to perform a stronger cache sync operation than is required, just on a page at a time rather than a single cache-line. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47814 --- sys/arm64/arm64/identcpu.c | 149 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index d430dc649e0b..a481661ff782 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,8 @@ static int allow_idc = 1; SYSCTL_INT(_machdep_cache, OID_AUTO, allow_idc, CTLFLAG_RDTUN, &allow_idc, 0, "Allow optimizations based on the IDC cache bit"); +static bool emulate_ctr = false; + static void check_cpu_regs(u_int cpu, struct cpu_desc *desc, struct cpu_desc *prev_desc); static uint64_t update_special_reg_field(uint64_t user_reg, u_int type, @@ -2076,6 +2079,8 @@ static const struct mrs_user_reg user_regs[] = { USER_REG(ID_AA64ZFR0_EL1, id_aa64zfr0, true), + USER_REG(CTR_EL0, ctr, true), + #ifdef COMPAT_FREEBSD32 USER_REG(ID_ISAR5_EL1, id_isar5, false), @@ -2087,6 +2092,143 @@ static const struct mrs_user_reg user_regs[] = { #define CPU_DESC_FIELD(desc, idx) \ *(uint64_t *)((char *)&(desc) + user_regs[(idx)].offset) +static bool +user_ctr_has_neoverse_n1_1542419(uint32_t midr, uint64_t ctr) +{ + /* Skip non-Neoverse-N1 */ + if (!CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, CPU_IMPL_ARM, + CPU_PART_NEOVERSE_N1, 0, 0)) + return (false); + + switch (CPU_VAR(midr)) { + default: + break; + case 4: + /* Fixed in r4p1 */ + if (CPU_REV(midr) > 0) + break; + /* FALLTHROUGH */ + case 3: + /* If DIC is enabled (coherent icache) then we are affected */ + return (CTR_DIC_VAL(ctr) != 0); + } + + return (false); +} + +static bool +user_ctr_check(const struct cpu_feat *feat __unused, u_int midr __unused) +{ + if (emulate_ctr) + return (true); + + if (user_ctr_has_neoverse_n1_1542419(midr, READ_SPECIALREG(ctr_el0))) + return (true); + + return (false); +} + +static bool +user_ctr_has_errata(const struct cpu_feat *feat __unused, u_int midr, + u_int **errata_list, u_int *errata_count) +{ + if (user_ctr_has_neoverse_n1_1542419(midr, READ_SPECIALREG(ctr_el0))) { + static u_int errata_id = 1542419; + + *errata_list = &errata_id; + *errata_count = 1; + return (true); + } + + return (false); +} + +static void +user_ctr_enable(const struct cpu_feat *feat __unused, + cpu_feat_errata errata_status, u_int *errata_list, u_int errata_count) +{ + MPASS(emulate_ctr || errata_status != ERRATA_NONE); + + /* + * The Errata Management Firmware Interface may incorrectly mark + * this as firmware mitigated. We should ignore that as there is + * a kernel component to the mitigation. + */ + if (errata_status != ERRATA_NONE && PCPU_GET(cpuid) == 0 && + cpu_feat_has_erratum(errata_list, errata_count, 1542419)) { + /* Clear fields we will change */ + user_cpu_desc.ctr &= ~(CTR_DIC_MASK | CTR_ILINE_WIDTH); + + /* + * Set DIC to none so userspace will execute an 'ic ivau' + * instruction that can be trapped by EL3. + */ + user_cpu_desc.ctr |= CTR_DIC_NONE; + /* + * Set the i-cache line size to be page size to reduce the + * number of times userspace needs to execute the 'ic ivau' + * instruction. The ctr_el0.IminLine is log2 the number of + * 4-byte words the instruction covers. As PAGE_SHIFT is log2 + * of the number of bytes in a page we need to subtract 2. + */ + user_cpu_desc.ctr |= (PAGE_SHIFT - 2) << CTR_ILINE_SHIFT; + + l_user_cpu_desc.ctr = user_cpu_desc.ctr; + } + + WRITE_SPECIALREG(sctlr_el1, + READ_SPECIALREG(sctlr_el1) & ~SCTLR_UCT); + isb(); +} + +static struct cpu_feat user_ctr = { + .feat_name = "Trap CTR_EL0", + .feat_check = user_ctr_check, + .feat_has_errata = user_ctr_has_errata, + .feat_enable = user_ctr_enable, + .feat_flags = CPU_FEAT_AFTER_DEV | CPU_FEAT_PER_CPU, +}; +DATA_SET(cpu_feat_set, user_ctr); + +static int +user_ctr_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, + uint32_t esr) +{ + uint64_t value; + int reg; + + if ((insn & MRS_MASK) != MRS_VALUE) + return (0); + + /* Check if this is the ctr_el0 register */ + /* TODO: Add macros to armreg.h */ + if (mrs_Op0(insn) != 3 || mrs_Op1(insn) != 3 || mrs_CRn(insn) != 0 || + mrs_CRm(insn) != 0 || mrs_Op2(insn) != 1) + return (0); + + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD) + value = user_cpu_desc.ctr; + else + value = l_user_cpu_desc.ctr; + /* + * We will handle this instruction, move to the next so we + * don't trap here again. + */ + frame->tf_elr += INSN_SIZE; + + reg = MRS_REGISTER(insn); + /* If reg is 31 then write to xzr, i.e. do nothing */ + if (reg == 31) + return (1); + + if (reg < nitems(frame->tf_x)) + frame->tf_x[reg] = value; + else if (reg == 30) + frame->tf_lr = value; + + return (1); +} + static int user_mrs_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, uint32_t esr) @@ -2497,6 +2639,7 @@ identify_cpu_sysinit(void *dummy __unused) panic("CPU does not support LSE atomic instructions"); #endif + install_undef_handler(true, user_ctr_handler); install_undef_handler(true, user_mrs_handler); } SYSINIT(identify_cpu, SI_SUB_CPU, SI_ORDER_MIDDLE, identify_cpu_sysinit, NULL); @@ -3029,6 +3172,12 @@ check_cpu_regs(u_int cpu, struct cpu_desc *desc, struct cpu_desc *prev_desc) } if (desc->ctr != prev_desc->ctr) { + /* + * If the cache is different on different cores we should + * emulate for userspace to provide a uniform value + */ + emulate_ctr = true; + /* * If the cache type register is different we may * have a different l1 cache type. From nobody Fri Jan 24 12:11:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfcB13btxz5lJs2; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfcB036bJz48Hx; Fri, 24 Jan 2025 12:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2axjmsv3o+xP0Wjiuqpkp/bZd6uDVd35Z8gcRBWql0k=; b=L6xLlaHW7wybyj4waQpXyhEr1W78Pxmq18sX/RMQwejTp4bF/c9mINR2daPQ8RHWSNFAYW g2XGrB/WMJ9KsaGi4+23pm9wHpPzS3PN0Lrwd2qeyzt7YpOC7lkFtdr0WNlYIqNoApelK/ l0KGDuXlOYmLPyydX6onQhgevBItJaSW3lMZf91dUN+jREgUWzAx/QFFEHwTEpVSSlf9Hs bnMQcA4rE9/5b+PtzlU11q28Mh8dKWmoivj91QcunBRUXH/B9kl4707qiKhGhPeIlN3Foh FYXo3ULtZhj0l3DqaCNdIur0ev/ftUiK7snona9Aql10LYF1WSBtQQF7/tnytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2axjmsv3o+xP0Wjiuqpkp/bZd6uDVd35Z8gcRBWql0k=; b=DbSakOEcraUeOaKdpRVWOMOdJCyViabg6HVr0kn+/XZViCCiXzwTmpIz5Lk8oS8ZY4xGmh 2zkYvrpDcXvptOtUcLovMihs2P9KXZFKkwctZDdqXC+RGO+6Shsi58r0KvA1hG8GF2KECC Q3OK21HgmTbqSngOM/CF2H0Z2zQ9IqiEcDv0GIEgt83dLAj0vh0LDHD/2NlGfmC38nSU+i QPgkRyoLYyGEag4PzPJflCK0kd3u0wFBQ5kvaBdZTwwmZsGCMRwdHBIKs0V8s7CWNwSaM3 EC0lqLJbnSOp00tyJRipbHDRYxW3xbR7amX/l37SD25SSfsIEGaBIxhKSJ1M7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720712; a=rsa-sha256; cv=none; b=iMeQ3CNgDWj4zkKWP6CbAlR7ejuvAD7foTdWkgpPS9DRngly/LBgoz27qx7bUfvcu6qAvN OOJ+yrRHcPFBMDPQLxRKG4+jgEXtvvmLryygxfD8r0nQPsqptOvFUHpwG+bnWM+q0USOqS QsNJJ6XCsENKTv9nSovO2UEII4H3neM0b+93vJ87C169AbWE3Hti6wD7rRkqAtKtCa5HP2 oQEXYIsT8qT/snlGMeP0R5OHJAjoj7hVl4Io2UXW7Av9l06skl8ICrrrbtXe6Cyh3XcObk 31QHGxRF13rDBAOnten/PmO7PiYsYBKa/4VVD6dwrXqiYtzpdlkmNCkZXIMAKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfc9z5cmTz8WN; Fri, 24 Jan 2025 12:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBpda040412; Fri, 24 Jan 2025 12:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBpIE040409; Fri, 24 Jan 2025 12:11:51 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:51 GMT Message-Id: <202501241211.50OCBpIE040409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3c4bc06f9b91 - main - arm64: Move DBM errata to the cpu feat framework List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c4bc06f9b91b719c2797f1cbd0b541ae4632332 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3c4bc06f9b91b719c2797f1cbd0b541ae4632332 commit 3c4bc06f9b91b719c2797f1cbd0b541ae4632332 Author: Andrew Turner AuthorDate: 2025-01-24 11:42:44 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 arm64: Move DBM errata to the cpu feat framework Move to the new cpu feature framework for enabling DBM and disabling when there are errata affecting it. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47815 --- sys/arm64/arm64/mp_machdep.c | 1 - sys/arm64/arm64/pmap.c | 87 +++++++++++++++++++++++++++++++------------- sys/arm64/include/pmap.h | 1 - 3 files changed, 61 insertions(+), 28 deletions(-) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index fe04e39edecc..987ff9ac1ceb 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -220,7 +220,6 @@ init_secondary(uint64_t cpu) pcpup = cpuid_to_pcpu[cpu]; pcpup->pc_midr = get_midr(); identify_cpu(cpu); - pmap_cpu_init(); /* Ensure the stores in identify_cpu have completed */ atomic_thread_fence_acq_rel(); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 5c1e5bb63e4d..5a3dbbf00203 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -146,6 +146,7 @@ #include #include +#include #include #include #include @@ -1309,8 +1310,6 @@ pmap_bootstrap(vm_size_t kernlen) vm_paddr_t start_pa, pa; uint64_t tcr; - pmap_cpu_init(); - tcr = READ_SPECIALREG(tcr_el1); /* Verify that the ASID is set through TTBR0. */ @@ -1625,39 +1624,75 @@ pmap_init_pv_table(void) } } -void -pmap_cpu_init(void) +static bool +pmap_dbm_check(const struct cpu_feat *feat __unused, u_int midr __unused) { - uint64_t id_aa64mmfr1, tcr; - bool enable_dbm; - - enable_dbm = false; + uint64_t id_aa64mmfr1; - /* Enable HAFDBS if supported */ id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - if (ID_AA64MMFR1_HAFDBS_VAL(id_aa64mmfr1) >= ID_AA64MMFR1_HAFDBS_AF_DBS) - enable_dbm = true; + return (ID_AA64MMFR1_HAFDBS_VAL(id_aa64mmfr1) >= + ID_AA64MMFR1_HAFDBS_AF_DBS); +} + +static bool +pmap_dbm_has_errata(const struct cpu_feat *feat __unused, u_int midr, + u_int **errata_list, u_int *errata_count) +{ /* Disable on Cortex-A55 for erratum 1024718 - all revisions */ if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, CPU_IMPL_ARM, - CPU_PART_CORTEX_A55, 0, 0)) - enable_dbm = false; + CPU_PART_CORTEX_A55, 0, 0)) { + static u_int errata_id = 1024718; + + *errata_list = &errata_id; + *errata_count = 1; + return (true); + } + /* Disable on Cortex-A510 for erratum 2051678 - r0p0 to r0p2 */ - else if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK | CPU_VAR_MASK, - CPU_IMPL_ARM, CPU_PART_CORTEX_A510, 0, 0)) - if (CPU_REV(PCPU_GET(midr)) < 3) - enable_dbm = false; - if (enable_dbm) { - tcr = READ_SPECIALREG(tcr_el1) | TCR_HD; - WRITE_SPECIALREG(tcr_el1, tcr); - isb(); - /* Flush the local TLB for the TCR_HD flag change */ - dsb(nshst); - __asm __volatile("tlbi vmalle1"); - dsb(nsh); - isb(); + if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK | CPU_VAR_MASK, + CPU_IMPL_ARM, CPU_PART_CORTEX_A510, 0, 0)) { + if (CPU_REV(PCPU_GET(midr)) < 3) { + static u_int errata_id = 2051678; + + *errata_list = &errata_id; + *errata_count = 1; + return (true); + } } + + return (false); +} + +static void +pmap_dbm_enable(const struct cpu_feat *feat __unused, + cpu_feat_errata errata_status, u_int *errata_list __unused, + u_int errata_count) +{ + uint64_t tcr; + + /* Skip if there is an erratum affecting DBM */ + if (errata_status != ERRATA_NONE) + return; + + tcr = READ_SPECIALREG(tcr_el1) | TCR_HD; + WRITE_SPECIALREG(tcr_el1, tcr); + isb(); + /* Flush the local TLB for the TCR_HD flag change */ + dsb(nshst); + __asm __volatile("tlbi vmalle1"); + dsb(nsh); + isb(); } +static struct cpu_feat feat_dbm = { + .feat_name = "FEAT_HAFDBS (DBM)", + .feat_check = pmap_dbm_check, + .feat_has_errata = pmap_dbm_has_errata, + .feat_enable = pmap_dbm_enable, + .feat_flags = CPU_FEAT_AFTER_DEV | CPU_FEAT_PER_CPU, +}; +DATA_SET(cpu_feat_set, feat_dbm); + /* * Initialize the pmap module. * diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index 75de9e342c72..2503f1df8404 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -142,7 +142,6 @@ extern pt_entry_t pmap_sh_attr; void pmap_activate_vm(pmap_t); void pmap_bootstrap(vm_size_t); -void pmap_cpu_init(void); int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); int pmap_change_prot(vm_offset_t va, vm_size_t size, vm_prot_t prot); void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode); From nobody Fri Jan 24 12:11:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfcB13cGPz5lJs3; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfcB101fbz481K; Fri, 24 Jan 2025 12:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyV3Qqw5CTvlmIGTd6l3+NL7I33od69sHMOwcO72DMM=; b=y4Luu/IMDz8TI3Rd3F8pJCIoyFl+G5Ct5F6D4OV49Zn8RkHZk8vc3/2HSprPyS1hodnIcb AqoHWHpNvFbdXH2U91pSd3nA13cpvC83XvznH97OU5K3tSX8VGLw1VXmdZDMCqiPgO59oR wymDMtOoocYVoU9CnjV7O2Oy9OOlrwruuq655IFjI0l7Gj6EeMiGRNe6nMB62z4wHBt496 lPM23UpBNp2+qzh67B/Ninur/kT0kPsuVwPhT0L1/MLTzC2N6mZUsPkjyPw4jW21b7myf9 zdKY5VARAGq0EO61tgYeKhAumyqd2Wq+mLRcFEYR38n00QxfjPtecccA2EU52g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyV3Qqw5CTvlmIGTd6l3+NL7I33od69sHMOwcO72DMM=; b=eh/q1NkV8MyinGrRShCtowYXNerYdoVIpIVKeYPVp7PzrNHpZHj207DBWwnste3Gn9C7R+ pKno6n/2wxmOExKhMj2ER6BI+Inyz0uo98uh00U2y/JAdG3PFCs7Zxgp/fiAXtCpz7fiSs 8bogXPWZSNrWD5pr8CvGgJbWOzwa2VtGAxPqBIKd1yGZkunLuhkg3b5vNnxDE0J3s7kPyZ Lp6hpBac0A8n2R8+XqMYw092mHpB+XV/iLh0Zr6t85BbvGDtReUEVg817McmlqwJJ8D9FD 8a8lN0gro7McKPP3KPSPRomr2sy1SXlmC1btL1S61Vlvs9rO4FZylt5bbzOirA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720713; a=rsa-sha256; cv=none; b=VzKfBGhvoqmlNFlICECqg5XJoctFw4Hsj3xm/QJG/hJe4/hVyMcQWj7Y/oa7uZqLtPWMLy fA42D1Wy9MiicER6ed+jGPTUq+5JWVHABF7kR5iT/gKAurLSj/Hq7Ii+kI6OmDtUMU+Tvy necnwBJGDrmEzskyux5e/8otwKA/wVQaiDECbQkj5Mz3xrz5587EXrDMDeb/suTr7hqnMy j33vtvVUoOFhUE/L1SE4eOd/tGCtCcILZMOjgzeZEnpqf3Upwfh0heMzRwr/C3beDsERNV 4u/B+92PruTQVSSpmLKbOiH7EVLbwyGWdSiIYrromvN1no/IDxvh4c5aKtwPEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfcB06CwNz8x7; Fri, 24 Jan 2025 12:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBqwG040447; Fri, 24 Jan 2025 12:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBqX8040444; Fri, 24 Jan 2025 12:11:52 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:52 GMT Message-Id: <202501241211.50OCBqX8040444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 62f8d65ee4d0 - main - arm64: Move FEAT_PAN to the cpu feat framework List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62f8d65ee4d0178f670a0930736d3628d06746fb Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=62f8d65ee4d0178f670a0930736d3628d06746fb commit 62f8d65ee4d0178f670a0930736d3628d06746fb Author: Andrew Turner AuthorDate: 2025-01-24 11:42:48 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 arm64: Move FEAT_PAN to the cpu feat framework Use the common framework rather than custom functions called on each CPU. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47816 --- sys/arm64/arm64/machdep.c | 38 ++++++++++++++++++++++---------------- sys/arm64/arm64/mp_machdep.c | 1 - sys/arm64/include/cpufunc.h | 2 -- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index db223e011c67..0a925842dba4 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -173,35 +173,43 @@ SYSINIT(ssp_warn, SI_SUB_COPYRIGHT, SI_ORDER_ANY, print_ssp_warning, NULL); SYSINIT(ssp_warn2, SI_SUB_LAST, SI_ORDER_ANY, print_ssp_warning, NULL); #endif -static void -pan_setup(void) +static bool +pan_check(const struct cpu_feat *feat __unused, u_int midr __unused) { uint64_t id_aa64mfr1; id_aa64mfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - if (ID_AA64MMFR1_PAN_VAL(id_aa64mfr1) != ID_AA64MMFR1_PAN_NONE) - has_pan = 1; + return (ID_AA64MMFR1_PAN_VAL(id_aa64mfr1) != ID_AA64MMFR1_PAN_NONE); } -void -pan_enable(void) +static void +pan_enable(const struct cpu_feat *feat __unused, + cpu_feat_errata errata_status __unused, u_int *errata_list __unused, + u_int errata_count __unused) { + has_pan = 1; /* * This sets the PAN bit, stopping the kernel from accessing * memory when userspace can also access it unless the kernel * uses the userspace load/store instructions. */ - if (has_pan) { - WRITE_SPECIALREG(sctlr_el1, - READ_SPECIALREG(sctlr_el1) & ~SCTLR_SPAN); - __asm __volatile( - ".arch_extension pan \n" - "msr pan, #1 \n" - ".arch_extension nopan \n"); - } + WRITE_SPECIALREG(sctlr_el1, + READ_SPECIALREG(sctlr_el1) & ~SCTLR_SPAN); + __asm __volatile( + ".arch_extension pan \n" + "msr pan, #1 \n" + ".arch_extension nopan \n"); } +static struct cpu_feat feat_pan = { + .feat_name = "FEAT_PAN", + .feat_check = pan_check, + .feat_enable = pan_enable, + .feat_flags = CPU_FEAT_EARLY_BOOT | CPU_FEAT_PER_CPU, +}; +DATA_SET(cpu_feat_set, feat_pan); + bool has_hyp(void) { @@ -964,7 +972,6 @@ initarm(struct arm64_bootparams *abp) init_param1(); cache_setup(); - pan_setup(); /* Bootstrap enough of pmap to enter the kernel proper */ pmap_bootstrap(lastaddr - KERNBASE); @@ -1029,7 +1036,6 @@ initarm(struct arm64_bootparams *abp) if ((boothowto & RB_KDB) != 0) kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); #endif - pan_enable(); kcsan_cpu_init(0); kasan_init(); diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 987ff9ac1ceb..d052033d9575 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -256,7 +256,6 @@ init_secondary(uint64_t cpu) #endif dbg_init(); - pan_enable(); mtx_lock_spin(&ap_boot_mtx); atomic_add_rel_32(&smp_cpus, 1); diff --git a/sys/arm64/include/cpufunc.h b/sys/arm64/include/cpufunc.h index c948799eb7b9..e6e1f682794e 100644 --- a/sys/arm64/include/cpufunc.h +++ b/sys/arm64/include/cpufunc.h @@ -41,8 +41,6 @@ breakpoint(void) #ifdef _KERNEL #include -void pan_enable(void); - static __inline register_t dbg_disable(void) { From nobody Fri Jan 24 12:11:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfcB25XR1z5lKpR; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfcB21KpVz47yP; Fri, 24 Jan 2025 12:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ERSt/nJ/J+WsyOCm74TtYjab048MrSLZwS618xaatSg=; b=yBVYhMylxdDesqx6WT3urLpYvEh7Mv0jCJobx6t92xvgxDtdONDUxXBNwfPjQUHtvqMjZ5 5j8Prj7SWbp3XNwaZLfNG/rTJTTjI4c+awbH1FLeawGgihBBTzN1qdQ7dZKTinRQRLJ8zS BqGr5ofHWaQ0OvnT5gkeRQtVLtt7pnvDTKEjjaatO+GAbnNQ3T3uOXE9jtX6BfLLlAI7P7 xLtbcVnzW7MPDp+5wMXEKDaUlgoa1dhqSVc2NuC7K1fw6bV/xTOfzKTLEl3bvnKGeYwr8P hykYrEG7Ue1e/BgqpHrp1byfDrrEobwaC+5EPX6TgFS2TWmzF3Q0PuUiajNQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ERSt/nJ/J+WsyOCm74TtYjab048MrSLZwS618xaatSg=; b=UUIRjNXMCPfYpl1ILn33K/L2nO0Ic06mzjblec3dUrZoq0CPR3lMbjltxpD0D+6RDbIFwH 0TGZcMQOK3cqqdVJhZ0WE26xc+fC8KFCIqoCr6obHngzg/CHCc0gU+jsqOtuwLKdurQBL2 Yor+sp9s1F83VjqOT7RyohLwvm0QLoGAAA9HuxAL31W2qt7krza4wnCHfMHDON38NIGP5Q 35aadr6OoA3uCaZ/WHBKIOsM1rRiIXwGhCNDPcVonxJQ+SqdiV5+mnDZLlDVVYwjEMDEBQ x1gI4JHpNrCTYLLnbHVBgPMpSt3I8rbd/tLzqZvbcZVJQDI/Y42jP5IV6BGK9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720714; a=rsa-sha256; cv=none; b=Syxnn7YT/vfuuQj+wCr46yqnCXbM/Rrmj87JfDIzL80PFjCzGRYGktEZIRrMqKlE/i3GeR tbqQ8Lk9xNAhkhY2FClcHQuLoegeWEl6UjfQgOVszld3hqMtAkz3hBPP715QE+if+BinRU tFKEL9CyAseBM7qiVsyhbUn97aOvTWipVfC/SchtBseaTSnlK/Tch/2RPQBSd18ZwjCv7q GrdYXjZI2MYBUBgjyDaFew0akDm41nZmg3GhWoIYFo+1h/k22VxzcDphaTopYuQzUH1Grl sezfrnQnfoubzIXKDYsHW/Io3rfLoFvoDI3eny3uBHPvtRj4p8CcxAU1e/UeRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfcB20PZLz8v3; Fri, 24 Jan 2025 12:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBrsx040482; Fri, 24 Jan 2025 12:11:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBrKd040479; Fri, 24 Jan 2025 12:11:53 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:53 GMT Message-Id: <202501241211.50OCBrKd040479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e3f9593ed6ff - main - arm64: Move FEAT_PAuth to the cpu feat framework List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3f9593ed6ff70da7a8be46644693389214f26d5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e3f9593ed6ff70da7a8be46644693389214f26d5 commit e3f9593ed6ff70da7a8be46644693389214f26d5 Author: Andrew Turner AuthorDate: 2025-01-24 11:42:54 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 arm64: Move FEAT_PAuth to the cpu feat framework Use the common framework rather than a custom function on boot. Because we need to be careful when enabling pointer authentication the enable function only sets the flag to tell other functions it needs to be enabled. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47818 --- sys/arm64/arm64/machdep.c | 7 ------- sys/arm64/arm64/ptrauth.c | 38 +++++++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 0a925842dba4..ff7a88edfe61 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -1010,13 +1010,6 @@ initarm(struct arm64_bootparams *abp) /* Detect early CPU feature support */ enable_cpu_feat(CPU_FEAT_EARLY_BOOT); - /* - * Check if pointer authentication is available on this system, and - * if so enable its use. This needs to be called before init_proc0 - * as that will configure the thread0 pointer authentication keys. - */ - ptrauth_init(); - /* * Dump the boot metadata. We have to wait for cninit() since console * output is required. If it's grossly incorrect the kernel will never diff --git a/sys/arm64/arm64/ptrauth.c b/sys/arm64/arm64/ptrauth.c index b5f9fad1dc95..7ef958b2e03c 100644 --- a/sys/arm64/arm64/ptrauth.c +++ b/sys/arm64/arm64/ptrauth.c @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -81,8 +82,8 @@ ptrauth_disable(void) return (false); } -void -ptrauth_init(void) +static bool +ptrauth_check(const struct cpu_feat *feat __unused, u_int midr __unused) { uint64_t isar1; int pac_enable; @@ -96,28 +97,43 @@ ptrauth_init(void) if (!pac_enable) { if (boothowto & RB_VERBOSE) printf("Pointer authentication is disabled\n"); - return; + return (false); } if (!get_kernel_reg(ID_AA64ISAR1_EL1, &isar1)) - return; + return (false); if (ptrauth_disable()) - return; + return (false); /* * This assumes if there is pointer authentication on the boot CPU * it will also be available on any non-boot CPUs. If this is ever * not the case we will have to add a quirk. */ - if (ID_AA64ISAR1_APA_VAL(isar1) > 0 || - ID_AA64ISAR1_API_VAL(isar1) > 0) { - enable_ptrauth = true; - elf64_addr_mask.code |= PAC_ADDR_MASK; - elf64_addr_mask.data |= PAC_ADDR_MASK; - } + return (ID_AA64ISAR1_APA_VAL(isar1) > 0 || + ID_AA64ISAR1_API_VAL(isar1) > 0); } +static void +ptrauth_enable(const struct cpu_feat *feat __unused, + cpu_feat_errata errata_status __unused, u_int *errata_list __unused, + u_int errata_count __unused) +{ + enable_ptrauth = true; + elf64_addr_mask.code |= PAC_ADDR_MASK; + elf64_addr_mask.data |= PAC_ADDR_MASK; +} + + +static struct cpu_feat feat_pauth = { + .feat_name = "FEAT_PAuth", + .feat_check = ptrauth_check, + .feat_enable = ptrauth_enable, + .feat_flags = CPU_FEAT_EARLY_BOOT | CPU_FEAT_SYSTEM, +}; +DATA_SET(cpu_feat_set, feat_pauth); + /* Copy the keys when forking a new process */ void ptrauth_fork(struct thread *new_td, struct thread *orig_td) From nobody Fri Jan 24 12:11:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfcB44TS4z5lKWv; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfcB42XNnz488Y; Fri, 24 Jan 2025 12:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peE8+8dFy4kAJPOjlSD5UT7aBnjiNcCSDsJ7d+FIYuQ=; b=PwH3i8sgdqsrG362LCJsmKJSgcaKX3bsYxS9ViiXCMlCy+D7uOTJ9TMlplo5D2zFaoi7VF 2QJhlXFH72eVvgR8YePEZbr9pi0FJ/OmiJN2wEe8hcZrS68WF/q1m4G006kAu9XM6RDK0N rBXE72NoDB01DJZhcz/57jnlSgxwRH61ZPPwwk+ufEVBE+KfUUKwOTTQE9Waam7TWygkfY DBXNUijsyzJTqQsfEU9ZJ56BKyvyZmfkb4pDLoxW4Uq1i0moOG/rhqpCJkt2MbsNEJO7Cd fuPBQEjs4Y25oqBSg8HxZ4brWeSyu1UGkxK7U74ENPRob3z6RX1EPtA/BZG/7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=peE8+8dFy4kAJPOjlSD5UT7aBnjiNcCSDsJ7d+FIYuQ=; b=R+Kco/hnugV7P0Jm5eZDTnQKfsz++1MmgJqxIxdER7XxRp8rPOaeky8nHDLM5F5cbobeNR iz6M+3mnXcZ7erEhMdRygL8IokVFYiO9n9tqKqR5347Uj1B3im09hrj3aPqV7wZszr8LcK mEE89SFifD/Sfu2M5JYDmhKbq84QCC/+DCUJKuDYLQOeR7GLpEidoHLzJBwZJOHpfsvWZ+ B672uwdNbIm8KFTI+ljA4mW8vEk4FCvf/U7ITI2ShDEdkc/X9yB9WXXp79vw6mGx493E40 rSfM3lyat9blwaWcouT0YU2FPiU8NcJOE0SXo5tosmQekDHXpXJDNxsD6S3f3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720716; a=rsa-sha256; cv=none; b=H5BK9t6nRojSIkfxktRxSXDQmFivSxuqQUC2hYToq8mgUNN07++j2vLXwMFkd5KN2kQ8Gl ak/1fLpOepbkLbAk2aSAHbYfSkgJDVHC+EXjTMpwaUj16zSsYlB61tSF7uHjFB+7BVF0Gd KtATWX7Q6Lx611EpZxAxpsztKERusZ+hWmYEvJcoqEtLy9yMF9WfKDmEuK537DVlt85AJD j7GA/jSVnIgvucxveKLmy403htNzTVC1VpjhxdAmd8sJqHvwIrsufc04tr2gXtUrJSnrqU 9wLAYZKeqRoqW/sgKE1rgiEg7x9b6nI0smM0OZKdltkH2rpeDIs6Od1mqiRoEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfcB423X9z8WR; Fri, 24 Jan 2025 12:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBueb040559; Fri, 24 Jan 2025 12:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBuHf040556; Fri, 24 Jan 2025 12:11:56 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:56 GMT Message-Id: <202501241211.50OCBuHf040556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 41dfdf04e2b1 - main - arm: Fix the location of a ';' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41dfdf04e2b1e39634603370299b15634a17e4a7 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=41dfdf04e2b1e39634603370299b15634a17e4a7 commit 41dfdf04e2b1e39634603370299b15634a17e4a7 Author: Andrew Turner AuthorDate: 2025-01-24 11:43:03 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:29 +0000 arm: Fix the location of a ';' It must have fallen off the line, return it to its correct location. Sponsored by: Arm Ltd --- sys/arm/arm/generic_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 9b5f0f52368b..775290960ebd 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -191,8 +191,8 @@ get_freq(void) static uint64_t get_cntxct_a64_unstable(bool physical) { - uint64_t val -; + uint64_t val; + isb(); if (physical) { do { From nobody Fri Jan 24 12:11:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfcB345RYz5lKpT; Fri, 24 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfcB31prQz47yZ; Fri, 24 Jan 2025 12:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0auGDO/siNuzuiYcOrNJhzl8XAspzf3M370NwHNj+o=; b=kvw1qRgX3xWs262J6vTDVT0bbf2JEVADyjAI+B24EWaaVvh8+pfz/j6FljfJQlz5V08Wrj md/ScYUG2rC2z9vFnJF9y6C6gT5z0nVpV5ktt7YxbnR6dt7HY+Y1UJKQ0w2AfGuPv79k+L 4WWMgJJBjQay7HzBGOZ1H/45u1D/GgCY66TbPwszKYwxQtdk7ruKDc/yRLfLqGUiKRCcPo /v1hZJnKYEGEy/yPZyrcqsTVdVGm8GzrBSjaXdvXhFzE+3Vc2bfyO9FvteJ3I+Swv5SBKF wHO8pU6Wm4Gtx3EEPedg0TJEuXi/ztUWmodzzgQppXBRRB35wreeLLWxsfK0yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737720715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0auGDO/siNuzuiYcOrNJhzl8XAspzf3M370NwHNj+o=; b=oOlkSQCxH3PtyRROm2AZuH48Wuku/KV1041LJCarstJpwozh3NLoV6kEWU3NxF6msdutnc puzevAb1tqC/0QxuBxcqKKMH1RyzoUBCjcBdMMD8HgES/iNeUjaG7OooLpa7ogFS3M7WeR BFWf2UmQxRfysa2EBxoEPtE0phllCE+VMCw8SY1FVYwXNYHguDI8tG4dva9o+EV+14CjX+ ZqaI7ryyhbzFGZgfocU9hYBZLXhugpdSVydigaIRsi7Tp7msJQ1RRsMwj/rBykTwbWPnqE ujVTw6zjN1pgekimbPjZsewkMeIdh6rFt902rWEUq9wsHkZ1SP+s1tlpLv6T4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737720715; a=rsa-sha256; cv=none; b=Cb5FtnjTwQANeUXC/NjKXcR1nfxDp2nSWbuOyObsSFgjEvlPnDpfTPuiKPqs9UrVvrhKar IKhrO9UULEMYN/32+iItfF4sDmryEV362d3a4+zlXIjmKOxoTYIpuWnaqq6Pqaq01GAWxK hnVk8dV9VWQzGw6rff2An1FuMTgUyHT27mO3y2oKfU/eYL4N4NNpDWY9qZKRuWR+bRFtlK JUgLcVnNGJghpHkzMCptaknDshqHh3RVUJwAFpyGMoNKJpW+Lr/sTR6NwtSbzCSHEsdN+g etJv4+bkaJdufubgBnvW1ZNf5IyruQzPeCuG6woXaPnVJnqp9cQ9tB/gIUg0cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfcB31N7Fz8v4; Fri, 24 Jan 2025 12:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OCBt02040517; Fri, 24 Jan 2025 12:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OCBt7L040514; Fri, 24 Jan 2025 12:11:55 GMT (envelope-from git) Date: Fri, 24 Jan 2025 12:11:55 GMT Message-Id: <202501241211.50OCBt7L040514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0c333f8c6e6a - main - psci: Support the arm64 Errata ABI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c333f8c6e6abee331b12a7dbadfe077dbaf79c8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0c333f8c6e6abee331b12a7dbadfe077dbaf79c8 commit 0c333f8c6e6abee331b12a7dbadfe077dbaf79c8 Author: Andrew Turner AuthorDate: 2025-01-24 11:42:59 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 12:09:28 +0000 psci: Support the arm64 Errata ABI Add support for the Arm Errata Management Firmware Interface (Errata ABI) [1]. This provides an interface for the kernel to query the status of an erratum workaround. Some errata may be mitigated depending on the other hardware in a SoC, e.g. Cortex-A78 erratum 2712571 is not affected in systems that use an Arm interconnect. As there may not be a way for the kernel to know if this is the case then it would have to implement the workaround even when not needed. There are other cases where the needed workaround is implemented in firmware and if not implemented then the kernel may decide to not use a feature. In this case we can query the firmware before deciding if we should use a feature or now. There is a known issue with some firmware implementations of the Errata ABI that incorrectly returns a status indicating the erratum is fully mitigated by the firmware, however there is a kernel component needed, e.g. Neoverse-N1 erratum 1542419. To handle this case we tell the caller there is some workaround implemented in the firmware and it can decide how to handle it. If this is fixed in a way we can detect we can add a new erratum status value to indicate this. [1] https://developer.arm.com/documentation/den0100/latest/ Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48055 --- sys/conf/files.arm64 | 1 + sys/dev/psci/smccc_errata.c | 138 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index c095bae42996..64c8acfcdb9a 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -421,6 +421,7 @@ dev/pci/pci_dw_if.m optional pci fdt dev/psci/psci.c standard dev/psci/smccc_arm64.S standard +dev/psci/smccc_errata.c standard dev/psci/smccc_trng.c standard dev/psci/smccc.c standard diff --git a/sys/dev/psci/smccc_errata.c b/sys/dev/psci/smccc_errata.c new file mode 100644 index 000000000000..db6b0a588a86 --- /dev/null +++ b/sys/dev/psci/smccc_errata.c @@ -0,0 +1,138 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Arm Ltd + * + * 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. + */ + +/* + * A driver for the Arm Errata Management Firmware Interface (Errata ABI). + * This queries into the SMCCC firmware for the status of errata using the + * interface documented in den0100 [1]. + * + * [1] https://developer.arm.com/documentation/den0100/latest + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define ERRATA_HIGHER_EL_MITIGATION 3 +#define ERRATA_NOT_AFFECTED 2 +#define ERRATA_AFFECTED 1 + +#define EM_VERSION SMCCC_FUNC_ID(SMCCC_FAST_CALL, \ + SMCCC_32BIT_CALL, SMCCC_STD_SECURE_SERVICE_CALLS, 0xf0u) +#define EM_VERSION_MIN 0x10000L +#define EM_FEATURES SMCCC_FUNC_ID(SMCCC_FAST_CALL, \ + SMCCC_32BIT_CALL, SMCCC_STD_SECURE_SERVICE_CALLS, 0xf1u) +#define EM_CPU_ERRATUM_FEATURES SMCCC_FUNC_ID(SMCCC_FAST_CALL, \ + SMCCC_32BIT_CALL, SMCCC_STD_SECURE_SERVICE_CALLS, 0xf2u) + +static device_identify_t errata_identify; +static device_probe_t errata_probe; +static device_attach_t errata_attach; +static cpu_feat_errata errata_cpu_feat_errata_check(const struct cpu_feat *, + u_int); + +static void +errata_identify(driver_t *driver, device_t parent) +{ + int32_t version; + + if (smccc_get_version() < SMCCC_MAKE_VERSION(1, 1)) + return; + + /* Check we have Errata 1.0 or later */ + version = psci_call(EM_VERSION, 0, 0, 0); + if (version < EM_VERSION_MIN) + return; + + if (BUS_ADD_CHILD(parent, 0, "errata", -1) == NULL) + device_printf(parent, "add errata child failed\n"); +} + +static int +errata_probe(device_t dev) +{ + device_set_desc(dev, "Arm SMCCC Errata Management"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +errata_attach(device_t dev) +{ + /* Check for EM_CPU_ERRATUM_FEATURES. It's mandatory, so should exist */ + if (arm_smccc_invoke(EM_FEATURES, EM_CPU_ERRATUM_FEATURES, NULL) < 0) { + device_printf(dev, + "EM_CPU_ERRATUM_FEATURES is not implemented\n"); + return (ENXIO); + } + + cpu_feat_register_errata_check(errata_cpu_feat_errata_check); + + return (0); +} + +static cpu_feat_errata +errata_cpu_feat_errata_check(const struct cpu_feat *feat __unused, u_int errata_id) +{ + struct arm_smccc_res res; + + switch(arm_smccc_invoke(EM_CPU_ERRATUM_FEATURES, errata_id, 0, &res)) { + default: + return (ERRATA_UNKNOWN); + case ERRATA_NOT_AFFECTED: + return (ERRATA_NONE); + case ERRATA_AFFECTED: + return (ERRATA_AFFECTED); + case ERRATA_HIGHER_EL_MITIGATION: + return (ERRATA_FW_MITIGAION); + } +} + +static device_method_t errata_methods[] = { + DEVMETHOD(device_identify, errata_identify), + DEVMETHOD(device_probe, errata_probe), + DEVMETHOD(device_attach, errata_attach), + + DEVMETHOD_END +}; + +static driver_t errata_driver = { + "errata", + errata_methods, + 0 +}; + +DRIVER_MODULE(errata, smccc, errata_driver, 0, 0); From nobody Fri Jan 24 13:36:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yff45531Bz5lQjw; Fri, 24 Jan 2025 13:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yff452VRhz3NQm; Fri, 24 Jan 2025 13:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737725813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bmTf9eZ+3MoTEc6Rv/o62Ed5virgYF4cP57wuNwnW1s=; b=IdHqJf1MGqEBWZVqN6Wfu4ebIZEeXMHqHEVgKUI/oLiMtOZZba7EUkqosPHpjn3ZajSvub qCqCD3Lrm31gWiZtZreM5ZFrlJDmoducsc6Te54t6nFs/oevE/Scjb6J89n3y/034AJwso 9H2ZZkASYFyha2eTYuaLbwzNYmugGoZJ3Cd+T/xQZvIQN+hhxzxYUY+QhIXWM5WhsEeMct g4QZR9r7gFf7zt8o1agTXOB+24gwm5jKiPlJyiHRad4JkzQ9eLeYMOyIFNt41xZ9FrmedE zbZoOCS9txXQa8uaGZnm6Rh0rAhabpQrIrhxpQ81LLZVg09uuZ1ORjrLDEtrsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737725813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bmTf9eZ+3MoTEc6Rv/o62Ed5virgYF4cP57wuNwnW1s=; b=WhY9UJiHrLItotoSYXq0YqqLHCLu4ItBFxfQdBs/pnYGkn3WhoTk3n2PeDSt+6NW+b2tHE l8nEnObOEa1icFBDeE0MM1gt6uMyRiuMXwJgtGu1OUhDGw4msBjHsTXsU1Vhtq+9Tw1m+2 WJeA3jJasDG+LHJa/wBa2fz8xVSzvrG7zaAvDqy8zRgmjYitvdqXHOZeDQ8t/CIq9e6YtW aM2NNGqRXQ5XhiDgq6ZY5s6TlIDFLZz8so6pKeLzgG9jWLp+BQ0imi8AY0uOm7FFqZKhhz fZ7eMNvDkHVG0E4CZj8SaWKMYVAG1t8bNA6yHkdN3YkD3K2SG6iBDzJCgVbyJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737725813; a=rsa-sha256; cv=none; b=vUmXw7sGcxZc5MKfuY8xzBGxtb0J7d6q8ey/IRW2fJdoIYUgFqPqy4dqhbSexnExakJhU7 NepqrhYv4KJXlEWYwcsBptJvjNlpHW7YSAPacDLvGVb7ImUJr7FjVlx7qOZ8OjiMBPPMgb ka2G9xtkb48ecAN4T4Vtd7ISvHvcJXrLti5DcS2V6w+je32caEq/6Lr05liv2+MQRB3sie C/SkVVEpPIalzvmhQdhuvud/sIv9muAvMqZ+KjB2l1eBcoTonnkQl13JLYT5fv8s+XWD3V j7XwBcxY/MSvbSVWskVfuLEHhk3Xez5L4TEQXVTPZeIp6NCPJBcDUPreruh1Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yff451XGkzB4L; Fri, 24 Jan 2025 13:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ODar23094437; Fri, 24 Jan 2025 13:36:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ODarMa094434; Fri, 24 Jan 2025 13:36:53 GMT (envelope-from git) Date: Fri, 24 Jan 2025 13:36:53 GMT Message-Id: <202501241336.50ODarMa094434@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: 6700e2d963ff - main - csu: add the "Retain" flag to notes sections flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 6700e2d963ff0475cc5cd444e92ce40855643084 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6700e2d963ff0475cc5cd444e92ce40855643084 commit 6700e2d963ff0475cc5cd444e92ce40855643084 Author: Konstantin Belousov AuthorDate: 2025-01-24 11:32:53 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-24 13:36:41 +0000 csu: add the "Retain" flag to notes sections flag It should make the notes immune against --gc-sections. Reported and tested by: bapt Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/csu/common/crtbrand.S | 2 +- lib/csu/common/feature_note.S | 2 +- lib/csu/common/ignore_init_note.S | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S index b59e2fd8056b..a06f72daa99d 100644 --- a/lib/csu/common/crtbrand.S +++ b/lib/csu/common/crtbrand.S @@ -36,7 +36,7 @@ * for more information. */ - .section .note.tag,"aG",%note,.freebsd.noteG,comdat + .section .note.tag,"aGR",%note,.freebsd.noteG,comdat .p2align 2 .4byte 2f-1f .4byte 4f-3f diff --git a/lib/csu/common/feature_note.S b/lib/csu/common/feature_note.S index 5c1d56d4cde1..fb9f6141699e 100644 --- a/lib/csu/common/feature_note.S +++ b/lib/csu/common/feature_note.S @@ -29,7 +29,7 @@ #include #include "notes.h" - .section .note.tag,"a",%note + .section .note.tag,"aR",%note .p2align 2 .4byte 2f-1f .4byte 4f-3f diff --git a/lib/csu/common/ignore_init_note.S b/lib/csu/common/ignore_init_note.S index 57fb4e8f4d51..d78be61f17a9 100644 --- a/lib/csu/common/ignore_init_note.S +++ b/lib/csu/common/ignore_init_note.S @@ -30,7 +30,7 @@ #include "notes.h" - .section .note.tag,"a",%note + .section .note.tag,"aR",%note .p2align 2 .4byte 2f-1f .4byte 4f-3f From nobody Fri Jan 24 14:36:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfgNN3jdMz5lVDf; Fri, 24 Jan 2025 14:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfgNN30jxz3Vbw; Fri, 24 Jan 2025 14:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0vXMjsVBudi8t+T6Pf4eiU84LO4Z9TvaVHUpRWp+WNU=; b=Nz4sbuCBoTqZnt5bjaG0qpYrD9Dll4DQeB8pc7k63CBMnH609NzvbE15syG9q8vS98XDA4 5nZdQ7IH8Lz4mWfX6TrMd2o8ZnTYPLHIZNqRbT+z31FTvoD45d1027w9oSC4YoLtKb6vGo uFJGV1rQAYmW91gzjRpnWnA0/1nn1QsjRmz/ivPg2p41czlB/mz6KJFwWx+YttpZDtXvj4 Kr0ALo0i+jBnq2a4ktTTy7mTPc83s6V8LIvW9vM/Kjg8SEoPjiWTqEjKjG56sB3AljKlj5 HtuUSPojAXAUERDPPHphAm2l0qbt4mD1EVl8Sq1BmPsjgd/Dh0EeumBTrxtiwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0vXMjsVBudi8t+T6Pf4eiU84LO4Z9TvaVHUpRWp+WNU=; b=bKkfmVhQQY167Y6HRHRTiMK0lDzvbh88bpsZRIKXidJIZrhyS3j0YB/imOBpdvhxZ46VII FVmcNF9u+KdUwLEvM6beBef7QxsKLTCCETMYMRQnSkLyzFume3Gzs4QrbQKuUL3AokWBsv 78bNU/42MvtoNEsdm+j23wDhOrvVP/TZwXxOyaV+HScVY1/VHTu3NEth4FfY5aM4uqI2F0 ymoLRHJmHvm0JX3tszteqv9Bhs2aRKuGm7AWvu+gZb4eOmF7U3sBRuGOD98RGNqz/6POQA CwlhDOsjuohXWyU5Qp3E1FMSM2Orepm8PVx6oq9LKlUeID6DGxB1MKXLfjEQxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737729364; a=rsa-sha256; cv=none; b=cghqOJu588PfDNngmrk51AVS2n25ZEMbyawNrCbL20ecOZqGam8+PCPDRg1KqVj99IV9eo LHUy19e+H5egMF9wrrZzMBTGu3GqmtkLJm/sWnA9b1jVaOnZKLINigazVpHDA6KX22q4xr T4Ch3kE8RZb6Zw/MnpLYUE5KfKD4Qv0ZsBcdgSYLHw3xeynj9n2+Ens08/SNMZ9RqqXXoh 3ciKgRgFgtgOllOaKyLLYoEWIiiesLFDMgXjPBvhX43/kXSP+Dd3ipkEHiYYgdG0sA+K/f pPRndUG3tZUd+UbrKYUwnc20cGUisDdxeyfp6pJ+9X3Q/14ToRlkfF4Wdc1N8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfgNN2W7FzDLP; Fri, 24 Jan 2025 14:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEa4N0006550; Fri, 24 Jan 2025 14:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEa4b9006547; Fri, 24 Jan 2025 14:36:04 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:36:04 GMT Message-Id: <202501241436.50OEa4b9006547@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: 5db50a3167ac - main - rtsold: Further usage message updates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 5db50a3167ac7a4f18088a5cfdaac64aa925c32e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5db50a3167ac7a4f18088a5cfdaac64aa925c32e commit 5db50a3167ac7a4f18088a5cfdaac64aa925c32e Author: Mark Johnston AuthorDate: 2025-01-24 14:06:59 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 14:06:59 +0000 rtsold: Further usage message updates Add -u, remove -p from the rtsol(8) usage message. PR: 266634 MFC after: 1 week --- usr.sbin/rtsold/rtsold.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index e0b168a379bf..63f20e3032a7 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -792,19 +792,19 @@ usage(const char *progname) { if (strcmp(progname, "rtsold") == 0) { - fprintf(stderr, "usage: rtsold [-dDfFim1] [-O script-name] " + fprintf(stderr, "usage: rtsold [-dDfFimu1] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] interface ...\n"); - fprintf(stderr, "usage: rtsold [-dDfFim1] [-O script-name] " + fprintf(stderr, "usage: rtsold [-dDfFimu1] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] -a\n"); } else { - fprintf(stderr, "usage: rtsol [-dDFi] [-O script-name] " + fprintf(stderr, "usage: rtsol [-dDFiu] [-O script-name] " "[-M script-name ] [-A script-name ] " - "[-p pidfile] [-R script-name] interface ...\n"); - fprintf(stderr, "usage: rtsol [-dDFi] [-O script-name] " + "[-R script-name] interface ...\n"); + fprintf(stderr, "usage: rtsol [-dDFiu] [-O script-name] " "[-M script-name ] [-A script-name ] " - "[-p pidfile] [-R script-name] -a\n"); + "[-R script-name] -a\n"); } exit(1); } From nobody Fri Jan 24 14:36:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfgNP703Wz5lV3y; Fri, 24 Jan 2025 14:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfgNP4N3cz3VJT; Fri, 24 Jan 2025 14:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmLgdxxwJBuPRpOfqRE4ONamvHqetHJMO16dBKzjIVU=; b=Xwe6HOtZqmFCf+qviMF0IkEbaoDYYpMak+vlGKL67sreHXS4nq3d39ExjwCI81GD194Nyb I7aq5YL9zMsDNKK3M8taJU+Jt1UryrJrl6d8Z1kFumIwFL3SHPjUg4gi4oyQGpIP+zSnb6 +9bTjkMbM8A6rWCznA1vWTZggRnF3GltUNOuU+iD/An9c1whlIuZ5920bJuFKBZF4LfCJ9 kaW9+bBqdRiqSvWC5IceCFx4h38AHOWY5csn/AZqzRXyF9wUNPtHcEypcyxubhZdfOcRkf BhqcLjPeexvh8eEJj1eChy0trRXm3kFITHuOs2Em77hRJBQTRFwR1ZBd6yO5vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmLgdxxwJBuPRpOfqRE4ONamvHqetHJMO16dBKzjIVU=; b=sYt7NyUnj8SEYtCzycHHJP6IGvdfqJ6kLwh7aj9/Rvr6p6Mu0eQHiez5hY+pKesCyJI9iC QQNstew2hjzk2sed4tswQM9ms04FccNvUQYrHdk186EYxYsKp3NAGilyeQS8bn9xH3NKai bWYJ9fOUXPr4Tx81EgbOgtNziUkgPuhXM+CBbgOFaE9h/FqO+oWs3svIXwCV9A1u5e3hrw +EjzPKJ9G1nvZXdkZcBan4GgifM1qUkt79O8FNlK/YCzuLwP+Co/aDH1DajTAl+P2E2eXt 18wwtgm+/Qlr3/bpI4Cja8UzyMtMWdncfWot6EcDaQONFeFChwqI9Zt0KH70LQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737729365; a=rsa-sha256; cv=none; b=cY6z6ySPs+bJUNYmI4CG93Krzf7dDB5Zf07qfIk6Os+Ts2VIMPRUyEPJkWWWHRTnKdAeM2 IB6o/YgaZM9sNT7r8NzejjA7GBGxacJ+JbLcY7CAbxh28SzW0g44eniOrbvmDVYlr96uKU kQZin8GvJLsXcquoMX7VGtKzAhxruA5z1ABZ6nwFer+O1TdS58cWV/GaB4JReJpe2ODP1a 7VuBqap7R1rCtpt/rtfGHFNQg0v5WG+2/FYH6iOwytOARn3dUYI9aUF2GkaUpWRoKnJn37 eVqU0MziHYd1YcSHDA0gvKZvrLwtpEttrOJWYOd4e/SHMJk2wQabhmkmal4S/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfgNP3mdNzDCy; Fri, 24 Jan 2025 14:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEa5J9006583; Fri, 24 Jan 2025 14:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEa5be006580; Fri, 24 Jan 2025 14:36:05 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:36:05 GMT Message-Id: <202501241436.50OEa5be006580@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: c901e89d8e46 - main - savecore: add missing call to cap_openlog when in capabilities mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: c901e89d8e467b56f844ab5dba18dc20d503c2be Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c901e89d8e467b56f844ab5dba18dc20d503c2be commit c901e89d8e467b56f844ab5dba18dc20d503c2be Author: Stéphane Rochoy AuthorDate: 2024-12-11 13:39:36 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 14:20:51 +0000 savecore: add missing call to cap_openlog when in capabilities mode Signed-off-by: Stéphane Rochoy Reviewed by: markj, oshogbo MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1546 --- sbin/savecore/savecore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 5ba7e62e7d6c..2f3ad3adc7ab 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -101,6 +101,9 @@ #define STATUS_GOOD 1 #define STATUS_UNKNOWN 2 +#define LOG_OPTIONS LOG_PERROR +#define LOG_FACILITY LOG_DAEMON + static cap_channel_t *capsyslog; static fileargs_t *capfa; static bool checkfor, compress, uncompress, clear, force, keep; /* flags */ @@ -1409,6 +1412,7 @@ init_caps(int argc, char **argv) exit(EXIT_FAILURE); } cap_close(capcas); + cap_openlog(capsyslog, "savecore", LOG_OPTIONS, LOG_FACILITY); } static void @@ -1436,7 +1440,7 @@ main(int argc, char **argv) savedir = "."; comp_desired = KERNELDUMP_COMP_NONE; - openlog("savecore", LOG_PERROR, LOG_DAEMON); + openlog("savecore", LOG_OPTIONS, LOG_FACILITY); signal(SIGINFO, infohandler); argc = xo_parse_args(argc, argv); From nobody Fri Jan 24 14:36:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfgNR1jFKz5lTs5; Fri, 24 Jan 2025 14:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfgNQ5l2Sz3VYT; Fri, 24 Jan 2025 14:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fRtXjYNF0FJlvTt9FNVDrNDxdSqdtaxcap9o6YNuLeM=; b=tgHYybzvn/VfEvJlhkuLRI8Mngo6EcIEU1ljSUxXdPtsvNWUJ/k+cR5ZOJ2cB+OyroKm4q Kvd/+4Gu60TdJviDBquMiAyqvfaTk1c8RVsDwL+9fuG+zgmA3tWpN/L0jp14z2nZLIV274 ys1S65u4CUu69JTcIdYhygz+cMMpsmG7SKyzw4YnyDcGFoD0elmUF3m6DbrGTsglkUN2yD 6qmqoYmPgSUgMcX/nbLcyhtzMqYCk7ZHvFciI4Z4h4LN0jXwFWOCtVIHb8o3QNmayyaWng k+GqKWjLZ01DGKemUQ6R9zO1SuGzT/TlsfFTccKBq+MAgTEvBJsuS+SgL+0Vrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fRtXjYNF0FJlvTt9FNVDrNDxdSqdtaxcap9o6YNuLeM=; b=tMUabNhKZyST72Hz2NYUu5Tna36HuX+H6azqoD16+sCvtcVgHcmPklvI7M/1RYwFiG0zl3 b6Wsve8+T5uj5VmYal7v90n+K7R8oZJHn+wLXcZwUnLus8ZcVsyu0QJct/bAEzyH8FyX5b j+0mJjlHVo9k1IDtgAm3Eakjmzhp2BnUwm5GmHa6dtQy3mQ9Dg5PCDz3JiIuadl1EM7/HV x7TgKe6ABJJHeWqJsG4OkLmg/XMaBazkkmTpGHolXxc/lbyhZNYiwSNO6LR8qp5kXNhE0h LKSJn+wT8LMlxrU0I5raQq6YSpg3UrKnAo93SEyrGJfHVPayrPzYb2aJdjsUkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737729366; a=rsa-sha256; cv=none; b=f3Sup1oTpboOs4+v00pmk47b/Twq7a2yWxTuk1HJoDvOUVzjV7/FT3yH8qTcfTiEIpPqgj 6+VA9qDj1IoK6e4L+USpQmCExdkA/DsqqIVlIQau+MxLmIiDRfiBkpRxg9itKpGCTfm9// EPTI6B3CPRMWJJF1HE/kfag9j1CgoyFLAkXcmKkOsWTmevn5qgPFqD/VHHtZ9SA79K+DA9 7IjCzF5uvntxt1davDFoR0g899LGN0hra2WlUzwFPQV6h7lxHeBtK5GYdFe1D+K8TigXlt hmLX+LtpHw24J8IOmCN2MNNZG6Qsd7hwNlnPyzKQRqQ9PHO0oVmPk8TSNrW6Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfgNQ5FGBzDD0; Fri, 24 Jan 2025 14:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEa6Oi006616; Fri, 24 Jan 2025 14:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEa6Uu006613; Fri, 24 Jan 2025 14:36:06 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:36:06 GMT Message-Id: <202501241436.50OEa6Uu006613@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: 3dc18af5770f - main - savecore: add a test for LOG_PERROR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3dc18af5770f9fc820343021d63dfc4cf09d9906 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc18af5770f9fc820343021d63dfc4cf09d9906 commit 3dc18af5770f9fc820343021d63dfc4cf09d9906 Author: Stéphane Rochoy AuthorDate: 2024-12-12 14:11:47 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 14:21:36 +0000 savecore: add a test for LOG_PERROR Signed-off-by: Stéphane Rochoy Reviewed by: markj, oshogbo MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1546 --- sbin/savecore/tests/Makefile | 2 +- sbin/savecore/tests/log_test.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sbin/savecore/tests/Makefile b/sbin/savecore/tests/Makefile index b58e79f518ef..81e6b8ce2667 100644 --- a/sbin/savecore/tests/Makefile +++ b/sbin/savecore/tests/Makefile @@ -1,3 +1,3 @@ -ATF_TESTS_SH= livedump_test +ATF_TESTS_SH= livedump_test log_test .include diff --git a/sbin/savecore/tests/log_test.sh b/sbin/savecore/tests/log_test.sh new file mode 100644 index 000000000000..9b006a2f2644 --- /dev/null +++ b/sbin/savecore/tests/log_test.sh @@ -0,0 +1,25 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 Stéphane Rochoy +# + +atf_test_case log_perror +log_perror_head() +{ + atf_set "descr" "Test LOG_PERROR behavior" +} +log_perror_body() +{ + atf_check -s exit:1 \ + -o ignore \ + -e save:savecore.err \ + savecore -vC /dev/missing + grep -qE 'savecore [0-9]+ - - /dev/missing: No such file or directory' savecore.err \ + || atf_fail "missing/invalid error output" +} + +atf_init_test_cases() +{ + atf_add_test_case log_perror +} From nobody Fri Jan 24 14:36:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfgNS05KLz5lV42; Fri, 24 Jan 2025 14:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfgNR5m4Rz3VJb; Fri, 24 Jan 2025 14:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rBATG9HY5YGtYU7lCyuZfIfDXdkxhjjnhM+uQnoOkk=; b=QRaVS7JFq4UezlJ4BVxBE9FpF9a/tGvzTxlChNWdiYzGSq0HrmvaqH6A6sqkpoIJYAhESa M04fbEeu6E024EhR31gBk3/zX7Z4Y3JpR7KL4F9INRygmJvQSh+1q50uBuNnOD54Eb5WM3 FkN4wuxdF9HM3DsHG7co9LrRlwaxnx4ldD8wrDsJxPoGDz9b8tpR7fiMuFDaWGF1RoHqMI BEI84PVlE5LggJwO+esUWsgz4nslgmscxBOqAFkYRX0e/Be0LLeHE3cffpcDDw83sqRwby TDG+8rDR0tXhwqEhWFJ1wVoMk7H4Np90YTvpBA2kjwgq0S0QYwPE9hEa7THuMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rBATG9HY5YGtYU7lCyuZfIfDXdkxhjjnhM+uQnoOkk=; b=uKo+zYxaj7B0qREoO11P4/c+65c0jjjmubxroM/wR9jPO9ZFy6ZaJwixj6K6Ma9u4C8lmD hhsHR8niKWOoE8lYcC343IwD901CQx6o5VGEhrLCZNUdIBj3RZ1LnB9nEq3bwGVW07o0+t xtkn0aEdV49CLgULxJkFbcBKou8eo4kwOlQyR4/bPRQ0wcwwYUFtC7EGQd6NVGxGUMShGD NOP++0T3ongRFnJIk50onEGXRAWqym+jcId/syNvZP518RTMwdF3+D18EZ2wbR8l4XnmM5 hGGDnRhFeOa0sL6LM46LgpZ1lr6NmkqToYH0xjh0mTC27hFvfTU5oiSlVJXeDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737729367; a=rsa-sha256; cv=none; b=Y2WqZI4AMZQu9lDr1CG1IpX5/cnK6XXlbtYIPFJTtKVYsDCD+YMkBkaiT7y1DAErwyrTsM EsDAlqqS20Xwfy1sSiN7Q4Q/CHYPC+Sxwx3XNWhyIzMOzH++B/fnclFjzK/BsAL6BtvAm5 0JLk/5npJ/VKrwNEtskU8F6jMH3rxtbwocm4jUUTV9j2PtPBu0/a8ZgNkUvWtdNdumP7wI T9oY9I4ObkrgCFCnkQRbtAMfanXPX9f1VKQyXCs6Cn1EQDguhNyMcXSTDabHBncA6quNhS Zb6UsgtFs2NlCjsj544H4FECfbBEA3OlMn7lmQktRjniWMwwSXnTPu1t5pdoMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfgNR5B2lzD9M; Fri, 24 Jan 2025 14:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEa7Zo006649; Fri, 24 Jan 2025 14:36:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEa7DC006646; Fri, 24 Jan 2025 14:36:07 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:36:07 GMT Message-Id: <202501241436.50OEa7DC006646@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: 16369f33c5d9 - main - inpcb: Remove an incorrect assertion in in_pcblbgroup_find() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 16369f33c5d920c614d0778642364ee1213e6069 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=16369f33c5d920c614d0778642364ee1213e6069 commit 16369f33c5d920c614d0778642364ee1213e6069 Author: Mark Johnston AuthorDate: 2025-01-24 14:22:54 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 14:22:54 +0000 inpcb: Remove an incorrect assertion in in_pcblbgroup_find() The inpcb might indeed not belong to a load-balancing group when passed from in_pcblbgroup_numa(). Reported by: syzbot+58bb60fe7a452df78835@syzkaller.appspotmail.com Fixes: 7cbb6b6e28db ("inpcb: Close some SO_REUSEPORT_LB races, part 2") --- sys/netinet/in_pcb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index c50e39f20c16..f9eac96acd5b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -304,8 +304,6 @@ in_pcblbgroup_find(struct inpcb *inp) pcbinfo = inp->inp_pcbinfo; INP_HASH_LOCK_ASSERT(pcbinfo); - KASSERT((inp->inp_flags & INP_INLBGROUP) != 0, - ("inpcb %p is not in a load balance group", inp)); hdr = &pcbinfo->ipi_lbgrouphashbase[ INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; From nobody Fri Jan 24 14:36:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfgNT1xFBz5lTgc; Fri, 24 Jan 2025 14:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfgNS6ZnWz3VT3; Fri, 24 Jan 2025 14:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3wtGTavu3EGayrj8Vk5GjtwjreOmwM9IRBj0kbfuJM=; b=wRO4T/kyc1MdoKOZYqpqnOfdWbaCmuggRhNq0ovzg+NzL28X1X2nBm/fFuZCRjy2OSRmWr MdaXw0JCDx/k97DXEUuuHAYAloVimQHBEA1J/jLWeVQPpdjpT2xJk32S9LCUPCjwaTSqUb fUC73O6jazi02D1jHQyW/ihkGcqOlJXsccQuKsaz6iMCdinoHjcBSDFR7xYDUgPz9wIfNL Af/uDrAe1sqsfY1XHkBCBgXle6S1UMcLgp6Ng+0wKMqDNuxz6nalhFpeC0rdZyaMgp1Tua OQIVfhSYYhVOSg84Yh9wyMKQAKgbldzxp4LfAnmFFG2VGNNQ2TMqQjzBr6WcfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737729368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3wtGTavu3EGayrj8Vk5GjtwjreOmwM9IRBj0kbfuJM=; b=UP1bSFcFu3AfbCJGdKo9JprYlkyxI6qOhJ/pc8tfL/63NJxpYl8CVbxxKUjm/kMYiMOM1G U+JwkB9Q4R+uQdrrtbKZcSBICiUfjofKltKhjjJRhBaFkBjurMLq0qGXgUx0UzzWPnGh4k ZN1cSJtd1FQFMv7GQBZ7U6Zz4heylMRVdzgyW2/k//FjM7ojDdZ8IyXtXJWHq00y1o1VJR H3QSY3CxYnMQwHBYqoeunXEK3e3gnpZO6fU4iqripXcAaBv0gAg4wlYKY/WdieGhOWUGR1 l2aSFT4FPazLPu5vjyBlOHcV7jWATu3mH5syoA4AYqGuLE2eo8dUj0lZI0edkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737729369; a=rsa-sha256; cv=none; b=rTQjpoim7s9/YqM0LXUaIF+PlMJRpaf1QXu35q5rJunf6QMOhSJOkREwZQ0vTZngNr5jw/ FddhVtTRtVq7DnTJOfffk1mzIpnJPxB4yCG1VjMHvzbdmdjpS6pEktC+be79whlOrlY+H2 sK5I6KZ/4cogx7a9JasLlKI/5K/+t+Vfp/LtLrXm0V4m3pnjq3ktGOIvA2x/hWSGVsWIr4 RzSLOuaWsvpFNGtkCfjkzjUZ3uIzIqH5JNhy9EEEVeaQ5kGq4G9xa9vGvfYe/9IZMRS7EE qONcEE7NwONRAgySF25Rthj4/E5XBh/1hYj9PNTjdLw3cFcrwuko16DS/oiYxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfgNS676VzTH4; Fri, 24 Jan 2025 14:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEa8Vs006684; Fri, 24 Jan 2025 14:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEa8SK006681; Fri, 24 Jan 2025 14:36:08 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:36:08 GMT Message-Id: <202501241436.50OEa8SK006681@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: ff13773802dc - main - savecore tests: Update to match output from savecore(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ff13773802dcc22f3585fb953c9fffbb605ce3ac Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff13773802dcc22f3585fb953c9fffbb605ce3ac commit ff13773802dcc22f3585fb953c9fffbb605ce3ac Author: Mark Johnston AuthorDate: 2025-01-24 14:32:36 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 14:32:36 +0000 savecore tests: Update to match output from savecore(8) --- sbin/savecore/tests/livedump_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/savecore/tests/livedump_test.sh b/sbin/savecore/tests/livedump_test.sh index 42c726bfad4e..382b090235ee 100644 --- a/sbin/savecore/tests/livedump_test.sh +++ b/sbin/savecore/tests/livedump_test.sh @@ -13,7 +13,7 @@ livedump_kldstat_head() } livedump_kldstat_body() { - atf_check savecore -L . + atf_check -e match:"savecore .*- livedump" savecore -L . kernel=$(sysctl -n kern.bootfile) From nobody Fri Jan 24 14:51:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfgjz4py9z5lW0g; Fri, 24 Jan 2025 14:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfgjz10gfz3bCg; Fri, 24 Jan 2025 14:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lp6ZaePx2zfUOyAuN4sMO3quJYio49N19SH+1WVFH7s=; b=ZLOxPjt/Pt/nWraIlGq7+Vm4l6KtycOJT3bUpCvTpWoqICNnzClzc9mdbAvS853Aip03FN rRtQmG5ru74CdTDNpjcpqDNEqse8l/EctUJqiRNxoZGlUQRrZAp5L5jZWT1pztsYlvdoAd jA8Bjr6PCy0FIKSc2WT1F1gdw56plL56PzxC3ghCtouhvVRAqaOInCm9ov/MezuoC4C9R9 XoCo7aiYr4hDNOnbwwlqEaTuh0/LLPtpRpGSJASq08aL4s/KYSu7QvRyiL2iNs1ah2lxfx 4BkBGvynIbkKGpf03SAjceZffbyzY0R54brAwsbq8Nm+Q88c2Zkd2cVCOraAKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lp6ZaePx2zfUOyAuN4sMO3quJYio49N19SH+1WVFH7s=; b=Oowd3C08pcF788FxpaBQkD69L2JRs9X30KWplmNP0Vamgpt/Xw4rzRtXRrnbDcHsPR3XYb vxa7aVgohSHOuvemb/ZSqMjYkYaGwv8jRhVNpBMFtdW+JmRvbL/oVvxv3hSzzyL9oIoZZ3 gmTVNujUWAVAooUHZiLHpSk3+Xvd/fvKTZaR9+auzkmBa8DOudoODOXEeg6fgqQ3fwfz1d rQips+ZawgclYezK3ojc3stIMQLiffRcxyQK1dwK2CIbR2Fy0POsBa0xvuz4cwdhhbM6QR Ypi2HDpl/IsUUMfxizICjN+Qkpx/97+Slj8vSl8m+IXL9rjN5U9jME2ei4N/dQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737730279; a=rsa-sha256; cv=none; b=prxK/8w65lPQY37gkS/Ur2cJMtGXNy55yPFXt39opSsoo/Qgx6RRnPh4FF8kCLMafu+Rxx J6+mNfDxytXJJ6GRLsJMJyMSYrAkqHAnvXh3MwDVfHFCIHZ0kzATqNcGqfumjw0oi8yXFy hQVolbC3x1y1cGJM4J1nzS/vnSUAgTwptftvwvePVhAa5NrqI2PT0aJZJwNbMr7f4s1Q41 UoD+YKGz2BSuBDJJKowMQvoYJycY2hG8RXyWbPGck6y9zx4rSgjVlJ6TLQvPTOk4GLWy5k 9Z1hjUtXP8jaansesJaPVB1AJVeaZvSr3kwLejNR5/qJIIWm4bpF/BWCSdDKfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfgjz0b5yzTJZ; Fri, 24 Jan 2025 14:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEpJM1036860; Fri, 24 Jan 2025 14:51:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEpJa3036857; Fri, 24 Jan 2025 14:51:19 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:51:19 GMT Message-Id: <202501241451.50OEpJa3036857@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: 8bba2c0f8958 - main - nvmf: Refactor reconnection support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 8bba2c0f8958443790b1f3abc0675719da987e87 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8bba2c0f8958443790b1f3abc0675719da987e87 commit 8bba2c0f8958443790b1f3abc0675719da987e87 Author: John Baldwin AuthorDate: 2025-01-24 14:43:19 +0000 Commit: John Baldwin CommitDate: 2025-01-24 14:43:19 +0000 nvmf: Refactor reconnection support Save more data associated with a new association including the network address of the remote controller. This permits reconnecting an association without providing the address or other details. To use this new mode, provide only an existing device ID to nvmecontrol's reconnect command. An address can still be provided to request a different address or other different settings for the new association. The saved data includes an entire Discovery Log page entry to aim to be compatible with other transports in the future. When a remote controller is connected to via a Discovery Log page entry (nvmecontrol connect-all), the raw entry is used. When a remote controller is connected to via an explicit address, an entry is synthesized from the parameters. Note that this is a pseudo-ABI break for the ioctls used by nvmf(4) in that the nvlists for handoff and reconnect now use a slightly different set of elements. Since this is only present in main I did not bother implementing compatability shims. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48214 --- lib/libnvmf/internal.h | 4 + lib/libnvmf/libnvmf.h | 17 ++- lib/libnvmf/nvmf_host.c | 77 ++++++++++++-- lib/libnvmf/nvmf_tcp.c | 22 ++++ lib/libnvmf/nvmf_transport.c | 9 ++ sbin/nvmecontrol/connect.c | 28 ++++- sbin/nvmecontrol/fabrics.c | 35 ++++-- sbin/nvmecontrol/fabrics.h | 15 ++- sbin/nvmecontrol/nvmecontrol.8 | 22 +++- sbin/nvmecontrol/reconnect.c | 234 ++++++++++++++++++++++++++++++++--------- sys/dev/nvmf/host/nvmf.c | 54 ++++++---- sys/dev/nvmf/host/nvmf_var.h | 2 + sys/dev/nvmf/nvmf.h | 14 ++- 13 files changed, 424 insertions(+), 109 deletions(-) diff --git a/lib/libnvmf/internal.h b/lib/libnvmf/internal.h index 7b3d4fbb03ef..300776c1213b 100644 --- a/lib/libnvmf/internal.h +++ b/lib/libnvmf/internal.h @@ -26,6 +26,8 @@ struct nvmf_transport_ops { /* Add params for kernel handoff. */ void (*kernel_handoff_params)(struct nvmf_qpair *qp, nvlist_t *nvl); + int (*populate_dle)(struct nvmf_qpair *qp, + struct nvme_discovery_log_entry *dle); /* Capsule operations. */ struct nvmf_capsule *(*allocate_capsule)(struct nvmf_qpair *qp); @@ -111,6 +113,8 @@ void na_clear_error(struct nvmf_association *na); void na_error(struct nvmf_association *na, const char *fmt, ...); int nvmf_kernel_handoff_params(struct nvmf_qpair *qp, nvlist_t **nvlp); +int nvmf_populate_dle(struct nvmf_qpair *qp, + struct nvme_discovery_log_entry *dle); int nvmf_pack_ioc_nvlist(struct nvmf_ioc_nv *nv, nvlist_t *nvl); #endif /* !__LIBNVMF_INTERNAL_H__ */ diff --git a/lib/libnvmf/libnvmf.h b/lib/libnvmf/libnvmf.h index 44f13fda5ddd..f34ccdb177e7 100644 --- a/lib/libnvmf/libnvmf.h +++ b/lib/libnvmf/libnvmf.h @@ -320,6 +320,14 @@ int nvmf_host_identify_namespace(struct nvmf_qpair *qp, uint32_t nsid, int nvmf_host_fetch_discovery_log_page(struct nvmf_qpair *qp, struct nvme_discovery_log **logp); +/* + * Construct a discovery log page entry that describes the connection + * used by a host association's admin queue pair. + */ +int nvmf_init_dle_from_admin_qp(struct nvmf_qpair *qp, + const struct nvme_controller_data *cdata, + struct nvme_discovery_log_entry *dle); + /* * Request a desired number of I/O queues via SET_FEATURES. The * number of actual I/O queues available is returned in *actual on @@ -332,7 +340,8 @@ int nvmf_host_request_queues(struct nvmf_qpair *qp, u_int requested, * Handoff active host association to the kernel. This frees the * qpairs (even on error). */ -int nvmf_handoff_host(struct nvmf_qpair *admin_qp, u_int num_queues, +int nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, + const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); /* @@ -359,8 +368,8 @@ int nvmf_reconnect_params(int fd, nvlist_t **nvlp); * Handoff active host association to an existing host in the kernel. * This frees the qpairs (even on error). */ -int nvmf_reconnect_host(int fd, struct nvmf_qpair *admin_qp, - u_int num_queues, struct nvmf_qpair **io_queues, - const struct nvme_controller_data *cdata); +int nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, + const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata); #endif /* !__LIBNVMF_H__ */ diff --git a/lib/libnvmf/nvmf_host.c b/lib/libnvmf/nvmf_host.c index c3668600c463..e194522870d1 100644 --- a/lib/libnvmf/nvmf_host.c +++ b/lib/libnvmf/nvmf_host.c @@ -709,6 +709,27 @@ nvmf_host_fetch_discovery_log_page(struct nvmf_qpair *qp, return (0); } +int +nvmf_init_dle_from_admin_qp(struct nvmf_qpair *qp, + const struct nvme_controller_data *cdata, + struct nvme_discovery_log_entry *dle) +{ + int error; + uint16_t cntlid; + + memset(dle, 0, sizeof(*dle)); + error = nvmf_populate_dle(qp, dle); + if (error != 0) + return (error); + if ((cdata->fcatt & 1) == 0) + cntlid = NVMF_CNTLID_DYNAMIC; + else + cntlid = cdata->ctrlr_id; + dle->cntlid = htole16(cntlid); + memcpy(dle->subnqn, cdata->subnqn, sizeof(dle->subnqn)); + return (0); +} + int nvmf_host_request_queues(struct nvmf_qpair *qp, u_int requested, u_int *actual) { @@ -767,17 +788,23 @@ is_queue_pair_idle(struct nvmf_qpair *qp) } static int -prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, struct nvmf_qpair *admin_qp, - u_int num_queues, struct nvmf_qpair **io_queues, - const struct nvme_controller_data *cdata) +prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, + const struct nvme_discovery_log_entry *dle, const char *hostnqn, + struct nvmf_qpair *admin_qp, u_int num_queues, + struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) { - nvlist_t *nvl, *nvl_qp; + const struct nvmf_association *na = admin_qp->nq_association; + nvlist_t *nvl, *nvl_qp, *nvl_rparams; u_int i; int error; if (num_queues == 0) return (EINVAL); + /* Ensure trtype matches. */ + if (dle->trtype != na->na_trtype) + return (EINVAL); + /* All queue pairs must be idle. */ if (!is_queue_pair_idle(admin_qp)) return (EBUSY); @@ -786,9 +813,35 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, struct nvmf_qpair *admin_qp, return (EBUSY); } + /* Fill out reconnect parameters. */ + nvl_rparams = nvlist_create(0); + nvlist_add_binary(nvl_rparams, "dle", dle, sizeof(*dle)); + nvlist_add_string(nvl_rparams, "hostnqn", hostnqn); + nvlist_add_number(nvl_rparams, "num_io_queues", num_queues); + nvlist_add_number(nvl_rparams, "kato", admin_qp->nq_kato); + nvlist_add_number(nvl_rparams, "io_qsize", io_queues[0]->nq_qsize); + nvlist_add_bool(nvl_rparams, "sq_flow_control", + na->na_params.sq_flow_control); + switch (na->na_trtype) { + case NVMF_TRTYPE_TCP: + nvlist_add_bool(nvl_rparams, "header_digests", + na->na_params.tcp.header_digests); + nvlist_add_bool(nvl_rparams, "data_digests", + na->na_params.tcp.data_digests); + break; + default: + __unreachable(); + } + error = nvlist_error(nvl_rparams); + if (error != 0) { + nvlist_destroy(nvl_rparams); + return (error); + } + nvl = nvlist_create(0); - nvlist_add_number(nvl, "trtype", admin_qp->nq_association->na_trtype); + nvlist_add_number(nvl, "trtype", na->na_trtype); nvlist_add_number(nvl, "kato", admin_qp->nq_kato); + nvlist_move_nvlist(nvl, "rparams", nvl_rparams); /* First, the admin queue. */ error = nvmf_kernel_handoff_params(admin_qp, &nvl_qp); @@ -816,7 +869,8 @@ prepare_queues_for_handoff(struct nvmf_ioc_nv *nv, struct nvmf_qpair *admin_qp, } int -nvmf_handoff_host(struct nvmf_qpair *admin_qp, u_int num_queues, +nvmf_handoff_host(const struct nvme_discovery_log_entry *dle, + const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) { struct nvmf_ioc_nv nv; @@ -829,8 +883,8 @@ nvmf_handoff_host(struct nvmf_qpair *admin_qp, u_int num_queues, goto out; } - error = prepare_queues_for_handoff(&nv, admin_qp, num_queues, io_queues, - cdata); + error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, + num_queues, io_queues, cdata); if (error != 0) goto out; @@ -924,15 +978,16 @@ nvmf_reconnect_params(int fd, nvlist_t **nvlp) } int -nvmf_reconnect_host(int fd, struct nvmf_qpair *admin_qp, u_int num_queues, +nvmf_reconnect_host(int fd, const struct nvme_discovery_log_entry *dle, + const char *hostnqn, struct nvmf_qpair *admin_qp, u_int num_queues, struct nvmf_qpair **io_queues, const struct nvme_controller_data *cdata) { struct nvmf_ioc_nv nv; u_int i; int error; - error = prepare_queues_for_handoff(&nv, admin_qp, num_queues, io_queues, - cdata); + error = prepare_queues_for_handoff(&nv, dle, hostnqn, admin_qp, + num_queues, io_queues, cdata); if (error != 0) goto out; diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index 3f794b5d9750..6f41ca7ff502 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -8,9 +8,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -1144,6 +1146,25 @@ tcp_kernel_handoff_params(struct nvmf_qpair *nq, nvlist_t *nvl) nvlist_add_number(nvl, "max_icd", qp->max_icd); } +static int +tcp_populate_dle(struct nvmf_qpair *nq, struct nvme_discovery_log_entry *dle) +{ + struct nvmf_tcp_qpair *qp = TQP(nq); + struct sockaddr_storage ss; + socklen_t ss_len; + + ss_len = sizeof(ss); + if (getpeername(qp->s, (struct sockaddr *)&ss, &ss_len) == -1) + return (errno); + + if (getnameinfo((struct sockaddr *)&ss, ss_len, dle->traddr, + sizeof(dle->traddr), dle->trsvcid, sizeof(dle->trsvcid), + NI_NUMERICHOST | NI_NUMERICSERV) != 0) + return (EINVAL); + + return (0); +} + static struct nvmf_capsule * tcp_allocate_capsule(struct nvmf_qpair *qp __unused) { @@ -1468,6 +1489,7 @@ struct nvmf_transport_ops tcp_ops = { .allocate_qpair = tcp_allocate_qpair, .free_qpair = tcp_free_qpair, .kernel_handoff_params = tcp_kernel_handoff_params, + .populate_dle = tcp_populate_dle, .allocate_capsule = tcp_allocate_capsule, .free_capsule = tcp_free_capsule, .transmit_capsule = tcp_transmit_capsule, diff --git a/lib/libnvmf/nvmf_transport.c b/lib/libnvmf/nvmf_transport.c index fa3826b8c50d..b105c17d2efb 100644 --- a/lib/libnvmf/nvmf_transport.c +++ b/lib/libnvmf/nvmf_transport.c @@ -259,6 +259,15 @@ nvmf_kernel_handoff_params(struct nvmf_qpair *qp, nvlist_t **nvlp) return (0); } +int +nvmf_populate_dle(struct nvmf_qpair *qp, struct nvme_discovery_log_entry *dle) +{ + struct nvmf_association *na = qp->nq_association; + + dle->trtype = na->na_trtype; + return (na->na_ops->populate_dle(qp, dle)); +} + const char * nvmf_transport_type(uint8_t trtype) { diff --git a/sbin/nvmecontrol/connect.c b/sbin/nvmecontrol/connect.c index ef614eca2e2a..c1d5d2cbaf5a 100644 --- a/sbin/nvmecontrol/connect.c +++ b/sbin/nvmecontrol/connect.c @@ -62,11 +62,14 @@ tcp_association_params(struct nvmf_association_params *params) static int connect_nvm_controller(enum nvmf_trtype trtype, int adrfam, const char *address, - const char *port, uint16_t cntlid, const char *subnqn) + const char *port, uint16_t cntlid, const char *subnqn, + const struct nvme_discovery_log_entry *dle) { struct nvme_controller_data cdata; + struct nvme_discovery_log_entry dle_thunk; struct nvmf_association_params aparams; struct nvmf_qpair *admin, **io; + const char *hostnqn; int error; memset(&aparams, 0, sizeof(aparams)); @@ -80,16 +83,31 @@ connect_nvm_controller(enum nvmf_trtype trtype, int adrfam, const char *address, return (EX_UNAVAILABLE); } + hostnqn = opt.hostnqn; + if (hostnqn == NULL) + hostnqn = nvmf_default_hostnqn(); io = calloc(opt.num_io_queues, sizeof(*io)); error = connect_nvm_queues(&aparams, trtype, adrfam, address, port, - cntlid, subnqn, opt.hostnqn, opt.kato * 1000, &admin, io, + cntlid, subnqn, hostnqn, opt.kato * 1000, &admin, io, opt.num_io_queues, opt.queue_size, &cdata); if (error != 0) { free(io); return (error); } - error = nvmf_handoff_host(admin, opt.num_io_queues, io, &cdata); + if (dle == NULL) { + error = nvmf_init_dle_from_admin_qp(admin, &cdata, &dle_thunk); + if (error != 0) { + warnc(error, "Failed to generate handoff parameters"); + disconnect_nvm_queues(admin, io, opt.num_io_queues); + free(io); + return (EX_IOERR); + } + dle = &dle_thunk; + } + + error = nvmf_handoff_host(dle, hostnqn, admin, opt.num_io_queues, io, + &cdata); if (error != 0) { warnc(error, "Failed to handoff queues to kernel"); free(io); @@ -140,7 +158,7 @@ connect_discovery_entry(struct nvme_discovery_log_entry *entry) /* XXX: Should this make use of entry->aqsz in some way? */ connect_nvm_controller(entry->trtype, adrfam, entry->traddr, - entry->trsvcid, entry->cntlid, entry->subnqn); + entry->trsvcid, entry->cntlid, entry->subnqn, entry); } static void @@ -198,7 +216,7 @@ connect_fn(const struct cmd *f, int argc, char *argv[]) cntlid = nvmf_parse_cntlid(opt.cntlid); error = connect_nvm_controller(trtype, AF_UNSPEC, address, port, cntlid, - opt.subnqn); + opt.subnqn, NULL); if (error != 0) exit(error); diff --git a/sbin/nvmecontrol/fabrics.c b/sbin/nvmecontrol/fabrics.c index 27ecc8fb6cdc..1d90a62dd3e3 100644 --- a/sbin/nvmecontrol/fabrics.c +++ b/sbin/nvmecontrol/fabrics.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,14 @@ init_hostid(void) return (true); } +const char * +nvmf_default_hostnqn(void) +{ + if (!init_hostid()) + exit(EX_IOERR); + return (nqn); +} + void nvmf_parse_address(const char *in_address, const char **address, const char **port, char **tofree) @@ -137,7 +146,7 @@ nvmf_parse_cntlid(const char *cntlid) } } -bool +static bool tcp_qpair_params(struct nvmf_qpair_params *params, int adrfam, const char *address, const char *port) { @@ -422,13 +431,10 @@ connect_nvm_queues(const struct nvmf_association_params *aparams, if (!init_hostid()) return (EX_IOERR); - if (hostnqn != NULL) { - if (!nvmf_nqn_valid(hostnqn)) { - warnx("Invalid HostNQN %s", hostnqn); - return (EX_USAGE); - } - } else - hostnqn = nqn; + if (hostnqn == NULL || !nvmf_nqn_valid(hostnqn)) { + warnx("Invalid HostNQN %s", hostnqn); + return (EX_USAGE); + } /* Association. */ na = nvmf_allocate_association(trtype, false, aparams); @@ -510,12 +516,19 @@ connect_nvm_queues(const struct nvmf_association_params *aparams, return (0); out: + disconnect_nvm_queues(*admin, io, num_io_queues); + nvmf_free_association(na); + return (error); +} + +void +disconnect_nvm_queues(struct nvmf_qpair *admin, struct nvmf_qpair **io, + u_int num_io_queues) +{ for (u_int i = 0; i < num_io_queues; i++) { if (io[i] == NULL) break; nvmf_free_qpair(io[i]); } - shutdown_controller(*admin); - nvmf_free_association(na); - return (error); + shutdown_controller(admin); } diff --git a/sbin/nvmecontrol/fabrics.h b/sbin/nvmecontrol/fabrics.h index 9d6ee24b88fb..1f43fc53bb8f 100644 --- a/sbin/nvmecontrol/fabrics.h +++ b/sbin/nvmecontrol/fabrics.h @@ -18,9 +18,11 @@ void nvmf_parse_address(const char *in_address, const char **address, uint16_t nvmf_parse_cntlid(const char *cntlid); -/* Returns true if able to open a connection. */ -bool tcp_qpair_params(struct nvmf_qpair_params *params, int adrfam, - const char *address, const char *port); +const char *nvmf_default_hostnqn(void); + +int nvmf_init_dle_from_address(enum nvmf_trtype trtype, const char *address, + const char *port, uint16_t cntlid, const char *subnqn, + struct nvme_discovery_log_entry *dle); /* Connect to a discovery controller and return the Admin qpair. */ struct nvmf_qpair *connect_discovery_adminq(enum nvmf_trtype trtype, @@ -38,4 +40,11 @@ int connect_nvm_queues(const struct nvmf_association_params *aparams, uint32_t kato, struct nvmf_qpair **admin, struct nvmf_qpair **io, u_int num_io_queues, u_int queue_size, struct nvme_controller_data *cdata); +/* + * Disconnect from an NVM controller disconnecting all queues and + * shutting down the controller. + */ +void disconnect_nvm_queues(struct nvmf_qpair *admin, struct nvmf_qpair **io, + u_int num_io_queues); + #endif /* !__FABRICS_H__ */ diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index e21079b17ed6..a9f4552fbdc6 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -235,6 +235,9 @@ .Aq Ar device-id | Ar namespace-id | Ar SubNQN .Nm .Ic reconnect +.Aq Ar device-id +.Nm +.Ic reconnect .Op Fl FGg .Op Fl i Ar queues .Op Fl k Ar seconds @@ -813,11 +816,20 @@ Delete the controller device associated with a remote I/O controller including any active association and open queues. .Ss reconnect Reestablish an association for the remote I/O controller associated with -.Ar device-id -at -.Ar address . -The address must include a port. -The flags have the same meaning for the new association as described above +.Ar device-id . +If an +.Ar address +is not provided, +the resolved address and settings from the previous association are used +to establish a new association. +If an +.Ar address +is provided, +the supplied address and command line flags are used to establish a new +association. +In this case, +the address must include a port and +the flags have the same meaning for the new association as described above for the .Cm connect command. diff --git a/sbin/nvmecontrol/reconnect.c b/sbin/nvmecontrol/reconnect.c index 4c9277bd34cb..adf1edac662b 100644 --- a/sbin/nvmecontrol/reconnect.c +++ b/sbin/nvmecontrol/reconnect.c @@ -5,6 +5,7 @@ * Written by: John Baldwin */ +#include #include #include #include @@ -24,7 +25,6 @@ static struct options { const char *dev; const char *transport; - const char *address; const char *hostnqn; uint32_t kato; uint16_t num_io_queues; @@ -35,7 +35,6 @@ static struct options { } opt = { .dev = NULL, .transport = "tcp", - .address = NULL, .hostnqn = NULL, .kato = NVMF_KATO_DEFAULT / 1000, .num_io_queues = 1, @@ -46,100 +45,240 @@ static struct options { }; static void -tcp_association_params(struct nvmf_association_params *params) +tcp_association_params(struct nvmf_association_params *params, + bool header_digests, bool data_digests) { params->tcp.pda = 0; - params->tcp.header_digests = opt.header_digests; - params->tcp.data_digests = opt.data_digests; + params->tcp.header_digests = header_digests; + params->tcp.data_digests = data_digests; /* XXX */ params->tcp.maxr2t = 1; } static int -reconnect_nvm_controller(int fd, enum nvmf_trtype trtype, int adrfam, - const char *address, const char *port) +reconnect_nvm_controller(int fd, const struct nvmf_association_params *aparams, + enum nvmf_trtype trtype, int adrfam, const char *address, const char *port, + uint16_t cntlid, const char *subnqn, const char *hostnqn, uint32_t kato, + u_int num_io_queues, u_int queue_size, + const struct nvme_discovery_log_entry *dle) { struct nvme_controller_data cdata; - struct nvmf_association_params aparams; - nvlist_t *rparams; + struct nvme_discovery_log_entry dle_thunk; struct nvmf_qpair *admin, **io; int error; - error = nvmf_reconnect_params(fd, &rparams); + io = calloc(num_io_queues, sizeof(*io)); + error = connect_nvm_queues(aparams, trtype, adrfam, address, port, + cntlid, subnqn, hostnqn, kato, &admin, io, num_io_queues, + queue_size, &cdata); if (error != 0) { - warnc(error, "Failed to fetch reconnect parameters"); - return (EX_IOERR); + free(io); + return (error); } - if (!nvlist_exists_number(rparams, "cntlid") || - !nvlist_exists_string(rparams, "subnqn")) { - nvlist_destroy(rparams); - warnx("Missing required reconnect parameters"); + if (dle == NULL) { + error = nvmf_init_dle_from_admin_qp(admin, &cdata, &dle_thunk); + if (error != 0) { + warnc(error, "Failed to generate handoff parameters"); + disconnect_nvm_queues(admin, io, num_io_queues); + free(io); + return (EX_IOERR); + } + dle = &dle_thunk; + } + + error = nvmf_reconnect_host(fd, dle, hostnqn, admin, num_io_queues, io, + &cdata); + if (error != 0) { + warnc(error, "Failed to handoff queues to kernel"); + free(io); return (EX_IOERR); } + free(io); + return (0); +} + +static int +reconnect_by_address(int fd, const nvlist_t *rparams, const char *addr) +{ + const struct nvme_discovery_log_entry *dle; + struct nvmf_association_params aparams; + enum nvmf_trtype trtype; + const char *address, *hostnqn, *port; + char *subnqn, *tofree; + int error; memset(&aparams, 0, sizeof(aparams)); aparams.sq_flow_control = opt.flow_control; - switch (trtype) { + if (strcasecmp(opt.transport, "tcp") == 0) { + trtype = NVMF_TRTYPE_TCP; + tcp_association_params(&aparams, opt.header_digests, + opt.data_digests); + } else { + warnx("Unsupported or invalid transport"); + return (EX_USAGE); + } + + nvmf_parse_address(addr, &address, &port, &tofree); + if (port == NULL) { + free(tofree); + warnx("Explicit port required"); + return (EX_USAGE); + } + + dle = nvlist_get_binary(rparams, "dle", NULL); + + hostnqn = opt.hostnqn; + if (hostnqn == NULL) + hostnqn = nvmf_default_hostnqn(); + + /* Ensure subnqn is a terminated C string. */ + subnqn = strndup(dle->subnqn, sizeof(dle->subnqn)); + + error = reconnect_nvm_controller(fd, &aparams, trtype, AF_UNSPEC, + address, port, le16toh(dle->cntlid), subnqn, hostnqn, + opt.kato * 1000, opt.num_io_queues, opt.queue_size, NULL); + free(subnqn); + free(tofree); + return (error); +} + +static int +reconnect_by_params(int fd, const nvlist_t *rparams) +{ + struct nvmf_association_params aparams; + const struct nvme_discovery_log_entry *dle; + char *address, *port, *subnqn; + int adrfam, error; + + dle = nvlist_get_binary(rparams, "dle", NULL); + + memset(&aparams, 0, sizeof(aparams)); + aparams.sq_flow_control = nvlist_get_bool(rparams, "sq_flow_control"); + switch (dle->trtype) { case NVMF_TRTYPE_TCP: - tcp_association_params(&aparams); + switch (dle->adrfam) { + case NVMF_ADRFAM_IPV4: + adrfam = AF_INET; + break; + case NVMF_ADRFAM_IPV6: + adrfam = AF_INET6; + break; + default: + warnx("Unsupported address family"); + return (EX_UNAVAILABLE); + } + switch (dle->tsas.tcp.sectype) { + case NVME_TCP_SECURITY_NONE: + break; + default: + warnx("Unsupported TCP security type"); + return (EX_UNAVAILABLE); + } + break; + + tcp_association_params(&aparams, + nvlist_get_bool(rparams, "header_digests"), + nvlist_get_bool(rparams, "data_digests")); break; default: - nvlist_destroy(rparams); - warnx("Unsupported transport %s", nvmf_transport_type(trtype)); + warnx("Unsupported transport %s", + nvmf_transport_type(dle->trtype)); return (EX_UNAVAILABLE); } - io = calloc(opt.num_io_queues, sizeof(*io)); - error = connect_nvm_queues(&aparams, trtype, adrfam, address, port, - nvlist_get_number(rparams, "cntlid"), - nvlist_get_string(rparams, "subnqn"), opt.hostnqn, opt.kato, - &admin, io, opt.num_io_queues, opt.queue_size, &cdata); + /* Ensure address, port, and subnqn is a terminated C string. */ + address = strndup(dle->traddr, sizeof(dle->traddr)); + port = strndup(dle->trsvcid, sizeof(dle->trsvcid)); + subnqn = strndup(dle->subnqn, sizeof(dle->subnqn)); + + error = reconnect_nvm_controller(fd, &aparams, dle->trtype, adrfam, + address, port, le16toh(dle->cntlid), dle->subnqn, + nvlist_get_string(rparams, "hostnqn"), + dnvlist_get_number(rparams, "kato", 0), + nvlist_get_number(rparams, "num_io_queues"), + nvlist_get_number(rparams, "io_qsize"), dle); + free(subnqn); + free(port); + free(address); + return (error); +} + +static int +fetch_and_validate_rparams(int fd, nvlist_t **rparamsp) +{ + const struct nvme_discovery_log_entry *dle; + nvlist_t *rparams; + size_t len; + int error; + + error = nvmf_reconnect_params(fd, &rparams); if (error != 0) { - free(io); + warnc(error, "Failed to fetch reconnect parameters"); + return (EX_IOERR); + } + + if (!nvlist_exists_binary(rparams, "dle") || + !nvlist_exists_string(rparams, "hostnqn") || + !nvlist_exists_number(rparams, "num_io_queues") || + !nvlist_exists_number(rparams, "io_qsize") || + !nvlist_exists_bool(rparams, "sq_flow_control")) { nvlist_destroy(rparams); - return (error); + warnx("Missing required reconnect parameters"); + return (EX_IOERR); } - nvlist_destroy(rparams); - error = nvmf_reconnect_host(fd, admin, opt.num_io_queues, io, &cdata); - if (error != 0) { - warnc(error, "Failed to handoff queues to kernel"); - free(io); + dle = nvlist_get_binary(rparams, "dle", &len); + if (len != sizeof(*dle)) { + nvlist_destroy(rparams); + warnx("Discovery Log entry reconnect parameter is wrong size"); return (EX_IOERR); } - free(io); + + switch (dle->trtype) { + case NVMF_TRTYPE_TCP: + if (!nvlist_exists_bool(rparams, "header_digests") || + !nvlist_exists_bool(rparams, "data_digests")) { + nvlist_destroy(rparams); + warnx("Missing required reconnect parameters"); + return (EX_IOERR); + } + break; + default: + nvlist_destroy(rparams); + warnx("Unsupported transport %s", + nvmf_transport_type(dle->trtype)); + return (EX_UNAVAILABLE); + } + + *rparamsp = rparams; return (0); } static void reconnect_fn(const struct cmd *f, int argc, char *argv[]) { - enum nvmf_trtype trtype; - const char *address, *port; - char *tofree; + nvlist_t *rparams; int error, fd; if (arg_parse(argc, argv, f)) return; - if (strcasecmp(opt.transport, "tcp") == 0) { - trtype = NVMF_TRTYPE_TCP; - } else - errx(EX_USAGE, "Unsupported or invalid transport"); - - nvmf_parse_address(opt.address, &address, &port, &tofree); - open_dev(opt.dev, &fd, 1, 1); - if (port == NULL) - errx(EX_USAGE, "Explicit port required"); + error = fetch_and_validate_rparams(fd, &rparams); + if (error != 0) + exit(error); - error = reconnect_nvm_controller(fd, trtype, AF_UNSPEC, address, port); + /* Check for optional address. */ + if (optind < argc) + error = reconnect_by_address(fd, rparams, argv[optind]); + else + error = reconnect_by_params(fd, rparams); if (error != 0) exit(error); + nvlist_destroy(rparams); close(fd); - free(tofree); } static const struct opts reconnect_opts[] = { @@ -166,7 +305,6 @@ static const struct opts reconnect_opts[] = { static const struct args reconnect_args[] = { { arg_string, &opt.dev, "controller-id" }, - { arg_string, &opt.address, "address" }, { arg_none, NULL, NULL }, }; diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 77d3081243f6..94205666accf 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -200,8 +200,10 @@ nvmf_send_keep_alive(void *arg) int nvmf_copyin_handoff(const struct nvmf_ioc_nv *nv, nvlist_t **nvlp) { + const struct nvme_discovery_log_entry *dle; + const struct nvme_controller_data *cdata; const nvlist_t *const *io; - const nvlist_t *admin; + const nvlist_t *admin, *rparams; nvlist_t *nvl; size_t i, num_io_queues; uint32_t qsize; @@ -214,7 +216,15 @@ nvmf_copyin_handoff(const struct nvmf_ioc_nv *nv, nvlist_t **nvlp) if (!nvlist_exists_number(nvl, "trtype") || !nvlist_exists_nvlist(nvl, "admin") || !nvlist_exists_nvlist_array(nvl, "io") || - !nvlist_exists_binary(nvl, "cdata")) + !nvlist_exists_binary(nvl, "cdata") || + !nvlist_exists_nvlist(nvl, "rparams")) + goto invalid; + + rparams = nvlist_get_nvlist(nvl, "rparams"); + if (!nvlist_exists_binary(rparams, "dle") || + !nvlist_exists_string(rparams, "hostnqn") || + !nvlist_exists_number(rparams, "num_io_queues") || + !nvlist_exists_number(rparams, "io_qsize")) goto invalid; admin = nvlist_get_nvlist(nvl, "admin"); @@ -224,7 +234,8 @@ nvmf_copyin_handoff(const struct nvmf_ioc_nv *nv, nvlist_t **nvlp) goto invalid; io = nvlist_get_nvlist_array(nvl, "io", &num_io_queues); - if (num_io_queues < 1) + if (num_io_queues < 1 || + num_io_queues != nvlist_get_number(rparams, "num_io_queues")) goto invalid; for (i = 0; i < num_io_queues; i++) { if (!nvmf_validate_qpair_nvlist(io[i], false)) @@ -232,14 +243,20 @@ nvmf_copyin_handoff(const struct nvmf_ioc_nv *nv, nvlist_t **nvlp) } /* Require all I/O queues to be the same size. */ - qsize = nvlist_get_number(io[0], "qsize"); - for (i = 1; i < num_io_queues; i++) { + qsize = nvlist_get_number(rparams, "io_qsize"); + for (i = 0; i < num_io_queues; i++) { if (nvlist_get_number(io[i], "qsize") != qsize) goto invalid; } - nvlist_get_binary(nvl, "cdata", &i); - if (i != sizeof(struct nvme_controller_data)) + cdata = nvlist_get_binary(nvl, "cdata", &i); + if (i != sizeof(*cdata)) + goto invalid; + dle = nvlist_get_binary(rparams, "dle", &i); + if (i != sizeof(*dle)) + goto invalid; + + if (memcmp(dle->subnqn, cdata->subnqn, sizeof(cdata->subnqn)) != 0) goto invalid; *nvlp = nvl; @@ -264,7 +281,7 @@ nvmf_probe(device_t dev) } static int -nvmf_establish_connection(struct nvmf_softc *sc, const nvlist_t *nvl) +nvmf_establish_connection(struct nvmf_softc *sc, nvlist_t *nvl) { const nvlist_t *const *io; const nvlist_t *admin; @@ -294,7 +311,7 @@ nvmf_establish_connection(struct nvmf_softc *sc, const nvlist_t *nvl) sc->io[i] = nvmf_init_qp(sc, trtype, io[i], name, i); if (sc->io[i] == NULL) { device_printf(sc->dev, "Failed to setup I/O queue %u\n", - i + 1); + i); return (ENXIO); } } @@ -314,6 +331,10 @@ nvmf_establish_connection(struct nvmf_softc *sc, const nvlist_t *nvl) memcpy(sc->cdata, nvlist_get_binary(nvl, "cdata", NULL), sizeof(*sc->cdata)); + /* Save reconnect parameters. */ + nvlist_destroy(sc->rparams); + sc->rparams = nvlist_take_nvlist(nvl, "rparams"); + return (0); } @@ -467,7 +488,7 @@ nvmf_attach(device_t dev) { struct make_dev_args mda; struct nvmf_softc *sc = device_get_softc(dev); - const nvlist_t *nvl = device_get_ivars(dev); + nvlist_t *nvl = device_get_ivars(dev); const nvlist_t * const *io; struct sysctl_oid *oid; uint64_t val; @@ -584,6 +605,7 @@ out: taskqueue_drain(taskqueue_thread, &sc->disconnect_task); sx_destroy(&sc->connection_lock); + nvlist_destroy(sc->rparams); free(sc->cdata, M_NVMF); return (error); } @@ -837,6 +859,7 @@ nvmf_detach(device_t dev) nvmf_destroy_aer(sc); sx_destroy(&sc->connection_lock); + nvlist_destroy(sc->rparams); free(sc->cdata, M_NVMF); return (0); } @@ -1053,21 +1076,12 @@ error: static int *** 64 LINES SKIPPED *** From nobody Fri Jan 24 14:54:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfgnq5DXnz5lW9v; Fri, 24 Jan 2025 14:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfgnq4QxGz3d8T; Fri, 24 Jan 2025 14:54:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg00C+LpuZGtmIM6QYTPhBDaX49YuCi0i/drQGO8xcY=; b=vE9tO42oNefhUx/ZBb178Uojvn4pMIvHMA3X0WIUXqY9jMS4bd7CDE7IM5ayXO1C4lNiO5 D+c2HIjzRYBqi60DslrbG5pIsj/JNopMOntNYkU9Wn6JqSHLHCkLP+ZHzv5ibF8ybgLHvy +n3R1HFS0E+xLVKyRtrFWzEA0FHQBrKt04l5+E0vyztQzoP7roGLmXrRfByHKAkupgLd8w pHewFgSO80jKN3XhsJsRT1T762aYdmQhOSzVcnNAlWIkNwrcDUcCsJp/Mh0Vcj+B8eOu2r zaGKHznRX8OkELwTTz7yRS3+qOY9sBPGIXUytK0Y8dOGp2Cv3Nz+FjQAwwPKtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg00C+LpuZGtmIM6QYTPhBDaX49YuCi0i/drQGO8xcY=; b=oTZUqSW8ogXLWWHNTRon9qO2n1VrXOuYQ8Di2erFhpjqxti7+xXhsLSkRoJEy49jAz+1/7 k4eP2k/QnV4+Czk199spWOIKX59goieMKQb+7xG09tUX0m/+I5korur5aa8XQdnr/bWf8M OtoxUjbUXoIQEFQD2+wfPG5ZsUD5vCuq3HzdFu7uD4FlcOkE3PXU39mUoUCkALA9bPZYXU jkVCHPibBdvSsDKDuQsOeCFkR/JX4KANIitqk9pQzTyPVs36XDOt1ReiUQv30iHJqtyysT g7/J/S3DFvGmDydVgSO03UsZFfEo/mvOO4Fb+QGES+tQUjVLaTxdfqtsq6Yrpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737730479; a=rsa-sha256; cv=none; b=Se9cLg7RS542g03rSmgKYcNJipSujC0nwZ0LYcxWNMJVg/gZbri4FQXezD6AR0TZbpAkjt TXFL+YAcTUaPJA3Ph4mExrDTnvRd2gNpMdbLJwg1UsA5jBGnpb7e2+JN/Ap4+JnDCEx0Og CvJiupcGOwlB3gHn6E3mNLSpQCWPXYuw38BJCysOYHnGvlMQstGg8f6S0nFqf3f2KgNqM0 lVdfZHdejaew/0zcRCFfAy/7uoFVosBWOqekNf8M6LUhSRiqKdvrjkSON13TCsgN8wwQ0A 9B07WLiTjQFm5Chjlctt/m+zPUGNS5sAAWtWQU0eiEGuBn6Xk+zYx8uF+708eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfgnq3nKWzTyL; Fri, 24 Jan 2025 14:54:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEsdXw043710; Fri, 24 Jan 2025 14:54:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEsdfr043707; Fri, 24 Jan 2025 14:54:39 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:54:39 GMT Message-Id: <202501241454.50OEsdfr043707@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: dd3603749cb7 - main - iscsi: Move valid_iscsi_name to libiscsiutil List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: dd3603749cb7f20a628f04d595b105962b21a3d2 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dd3603749cb7f20a628f04d595b105962b21a3d2 commit dd3603749cb7f20a628f04d595b105962b21a3d2 Author: John Baldwin AuthorDate: 2025-01-24 14:52:10 +0000 Commit: John Baldwin CommitDate: 2025-01-24 14:53:22 +0000 iscsi: Move valid_iscsi_name to libiscsiutil While here, use isxdigit(3) instead of a home-rolled version. Reviewed by: mav, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48593 --- lib/libiscsiutil/libiscsiutil.h | 3 ++ lib/libiscsiutil/utils.c | 71 ++++++++++++++++++++++++++ usr.bin/iscsictl/Makefile | 3 +- usr.bin/iscsictl/iscsictl.c | 107 ++-------------------------------------- usr.bin/iscsictl/iscsictl.h | 3 -- usr.sbin/ctld/ctld.c | 103 +------------------------------------- usr.sbin/ctld/ctld.h | 2 - usr.sbin/ctld/login.c | 2 +- 8 files changed, 82 insertions(+), 212 deletions(-) diff --git a/lib/libiscsiutil/libiscsiutil.h b/lib/libiscsiutil/libiscsiutil.h index bf26a5b8ed66..8da6ead73fce 100644 --- a/lib/libiscsiutil/libiscsiutil.h +++ b/lib/libiscsiutil/libiscsiutil.h @@ -154,6 +154,9 @@ void text_send_response(struct pdu *request, void connection_init(struct connection *conn, const struct connection_ops *ops, bool use_proxy); +bool valid_iscsi_name(const char *name, + void (*warn_fn)(const char *, ...)); + void log_init(int level); void log_set_peer_name(const char *name); void log_set_peer_addr(const char *addr); diff --git a/lib/libiscsiutil/utils.c b/lib/libiscsiutil/utils.c index e078c7a53a17..ef2d67106da5 100644 --- a/lib/libiscsiutil/utils.c +++ b/lib/libiscsiutil/utils.c @@ -28,10 +28,13 @@ * SUCH DAMAGE. */ +#include #include #include "libiscsiutil.h" +#define MAX_NAME_LEN 223 + char * checked_strdup(const char *s) { @@ -42,3 +45,71 @@ checked_strdup(const char *s) log_err(1, "strdup"); return (c); } + +bool +valid_iscsi_name(const char *name, void (*warn_fn)(const char *, ...)) +{ + int i; + + if (strlen(name) >= MAX_NAME_LEN) { + warn_fn("overlong name for target \"%s\"; max length allowed " + "by iSCSI specification is %d characters", + name, MAX_NAME_LEN); + return (false); + } + + /* + * In the cases below, we don't return an error, just in case the admin + * was right, and we're wrong. + */ + if (strncasecmp(name, "iqn.", strlen("iqn.")) == 0) { + for (i = strlen("iqn."); name[i] != '\0'; i++) { + /* + * XXX: We should verify UTF-8 normalisation, as defined + * by 3.2.6.2: iSCSI Name Encoding. + */ + if (isalnum(name[i])) + continue; + if (name[i] == '-' || name[i] == '.' || name[i] == ':') + continue; + warn_fn("invalid character \"%c\" in target name " + "\"%s\"; allowed characters are letters, digits, " + "'-', '.', and ':'", name[i], name); + break; + } + /* + * XXX: Check more stuff: valid date and a valid reversed domain. + */ + } else if (strncasecmp(name, "eui.", strlen("eui.")) == 0) { + if (strlen(name) != strlen("eui.") + 16) + warn_fn("invalid target name \"%s\"; the \"eui.\" " + "should be followed by exactly 16 hexadecimal " + "digits", name); + for (i = strlen("eui."); name[i] != '\0'; i++) { + if (!isxdigit(name[i])) { + warn_fn("invalid character \"%c\" in target " + "name \"%s\"; allowed characters are 1-9 " + "and A-F", name[i], name); + break; + } + } + } else if (strncasecmp(name, "naa.", strlen("naa.")) == 0) { + if (strlen(name) > strlen("naa.") + 32) + warn_fn("invalid target name \"%s\"; the \"naa.\" " + "should be followed by at most 32 hexadecimal " + "digits", name); + for (i = strlen("naa."); name[i] != '\0'; i++) { + if (!isxdigit(name[i])) { + warn_fn("invalid character \"%c\" in target " + "name \"%s\"; allowed characters are 1-9 " + "and A-F", name[i], name); + break; + } + } + } else { + warn_fn("invalid target name \"%s\"; should start with " + "either \"iqn.\", \"eui.\", or \"naa.\"", + name); + } + return (true); +} diff --git a/usr.bin/iscsictl/Makefile b/usr.bin/iscsictl/Makefile index 6c09faa3d915..c47b28e7be5e 100644 --- a/usr.bin/iscsictl/Makefile +++ b/usr.bin/iscsictl/Makefile @@ -3,9 +3,10 @@ PROG= iscsictl SRCS= iscsictl.c periphs.c parse.y token.l y.tab.h CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/dev/iscsi +CFLAGS+= -I${SRCTOP}/lib/libiscsiutil MAN= iscsi.conf.5 iscsictl.8 -LIBADD= util xo +LIBADD= iscsiutil util xo YFLAGS+= -v LFLAGS+= -i diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c index 922e9ed9ebea..f78e47d226bf 100644 --- a/usr.bin/iscsictl/iscsictl.c +++ b/usr.bin/iscsictl/iscsictl.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -122,38 +123,6 @@ default_initiator_name(void) return (name); } -static bool -valid_hex(const char ch) -{ - switch (ch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'a': - case 'A': - case 'b': - case 'B': - case 'c': - case 'C': - case 'd': - case 'D': - case 'e': - case 'E': - case 'f': - case 'F': - return (true); - default: - return (false); - } -} - int parse_enable(const char *enable) { @@ -171,74 +140,6 @@ parse_enable(const char *enable) return (ENABLE_UNSPECIFIED); } -bool -valid_iscsi_name(const char *name) -{ - int i; - - if (strlen(name) >= MAX_NAME_LEN) { - xo_warnx("overlong name for \"%s\"; max length allowed " - "by iSCSI specification is %d characters", - name, MAX_NAME_LEN); - return (false); - } - - /* - * In the cases below, we don't return an error, just in case the admin - * was right, and we're wrong. - */ - if (strncasecmp(name, "iqn.", strlen("iqn.")) == 0) { - for (i = strlen("iqn."); name[i] != '\0'; i++) { - /* - * XXX: We should verify UTF-8 normalisation, as defined - * by 3.2.6.2: iSCSI Name Encoding. - */ - if (isalnum(name[i])) - continue; - if (name[i] == '-' || name[i] == '.' || name[i] == ':') - continue; - xo_warnx("invalid character \"%c\" in iSCSI name " - "\"%s\"; allowed characters are letters, digits, " - "'-', '.', and ':'", name[i], name); - break; - } - /* - * XXX: Check more stuff: valid date and a valid reversed domain. - */ - } else if (strncasecmp(name, "eui.", strlen("eui.")) == 0) { - if (strlen(name) != strlen("eui.") + 16) - xo_warnx("invalid iSCSI name \"%s\"; the \"eui.\" " - "should be followed by exactly 16 hexadecimal " - "digits", name); - for (i = strlen("eui."); name[i] != '\0'; i++) { - if (!valid_hex(name[i])) { - xo_warnx("invalid character \"%c\" in iSCSI " - "name \"%s\"; allowed characters are 1-9 " - "and A-F", name[i], name); - break; - } - } - } else if (strncasecmp(name, "naa.", strlen("naa.")) == 0) { - if (strlen(name) > strlen("naa.") + 32) - xo_warnx("invalid iSCSI name \"%s\"; the \"naa.\" " - "should be followed by at most 32 hexadecimal " - "digits", name); - for (i = strlen("naa."); name[i] != '\0'; i++) { - if (!valid_hex(name[i])) { - xo_warnx("invalid character \"%c\" in ISCSI " - "name \"%s\"; allowed characters are 1-9 " - "and A-F", name[i], name); - break; - } - } - } else { - xo_warnx("invalid iSCSI name \"%s\"; should start with " - "either \".iqn\", \"eui.\", or \"naa.\"", - name); - } - return (true); -} - void conf_verify(struct conf *conf) { @@ -257,7 +158,7 @@ conf_verify(struct conf *conf) xo_errx(1, "cannot specify TargetName for discovery " "sessions for target \"%s\"", targ->t_nickname); if (targ->t_name != NULL) { - if (valid_iscsi_name(targ->t_name) == false) + if (valid_iscsi_name(targ->t_name, xo_warnx) == false) xo_errx(1, "invalid target name \"%s\"", targ->t_name); } @@ -268,7 +169,7 @@ conf_verify(struct conf *conf) targ->t_nickname); if (targ->t_initiator_name == NULL) targ->t_initiator_name = default_initiator_name(); - if (valid_iscsi_name(targ->t_initiator_name) == false) + if (valid_iscsi_name(targ->t_initiator_name, xo_warnx) == false) xo_errx(1, "invalid initiator name \"%s\"", targ->t_initiator_name); if (targ->t_header_digest == DIGEST_UNSPECIFIED) @@ -1014,7 +915,7 @@ main(int argc, char **argv) user, secret, enable); } else { if (Aflag != 0 && target != NULL) { - if (valid_iscsi_name(target) == false) + if (valid_iscsi_name(target, xo_warnx) == false) xo_errx(1, "invalid target name \"%s\"", target); } conf = conf_new(); diff --git a/usr.bin/iscsictl/iscsictl.h b/usr.bin/iscsictl/iscsictl.h index 3bc69e4877a9..dea1a6712dd8 100644 --- a/usr.bin/iscsictl/iscsictl.h +++ b/usr.bin/iscsictl/iscsictl.h @@ -40,8 +40,6 @@ #define ISCSICTL_XO_VERSION "1" -#define MAX_NAME_LEN 223 - #define AUTH_METHOD_UNSPECIFIED 0 #define AUTH_METHOD_NONE 1 #define AUTH_METHOD_CHAP 2 @@ -103,7 +101,6 @@ void target_delete(struct target *ic); void print_periphs(int session_id); -bool valid_iscsi_name(const char *name); int parse_enable(const char *enable); #endif /* !ISCSICTL_H */ diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 3136a5d4b7cb..93a749b9109a 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1072,106 +1072,6 @@ portal_group_set_redirection(struct portal_group *pg, const char *addr) return (0); } -static bool -valid_hex(const char ch) -{ - switch (ch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'a': - case 'A': - case 'b': - case 'B': - case 'c': - case 'C': - case 'd': - case 'D': - case 'e': - case 'E': - case 'f': - case 'F': - return (true); - default: - return (false); - } -} - -bool -valid_iscsi_name(const char *name) -{ - int i; - - if (strlen(name) >= MAX_NAME_LEN) { - log_warnx("overlong name for target \"%s\"; max length allowed " - "by iSCSI specification is %d characters", - name, MAX_NAME_LEN); - return (false); - } - - /* - * In the cases below, we don't return an error, just in case the admin - * was right, and we're wrong. - */ - if (strncasecmp(name, "iqn.", strlen("iqn.")) == 0) { - for (i = strlen("iqn."); name[i] != '\0'; i++) { - /* - * XXX: We should verify UTF-8 normalisation, as defined - * by 3.2.6.2: iSCSI Name Encoding. - */ - if (isalnum(name[i])) - continue; - if (name[i] == '-' || name[i] == '.' || name[i] == ':') - continue; - log_warnx("invalid character \"%c\" in target name " - "\"%s\"; allowed characters are letters, digits, " - "'-', '.', and ':'", name[i], name); - break; - } - /* - * XXX: Check more stuff: valid date and a valid reversed domain. - */ - } else if (strncasecmp(name, "eui.", strlen("eui.")) == 0) { - if (strlen(name) != strlen("eui.") + 16) - log_warnx("invalid target name \"%s\"; the \"eui.\" " - "should be followed by exactly 16 hexadecimal " - "digits", name); - for (i = strlen("eui."); name[i] != '\0'; i++) { - if (!valid_hex(name[i])) { - log_warnx("invalid character \"%c\" in target " - "name \"%s\"; allowed characters are 1-9 " - "and A-F", name[i], name); - break; - } - } - } else if (strncasecmp(name, "naa.", strlen("naa.")) == 0) { - if (strlen(name) > strlen("naa.") + 32) - log_warnx("invalid target name \"%s\"; the \"naa.\" " - "should be followed by at most 32 hexadecimal " - "digits", name); - for (i = strlen("naa."); name[i] != '\0'; i++) { - if (!valid_hex(name[i])) { - log_warnx("invalid character \"%c\" in target " - "name \"%s\"; allowed characters are 1-9 " - "and A-F", name[i], name); - break; - } - } - } else { - log_warnx("invalid target name \"%s\"; should start with " - "either \"iqn.\", \"eui.\", or \"naa.\"", - name); - } - return (true); -} - struct pport * pport_new(struct kports *kports, const char *name, uint32_t ctl_port) { @@ -1389,8 +1289,7 @@ target_new(struct conf *conf, const char *name) log_warnx("duplicated target \"%s\"", name); return (NULL); } - if (valid_iscsi_name(name) == false) { - log_warnx("target name \"%s\" is invalid", name); + if (valid_iscsi_name(name, log_warnx) == false) { return (NULL); } targ = calloc(1, sizeof(*targ)); diff --git a/usr.sbin/ctld/ctld.h b/usr.sbin/ctld/ctld.h index 3f4b653d6896..88490a94464e 100644 --- a/usr.sbin/ctld/ctld.h +++ b/usr.sbin/ctld/ctld.h @@ -46,7 +46,6 @@ #define DEFAULT_CD_BLOCKSIZE 2048 #define MAX_LUNS 1024 -#define MAX_NAME_LEN 223 #define MAX_DATA_SEGMENT_LENGTH (128 * 1024) #define SOCKBUF_SIZE 1048576 @@ -387,7 +386,6 @@ void login(struct ctld_connection *conn); void discovery(struct ctld_connection *conn); -bool valid_iscsi_name(const char *name); void set_timeout(int timeout, int fatal); #endif /* !CTLD_H */ diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index afd3210a828a..f57582f4e62f 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -874,7 +874,7 @@ login(struct ctld_connection *conn) login_send_error(request, 0x02, 0x07); log_errx(1, "received Login PDU without InitiatorName"); } - if (valid_iscsi_name(initiator_name) == false) { + if (valid_iscsi_name(initiator_name, log_warnx) == false) { login_send_error(request, 0x02, 0x00); log_errx(1, "received Login PDU with invalid InitiatorName"); } From nobody Fri Jan 24 14:54:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfgnr5RjVz5lW85; Fri, 24 Jan 2025 14:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfgnr4pt2z3dSV; Fri, 24 Jan 2025 14:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKU+bD+bDhjzk3MSwujqyxMRH6FzNMQWpRUBNAqZKgA=; b=d59w5jdBTwKLIANGM+ZGeqFJPeZuY2EtFNnrqroxMTRvDx39mVe/ATlcFYWAMAJa8+BN4I U3FnbyojkuQ7dSUt69hQ0YErWmsevIwmNYgauzQZHeHPYBDNnUkARLYJhJhFggruB4juLU 2nQJhnoQcHe70NpqhrLbjpkkWqfH5t2XFz56csAq6nQEAbfWiL4HV0BqpBZ3xljrnWXb94 Jiby+43qarklt81pFWwKEiUcmtulh0/+lNVLlzVLJRS7sJKMltYcQN9nMR8OjTka5F0kEW ay7OvuCMTZcCfiI9CvudNaw+ENPkV35GlwEBLMV7ajB4v/VFNPJQzFF1OrW5Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKU+bD+bDhjzk3MSwujqyxMRH6FzNMQWpRUBNAqZKgA=; b=v9ES8arxsIc3h2mJE40ZGaWlvA+j4qR7yVsQvyMoObtfCwY6bF0G2pCBnSygNDOBSJ/0jd VPekmKBs0sTs4M8GHI98JpRJkJtxRDotpCR8YfryNb6E07lgGS2X3BbPJr96nsWnPhgykM dCV0X1rVAdFiZXm+SWUWIO/XTyB90BlBo6k3ODPkOVHHVZgi8E5kezIjO8PkotIgMsZZ0H OIpUM9eUiHVNg5/cZkK9ikQAu9j2eNmd4OF23L7ZqA7IDrdheqeVEb3cZa8pFanAB4h8fS 8gcxiGqZeFanP2ZIE9RJIhAviGm48lhSCvgl4AGlMIl6Zmxgy3x7aSYvC+Kn9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737730480; a=rsa-sha256; cv=none; b=nBY03PR46HxDUf+X5cqLvL7P6muEnYtzC1MbSN3fs531py4fo1slA9eqMeycGwCer9Z3NW yghf9w8Y+k7QQiVGQJ+hjuXqcZKP2CsWUJ3y+iU2mnYBgKFnRanb7SBMw3LjQGLHonAgyf UmL3i6GqeKST6evcRILGcdgBzPe/zwBSO9vrq/8658cZBpqVxgK894LBTnrBWPkRx9ezVW Ppp5zRyZa3G4NcbGCRdZzWbmp9vST/3nzr4p0louZUm+ypwA/jH8NOTCZEbc91oqkc8CQO iBYph1hVjIIBeX2NdhteYf9leR2I+SYAQYS63ps3wnhhKJiDGppBnBGxtcOQtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfgnr4N54zTK6; Fri, 24 Jan 2025 14:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEseKK043751; Fri, 24 Jan 2025 14:54:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEsebb043748; Fri, 24 Jan 2025 14:54:40 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:54:40 GMT Message-Id: <202501241454.50OEsebb043748@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: 78cd9f0c0941 - main - ctld: Use bool in uclparse.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 78cd9f0c0941e7a85dde12f719d16392b23a9975 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78cd9f0c0941e7a85dde12f719d16392b23a9975 commit 78cd9f0c0941e7a85dde12f719d16392b23a9975 Author: John Baldwin AuthorDate: 2025-01-24 14:52:26 +0000 Commit: John Baldwin CommitDate: 2025-01-24 14:53:26 +0000 ctld: Use bool in uclparse.c Previously these functions all returned either 0 or 1, but 0 was success and 1 was failure. Use a bool where false indicates failure instead which is more readable. Reviewed by: mav, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48594 --- usr.sbin/ctld/uclparse.c | 256 +++++++++++++++++++++++------------------------ 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index b93142ede8a4..b48a96cb0263 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -44,17 +44,17 @@ static struct conf *conf = NULL; -static int uclparse_toplevel(const ucl_object_t *); -static int uclparse_chap(struct auth_group *, const ucl_object_t *); -static int uclparse_chap_mutual(struct auth_group *, const ucl_object_t *); -static int uclparse_lun(const char *, const ucl_object_t *); -static int uclparse_auth_group(const char *, const ucl_object_t *); -static int uclparse_portal_group(const char *, const ucl_object_t *); -static int uclparse_target(const char *, const ucl_object_t *); -static int uclparse_target_portal_group(struct target *, const ucl_object_t *); -static int uclparse_target_lun(struct target *, const ucl_object_t *); - -static int +static bool uclparse_toplevel(const ucl_object_t *); +static bool uclparse_chap(struct auth_group *, const ucl_object_t *); +static bool uclparse_chap_mutual(struct auth_group *, const ucl_object_t *); +static bool uclparse_lun(const char *, const ucl_object_t *); +static bool uclparse_auth_group(const char *, const ucl_object_t *); +static bool uclparse_portal_group(const char *, const ucl_object_t *); +static bool uclparse_target(const char *, const ucl_object_t *); +static bool uclparse_target_portal_group(struct target *, const ucl_object_t *); +static bool uclparse_target_lun(struct target *, const ucl_object_t *); + +static bool uclparse_chap(struct auth_group *auth_group, const ucl_object_t *obj) { const struct auth *ca; @@ -65,7 +65,7 @@ uclparse_chap(struct auth_group *auth_group, const ucl_object_t *obj) if (!user || user->type != UCL_STRING) { log_warnx("chap section in auth-group \"%s\" is missing " "\"user\" string key", auth_group->ag_name); - return (1); + return (false); } secret = ucl_object_find_key(obj, "secret"); @@ -79,12 +79,12 @@ uclparse_chap(struct auth_group *auth_group, const ucl_object_t *obj) ucl_object_tostring(secret)); if (ca == NULL) - return (1); + return (false); - return (0); + return (true); } -static int +static bool uclparse_chap_mutual(struct auth_group *auth_group, const ucl_object_t *obj) { const struct auth *ca; @@ -96,28 +96,28 @@ uclparse_chap_mutual(struct auth_group *auth_group, const ucl_object_t *obj) if (!user || user->type != UCL_STRING) { log_warnx("chap-mutual section in auth-group \"%s\" is missing " "\"user\" string key", auth_group->ag_name); - return (1); + return (false); } secret = ucl_object_find_key(obj, "secret"); if (!secret || secret->type != UCL_STRING) { log_warnx("chap-mutual section in auth-group \"%s\" is missing " "\"secret\" string key", auth_group->ag_name); - return (1); + return (false); } mutual_user = ucl_object_find_key(obj, "mutual-user"); if (!user || user->type != UCL_STRING) { log_warnx("chap-mutual section in auth-group \"%s\" is missing " "\"mutual-user\" string key", auth_group->ag_name); - return (1); + return (false); } mutual_secret = ucl_object_find_key(obj, "mutual-secret"); if (!secret || secret->type != UCL_STRING) { log_warnx("chap-mutual section in auth-group \"%s\" is missing " "\"mutual-secret\" string key", auth_group->ag_name); - return (1); + return (false); } ca = auth_new_chap_mutual(auth_group, @@ -127,12 +127,12 @@ uclparse_chap_mutual(struct auth_group *auth_group, const ucl_object_t *obj) ucl_object_tostring(mutual_secret)); if (ca == NULL) - return (1); + return (false); - return (0); + return (true); } -static int +static bool uclparse_target_portal_group(struct target *target, const ucl_object_t *obj) { struct portal_group *tpg; @@ -144,14 +144,14 @@ uclparse_target_portal_group(struct target *target, const ucl_object_t *obj) if (!portal_group || portal_group->type != UCL_STRING) { log_warnx("portal-group section in target \"%s\" is missing " "\"name\" string key", target->t_name); - return (1); + return (false); } auth_group = ucl_object_find_key(obj, "auth-group-name"); if (auth_group && auth_group->type != UCL_STRING) { log_warnx("portal-group section in target \"%s\" is missing " "\"auth-group-name\" string key", target->t_name); - return (1); + return (false); } @@ -159,7 +159,7 @@ uclparse_target_portal_group(struct target *target, const ucl_object_t *obj) if (tpg == NULL) { log_warnx("unknown portal-group \"%s\" for target " "\"%s\"", ucl_object_tostring(portal_group), target->t_name); - return (1); + return (false); } if (auth_group) { @@ -168,7 +168,7 @@ uclparse_target_portal_group(struct target *target, const ucl_object_t *obj) log_warnx("unknown auth-group \"%s\" for target " "\"%s\"", ucl_object_tostring(auth_group), target->t_name); - return (1); + return (false); } } @@ -176,14 +176,14 @@ uclparse_target_portal_group(struct target *target, const ucl_object_t *obj) if (tp == NULL) { log_warnx("can't link portal-group \"%s\" to target " "\"%s\"", ucl_object_tostring(portal_group), target->t_name); - return (1); + return (false); } tp->p_auth_group = tag; - return (0); + return (true); } -static int +static bool uclparse_target_lun(struct target *target, const ucl_object_t *obj) { struct lun *lun; @@ -196,17 +196,17 @@ uclparse_target_lun(struct target *target, const ucl_object_t *obj) if (tmp >= MAX_LUNS) { log_warnx("LU number %ju in target \"%s\" is too big", tmp, target->t_name); - return (1); + return (false); } asprintf(&name, "%s,lun,%ju", target->t_name, tmp); lun = lun_new(conf, name); if (lun == NULL) - return (1); + return (false); lun_set_scsiname(lun, name); target->t_luns[tmp] = lun; - return (0); + return (true); } if (obj->type == UCL_OBJECT) { @@ -216,32 +216,32 @@ uclparse_target_lun(struct target *target, const ucl_object_t *obj) if (num == NULL || num->type != UCL_INT) { log_warnx("lun section in target \"%s\" is missing " "\"number\" integer property", target->t_name); - return (1); + return (false); } tmp = ucl_object_toint(num); if (tmp >= MAX_LUNS) { log_warnx("LU number %ju in target \"%s\" is too big", tmp, target->t_name); - return (1); + return (false); } if (name == NULL || name->type != UCL_STRING) { log_warnx("lun section in target \"%s\" is missing " "\"name\" string property", target->t_name); - return (1); + return (false); } lun = lun_find(conf, ucl_object_tostring(name)); if (lun == NULL) - return (1); + return (false); target->t_luns[tmp] = lun; } - return (0); + return (true); } -static int +static bool uclparse_toplevel(const ucl_object_t *top) { ucl_object_iter_t it = NULL, iter = NULL; @@ -257,7 +257,7 @@ uclparse_toplevel(const ucl_object_t *top) conf->conf_debug = ucl_object_toint(obj); else { log_warnx("\"debug\" property value is not integer"); - return (1); + return (false); } } @@ -266,7 +266,7 @@ uclparse_toplevel(const ucl_object_t *top) conf->conf_timeout = ucl_object_toint(obj); else { log_warnx("\"timeout\" property value is not integer"); - return (1); + return (false); } } @@ -275,7 +275,7 @@ uclparse_toplevel(const ucl_object_t *top) conf->conf_maxproc = ucl_object_toint(obj); else { log_warnx("\"maxproc\" property value is not integer"); - return (1); + return (false); } } @@ -285,7 +285,7 @@ uclparse_toplevel(const ucl_object_t *top) ucl_object_tostring(obj)); else { log_warnx("\"pidfile\" property value is not string"); - return (1); + return (false); } } @@ -295,18 +295,18 @@ uclparse_toplevel(const ucl_object_t *top) while ((child = ucl_iterate_object(obj, &iter, true))) { if (child->type != UCL_STRING) - return (1); + return (false); err = isns_new(conf, ucl_object_tostring(child)); if (err != 0) { - return (1); + return (false); } } } else { log_warnx("\"isns-server\" property value is " "not an array"); - return (1); + return (false); } } @@ -315,7 +315,7 @@ uclparse_toplevel(const ucl_object_t *top) conf->conf_timeout = ucl_object_toint(obj); else { log_warnx("\"isns-period\" property value is not integer"); - return (1); + return (false); } } @@ -324,7 +324,7 @@ uclparse_toplevel(const ucl_object_t *top) conf->conf_timeout = ucl_object_toint(obj); else { log_warnx("\"isns-timeout\" property value is not integer"); - return (1); + return (false); } } @@ -336,7 +336,7 @@ uclparse_toplevel(const ucl_object_t *top) } } else { log_warnx("\"auth-group\" section is not an object"); - return (1); + return (false); } } @@ -348,7 +348,7 @@ uclparse_toplevel(const ucl_object_t *top) } } else { log_warnx("\"portal-group\" section is not an object"); - return (1); + return (false); } } @@ -360,7 +360,7 @@ uclparse_toplevel(const ucl_object_t *top) } } else { log_warnx("\"lun\" section is not an object"); - return (1); + return (false); } } } @@ -380,15 +380,15 @@ uclparse_toplevel(const ucl_object_t *top) } } else { log_warnx("\"target\" section is not an object"); - return (1); + return (false); } } } - return (0); + return (true); } -static int +static bool uclparse_auth_group(const char *name, const ucl_object_t *top) { struct auth_group *auth_group; @@ -408,7 +408,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } if (auth_group == NULL) - return (1); + return (false); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -418,7 +418,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) err = auth_group_set_type(auth_group, value); if (err) - return (1); + return (false); } if (!strcmp(key, "chap")) { @@ -426,13 +426,13 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) log_warnx("\"chap\" property of " "auth-group \"%s\" is not an array", name); - return (1); + return (false); } it2 = NULL; while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (uclparse_chap(auth_group, tmp) != 0) - return (1); + if (!uclparse_chap(auth_group, tmp)) + return (false); } } @@ -441,13 +441,13 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) log_warnx("\"chap-mutual\" property of " "auth-group \"%s\" is not an array", name); - return (1); + return (false); } it2 = NULL; while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (uclparse_chap_mutual(auth_group, tmp) != 0) - return (1); + if (!uclparse_chap_mutual(auth_group, tmp)) + return (false); } } @@ -456,7 +456,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) log_warnx("\"initiator-name\" property of " "auth-group \"%s\" is not an array", name); - return (1); + return (false); } it2 = NULL; @@ -465,7 +465,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) an = auth_name_new(auth_group, value); if (an == NULL) - return (1); + return (false); } } @@ -474,7 +474,7 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) log_warnx("\"initiator-portal\" property of " "auth-group \"%s\" is not an array", name); - return (1); + return (false); } it2 = NULL; @@ -483,15 +483,15 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) ap = auth_portal_new(auth_group, value); if (ap == NULL) - return (1); + return (false); } } } - return (0); + return (true); } -static int +static bool uclparse_portal_group(const char *name, const ucl_object_t *top) { struct portal_group *portal_group; @@ -508,7 +508,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } if (portal_group == NULL) - return (1); + return (false); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -521,7 +521,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) "for portal-group \"%s\"", ucl_object_tostring(obj), portal_group->pg_name); - return (1); + return (false); } } @@ -530,19 +530,19 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) log_warnx("\"discovery-filter\" property of " "portal-group \"%s\" is not a string", portal_group->pg_name); - return (1); + return (false); } if (portal_group_set_filter(portal_group, ucl_object_tostring(obj)) != 0) - return (1); + return (false); } if (!strcmp(key, "listen")) { if (obj->type == UCL_STRING) { if (portal_group_add_listen(portal_group, ucl_object_tostring(obj), false) != 0) - return (1); + return (false); } else if (obj->type == UCL_ARRAY) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { @@ -550,13 +550,13 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) portal_group, ucl_object_tostring(tmp), false) != 0) - return (1); + return (false); } } else { log_warnx("\"listen\" property of " "portal-group \"%s\" is not a string", portal_group->pg_name); - return (1); + return (false); } } @@ -564,7 +564,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) if (obj->type == UCL_STRING) { if (portal_group_add_listen(portal_group, ucl_object_tostring(obj), true) != 0) - return (1); + return (false); } else if (obj->type == UCL_ARRAY) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { @@ -572,13 +572,13 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) portal_group, ucl_object_tostring(tmp), true) != 0) - return (1); + return (false); } } else { log_warnx("\"listen\" property of " "portal-group \"%s\" is not a string", portal_group->pg_name); - return (1); + return (false); } } @@ -587,19 +587,19 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) log_warnx("\"listen\" property of " "portal-group \"%s\" is not a string", portal_group->pg_name); - return (1); + return (false); } if (portal_group_set_redirection(portal_group, ucl_object_tostring(obj)) != 0) - return (1); + return (false); } if (!strcmp(key, "options")) { if (obj->type != UCL_OBJECT) { log_warnx("\"options\" property of portal group " "\"%s\" is not an object", portal_group->pg_name); - return (1); + return (false); } while ((tmp = ucl_iterate_object(obj, &it2, @@ -614,7 +614,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) if ((obj->type != UCL_STRING) && (obj->type != UCL_INT)) { log_warnx("\"dscp\" property of portal group " "\"%s\" is not a string or integer", portal_group->pg_name); - return(1); + return (false); } if (obj->type == UCL_INT) portal_group->pg_dscp = ucl_object_toint(obj); @@ -668,7 +668,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2; else { log_warnx("\"dscp\" property value is not a supported textual value"); - return (1); + return (false); } } } @@ -677,7 +677,7 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) if (obj->type != UCL_INT) { log_warnx("\"pcp\" property of portal group " "\"%s\" is not an integer", portal_group->pg_name); - return(1); + return (false); } portal_group->pg_pcp = ucl_object_toint(obj); if (!((portal_group->pg_pcp >= 0) && (portal_group->pg_pcp <= 7))) { @@ -687,10 +687,10 @@ uclparse_portal_group(const char *name, const ucl_object_t *top) } } - return (0); + return (true); } -static int +static bool uclparse_target(const char *name, const ucl_object_t *top) { struct target *target; @@ -700,7 +700,7 @@ uclparse_target(const char *name, const ucl_object_t *top) target = target_new(conf, name); if (target == NULL) - return (1); + return (false); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -709,7 +709,7 @@ uclparse_target(const char *name, const ucl_object_t *top) if (obj->type != UCL_STRING) { log_warnx("\"alias\" property of target " "\"%s\" is not a string", target->t_name); - return (1); + return (false); } target->t_alias = strdup(ucl_object_tostring(obj)); @@ -727,19 +727,19 @@ uclparse_target(const char *name, const ucl_object_t *top) log_warnx("cannot use both auth-group " "and explicit authorisations for " "target \"%s\"", target->t_name); - return (1); + return (false); } ag = ucl_object_tostring(obj); if (!ag) { log_warnx("auth-group must be a string"); - return (1); + return (false); } target->t_auth_group = auth_group_find(conf, ag); if (target->t_auth_group == NULL) { log_warnx("unknown auth-group \"%s\" for target " "\"%s\"", ucl_object_tostring(obj), target->t_name); - return (1); + return (false); } } @@ -751,19 +751,19 @@ uclparse_target(const char *name, const ucl_object_t *top) log_warnx("cannot use both auth-group and " "auth-type for target \"%s\"", target->t_name); - return (1); + return (false); } } else { target->t_auth_group = auth_group_new(conf, NULL); if (target->t_auth_group == NULL) - return (1); + return (false); target->t_auth_group->ag_target = target; } error = auth_group_set_type(target->t_auth_group, ucl_object_tostring(obj)); if (error != 0) - return (1); + return (false); } if (!strcmp(key, "chap")) { @@ -772,22 +772,22 @@ uclparse_target(const char *name, const ucl_object_t *top) log_warnx("cannot use both auth-group " "and chap for target \"%s\"", target->t_name); - return (1); + return (false); } } else { target->t_auth_group = auth_group_new(conf, NULL); if (target->t_auth_group == NULL) { - return (1); + return (false); } target->t_auth_group->ag_target = target; } - if (uclparse_chap(target->t_auth_group, obj) != 0) - return (1); + if (!uclparse_chap(target->t_auth_group, obj)) + return (false); } if (!strcmp(key, "chap-mutual")) { - if (uclparse_chap_mutual(target->t_auth_group, obj) != 0) - return (1); + if (!uclparse_chap_mutual(target->t_auth_group, obj)) + return (false); } if (!strcmp(key, "initiator-name")) { @@ -798,19 +798,19 @@ uclparse_target(const char *name, const ucl_object_t *top) log_warnx("cannot use both auth-group and " "initiator-name for target \"%s\"", target->t_name); - return (1); + return (false); } } else { target->t_auth_group = auth_group_new(conf, NULL); if (target->t_auth_group == NULL) - return (1); + return (false); target->t_auth_group->ag_target = target; } an = auth_name_new(target->t_auth_group, ucl_object_tostring(obj)); if (an == NULL) - return (1); + return (false); } if (!strcmp(key, "initiator-portal")) { @@ -821,33 +821,33 @@ uclparse_target(const char *name, const ucl_object_t *top) log_warnx("cannot use both auth-group and " "initiator-portal for target \"%s\"", target->t_name); - return (1); + return (false); } } else { target->t_auth_group = auth_group_new(conf, NULL); if (target->t_auth_group == NULL) - return (1); + return (false); target->t_auth_group->ag_target = target; } ap = auth_portal_new(target->t_auth_group, ucl_object_tostring(obj)); if (ap == NULL) - return (1); + return (false); } if (!strcmp(key, "portal-group")) { if (obj->type == UCL_OBJECT) { - if (uclparse_target_portal_group(target, obj) != 0) - return (1); + if (!uclparse_target_portal_group(target, obj)) + return (false); } if (obj->type == UCL_ARRAY) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (uclparse_target_portal_group(target, - tmp) != 0) - return (1); + if (!uclparse_target_portal_group(target, + tmp)) + return (false); } } } @@ -863,26 +863,26 @@ uclparse_target(const char *name, const ucl_object_t *top) if (obj->type != UCL_STRING) { log_warnx("\"redirect\" property of target " "\"%s\" is not a string", target->t_name); - return (1); + return (false); } if (target_set_redirection(target, ucl_object_tostring(obj)) != 0) - return (1); + return (false); } if (!strcmp(key, "lun")) { while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (uclparse_target_lun(target, tmp) != 0) - return (1); + if (!uclparse_target_lun(target, tmp)) + return (false); } } } - return (0); + return (true); } -static int +static bool uclparse_lun(const char *name, const ucl_object_t *top) { struct lun *lun; @@ -892,7 +892,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) lun = lun_new(conf, name); if (lun == NULL) - return (1); + return (false); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -902,7 +902,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) log_warnx("\"backend\" property of lun " "\"%s\" is not a string", lun->l_name); - return (1); + return (false); } lun_set_backend(lun, ucl_object_tostring(obj)); @@ -912,7 +912,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_INT) { log_warnx("\"blocksize\" property of lun " "\"%s\" is not an integer", lun->l_name); - return (1); + return (false); } lun_set_blocksize(lun, ucl_object_toint(obj)); @@ -922,7 +922,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_STRING) { log_warnx("\"device-id\" property of lun " "\"%s\" is not an integer", lun->l_name); - return (1); + return (false); } lun_set_device_id(lun, ucl_object_tostring(obj)); @@ -932,7 +932,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_OBJECT) { log_warnx("\"options\" property of lun " "\"%s\" is not an object", lun->l_name); - return (1); + return (false); } while ((child = ucl_iterate_object(obj, &child_it, @@ -947,7 +947,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_STRING) { log_warnx("\"path\" property of lun " "\"%s\" is not a string", lun->l_name); - return (1); + return (false); } lun_set_path(lun, ucl_object_tostring(obj)); @@ -957,7 +957,7 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_STRING) { log_warnx("\"serial\" property of lun " "\"%s\" is not a string", lun->l_name); - return (1); + return (false); } lun_set_serial(lun, ucl_object_tostring(obj)); @@ -967,14 +967,14 @@ uclparse_lun(const char *name, const ucl_object_t *top) if (obj->type != UCL_INT) { log_warnx("\"size\" property of lun " "\"%s\" is not an integer", lun->l_name); - return (1); + return (false); } lun_set_size(lun, ucl_object_toint(obj)); } } - return (0); + return (true); } int @@ -982,7 +982,7 @@ uclparse_conf(struct conf *newconf, const char *path) { struct ucl_parser *parser; ucl_object_t *top; - int error; + bool parsed; conf = newconf; parser = ucl_parser_new(0); @@ -995,9 +995,9 @@ uclparse_conf(struct conf *newconf, const char *path) } top = ucl_parser_get_object(parser); - error = uclparse_toplevel(top); + parsed = uclparse_toplevel(top); ucl_object_unref(top); ucl_parser_free(parser); - return (error); + return (parsed ? 0 : 1); } From nobody Fri Jan 24 14:54:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfgnt1FmLz5lWSL; Fri, 24 Jan 2025 14:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfgns65yCz3dMf; Fri, 24 Jan 2025 14:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ggieH6/GrGHpuonSWOXQ3av5VFzI0TiV0bGXQdaILI=; b=UZ3XJCwOaswktYmUEvy0JkqioqTTyazDIRxNQ7w8LraRgkboQVQZFlQ+QlBszC+pHtpo6r 6Xhh4EsXCAdj7cSJeWyUE9WfFA9oIbiP9HOZxTqLFgA9Wi6i4Fk1LFDMmpRAF+6GWKeE/5 RjedJDAJcLwXlzq3XUuTPZ6zLxlM9+vMaZpYzR9tLCp3aliDFRN1KUzSHD5mTLpYPS+LW3 tslJHUlvgj74oDACjZi7brfTUDMbD9XX0IYCV//9UHS5T6L/IZ6jgcR2Huow5Vx3MukikJ qz9jHq/Wmq2foI/EKMB9zhd6Ukjx1qEoayCl8lX3RwDOC1thtuAOG6uBc4rGSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ggieH6/GrGHpuonSWOXQ3av5VFzI0TiV0bGXQdaILI=; b=wtyZ5ZzxTOKWhrueCu9csmqx0nxAVGABTu4JMAHToalU42c5YvaK2jLBAVOtGcSDI1O3kS gAOHWEDPX7zNewKElEl7ABBEXb0lnMXjdgKuE1eSkfM2WfBgqqjnCP+DxCFJYIDtBcbIWg OS6WyBQKygXxuFm4C3B0fTxp4vGPMUAt1NDV7Bv40kyh378Inq4ZMD6Fs/P3KFWdTkX3nV +bLAJfSDtG80IdSa0TAAF8Lm2saSfp5u5Ciip7eHqM/vLYIb7Hld1Q8R9s4mQwUJW2yvkC K2qxPj2tniK6vtk2dxzBqffZeJj1dy6FCLconZo2XhVTLdoRogayzIaWQhDQEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737730481; a=rsa-sha256; cv=none; b=cvBlvFViy3mi7mxwZ+zJDxIyxalh33q9Yb/ETy87+SdcieSg7D28nIg61Ck8ahRDDtgDjp BdQ+cQ2/vaProgRPBje+HKBWVbI3mjznvpz88dJWONV5uaQBgUrQXLnPhrj9AR+bP+zq2s eUGW6PdSnAGnkM9tIAhyJ41uO8SFPe/JmcF4mwCzXwehLpLSU08jlIU+Bey3sgClpKv6eo CM7w17ymYTQA0w+4onfvbwJgwuDXhtZkM+cVqorOWCrJ9dGNf5iJMrzkISqfEeYpJxEH9B pKVbbXdpwvADb40O7wfRlyjBHObJQvA2a5/AXllOMCCbUBLBPmfpxOVV9RakEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfgns5KMBzDNM; Fri, 24 Jan 2025 14:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEsfpO043785; Fri, 24 Jan 2025 14:54:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEsfK1043782; Fri, 24 Jan 2025 14:54:41 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:54:41 GMT Message-Id: <202501241454.50OEsfK1043782@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: b4a5ab97c810 - main - ctld: Factor out code to setup a listening socket into a separate function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: b4a5ab97c8104bd9e3f36b164b4648bf9dc6bc94 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a5ab97c8104bd9e3f36b164b4648bf9dc6bc94 commit b4a5ab97c8104bd9e3f36b164b4648bf9dc6bc94 Author: John Baldwin AuthorDate: 2025-01-24 14:52:51 +0000 Commit: John Baldwin CommitDate: 2025-01-24 14:53:30 +0000 ctld: Factor out code to setup a listening socket into a separate function While here: - Reuse the address family from the addrinfo structure instead of calling getsockname(2) on the socket. - Remove a bogus comment about the PCP option. Reviewed by: mav, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48596 --- usr.sbin/ctld/ctld.c | 199 ++++++++++++++++++++++++--------------------------- 1 file changed, 94 insertions(+), 105 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 93a749b9109a..a67ff51a451d 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1806,6 +1806,98 @@ conf_verify(struct conf *conf) return (0); } +static bool +portal_init_socket(struct portal *p) +{ + struct portal_group *pg = p->p_portal_group; + int error, sockbuf; + int one = 1; + + log_debugx("listening on %s, portal-group \"%s\"", + p->p_listen, pg->pg_name); + p->p_socket = socket(p->p_ai->ai_family, p->p_ai->ai_socktype, + p->p_ai->ai_protocol); + if (p->p_socket < 0) { + log_warn("socket(2) failed for %s", + p->p_listen); + return (false); + } + + sockbuf = SOCKBUF_SIZE; + if (setsockopt(p->p_socket, SOL_SOCKET, SO_RCVBUF, &sockbuf, + sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_RCVBUF) failed for %s", + p->p_listen); + sockbuf = SOCKBUF_SIZE; + if (setsockopt(p->p_socket, SOL_SOCKET, SO_SNDBUF, &sockbuf, + sizeof(sockbuf)) == -1) + log_warn("setsockopt(SO_SNDBUF) failed for %s", p->p_listen); + if (setsockopt(p->p_socket, SOL_SOCKET, SO_NO_DDP, &one, + sizeof(one)) == -1) + log_warn("setsockopt(SO_NO_DDP) failed for %s", p->p_listen); + error = setsockopt(p->p_socket, SOL_SOCKET, SO_REUSEADDR, &one, + sizeof(one)); + if (error != 0) { + log_warn("setsockopt(SO_REUSEADDR) failed for %s", p->p_listen); + close(p->p_socket); + p->p_socket = 0; + return (false); + } + + if (pg->pg_dscp != -1) { + /* Only allow the 6-bit DSCP field to be modified */ + int tos = pg->pg_dscp << 2; + switch (p->p_ai->ai_family) { + case AF_INET: + if (setsockopt(p->p_socket, IPPROTO_IP, IP_TOS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IP_TOS) failed for %s", + p->p_listen); + break; + case AF_INET6: + if (setsockopt(p->p_socket, IPPROTO_IPV6, IPV6_TCLASS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IPV6_TCLASS) failed for %s", + p->p_listen); + break; + } + } + if (pg->pg_pcp != -1) { + int pcp = pg->pg_pcp; + switch (p->p_ai->ai_family) { + case AF_INET: + if (setsockopt(p->p_socket, IPPROTO_IP, IP_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IP_VLAN_PCP) failed for %s", + p->p_listen); + break; + case AF_INET6: + if (setsockopt(p->p_socket, IPPROTO_IPV6, IPV6_VLAN_PCP, + &pcp, sizeof(pcp)) == -1) + log_warn("setsockopt(IPV6_VLAN_PCP) failed for %s", + p->p_listen); + break; + } + } + + error = bind(p->p_socket, p->p_ai->ai_addr, + p->p_ai->ai_addrlen); + if (error != 0) { + log_warn("bind(2) failed for %s", p->p_listen); + close(p->p_socket); + p->p_socket = 0; + return (false); + } + error = listen(p->p_socket, -1); + if (error != 0) { + log_warn("listen(2) failed for %s", p->p_listen); + close(p->p_socket); + p->p_socket = 0; + return (false); + } + return (true); +} + static int conf_apply(struct conf *oldconf, struct conf *newconf) { @@ -1814,8 +1906,7 @@ conf_apply(struct conf *oldconf, struct conf *newconf) struct portal *oldp, *newp; struct port *oldport, *newport, *tmpport; struct isns *oldns, *newns; - int changed, cumulated_error = 0, error, sockbuf; - int one = 1; + int changed, cumulated_error = 0, error; if (oldconf->conf_debug != newconf->conf_debug) { log_debugx("changing debug level to %d", newconf->conf_debug); @@ -2082,109 +2173,7 @@ conf_apply(struct conf *oldconf, struct conf *newconf) assert(proxy_mode == false); assert(newp->p_iser == false); - log_debugx("listening on %s, portal-group \"%s\"", - newp->p_listen, newpg->pg_name); - newp->p_socket = socket(newp->p_ai->ai_family, - newp->p_ai->ai_socktype, - newp->p_ai->ai_protocol); - if (newp->p_socket < 0) { - log_warn("socket(2) failed for %s", - newp->p_listen); - cumulated_error++; - continue; - } - sockbuf = SOCKBUF_SIZE; - if (setsockopt(newp->p_socket, SOL_SOCKET, SO_RCVBUF, - &sockbuf, sizeof(sockbuf)) == -1) - log_warn("setsockopt(SO_RCVBUF) failed " - "for %s", newp->p_listen); - sockbuf = SOCKBUF_SIZE; - if (setsockopt(newp->p_socket, SOL_SOCKET, SO_SNDBUF, - &sockbuf, sizeof(sockbuf)) == -1) - log_warn("setsockopt(SO_SNDBUF) failed " - "for %s", newp->p_listen); - if (setsockopt(newp->p_socket, SOL_SOCKET, SO_NO_DDP, - &one, sizeof(one)) == -1) - log_warn("setsockopt(SO_NO_DDP) failed " - "for %s", newp->p_listen); - error = setsockopt(newp->p_socket, SOL_SOCKET, - SO_REUSEADDR, &one, sizeof(one)); - if (error != 0) { - log_warn("setsockopt(SO_REUSEADDR) failed " - "for %s", newp->p_listen); - close(newp->p_socket); - newp->p_socket = 0; - cumulated_error++; - continue; - } - if (newpg->pg_dscp != -1) { - struct sockaddr sa; - int len = sizeof(sa); - getsockname(newp->p_socket, &sa, &len); - /* - * Only allow the 6-bit DSCP - * field to be modified - */ - int tos = newpg->pg_dscp << 2; - if (sa.sa_family == AF_INET) { - if (setsockopt(newp->p_socket, - IPPROTO_IP, IP_TOS, - &tos, sizeof(tos)) == -1) - log_warn("setsockopt(IP_TOS) " - "failed for %s", - newp->p_listen); - } else - if (sa.sa_family == AF_INET6) { - if (setsockopt(newp->p_socket, - IPPROTO_IPV6, IPV6_TCLASS, - &tos, sizeof(tos)) == -1) - log_warn("setsockopt(IPV6_TCLASS) " - "failed for %s", - newp->p_listen); - } - } - if (newpg->pg_pcp != -1) { - struct sockaddr sa; - int len = sizeof(sa); - getsockname(newp->p_socket, &sa, &len); - /* - * Only allow the 6-bit DSCP - * field to be modified - */ - int pcp = newpg->pg_pcp; - if (sa.sa_family == AF_INET) { - if (setsockopt(newp->p_socket, - IPPROTO_IP, IP_VLAN_PCP, - &pcp, sizeof(pcp)) == -1) - log_warn("setsockopt(IP_VLAN_PCP) " - "failed for %s", - newp->p_listen); - } else - if (sa.sa_family == AF_INET6) { - if (setsockopt(newp->p_socket, - IPPROTO_IPV6, IPV6_VLAN_PCP, - &pcp, sizeof(pcp)) == -1) - log_warn("setsockopt(IPV6_VLAN_PCP) " - "failed for %s", - newp->p_listen); - } - } - error = bind(newp->p_socket, newp->p_ai->ai_addr, - newp->p_ai->ai_addrlen); - if (error != 0) { - log_warn("bind(2) failed for %s", - newp->p_listen); - close(newp->p_socket); - newp->p_socket = 0; - cumulated_error++; - continue; - } - error = listen(newp->p_socket, -1); - if (error != 0) { - log_warn("listen(2) failed for %s", - newp->p_listen); - close(newp->p_socket); - newp->p_socket = 0; + if (!portal_init_socket(newp)) { cumulated_error++; continue; } From nobody Fri Jan 24 14:54:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfgnv3Jylz5lVxp; Fri, 24 Jan 2025 14:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfgnt6fVqz3dHS; Fri, 24 Jan 2025 14:54:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1R3oMGrJ2Lf5qc+tYhrTLRgS1/OG4rwdKxWjdYo6iOs=; b=kLTKho28GaeUCn+nuVf4V7Byvrc8H/cP2VESjMH7dG3nLSmHJHTTZJQaoTPP7ftJHN/Nf5 wfrhkNncCSYvLSaqlGqFKVkf7nNuxPnqSH5m0TnB/SVdabnteUj9UqFGwUSDvLylXCQzKP +N/pTmhz4uBfWZUtT76sN6BwkGcFPij/o5xeWSwcji0SK4oZRgAUE8qmd+tqqGv5St4jfK DK97FzRdFKNqoZ2A5YthYP/6AjmaipCdVBcvSKh5gNEnFFjIO8UlByjWLhx5Q91xZVYw20 EhKpSC2HG6IqfnCqlaOLN24QwtLl0jcPmKePEW7+8vJcgreU18wz6mx23Ev0KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737730482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1R3oMGrJ2Lf5qc+tYhrTLRgS1/OG4rwdKxWjdYo6iOs=; b=PAXDaQ9hYBao5XSHsR+18W2hp1zYQZqUR/iuZiHTd0/Jyq0lHxkv0/ZgOAfeKWv5jGMRkO ua7+f8IyxxEUjn0bFk5e49L+hbr205EnzexuGnyz7Rw9cA4p7u7bwjzLFrrXnbGeBFTLwX N8ecZJTNhBu/t8ufn2H4B4lqWk7yewvdM2QKUSuvN/gQT42dVe2Kzvr+Lh/8lmuzXdGHV2 WeX7xbYx3P+Woy8Pf0NP499X5TtEVzRmDJro3UYHxd4F+9zzKLnmfJAUhar/rqP8ocqrPe JCVovJxJOkCgRukGg8hfVV8ihQ/42qoW8Y1SA2hbSgEYMOcp+nCAMkH2yKvctg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737730482; a=rsa-sha256; cv=none; b=V2maALaeu5MdTsYpEa+ZcrYMtVhdKTlqD+vp16/p8vBa1YraEjTZqYxivTYbQK6AOgSySe T3oqcSZYhtCP7fYKTw4s/lWbkT/AlDqJdVDv6JmOVzwowhu/9jqO0gCiGcMWHeaQzAfTSy G9YsZNMcHxO012iHHuqVygio/adAPldS/tpqWTQfRNJ0YKYprvis3i0IK6AJeaLJuKvZMc butnfi78ty4aln5CHuPXZG2cMqiHXWa2XU/AwbR3LDBTCs1SKYmkaCzssePI2Rb+s0HLSy XdbgB/ZjKMZOCTG/5BCttGPSF8A9VCchwUcCCMZBhYL2cUruMOkXyhWXdwwGBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfgnt6CSjzTt2; Fri, 24 Jan 2025 14:54:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OEsgLt043819; Fri, 24 Jan 2025 14:54:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OEsgkp043816; Fri, 24 Jan 2025 14:54:42 GMT (envelope-from git) Date: Fri, 24 Jan 2025 14:54:42 GMT Message-Id: <202501241454.50OEsgkp043816@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: ca81304f7cbe - main - ctld: Fix assertion against the wrong field List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ca81304f7cbe033be802e3e2ef12378a61fe2175 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ca81304f7cbe033be802e3e2ef12378a61fe2175 commit ca81304f7cbe033be802e3e2ef12378a61fe2175 Author: John Baldwin AuthorDate: 2025-01-24 14:53:44 +0000 Commit: John Baldwin CommitDate: 2025-01-24 14:53:44 +0000 ctld: Fix assertion against the wrong field Reviewed by: mav, imp, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48622 --- usr.sbin/ctld/discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ctld/discovery.c b/usr.sbin/ctld/discovery.c index f548b41d5cba..09613284f881 100644 --- a/usr.sbin/ctld/discovery.c +++ b/usr.sbin/ctld/discovery.c @@ -161,7 +161,7 @@ discovery_target_filtered_out(const struct ctld_connection *conn, ag = targ->t_auth_group; pg = conn->conn_portal->p_portal_group; - assert(pg->pg_discovery_auth_group != PG_FILTER_UNKNOWN); + assert(pg->pg_discovery_filter != PG_FILTER_UNKNOWN); if (pg->pg_discovery_filter >= PG_FILTER_PORTAL && auth_portal_check(ag, &conn->conn_initiator_sa) != 0) { From nobody Fri Jan 24 15:08:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfh5j6Dnmz5lX30; Fri, 24 Jan 2025 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfh5j5jW9z3jY3; Fri, 24 Jan 2025 15:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737731305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5VavZ0tpP5BeHhfLGZKAFTeAvBVV160a5fgN5EDSNg=; b=YmVBEYPq6jQkA4UzySiuwymwjmyWH6f4rm8br1tMQUDSl8yjKi8AEF128emKlwQs5ns9zz n0bV5XehWCEcfD6oguIj6PXPbhzOZVcr9Mm6EqlGWxZzse1xz3+6EGxrjADaVkxbzE5FnH UeP2pp8UjbpAt+uRKtBboaIVUKedAt7vRVTANZp3T/oKnbCOuytc9jTyQMwKaiXXJLvteO 5X22byE2Pp2fBla1CSs41xeCmo/CTHiH3sRUtNLd7cm8Fslnw+10vW0zOYr/L3MM4HNuBP ba5+kTkEYinVnk6z8SGJSNrwQDrpAbFZYATQTPN/N5OSQBicASdEvAbVAvXqaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737731305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5VavZ0tpP5BeHhfLGZKAFTeAvBVV160a5fgN5EDSNg=; b=WJVsJkWdAqKaJ3jdn5PQaxJEAjpiya5M9ZXv2p4ibLkJPA+fApAkrYC8g5UWiAzfQOjrAY ZzhCNfRjK1aym4jsRg//l8s4Fa8+MY12e9AXWzGeazgcok7VZB3wmKwn+QrhaavSaNIh9c noXYb61/BJ+gu8SsYLdFcOTg3qhaqUQ2LAxKzKZgBLBjsDwi1Edg7K1c8aG6A3n4aHiY7q 3q92XdlSh4zXCZiWjA1v4bO4GnzB+MqksJPisX/orSehCVh2L9Nvx6g9A8x+3OrtAL4lX/ 7dobfuRs9Gxqum0qSebBYRIfyg43a6pc3z5wcoF70aqJ5eVn3U6tahMokWrMtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737731305; a=rsa-sha256; cv=none; b=B9WhOG/oLA24Gn9JD+mlvm3DuKS0AZUK8CuYz4lm1WBf+psQgeAgvv3DPoxUBo59NMslD4 //vxSnERO6senxyHHsinUSl9J+NisFsIIPR9fBmzKdtm/pD7wf7qdrS8rqn7xcedb7FTNo 215CV3L8QZpeaANGy/Bj/XWgg5aw1u3dPf3LG9UQ/hvEsZzc4PUqeS+g6bsjdps3koeZFS fWqWbOeQlluK4k75PQ/3JIs3pjCm+B+Q1O2b1NuSI7tUF3fEfnJPeu8+AtFTn7Z+qLhs09 8GzGaYh+SQGZmSf+AE6sCj2ywU23PTTr6wfM0lPTFBIICHEUSMtRp3MNm7dUTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfh5j5962zV0h; Fri, 24 Jan 2025 15:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OF8PdN064573; Fri, 24 Jan 2025 15:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OF8PF4064570; Fri, 24 Jan 2025 15:08:25 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:08:25 GMT Message-Id: <202501241508.50OF8PF4064570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0863dc10354f - main - ithread: Allow some ithreads to sleep List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0863dc10354ff458a3ddf8ef3b47044d7a615154 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0863dc10354ff458a3ddf8ef3b47044d7a615154 commit 0863dc10354ff458a3ddf8ef3b47044d7a615154 Author: Andrew Turner AuthorDate: 2025-01-13 05:35:27 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 15:08:09 +0000 ithread: Allow some ithreads to sleep Some ithreads need to hold a sleep mutex, e.g. when calling ACPI methods. Allow ithreads to be marked as sleepable when this is known to be safe. Reviewed by: markj, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48283 --- share/man/man9/intr_event.9 | 10 +++++++++- sys/kern/kern_intr.c | 18 +++++++++++++----- sys/sys/bus.h | 1 + sys/sys/interrupt.h | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/share/man/man9/intr_event.9 b/share/man/man9/intr_event.9 index d1964ce289a5..ba8faf877e6a 100644 --- a/share/man/man9/intr_event.9 +++ b/share/man/man9/intr_event.9 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 30, 2022 +.Dd January 24, 2025 .Dt INTR_EVENT 9 .Os .Sh NAME @@ -295,6 +295,14 @@ from the handler's source triggers. Presently, the .Dv INTR_ENTROPY flag is not valid for software interrupt handlers. +The +.Dv INTR_SLEEPABLE +flag specifies that the interrupt ithread may sleep. +Presently, the +.Dv INTR_SLEEPABLE +flag requires the +.Dv INTR_EXCL +flag to be set. .Ss Handler Callbacks Each .Vt struct intr_event diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index ad0cc135167e..4ef37ac829b3 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -610,6 +610,12 @@ intr_event_add_handler(struct intr_event *ie, const char *name, if (ie == NULL || name == NULL || (handler == NULL && filter == NULL)) return (EINVAL); + if ((flags & INTR_SLEEPABLE) != 0 && (flags & INTR_EXCL) == 0) { + printf("%s: INTR_SLEEPABLE requires INTR_EXCL to be set\n", + __func__); + return (EINVAL); + } + /* Allocate and populate an interrupt handler structure. */ ih = malloc(sizeof(struct intr_handler), M_ITHREAD, M_WAITOK | M_ZERO); ih->ih_filter = filter; @@ -627,16 +633,18 @@ intr_event_add_handler(struct intr_event *ie, const char *name, if (flags & INTR_TYPE_NET) ih->ih_flags |= IH_NET; - /* We can only have one exclusive handler in a event. */ + /* We can only have one exclusive or sleepable handler in a event. */ mtx_lock(&ie->ie_lock); if (!CK_SLIST_EMPTY(&ie->ie_handlers)) { - if ((flags & INTR_EXCL) || + if ((flags & (INTR_EXCL | INTR_SLEEPABLE)) || (CK_SLIST_FIRST(&ie->ie_handlers)->ih_flags & IH_EXCLUSIVE)) { mtx_unlock(&ie->ie_lock); free(ih, M_ITHREAD); return (EINVAL); } } + if (flags & INTR_SLEEPABLE) + ie->ie_flags |= IE_SLEEPABLE; /* Create a thread if we need one. */ while (ie->ie_thread == NULL && handler != NULL) { @@ -1190,11 +1198,11 @@ static void ithread_execute_handlers(struct proc *p, struct intr_event *ie) { - /* Interrupt handlers should not sleep. */ - if (!(ie->ie_flags & IE_SOFT)) + /* Only specifically marked sleepable interrupt handlers can sleep. */ + if (!(ie->ie_flags & (IE_SOFT | IE_SLEEPABLE))) THREAD_NO_SLEEPING(); intr_event_execute_handlers(p, ie); - if (!(ie->ie_flags & IE_SOFT)) + if (!(ie->ie_flags & (IE_SOFT | IE_SLEEPABLE))) THREAD_SLEEPING_OK(); /* diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 8b32e10f1285..84df9e6956d3 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -277,6 +277,7 @@ enum intr_type { INTR_EXCL = 256, /* exclusive interrupt */ INTR_MPSAFE = 512, /* this interrupt is SMP safe */ INTR_ENTROPY = 1024, /* this interrupt provides entropy */ + INTR_SLEEPABLE = 2048, /* this interrupt handler can sleep */ INTR_MD1 = 4096, /* flag reserved for MD use */ INTR_MD2 = 8192, /* flag reserved for MD use */ INTR_MD3 = 16384, /* flag reserved for MD use */ diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h index 899d65e386e0..2e84faa78e38 100644 --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -129,6 +129,7 @@ struct intr_event { /* Interrupt event flags kept in ie_flags. */ #define IE_SOFT 0x000001 /* Software interrupt. */ +#define IE_SLEEPABLE 0x000002 /* Sleepable ithread */ #define IE_ADDING_THREAD 0x000004 /* Currently building an ithread. */ /* Flags to pass to swi_sched. */ From nobody Fri Jan 24 15:08:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfh5k74Jtz5lWwN; Fri, 24 Jan 2025 15:08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfh5k64Fzz3jQq; Fri, 24 Jan 2025 15:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737731306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XixfAY2qMZAAYVhrZlHX4z69t67DR+jsuW5UGZrL6Ys=; b=uqQsvLvRtPBW+sCqO9XT5d46hc9625DHtZDjmEAkvYncgaJ1JCcw9Z8I9mqpRWlfkZ7YKQ M4Tydjn2mn6FV2kyM+761vvib+cZwtX2ZaQ1fBy+9mtiLk/L3NxA+PtH0Hu+e+AjUUmtBz FgkfLhCTHRdERB6bmeVy/V0q265PzVanV4so7R1assWZNM8us+FsleF830nLu8hcuARQ25 Nt/yVpNma7MwA7XKllPWw2jNpBCjr6D1dtTQBa4xhVqP+an38aksAgKitlq6RitNBKtWcL gTkxe1rw2xbBZ8PHDlsU9p+IhG1YtOTYRt5GTh5gsKFGYRbZBVUKGXfRqOx4Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737731306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XixfAY2qMZAAYVhrZlHX4z69t67DR+jsuW5UGZrL6Ys=; b=oP23pvNQ6KgJWxvuWTL44WWzl1JzhEimueLvXzS0WhEnICFcRW/4QgJEComwdiq7l13PRN 0BmtjPxBydrV9Iau+ysMtxjw1SnFcNjU/RZxayuDJXdcQs3LDUz8RFQkjxvfzfGRrYtCpn N7MpYfJkM7GdfnUUTFRZDvbkSSrkKzYyS01br0SmmWqlimFhAe+vewTbEj9T5TnMhY+MTW /jN/mwAZehTRC6cjBuKruE4f7i4r55RVVsqGKdvR6R6nxo4LCd4JtMEbm2hdbSTBWm1QHK aabGelbKh2skhUlueWE/k+yszxzg7k4yMKDbfEgoKd/P1K06XgTMTnG9tGIK8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737731306; a=rsa-sha256; cv=none; b=uhsEaZsFtJi/TCm8BF/uHipOaVFMPzI+2VKVAv8yJc4UR6s0WrErq5k3ZyXq3g0VkpRkZE aXs3Vs1W2wQ6MqnskcUeyw7j/C1V5J5NJelffaiFddrMNnw0gmLK0yEePmUyGHeW+vwelA Ufog8SOXwgHamwmWNJ2dHsk8T0LyRSu2s7/sNHRagST8wubXVwOKkW+eDRAxq8WtT/HJ/d cB21NlK9HF7kZBjJXhvgmxO2VTmX4g33XYPWVAd1izqTZXPMTks8t+9kK13hiO3r5ndTpy n51y4TrrhUbss4GQwCmpImyMIUAfmL9SLfvAFH0B5yBxbhRNddmwCwHeWno//A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfh5k5fp3zVT8; Fri, 24 Jan 2025 15:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OF8QBW064606; Fri, 24 Jan 2025 15:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OF8QL6064603; Fri, 24 Jan 2025 15:08:26 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:08:26 GMT Message-Id: <202501241508.50OF8QL6064603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: dbedcc169f70 - main - acpi: Mark the GED ithread as sleepable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbedcc169f70c924a680e02bc86d7419682a70ac Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dbedcc169f70c924a680e02bc86d7419682a70ac commit dbedcc169f70c924a680e02bc86d7419682a70ac Author: Andrew Turner AuthorDate: 2025-01-13 05:37:52 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 15:08:09 +0000 acpi: Mark the GED ithread as sleepable We need to complete calling the ACPI method before marking the interrupt as complete. If two threads are inspecting the ACPI tables at the same time they may both try to lock the ACPI mutex causing one to sleep. If this is the ithread it will panic the kernel as this is not allowed. Update the ged ithread to allow sleeping as it is expected this lock will be uncommon enough any sleep will be short. PR: 283103 Reviewed by: markj (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48284 --- sys/dev/acpica/acpi_ged.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_ged.c b/sys/dev/acpica/acpi_ged.c index 23e125f277c5..caf911758ed2 100644 --- a/sys/dev/acpica/acpi_ged.c +++ b/sys/dev/acpica/acpi_ged.c @@ -244,8 +244,9 @@ acpi_ged_attach(device_t dev) } if (bus_setup_intr(dev, sc->evts[i].r, - INTR_TYPE_MISC | INTR_MPSAFE, NULL, acpi_ged_intr, - &sc->evts[i], &sc->evts[i].cookie) != 0) { + INTR_TYPE_MISC | INTR_MPSAFE | INTR_SLEEPABLE | + INTR_EXCL, NULL, acpi_ged_intr, &sc->evts[i], + &sc->evts[i].cookie) != 0) { device_printf(dev, "Failed to setup intr %d\n", i); } } From nobody Fri Jan 24 15:39:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfhnP4Ttxz5lZ9F; Fri, 24 Jan 2025 15:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfhnP3zWwz44m2; Fri, 24 Jan 2025 15:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff4LSk+A3o+uU/W5E8eTpz0x3oJolKiIeKiiVJxHkGc=; b=pPo6kwLUHCxRH8GzAmqG98kNP4jRBA1N3GuBWQxbyGk4ZY/g/Lap6E2kj+tw/5FKB0HC/0 3ynYLZhKYCT8qomAKy/5VDffE1cklc2GOuU5zAn0ImsHencMDXCX8W31ADbNbZ2WXbbdA5 qbE4k6wQZ0Zm7g9NF3hqCo7OyVbQhDrCw4m1zkieeM+T0vpuobfW6PmNh98tuYgH/8QTj5 Zqcxd1Y7gC4Q8FPToO+kxYRMX0+y/9eXONywUEaoZ88D3J/PdgHUVrppxqeQ7W+eYDh5Sw ysHkn/mFtCHji9BbuZWATZkDDwqrZAgP8Ehnv4dlMIEhWM9Q0G02Rh1voHHbuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff4LSk+A3o+uU/W5E8eTpz0x3oJolKiIeKiiVJxHkGc=; b=HSphsqdM6tN0a5PFLxexjAMTgW9Xekwq5ghlgIxmdhho9MwSSGM1N3AHBiMARVPrepigXu u++0bOllfgeMbSEiCQ/Npa8BBbqBmEOMpEx513DEi6GODxMbHGN4xVRDl2l41DIIiQ63Oh AiImFdQ6xlXFv/S3GSUiirZw4he6BkRnp1cwqcKekD1uEuxIjUMKdHlOz1zoQ6Mt+d+JxC UV+9Smj6kMOBAry2JJt1op7MZ+hmxXDJWN6nnoumEmMT1CqrOWo/Ys019ZNGzWdtYy4j6+ BVsawr+hHAXSx0+4qJd8XUmkYWPM2pAmL726UzWVtXA8shtnNXhMM9ZQjv4zOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733161; a=rsa-sha256; cv=none; b=CkUe9kPQZK4X2WOGw+XZM6R3of5QZFqzjfkECkPTrTVgCPnj41sJJSpWQNcwgXgDHS1rMt 876w2YCTBsdjWgPLf9L5EH8asDeYOZNvnSO6zQgP2Bq6rJliMy4g3GigbMo+LwacY8zejk Di7WzvdkqCPn2/+x+pc50Vwd8eE5RBVhk6vRecvAAjdd4GdgbvlU16fOwhoTylyccc+Kfi 110CCtEDxNCZxUL0KCp8lx/jONZmLBXDqYQkzMOjCn7i/VhPE5mHIxB2fXS7DNUdVd+bCa 0A6uAGyPAENEpeQqfldDFfxBegHLCAZxUgbWv6j4nN6hrnqHu09d8mTwjv6vaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfhnP3MWHzXTW; Fri, 24 Jan 2025 15:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFdLgw020748; Fri, 24 Jan 2025 15:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFdLek020745; Fri, 24 Jan 2025 15:39:21 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:39:21 GMT Message-Id: <202501241539.50OFdLek020745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 894efae09de4 - stable/14 - sysctl(9): Enable vnet sysctl variables to be loader tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 894efae09de43a38b0ff667c4b7195dc377640e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=894efae09de43a38b0ff667c4b7195dc377640e4 commit 894efae09de43a38b0ff667c4b7195dc377640e4 Author: Zhenlei Huang AuthorDate: 2023-09-09 08:06:23 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:35:49 +0000 sysctl(9): Enable vnet sysctl variables to be loader tunable Complete phase two of 3da1cf1e88f8. In 3da1cf1e88f8, the meaning of the flag CTLFLAG_TUN is extended to automatically check if there is a kernel environment variable which shall initialize the SYSCTL during early boot. It works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTLs which belong to VNETs. This change extends the meaning further, to allow it also works for the SYSCTLs which belong to VNETs. A typical usage is ``` VNET_DEFINE_STATIC(int, foo) = 0; SYSCTL_INT(_net, OID_AUTO, foo, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(foo), 0, "Description of the foo loader tunable"); ``` Note that the implementation has a limitation. It behaves the same way as that of non-vnet loader tunables. That is, after the kernel or modules being initialized, any changes (e.g. via kenv) to kernel environment variable will not affect the corresponding vnet variable of subsequently created VNETs. To overcome it, we can use TUNABLE_XXX_FETCH to fetch the kernel environment variable into those vnet variables during vnet constructing. This change will fix the following SYSCTLs those belong to VNETs and have CTLFLAG_TUN flag: ``` net.add_addr_allfibs net.bpf.optimize_writers net.inet.tcp.fastopen.ccache_buckets net.link.bridge.inherit_mac net.link.bridge.ipfw_arp net.link.bridge.log_stp net.link.bridge.pfil_bridge net.link.bridge.pfil_local_phys net.link.bridge.pfil_member net.link.bridge.pfil_onlyip net.link.lagg.default_use_flowid net.link.lagg.default_use_numa net.link.lagg.default_flowid_shift net.link.lagg.lacp.debug net.link.lagg.lacp.default_strict_mode ``` Although the following vnet SYSCTLs have CTLFLAG_TUN flag, theirs values are re-fetched via TUNABLE_XXX_FETCH, thus are not affected by this change. ``` net.inet.ip.reass_hashsize net.inet.tcp.hostcache.cachelimit net.inet.tcp.hostcache.hashsize net.inet.tcp.hostcache.bucketlimit net.inet.tcp.syncache.bucketlimit net.inet.tcp.syncache.cachelimit net.inet.tcp.syncache.hashsize net.key.spdcache.maxentries net.key.spdcache.threshold ``` In memoriam: hselasky Discussed with: hselasky, glebius Fixes: 3da1cf1e88f8 Extend the meaning of the CTLFLAG_TUN flag ... MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D39638 (cherry picked from commit 110113bc086f5df1a9b6547edb1ab0cec698c55c) --- sys/kern/kern_linker.c | 3 +++ sys/kern/kern_sysctl.c | 3 --- sys/kern/link_elf.c | 20 ++++++++++++++++++++ sys/kern/link_elf_obj.c | 30 +++++++++++++++++++++++++++++- sys/kern/linker_if.m | 9 +++++++++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index a04dd4cec563..2a024816f23c 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -474,6 +474,9 @@ linker_load_file(const char *filename, linker_file_t *result) } modules = !TAILQ_EMPTY(&lf->modules); linker_file_register_sysctls(lf, false); +#ifdef VIMAGE + LINKER_PROPAGATE_VNETS(lf); +#endif linker_file_sysinit(lf); lf->flags |= LINKER_FILE_LINKED; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 7f0bd48747f3..9f340404f9b3 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -526,9 +526,6 @@ sysctl_register_oid(struct sysctl_oid *oidp) RB_INSERT(sysctl_oid_list, parent, oidp); if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE && -#ifdef VIMAGE - (oidp->oid_kind & CTLFLAG_VNET) == 0 && -#endif (oidp->oid_kind & CTLFLAG_TUN) != 0 && (oidp->oid_kind & CTLFLAG_NOFETCH) == 0) { /* only fetch value once */ diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index c7871e8e2e0d..bcce79a8b262 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -160,6 +160,9 @@ static int link_elf_each_function_nameval(linker_file_t, static void link_elf_reloc_local(linker_file_t); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); +#ifdef VIMAGE +static void link_elf_propagate_vnets(linker_file_t); +#endif static int elf_lookup(linker_file_t, Elf_Size, int, Elf_Addr *); static kobj_method_t link_elf_methods[] = { @@ -178,6 +181,9 @@ static kobj_method_t link_elf_methods[] = { KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), +#ifdef VIMAGE + KOBJMETHOD(linker_propagate_vnets, link_elf_propagate_vnets), +#endif KOBJMETHOD_END }; @@ -1934,6 +1940,20 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (ef->ddbstrcnt); } +#ifdef VIMAGE +static void +link_elf_propagate_vnets(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t)lf; + int size; + + if (ef->vnet_base != 0) { + size = (uintptr_t)ef->vnet_stop - (uintptr_t)ef->vnet_start; + vnet_data_copy((void *)ef->vnet_base, size); + } +} +#endif + #if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) || defined(__powerpc__) /* * Use this lookup routine when performing relocations early during boot. diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 2718a92d7864..a7fbfaa3ca64 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -150,6 +150,9 @@ static int link_elf_each_function_nameval(linker_file_t, static int link_elf_reloc_local(linker_file_t, bool); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); +#ifdef VIMAGE +static void link_elf_propagate_vnets(linker_file_t); +#endif static int elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int deps, Elf_Addr *); @@ -170,6 +173,9 @@ static kobj_method_t link_elf_methods[] = { KOBJMETHOD(linker_ctf_get, link_elf_ctf_get), KOBJMETHOD(linker_symtab_get, link_elf_symtab_get), KOBJMETHOD(linker_strtab_get, link_elf_strtab_get), +#ifdef VIMAGE + KOBJMETHOD(linker_propagate_vnets, link_elf_propagate_vnets), +#endif KOBJMETHOD_END }; @@ -1872,7 +1878,7 @@ link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab) return (0); return (ef->ddbsymcnt); } - + static long link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) { @@ -1883,3 +1889,25 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (0); return (ef->ddbstrcnt); } + +#ifdef VIMAGE +static void +link_elf_propagate_vnets(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t) lf; + + if (ef->progtab) { + for (int i = 0; i < ef->nprogtab; i++) { + if (ef->progtab[i].size == 0) + continue; + if (ef->progtab[i].name == NULL) + continue; + if (strcmp(ef->progtab[i].name, VNET_SETNAME) == 0) { + vnet_data_copy(ef->progtab[i].addr, + ef->progtab[i].size); + break; + } + } + } +} +#endif diff --git a/sys/kern/linker_if.m b/sys/kern/linker_if.m index 0722390d4e20..a50ed1ea84a3 100644 --- a/sys/kern/linker_if.m +++ b/sys/kern/linker_if.m @@ -154,3 +154,12 @@ STATICMETHOD int link_preload { METHOD int link_preload_finish { linker_file_t file; }; + +#ifdef VIMAGE +# +# Propagate system tunable values to all vnets. +# +METHOD void propagate_vnets { + linker_file_t file; +}; +#endif From nobody Fri Jan 24 15:42:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfhsF2Xdsz5lZ7n; Fri, 24 Jan 2025 15:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfhsF0Tv6z459g; Fri, 24 Jan 2025 15:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cpNFKzhWTRN+jAWocdp+n1RzmZcS+GOXXBd976XIFw=; b=v/g3SXW+yxxqT/sTotybEDVXxUHH0UobIHdJoffqchcQpE4wdA0KroQ70hTaGJkOFawbu3 gru1SI8d62xQTtLMENV8GSZRlX7+GGF54bC+yEt/RkVUSxwBpdgD0gtmKyz7kvDWJnhWAe KjiZcAAFVNE/dmS9deh1efkaLvS26jqSZFJiKUhRUCw5xjvQnrKJwsrnPzDc9Pmj92pWqG 4w4dMfebcgUyzCtdNEc/4jqeXO1d7dnIofPMFfpFEPJkCdi5s2tM1hmkgoS3E+gtDGJ6Qs llEi5Gi7xpHZ/XpYXbTaqDCH/6nVbcwodgYGBLGjjdzi+saRQkbNjAuCv7xwxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cpNFKzhWTRN+jAWocdp+n1RzmZcS+GOXXBd976XIFw=; b=e4l0TAdHc6N2V4kT81ap6DJLJDXWXmxgk13JDcGT8CYAGGYoFiitIKEPIir7E68H2+k8+t wMsdKgG9Y+oeg1aBjVCnVFtXvp7+5PH/Ezyxe5xl9r2FPKqKa4admVyZrXRzK6FWGCBDab Yy3dB51KvRo1Gj+P2vRwN34my71Gz06Nh/qMI8DFyTK1Mhv9SNPZava1qH4r7U8K8iZDzo yTFokKWjoZcPjyi2tPwaWtklHbrNZUMf++2Dp3wG6vDPFjU6mFAuNU9DPuVA5o12rDPxh0 98J2tZ69SE5WFkJ/Cqx2zAjkw6g4D6F0cZSD7jUKQBtf2bFpZ8fUfWMSFG4dRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733361; a=rsa-sha256; cv=none; b=S+Rh10B3GSdMgFHrZOSlbmraRuS2wUIo+/I45xGivp49VRTz/k2g0p4EDHEK8jrxG/UIxa lOcnm1fGD32bAeu2wxUxK7dhq7pX7j8Kx+BDE4uG3b5xTsLPGSWjS/O7vnwO/z9WZuC1AZ VBLF0NWE9Uy6PmDzO9FFsO08jxORC5HjGJ+XK6vZ4zOh3tD9yhi4IkQaVblwId7nfP9ipd pWrUfh4M31HfYZmWG9kxmVqbt22VfQTGFiUetbMC1qAP8kCzI/DDGiscgA9QgLYtIBQG3k xbWXxGdMFMTyihottIlQpKkt5cjhYXMtukIM+3R6ILcVqUC0OrK9xm+X+5iSgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfhsD6r99zXSP; Fri, 24 Jan 2025 15:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFgeAQ037260; Fri, 24 Jan 2025 15:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFgeSd037257; Fri, 24 Jan 2025 15:42:40 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:42:40 GMT Message-Id: <202501241542.50OFgeSd037257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d67b1748ea34 - stable/14 - carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d67b1748ea34ad6f66072694fd8b623ab0ea72b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d67b1748ea34ad6f66072694fd8b623ab0ea72b1 commit d67b1748ea34ad6f66072694fd8b623ab0ea72b1 Author: Zhenlei Huang AuthorDate: 2023-09-09 08:10:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:41:09 +0000 carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH With recent change 110113bc086f, a vnet tunable can be initialized when there is a corresponding kernel environment variable unless it is marked with the flag CTLFLAG_NOFETCH. The initialization may happen during early boot(linker preload), at that time vnet0 has not been created. The hander carp_allow_sysctl() for the tunable net.inet.carp.allow requires vnet, thus invoking it during early boot will cause kernel panic. The tunnable is initialized by vnet sysinit routine ipcarp_sysinit() so let's just mark it with flag CTLFLAG_NOFETCH. No functional change intended. Fixes: 110113bc086f sysctl(9): Enable vnet sysctl variables to be loader tunable MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D41525 (cherry picked from commit 242fa308f3c3def32b2e61e0b78c11b3697e4492) --- sys/netinet/ip_carp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 335cb42613bf..ddbc13e7c878 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -237,7 +237,7 @@ static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "CARP"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, allow, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &VNET_NAME(carp_allow), 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp, From nobody Fri Jan 24 15:48:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfhzd6Pdgz5lZS4; Fri, 24 Jan 2025 15:48: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfhzd5jFnz4688; Fri, 24 Jan 2025 15:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt7WnfR01VyREjI5XnE+ehbJJfBCRFYbQK6lxP0ZRUU=; b=sBCILoR4A4OZP5UwTGh3rwO94BpQVQ1sdjo/2TZzCU3HcQw/eZ9ela0fakhurcmd7j9VLy Z+iYlszQlgDQRYRUTPLp9lsJwe5XIZXD3T7FwzZCSPWZhalPimVlxqA/NtTrgSLhZlP6Bm meZwJ9vmJGTIsrkTenQTFcDGPADjITNXNi8wm1oA5KNQa5EC1jseQ/GSrC+A04CJD5ilYJ SKi+a9HOEEQQI4xwsD0ul7AQC7S5EpqklPmu58DJH6OquZ2oEMFA6pBopL2ZpVDO3Hktva IxTpTtPTEcE0uhOcfEam7YVW65hr4cGrk24el/FFxPJg7F8yycLWkPZKsvrIHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yt7WnfR01VyREjI5XnE+ehbJJfBCRFYbQK6lxP0ZRUU=; b=L6iD5hUk0lxWJqmwnNcIqZYyebDTmFCS8r1K+1YqmzcTBTgObEnqKxeeqVYb4q7rWPePib oaz38MOytc8L3iMMj2zKg+8jy2vLfQE9XiXFGk6nyR29G1RGJf1pqnygFM1Fq5A2/tod2N EuBRX6EAw8pXrGAsgYz0ZwhbBBJ4GSVKx7snvtsRVSlZyDwKw0LN/qsunz/j8VqUts5hcb hoLKFrBVRZ8lUysKQkcftIkpRCZj1rEJa4z4zdkbBWgYU0h6UWzEYqvyb32FKmv8gevAwk a1H9MjZ2K/ZZid7CNEW/dL60slhltTXZxjR0w0SFdDSGev1GFuMCGe2bAU+nDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733693; a=rsa-sha256; cv=none; b=uleEbuMzFCvYbn72RzWjK8dpL8AQSXEovuWXcR8E8XgU0tEEJyxhDdNtMavWnfzW+BVZgJ uhsTT7iL4Rtl/epLS6btklozg4fV+VFcx0zNMUalPm2GA3gFoZads9Ne2SBDtJYUiQQKPq i+n72JmWRlC2bIwComd9SbL5HDFehmIes+H0dj0yoSldQondtfIL9sGk03xzsVoieM5qGR FVleQvfd8AS+d3vejuUplrBOm8E3+lHh8WtaRYqe6E5IubKCcWWT19QhNBu8q3dxPFa1tO NddXQmajVNSK2eOpKy3fZHpS6PBIS/EWa1x9OPOcPP0UcCz5hz+0Z1NIlcIFjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfhzd4p0bzXRv; Fri, 24 Jan 2025 15:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFmD4e038987; Fri, 24 Jan 2025 15:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFmDYF038984; Fri, 24 Jan 2025 15:48:13 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:48:13 GMT Message-Id: <202501241548.50OFmDYF038984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3965be101c43 - stable/14 - pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3965be101c434437ce8819250e9e6b3e5c3d702e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3965be101c434437ce8819250e9e6b3e5c3d702e commit 3965be101c434437ce8819250e9e6b3e5c3d702e Author: Zhenlei Huang AuthorDate: 2023-09-22 10:05:02 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:46:20 +0000 pf: Convert PF_DEFAULT_TO_DROP into a vnet loader tunable 'net.pf.default_to_drop' 7f7ef494f11d introduced a compile time option PF_DEFAULT_TO_DROP to make the pf(4) default rule to drop. While this change exposes a vnet loader tunable 'net.pf.default_to_drop' so that users can change the default rule without re-compiling the pf(4) module. This change is similiar to that for IPFW [1]. 1. 5f17ebf94db5 Convert IPFW_DEFAULT_TO_ACCEPT into a loader tunable 'net.inet.ip.fw.default_to_accept' Reviewed by: #network, kp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D39866 (cherry picked from commit c531c1d1462c45f7ce5de4f9913226801f3073bd) --- share/man/man4/pf.4 | 4 ++++ sys/netpfil/pf/pf_ioctl.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 4938e719b17e..cd87b98ea45d 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -87,6 +87,10 @@ Default value is 131072. Size of hash table that store source nodes. Should be power of 2. Default value is 32768. +.It Va net.pf.default_to_drop +This value overrides +.Cd "options PF_DEFAULT_TO_DROP" +from kernel configuration file. .It Va net.pf.rdr_srcport_rewrite_tries The maximum number of times to try and find a free source port when handling redirects. diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 6cb7bc95df2b..e67a0ddadfb7 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -199,6 +199,16 @@ SYSCTL_BOOL(_net_pf, OID_AUTO, filter_local, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(pf_filter_local), false, "Enable filtering for packets delivered to local network stack"); +#ifdef PF_DEFAULT_TO_DROP +VNET_DEFINE_STATIC(bool, default_to_drop) = true; +#else +VNET_DEFINE_STATIC(bool, default_to_drop); +#endif +#define V_default_to_drop VNET(default_to_drop) +SYSCTL_BOOL(_net_pf, OID_AUTO, default_to_drop, CTLFLAG_RDTUN | CTLFLAG_VNET, + &VNET_NAME(default_to_drop), false, + "Make the default rule drop all packets."); + static void pf_init_tagset(struct pf_tagset *, unsigned int *, unsigned int); static void pf_cleanup_tagset(struct pf_tagset *); @@ -335,11 +345,7 @@ pfattach_vnet(void) /* default rule should never be garbage collected */ V_pf_default_rule.entries.tqe_prev = &V_pf_default_rule.entries.tqe_next; -#ifdef PF_DEFAULT_TO_DROP - V_pf_default_rule.action = PF_DROP; -#else - V_pf_default_rule.action = PF_PASS; -#endif + V_pf_default_rule.action = V_default_to_drop ? PF_DROP : PF_PASS; V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; From nobody Fri Jan 24 15:50:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfj2M39Wrz5lZV5; Fri, 24 Jan 2025 15:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfj2M2bgKz46ZJ; Fri, 24 Jan 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Hli9L2VaFN1VQu3ZGsd9nYK8CcoRm3/CAl2+1uEcIc=; b=gtMujfxHukwxxmampH9Iej5dhh2cTYE5k4PCeiG64whGItAcGjmAthoNV9r142CLGJTOve WLNL8k38tECTu+4x7m2yzaDZmi71Gn8B1jWSvVaWGqpZ8gYYLSr4TXUca+XxRMnjQsBbeU BiIw3WbcuC6+mxnbW9fF7O8kPnpjA5uF8Me6oM/dDvZPni1FF6XfbDZbzVdC9N2YlQFxkR 0ZLiJ8U7g/A8+7C+FWokt5NVzcEQ1u/Pc8uNVVORunaBNZGdyR0yC8g/tqCIih3Ybg8Lhs mJ/H++ygYE7kyhv9YTSMKyEbt3VrEd06Gq83b+6p8mAq2AbmhztgBG3PeiPakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Hli9L2VaFN1VQu3ZGsd9nYK8CcoRm3/CAl2+1uEcIc=; b=oaUjR4KdaKqZhU7lzUxK7MskTBn8FWT7P8vcHvJpl7LXoUJoEFa8EQTFms1LCUZ/6q0FHU YqsBq1l6x8blxe5S+8tZxJwXfEaZKr7LzmEbEQmIlp0OLAbho27y6iofreZJ7xiWk0TJak +4gcPLNJKJwyj/t8la3azFg2lb0ikqbY6a2BbNe9mZCyuwbwez+LqDGDo3Ve3/vE/zicYS +u0Zv041AdJGjfc/mQvQOpFIDE19SdC1oIfgNa4ZaSRV4GHNV0X4BM8PmcbV52a1qKkd4w A8gib04BP7DH/WFdUfFbAPJQqXu3gYOyDGiTPyvG745fLG5LYpS0kjA9RpKmaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733835; a=rsa-sha256; cv=none; b=iBF1Id4yaH/o3lPWF9cjXLVFVC+u+i/iffTY19kv8xu1KS7rPHt04IxWQiGYX+7RsnIc12 UC3HMvTDOnp1/Pi5hHkydA7aOdI/wAPmHJs2FUSy6LI4gB9VUlwO2OXzXbYh8o7K7ImQ6q S5+uD7GK5DMWiH24Fso1UJ6lkSva+jVp7bkYEJMqNpaRKIXyfJSiteFo/0N8GsLIG1ebL2 OLxvcBVQ3FK2CymBEcYJNQQFe0ne1HqWC976Q5bTGVxOVNmLna4cT7EGFJUQCCiCDcZm1P zA9Ft8iYHVpCwayXAXkBY2SG9lcKN7GfCnF27Rbc9RR08ZVbHYcCp2t45vF4eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfj2M24lwzXVB; Fri, 24 Jan 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFoZYK048332; Fri, 24 Jan 2025 15:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFoZIr048330; Fri, 24 Jan 2025 15:50:35 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:50:35 GMT Message-Id: <202501241550.50OFoZIr048330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1d890d546b06 - stable/14 - sysctl: Fix usage() and SYNOPSIS section of man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d890d546b064f2c7753b949f5dbf00d79cde292 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d890d546b064f2c7753b949f5dbf00d79cde292 commit 1d890d546b064f2c7753b949f5dbf00d79cde292 Author: Zhenlei Huang AuthorDate: 2025-01-23 07:24:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:49:33 +0000 sysctl: Fix usage() and SYNOPSIS section of man page I forgot to update the usage() and SYNOPSIS section of man page when adding the two options -J and -V. While here, fix the options sort order in SYNOPSIS section. Fixes: 5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables MFC after: 1 day (cherry picked from commit 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3) --- sbin/sysctl/sysctl.8 | 6 +++--- sbin/sysctl/sysctl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index fadc162b80c6..da4dec6be005 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -30,7 +30,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd October 29, 2024 +.Dd January 23, 2025 .Dt SYSCTL 8 .Os .Sh NAME @@ -38,13 +38,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdeFhilNnoTtqWx +.Op Fl bdeFhiJlNnoqTtVWx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm -.Op Fl bdeFhlNnoTtqWx +.Op Fl bdeFhJlNnoqTtVWx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 8ec9089bd2cf..df9b453d52a0 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -122,8 +122,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdeFhilNnoqTtWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdeFhlNnoqTtWx] [ -B ] -a"); + "usage: sysctl [-bdeFhiJlNnoqTtVWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdeFhJlNnoqTtVWx] [ -B ] -a"); exit(1); } From nobody Fri Jan 24 15:50:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfj2N4k89z5lZfk; Fri, 24 Jan 2025 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfj2N39xBz46LV; Fri, 24 Jan 2025 15:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBdtNFMngvnP4JRNUzekVyD/Ryaj+1gI5HHLbJNguQ=; b=YwQdJBZR3o7UvWjcniC5ZTQm8+uc5VtyhLdLnFPZNQQ8ED3wRLjnAut00kShciZMTcR+ys rWKq/SoshDAHGEImrxueH6rL6Fw0Ya34Q4UVnSTiuj0V4Z66fTZpI3+JztI53PXYaNSKQC AZUnFXuNZFvBaC+3E/LTO4b0Hge3U0GcBu47qv14WwGUj3RZYjtn2tVBAqMv4CGp7Gh59g 1kB+Y1dS8lW0jaMySrKuGjtvbCc8nFUfdYQ0VB5Hc+21nkoxuKLveD7HM42gEdnaQh13Nu AJigbEB8plSuuJFFR7BlNoy5vXAVYPxRSjTwk27ILVd461WqmHg/CXq+O9jpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737733836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eLBdtNFMngvnP4JRNUzekVyD/Ryaj+1gI5HHLbJNguQ=; b=dER5+NNRCFifgDmcC1LiQckeeui4ynf5s2eF+DC3aWyqHZqafRIJuqW9i4XwtRPHgOZC8F o0k9uRS9Sc9sZfc+IPYomObvA8c3ZNxWZtc/m5vmMfZX+drI5g8RGxPDz0OcXfwUNZN+B+ ORT/04TqpzfUiC2sKCwQnpAfrQVifC5odyzd5PJnm2lOyB5Je7bA0cnxn99GRz9tp8LZhW P98MoyR0sIr8Ol/uF/nxuimN65McXBVlNobMpW8WD4q86ssQHW2RuQwUgstJkSAEvd11x0 vlXnhgIoYYm2wjN3YcxQxDCSXyKWw2OfvFuhIn3B/u2pUvh/+U1xIj6JaV+dSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737733836; a=rsa-sha256; cv=none; b=iqjRPaxD+TEKUAmKsS5jc3k8KNMw2q6f2xoaYCQ5vdvcf0/71UDvtsljrmmMB9IbHhVRE4 y6ke48EATpK8LAJ+PGoGjYy3Jkmibyjy4Tor0PtSKRzsBfiEdr+1KrfTL76ll8trRU3ER9 O0dmmbfNon0sTTV+StCThUHAop9kw4KAjK91+UOYG+JIZ9I4JJOzsfxcmPjBD5+IZU9VBr u7qO0/8RzqosiyYO1JRVAtkSTiZ+YqdXWQKBPdfSqTSnsvCvHhnJW3yN+0MIl60CXrSFuS lm3gl7u9klk39vusm9PwbJ8RJ2HZv5JfVw1S7OQP6B6nqaGRAVqgXo9StooA3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfj2N2l1qzXmd; Fri, 24 Jan 2025 15:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OFoap2048376; Fri, 24 Jan 2025 15:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OFoaaE048373; Fri, 24 Jan 2025 15:50:36 GMT (envelope-from git) Date: Fri, 24 Jan 2025 15:50:36 GMT Message-Id: <202501241550.50OFoaaE048373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 0e4f9db00dc3 - stable/14 - sysctl: Sort options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e4f9db00dc3907f90152afdeee7965555563927 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=0e4f9db00dc3907f90152afdeee7965555563927 commit 0e4f9db00dc3907f90152afdeee7965555563927 Author: Zhenlei Huang AuthorDate: 2025-01-23 08:01:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-24 15:49:49 +0000 sysctl: Sort options No functional change intended. MFC after: 1 day (cherry picked from commit c294ecb25b5f3553b5c84b630869bb05724c9629) --- sbin/sysctl/sysctl.8 | 16 ++++++++-------- sbin/sysctl/sysctl.c | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index da4dec6be005..aee66173fdea 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -70,10 +70,6 @@ opaque or excluded from listing via the flag. This option is ignored if one or more variable names are specified on the command line. -.It Fl b -Force the value of the variable(s) to be output in raw, binary format. -No names are printed and no terminating newlines are output. -This is mostly useful with a single variable. .It Fl B Ar bufsize Set the buffer size to read from the .Nm @@ -83,6 +79,10 @@ This is necessary for a .Nm that has variable length, and the probe value of 0 is a valid length, such as .Va kern.arandom . +.It Fl b +Force the value of the variable(s) to be output in raw, binary format. +No names are printed and no terminating newlines are output. +This is mostly useful with a single variable. .It Fl d Print the description of the variable instead of its value. .It Fl e @@ -96,15 +96,15 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl F +Print the format of the variable. +This is additional information to describe the type of the variable and +most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl f Ar filename Specify a file which contains a pair of name and value in each line. .Nm reads and processes the specified file first and then processes the name and value pairs in the command line argument. -.It Fl F -Print the format of the variable. -This is additional information to describe the type of the variable and -most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl h Format output for human, rather than machine, readability. .It Fl i diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index df9b453d52a0..13161e9a3be4 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -137,7 +137,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:FhiJlNnoqtTVwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AaB:bdeFf:hiJlNnoqTtVWwXx")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -146,24 +146,24 @@ main(int argc, char **argv) case 'a': aflag = 1; break; - case 'b': - bflag = 1; - break; case 'B': Bflag = strtol(optarg, NULL, 0); break; + case 'b': + bflag = 1; + break; case 'd': dflag = 1; break; case 'e': eflag = 1; break; - case 'f': - conffile = optarg; - break; case 'F': Fflag = true; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -188,22 +188,22 @@ main(int argc, char **argv) case 'q': qflag = 1; break; - case 't': - tflag = 1; - break; case 'T': Tflag = 1; break; + case 't': + tflag = 1; + break; case 'V': Vflag = true; break; + case 'W': + Wflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; - case 'W': - Wflag = 1; - break; case 'X': /* compatibility */ aflag = xflag = 1; From nobody Fri Jan 24 16:22:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfjkc6jjKz5lcG8; Fri, 24 Jan 2025 16:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfjkc5yN3z4F4C; Fri, 24 Jan 2025 16:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737735720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYYJWDkAMFLGGuih2vv35w63nkMv/vaSeRSNC8zfXxc=; b=opVxil5aKKFJRpiwH2RZ7iz+p/vII3jsCS64PLZb+tX2ca28cppaWdX8Z9QDncluM3m+yr GKhwGBGozQEpmntZqJMceSj/Bz+GtmRp9SPxafaanezKC4AE7bwW1yVegDMJ6L5FyoTQJl 5wkoor8p7qPZOgfwJdRbo0DKXghlLLtnH4McGWQqxlwqFgZVKc69VGSvmSck+ul8aYP/JP SQy+Ww34aCaN0SIaJploODE2EMpd7/uc3s3bZ7w5gcQTAF2SaSH4hfGiSJrEqWdhlcEVUe 4jFGMfTJagWJW1MEKdOMO9Qo3usxSqiQVr4QdGhEjX1JwIR684WZBq3jiDVZXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737735720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYYJWDkAMFLGGuih2vv35w63nkMv/vaSeRSNC8zfXxc=; b=D3sLzZ2cKdTsMitMGBFS4aukMjVJmQUuRGdM3Oup+1WgC5/C/2+R6j9ShVZKfQV0nLU0oY R3G9aKdr7zjtHITjgbk5opVCCBlyztUnWnOE/unJJDu2fA2bcZbxPy1OXEKw/iqYX9aP3G dRiXk0mOxVbRiHQj3y3cdh1mtBNJDJxF4M56RJXH5u/YTrrLmJV1e9FB6Zxc0c2Gaf+AMw vlq9+p4vU6iQyo2ve/AT9jLbb3oFgH8e1T4xhJ6WZDc192/yALfCLsPxWCt2Cz+1vr3fsm TFV66b5aK5xi1weVMYDjq+TQO+GAAUtj8FlQU0lr9nvraXi3VfUcDPzYZmMrbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737735720; a=rsa-sha256; cv=none; b=O89fjqc2oCNI6llHfGsEuDNiaEDbyVQfRvEf2wKss0a3mcwBNWIWZ2GsPaGfueRlt56MOu I4A6CQFi4aX9KD4dDs6kR5A7ayMlgEapfH16sfG+6Pw2URtjvTq7vRG3SjJCkL22MHoItW WjwBHYH38OxXYIbxzPtpHJPFuV+v/2PjJgGtyrq7sQg9ynklrJiHIsqcZy4fgRiIyB2Jab mrQxaZM2pspgfMwCXNmZc7g+JSLt03quNwoH+Cwp4vQxYyeDyDhRqmHVeZKePqvcv4vyPj 3nzVULCR+xrZcGhHNZLkkL45XJHyaNznJGeAXfBp9YbaPMNg+pbUhpfmCcD3RQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfjkc5SWWzYqx; Fri, 24 Jan 2025 16:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OGM0Kn011979; Fri, 24 Jan 2025 16:22:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OGM0FA011976; Fri, 24 Jan 2025 16:22:00 GMT (envelope-from git) Date: Fri, 24 Jan 2025 16:22:00 GMT Message-Id: <202501241622.50OGM0FA011976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c6170b00f44e - main - vmm: Depend on vmm_hyp* files as needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6170b00f44e97f054a3e318744729d05d5360f9 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c6170b00f44e97f054a3e318744729d05d5360f9 commit c6170b00f44e97f054a3e318744729d05d5360f9 Author: Andrew Turner AuthorDate: 2025-01-24 16:09:03 +0000 Commit: Andrew Turner CommitDate: 2025-01-24 16:21:06 +0000 vmm: Depend on vmm_hyp* files as needed The arm64 vmm_nvhe* files depend on a vmm_hyp file to provide most of the implementation. As these are built with custom rules the normal generated dependency information is not used, even if generated. Add a dependency between these two sets of files to ensure when the implementation is updated the file will be rebuilt. Sponsored by: Arm Ltd --- sys/modules/vmm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 7c34dd92939b..c990852ae441 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -45,11 +45,11 @@ CLEANFILES+= vmm_nvhe_exception.o vmm_nvhe.o CLEANFILES+= vmm_hyp_blob.elf.full CLEANFILES+= vmm_hyp_blob.elf vmm_hyp_blob.bin -vmm_nvhe_exception.o: vmm_nvhe_exception.S +vmm_nvhe_exception.o: vmm_nvhe_exception.S vmm_hyp_exception.S ${CC} -c -x assembler-with-cpp -DLOCORE \ ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} -o ${.TARGET} -fpie -vmm_nvhe.o: vmm_nvhe.c +vmm_nvhe.o: vmm_nvhe.c vmm_hyp.c ${CC} -c ${NOSAN_CFLAGS:N-mbranch-protection*} ${.IMPSRC} \ -o ${.TARGET} -fpie From nobody Fri Jan 24 16:48:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfkK93P8Qz5ldxh; Fri, 24 Jan 2025 16:48: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfkK90gp9z4JfR; Fri, 24 Jan 2025 16:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737737309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYDkAsEjY/vl7w0TtEiNYitIXYotcvXoCv1Zfr7+7+A=; b=GSmPA6+Y1Z/cE9aN2X8VlC6JmmOE4N/Qst59sQ5MxgnzgSCa/bQ0+h+PKy22JHl1SPjQIg +Fre2rmBYvhcMn3auGI6UxGbwhLzWmpy964d3z8OMvm6ob/WRS6NUZG3m+JeVnDUjTWT6h btre7To2Q3mBx5I+s7UGNi/xMsG04W4VREZF7gABzrMKY/6oTf1w9gdgU3RD/rXqFL8vIL d9LPdZex4iAshGsDwiWKKpgw8a1uUctUoG8OWSji4XKVBkg4OMlt/WzjomeOK49wnudE0y E1TEQB1AYyCCczqIvCX7y+3juM0CSXpQ7ZXt6AYqUtuaxuRthQtjD7P2r20IbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737737309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VYDkAsEjY/vl7w0TtEiNYitIXYotcvXoCv1Zfr7+7+A=; b=iBoZGIT4RWBzo/QO15QTtKJChHAEAQIArxRIWjBck6O0tK//8JgDcaobdSQkbMTlIHS1lO auv03/66u0GkOTiGMtfYvTj8A4FHxE1DptD7hxLymHHVJjb693f2AX/ODWtH86eorC88ZF fWKDx3lhxg4n+nQt03P6KZAZtq80H4DoBVWlgl2LRyoX3RoY1bJqtAmX/XpJab7775DcHH bb/02SigqXer/kvmQAjjlP4xcCqOhgXJDBbTSMsMWQzOnL6Y8xxfjOKA36cVIDWLo19YN9 snXaSGFbVCmRVDjmpOf/+/ox47G2r8n3Pvk6vqnkCwhpFz7toj5sE5D0tJDZ5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737737309; a=rsa-sha256; cv=none; b=PB4oiNBtVX1xcndrP2B13TWxIoYNwT85TRy2T0KTlQk7h6Siv2+Gr9AIta+ff+FJO0QEVl 9K4KRXFMs+XgsAMKi5KekmA+h3qvWoxkujPx8hhfZzUl4LuFnQYyDw8IbSEM1mSjHoxrXd FMYJb1dCIhV196KiG9SDWUZoINj7dElhKhv9LiK1UksS871jN4HOSz56lBkKfMrGYLvC/5 dk2bKruHbKbKfxmVV1dM0BugmSa8yeyWhcqUcN9JdYQUOyMNh6iES0swvJcD1Qkh+DAWV8 NWaIPiMvC+gkMWKlWSGd4+bQI3DDquCc9MId+7lG9brrU795IpETgktEXd2OoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfkK90FPqzZs1; Fri, 24 Jan 2025 16:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OGmScD051439; Fri, 24 Jan 2025 16:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OGmSre051436; Fri, 24 Jan 2025 16:48:28 GMT (envelope-from git) Date: Fri, 24 Jan 2025 16:48:28 GMT Message-Id: <202501241648.50OGmSre051436@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: 04a3ca71ead6 - main - netcat: Add a flag to enable the use of SO_REUSEPORT_LB List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 04a3ca71ead61b4ced23a791d3a5e2633ca1ef72 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=04a3ca71ead61b4ced23a791d3a5e2633ca1ef72 commit 04a3ca71ead61b4ced23a791d3a5e2633ca1ef72 Author: Mark Johnston AuthorDate: 2025-01-24 16:37:43 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 16:37:43 +0000 netcat: Add a flag to enable the use of SO_REUSEPORT_LB This is handy for testing purposes. Hide it behind a long option so that it doesn't conflict with upstream, like we do with several other flags. Reviewed by: imp, glebius, delphij MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48543 --- contrib/netcat/nc.1 | 9 ++++++++- contrib/netcat/netcat.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/contrib/netcat/nc.1 b/contrib/netcat/nc.1 index 2e34cdc586c3..5801c6fa00e3 100644 --- a/contrib/netcat/nc.1 +++ b/contrib/netcat/nc.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2023 +.Dd January 20, 2025 .Dt NC 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval +.Op Fl -lb .Op Fl -no-tcpopt .Op Fl -sctp .Op Fl -crlf @@ -175,6 +176,12 @@ options. Additionally, any timeouts specified with the .Fl w option are ignored. +.It Fl -lb +When using +.Fl l , +put the socket in load-balancing mode. +In this mode, multiple sockets can bind to the same address and port, +and incoming connections are distributed among them. .It Fl M Collect per-connection TCP statistics using the .Xr stats 3 diff --git a/contrib/netcat/netcat.c b/contrib/netcat/netcat.c index 279489a45e92..7035fdf68961 100644 --- a/contrib/netcat/netcat.c +++ b/contrib/netcat/netcat.c @@ -89,6 +89,7 @@ int Fflag; /* fdpass sock to stdout */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ +int FreeBSD_lb; /* Use SO_REUSEPORT_LB */ int FreeBSD_Mflag; /* Measure using stats(3) */ int Nflag; /* shutdown() network socket */ int nflag; /* Don't do name look up */ @@ -168,6 +169,7 @@ main(int argc, char *argv[]) char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct option longopts[] = { { "crlf", no_argument, &FreeBSD_crlf, 1 }, + { "lb", no_argument, &FreeBSD_lb, 1 }, { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, { "sctp", no_argument, &FreeBSD_sctp, 1 }, { "tun", required_argument, NULL, FREEBSD_TUN }, @@ -371,6 +373,8 @@ main(int argc, char *argv[]) errx(1, "cannot use -z and -l"); if (!lflag && kflag) errx(1, "must use -l with -k"); + if (!lflag && FreeBSD_lb) + errx(1, "must use -l with --lb"); if (FreeBSD_sctp) { if (uflag) errx(1, "cannot use -u and --sctp"); @@ -800,6 +804,8 @@ local_listen(char *host, char *port, struct addrinfo hints) res0 = res; do { + int opt; + if ((s = socket(res0->ai_family, res0->ai_socktype, res0->ai_protocol)) < 0) continue; @@ -808,7 +814,8 @@ local_listen(char *host, char *port, struct addrinfo hints) &rtableid, sizeof(rtableid)) == -1)) err(1, "setsockopt SO_SETFIB"); - ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); + opt = FreeBSD_lb != 0 ? SO_REUSEPORT_LB : SO_REUSEPORT; + ret = setsockopt(s, SOL_SOCKET, opt, &x, sizeof(x)); if (ret == -1) err(1, NULL); From nobody Fri Jan 24 19:25:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfnpp4vh0z5lp1L; Fri, 24 Jan 2025 19:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfnpp4Ngsz3P9S; Fri, 24 Jan 2025 19:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737746754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BX9cPtCdyFGaofJJcCP3hj1scHukhkyr4GBUOA2QfsE=; b=OnK+vk6iYsbuUoNrvVnVra9sZHTOVIwfBa8X0YArol3Pj/TdLjnPsJl0U/OwdMenf1dCAf VDPm3DH2XVNrdSSLRzRSQw5tP53fDV28C1hImFXm+Mv/IQ307mAvEYF4rqd9aI9nvZOZIx U0UQw34kA5cF1NJF0xOvmrIk/huO5oT6BvW5jWo2lqzoqQ7Xg4EV9MmPsxN+rUoHGeamL7 IEug+Xtzqg4TFsx51yytpXMAADkKPfpxl7oq4+vKqLd1FEU7BbDRUF9B9H96VITTh6kThi dN8alzBZtkwNq5af/VtXetbDOgmjlAGP33823nX5RhO7MRMHPPQLyd96YGQucg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737746754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BX9cPtCdyFGaofJJcCP3hj1scHukhkyr4GBUOA2QfsE=; b=L6YnC3rUa9F1t8hmk4ojGmLee97lHlV/+UQNg5XbzP9h3tQlfm5VthmX84T0a7KzL/kFk/ 1thhNZWLlI/oIDXZXkEVhXUIWmb0LIfx2o5gSDj+V/ldUKOKxRE/tnDgQ5r6CfAu8XA3hX qYjqIrGE0qfS4d28gLMi9pY2V5hMMXDNYSJsKypM9okklZxA8gcnXVINPrRfy/LH6Bi18L 8N5XbDK0f6SH9hLB49Xrn0A1WOWA7Q/PdiAy8IO9ptHODizldJ+G9Fb4m8ONG4hQdHpTxw LpCjaiwcHSCkCaUv+1v431TOE/Di7Ug+3NFDNFQ6Em62NEyQ7nlNmZqMP5V5Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737746754; a=rsa-sha256; cv=none; b=eGXEn48EAAnslab2yrRApmVhWm91WDY4Y1IKhW3gwKp/7YK2YuqrVXKXAXjPPl+1+ghUDO gCYjhWlLDrVbJUtawDgn6qvjDeWScGtUtfR0PEs6APPl5QDCg9YagGOFaSkJOYhbWk0vQP PAsMc6dxg8g1Ne9ECl1poEr/j580opqIxcZ1X3sopvIAw/mqSowaZMQwp9nfit2xb/4ClT fXsinJHImil4YWT0TwbMofcaoreeDhxCeevt/9lpC31y6oeYAA3F85A6LhASYOxI5i3Zlk fEkBs6qnASN+ZxWBb5nWhAhS+2LE00TLF/Ba/M0IGJOL+LjN6edheJ91Buyb3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfnpp3YwWzfWc; Fri, 24 Jan 2025 19:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJPs8a048780; Fri, 24 Jan 2025 19:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJPsLJ048777; Fri, 24 Jan 2025 19:25:54 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:25:54 GMT Message-Id: <202501241925.50OJPsLJ048777@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: dc273058cb0b - main - ure(4): Add support for ELECOM EDC-QUA3C List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: dc273058cb0b6bef075e77272afc66f1a1fd3889 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dc273058cb0b6bef075e77272afc66f1a1fd3889 commit dc273058cb0b6bef075e77272afc66f1a1fd3889 Author: FUKAUMI Naoki AuthorDate: 2025-01-23 01:43:59 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 19:25:11 +0000 ure(4): Add support for ELECOM EDC-QUA3C ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter. This also works as a cdce(4) device by: usbconfig -d X.Y set_config 1 or usbconfig -d X.Y set_config 2 Signed-off-by: FUKAUMI Naoki MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1578 --- sys/dev/usb/net/if_ure.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 8e307daccfad..7c9b74334b58 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -96,6 +96,7 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i), \ USB_IFACE_CLASS(UICLASS_VENDOR), \ USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR) } + URE_DEV(ELECOM, EDCQUA3C, 0), URE_DEV(LENOVO, RTL8153, URE_FLAG_8153), URE_DEV(LENOVO, TBT3LANGEN2, 0), URE_DEV(LENOVO, ONELINK, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index c71ebbaf9405..61f563ca1aa6 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1944,6 +1944,7 @@ product ELECOM WDC150SU2M 0x4008 WDC-150SU2M product ELECOM LDUSBTX2 0x400b LD-USB/TX product ELECOM WDB433SU2M2 0x400f WDB-433SU2M2 product ELECOM LDUSB20 0x4010 LD-USB20 +product ELECOM EDCQUA3C 0x4017 EDC-QUA3C product ELECOM UCSGT 0x5003 UC-SGT product ELECOM UCSGT0 0x5004 UC-SGT product ELECOM LDUSBTX3 0xabc1 LD-USB/TX From nobody Fri Jan 24 19:40:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfp752cnDz5lptB; Fri, 24 Jan 2025 19:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfp751sLyz3QfK; Fri, 24 Jan 2025 19:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/IPUH1d/k478gRKAZq9LcX4RmKzDYqEIBwifyh0uVI=; b=kiz3WWpT4XNPvstAdVspyMp+8us1JXAabzl6u238HZXiZisPQLvYpHyJkt/4dcVEpO8kth 0NMEP2SOt6VCwp+D5SxTdxY60HLmP3QzMfTvdvvm6EfToj5Yqrd239dh/WWy7r000bZQvY VtcNxnIjNjSrRXuUS6gr2jtD3HGuiVq0unlK/SpUTBIz+E2raf26RTgjcvj3MxHSuC3fqM M96b+WVcO+ZrOrHgzII4795XwltJW+0iDvnsd08HI6heafGXncqF1YSq30PwlUogq00jpC 6MHYigbi1RZvFCCZHdmvbk2zgSntxdxJZUH05LqvSnpryBWABtp0MFTl4b2sFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/IPUH1d/k478gRKAZq9LcX4RmKzDYqEIBwifyh0uVI=; b=wRbSt5JEE6ZfOTkZGTaJFPIE7CQJsUJ0HkU6GFQnhpfxzV68uXU6jXetGLn9Vh93NB8DS5 xDC+6bp+Sj9NFegHsWBNkrG+K9+mDVh50gassG9qWkckx1KQUk6PgX0mwIf8raADbtKBaG A/fj5uJzJ/JbfQyyH8gn5X1IQghM7SyHwBGBj5dD72sAVrQwYZs5kBLiATyuB6lWRqWwvo PWP/wYIrJbLtCUbWezfxA0SRscMPkFWXdfOwblxVzUr40zRmNFNerPFCTtDRQC49T28YGn u2IZ7rJzNbkAbJwoOrnV6wjdDJwBBY2a+QP+BFVQZGXxORLWQTXMMMESeuCdqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737747601; a=rsa-sha256; cv=none; b=l6CRwuTj8uoYhjo8/1z8Vw0pA7B5nScZXhklpxYB+fo6OvkHgyLRXeumQg+vxAmOMRa6dM BL0+pXX52sgzU2n0qadb2l5PNUL7fc6cUQ70ojq5iY3+u1W0S7b6EJ9Ohp05OAGrvwK2Mn yjbQWgzYCn3BXt3tLHf6LojqdzqtN8+FlvGuwEe/6L4ql0DPn57a4Uv8dlM0+tzCGH2Zu2 F69xlbW29SEnt4SEzEIR+8FWFFoN0tiqa0nS1Wa9YI4w3Dlte26XgHB+CGm7Qn2OhgkaHK kw8v7zD2XRyxVq/C+1FQ79ln3MM/Ra8A4WSMEoFj839/+5koHUCeFEyjbsrWPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfp7518xKzgH3; Fri, 24 Jan 2025 19:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJe1dL070893; Fri, 24 Jan 2025 19:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJe1bh070890; Fri, 24 Jan 2025 19:40:01 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:40:01 GMT Message-Id: <202501241940.50OJe1bh070890@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: d726bc286325 - main - bsdinstall: hook up help line and prompt for ZFS disk selection List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: d726bc286325dd7093b83c6ebcbaa768c687d825 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d726bc286325dd7093b83c6ebcbaa768c687d825 commit d726bc286325dd7093b83c6ebcbaa768c687d825 Author: Franco Fichtner AuthorDate: 2025-01-23 11:27:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 19:33:18 +0000 bsdinstall: hook up help line and prompt for ZFS disk selection Previously we were passing the wrong variable names for the prompt and help line, so the intended action wasn't clear to the user. Reviewed by: jhb, markj MFC after: 3 days See also: https://github.com/opnsense/installer/issues/22 Pull Request: https://github.com/freebsd/freebsd-src/pull/1579 --- usr.sbin/bsdinstall/scripts/zfsboot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index bfb863f5e7c8..f4670e0d272c 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -688,17 +688,17 @@ dialog_menu_layout() done eval f_dialog_checklist_size height width rows \ - \"\$title\" \"\$btitle\" \"\$prompt\" \ - \"\$hline\" $disk_check_list + \"\$title\" \"\$btitle\" \"\$disk_prompt\" \ + \"\$disk_hline\" $disk_check_list selections=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --separate-output \ - --hline \"\$hline\" \ + --hline \"\$disk_hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_back\" \ - --checklist \"\$prompt\" \ + --checklist \"\$disk_prompt\" \ $height $width $rows \ $disk_check_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD From nobody Fri Jan 24 19:41:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfp9B5kYfz5lq2J; Fri, 24 Jan 2025 19:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfp9B1T31z3SYj; Fri, 24 Jan 2025 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlRgaDLA2r87ta/TFFCqGA6FiubtDXzVhIk26DRTjx4=; b=FdSE0Bs+a3fa66Q1edTeDasH0u5F1+wS3xcU/rfluoZ4JSN07FvsjqP74kcOAB1qDQJyK1 SmHBhrtxk6CJkrfOjgfWWwveyJ+U9p6YXyBLPfCc345oXbVB5S5NStQuXZLlY8U8YJkeW1 CgXGxxW/kE/NauGDOnPpGri43sWBRruy/OjvgfEO/pcS0M4dU6F1Qf61nmb8g0aLaHiFaA yHOWmdH6gk5rHE6DzalGyaybIJv/hJyGy6bwOr6tG0XWbDiO5+5yuN3yXmawq8e/XNe45p DxAVj+g3coPHA2sCtr3QBJ+/MBVg/m0zDjnzUMuBnsA5hdmg7mqDZeBHqOgxvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlRgaDLA2r87ta/TFFCqGA6FiubtDXzVhIk26DRTjx4=; b=OyNP9lSXQf0oovaEX2FRXQhrrCHRRQPZBnUewK5VnUQ2PIsCqjBCH9ihrWv/hyjEP8BvH0 fOqqiezARQUguVnReFS7CHREFB5GzjBV/extuhfggETMRGk6vofFLytfNfmVtyFdlnAoNh /wr5LuiaNcofE0vBu/LjvOHesOmaAp2KuFKML/QCAxgCT2lzElnEBLREMWeU9/rdwyPAE7 yUhQqYgnXzdc+CIx7XqcktNEDRCwzvnMGmaFNdBmOyGKXbUdqEmR3VkMhPe3UKA2+/H0Vb NKIIYuE/tgZNsB60PKgLUv2esJJS8ums65b9I1s8jVtSMXnJkT84Hl0tDzJwOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737747710; a=rsa-sha256; cv=none; b=DnFtv7LRpMVkVsx2zGwJRKsMLcZXo/XDSNHv0+Sw8tGO4OsVxkk0TxJW7doTi0mWTsZ7LR p22p6Kt+i2GcBYg/138CNPAOVCESLGMWsvUNwtX0WFR4N/U8jMCLTizykgDyIB2/uOR2Mf 3avBNaYxvqOh1Ro0YAju6qeJspfP/k/FZ68Sud69Eg4boVrVyg3jwoQSqgaNT57PoVKnP5 yn6KQ4gDJ9Rld64HnWDLo1ivD53rkMoEBdEXjww67gBF4mI7IkMBMYXpVNEfR+2uddn0Py PEcvICRTHqdr9IjtNhlJpZukRRQkWNRONPzf1ml9yrag50rExV+Ss3okZuTyng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfp9B11yVzgJB; Fri, 24 Jan 2025 19:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJfoex083246; Fri, 24 Jan 2025 19:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJfoWN083243; Fri, 24 Jan 2025 19:41:50 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:41:50 GMT Message-Id: <202501241941.50OJfoWN083243@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: 3c61bbebc416 - main - Update rc.initdiskless, fix error handling of remount_optional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3c61bbebc4166ca209b9becfd1529298bac6ed66 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3c61bbebc4166ca209b9becfd1529298bac6ed66 commit 3c61bbebc4166ca209b9becfd1529298bac6ed66 Author: Keve Müller AuthorDate: 2024-10-27 13:09:24 +0000 Commit: Warner Losh CommitDate: 2025-01-24 19:40:33 +0000 Update rc.initdiskless, fix error handling of remount_optional chkerr() ignores the exit code of a preceding mount command in case a file ```remount_optional``` exists. The check is performed and a subshell is launched to log the informational message and return. The return is executed in the context of the subshell, not the context of the chkerr() function, hence is a NOP. The remount_optional check is hence ineffective. Change the code to if/then/fi, so the return is evaluated in the context of the chkerr function, to make the check effective. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1497 --- libexec/rc/rc.initdiskless | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.initdiskless b/libexec/rc/rc.initdiskless index a4c6c613b85a..3b66a3c4928a 100644 --- a/libexec/rc/rc.initdiskless +++ b/libexec/rc/rc.initdiskless @@ -174,7 +174,10 @@ log() { chkerr() { lastitem () ( n=$(($# - 1)) ; shift $n ; echo $1 ) mountpoint="$(lastitem $2)" - [ -r $mountpoint/remount_optional ] && ( echo "$2 failed: ignoring due to remount_optional" ; return ) + if [ -r $mountpoint/remount_optional ]; then + echo "$2 failed: ignoring due to remount_optional" + return + fi case $1 in 0) ;; From nobody Fri Jan 24 19:41:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfp9C5wYnz5lqJ2; Fri, 24 Jan 2025 19:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfp9C2L15z3SYr; Fri, 24 Jan 2025 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AT2q6E3xbpDLphuTr3ixbmNVMML6V5hBoadCjvEsyu4=; b=u4Zo+QoQDOFchCzpeuu5NKK8QP94yWqXDaomXkkvnaDJEM1qxFYhI1/cNfqBs4fU3ZrUyu w41Y98F9spZ6/LW4YYEuAKids/0xZ69LrxZBZviDZDAQXkegRpfjuHfhYJdqEYuNZWWxRd W62lpzJbNGZ4Gp/PZ0TheD3Zh4d3VVElYvHQZZxltz/wAzLYQu3MoQIZ8RevyaxbEsm6qd BPOSAcZhVZcUlXCkkzpeYAv9HV0QZnNMWTrvmN8gJWkm5rAfRVw1PHyGq9ir/G4gTlreFr M87PZ0FU3/PmgnCZzggvzceifniZ1t4vwxy2VeNFhnRzpHYb3chs4h3mi/39/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737747711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AT2q6E3xbpDLphuTr3ixbmNVMML6V5hBoadCjvEsyu4=; b=fVSFH+X8uYCfBy7FDk4ujb0pbaOhNrda36OhgOP4SCKymsXU2vgFAvlGlGECSmhWDtSHur vWAI6ThBvu1ki7kUlF+KuLlt2hiE2o33p1FNX0c2ixF/6JEPATFHq/lJqqKJYBFXkU8KiA P4tXNiBuqddotgJ7vR9piEpGt6n5Zqxm0KaoOFIdaJARwvPJg3/B4Az3q68nk1kAbEa9zd Au4KHjiq8Srp0kcScKEjQcKKAngq4f4481pYyqJ5F5J5rVp8quwBs1Sq++NSAnUyZjlSlb 7HrAK5y+PfYqCpxksB64QhNCbTFfEdiMjqnVeqc7yTLXMPLdl0K2moO6CzMGUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737747711; a=rsa-sha256; cv=none; b=LCtrnNCFAKm7R8wlIQ2N1Wp6yCvbAJWkxDE1nzWcjFFltn+whcMEyknXxCui37cB5SzoJV JATaaIVzjLXeA7yQypXbUgfGIDE8QzlvDFdz09iCHz8ZzC6L/Yqvrx4s668w04JZSLzU2+ TAccIuHHN4Adf2s/Zt1I6YjXHQm3Yoc2wdteuWCLkUMNpEnlGYOO/EH+zfEnDDU9Un94/0 WqTR/EBCeGuisNEqmrrOOm41qaiI+xzhcQe4wlwhmT2go1YSPglkcnkTQij6gPkc4ZGOoa pwyh/ornYIpVk5OWQsoJx/kfEdjvIpISuDac4/t+gkBY+PtBPXeS4icER0VTPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfp9C1fxLzgJD; Fri, 24 Jan 2025 19:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJfpLo083280; Fri, 24 Jan 2025 19:41:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJfp9O083277; Fri, 24 Jan 2025 19:41:51 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:41:51 GMT Message-Id: <202501241941.50OJfp9O083277@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: 813f244b27eb - main - ps3disk.c: Rewrite ps3disk_transfer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 813f244b27eba29aebaad0b725f30c58216bfab9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=813f244b27eba29aebaad0b725f30c58216bfab9 commit 813f244b27eba29aebaad0b725f30c58216bfab9 Author: Chattrapat Sangmanee AuthorDate: 2024-10-16 14:49:22 +0000 Commit: Warner Losh CommitDate: 2025-01-24 19:40:34 +0000 ps3disk.c: Rewrite ps3disk_transfer This function is bugged since the beginning, but it never hit because its variable doesn't allow. However, since commit a77e1f0f81df5fa3b4a6a38728ebace599cb18a4 it happen now. First, it assume that ds_len will always equal to real user requested size. So it being used for sector count calculation. This is no longer true, and will fail if attempt to read last few sectors. Use bp->bio_length instead. Second, this being a loop is pointless because nsegs will never be > 1 as specified at bus_dma_tag_create() call. And all it doing is to repeat very same command again but with different ds_addr. Since bio_driver2 tag ident pointer are being reused, the result will be discarded at ps3disk_intr(). Signed-off-by: Chattrapat Sangmanee Reviewed by: imp,mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1414 --- sys/powerpc/ps3/ps3disk.c | 96 +++++++++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/sys/powerpc/ps3/ps3disk.c b/sys/powerpc/ps3/ps3disk.c index 0931e6aad58b..4d9976ecccee 100644 --- a/sys/powerpc/ps3/ps3disk.c +++ b/sys/powerpc/ps3/ps3disk.c @@ -588,9 +588,10 @@ ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, int error) struct bio *bp = (struct bio *)(arg); struct ps3disk_softc *sc = (struct ps3disk_softc *)bp->bio_disk->d_drv1; struct ps3disk_region *rp = &sc->sc_reg[bp->bio_disk->d_unit]; + bus_dma_segment_t *seg = &segs[0]; uint64_t devid = ps3bus_get_device(sc->sc_dev); - uint64_t block; - int i, err; + uint64_t block, bio_length, sector_op_count; + int err; /* Locks already held by busdma */ PS3DISK_ASSERT_LOCKED(sc); @@ -603,49 +604,62 @@ ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, int error) return; } + /* supports only 1 segment */ + + KASSERT(nsegs == 1, + ("nsegs must be 1!, %d", nsegs)); + block = bp->bio_pblkno; - for (i = 0; i < nsegs; i++) { - KASSERT((segs[i].ds_len % sc->sc_blksize) == 0, - ("DMA fragments not blocksize multiples")); - - if (bp->bio_cmd == BIO_READ) { - err = lv1_storage_read(devid, rp->r_id, - block, segs[i].ds_len/sc->sc_blksize, - rp->r_flags, segs[i].ds_addr, - (uint64_t *)&bp->bio_driver2); - } else { - bus_dmamap_sync(sc->sc_dmatag, - (bus_dmamap_t)bp->bio_driver1, - BUS_DMASYNC_PREWRITE); - err = lv1_storage_write(devid, rp->r_id, - block, segs[i].ds_len/sc->sc_blksize, - rp->r_flags, segs[i].ds_addr, - (uint64_t *)&bp->bio_driver2); - } + bio_length = bp->bio_length; - if (err) { - if (err == LV1_BUSY) { - bioq_remove(&sc->sc_bioq, bp); - bioq_insert_tail(&sc->sc_deferredq, bp); - } else { - bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) - bp->bio_driver1); - bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) - bp->bio_driver1); - device_printf(sc->sc_dev, "Could not read " - "sectors (0x%08x)\n", err); - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; - bioq_remove(&sc->sc_bioq, bp); - biodone(bp); - } - - break; - } + /* ds_len always >= bio_length */ + + KASSERT((seg->ds_len % bio_length) == 0, + ("ds_len not bio_length multiples, %lu, %lu", + (uint64_t)seg->ds_len, bio_length)); - DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); + KASSERT((bio_length % sc->sc_blksize) == 0, + ("bio_length not blocksize multiples, %lu, %lu", + bio_length, (uint64_t)sc->sc_blksize)); + + sector_op_count = bio_length / sc->sc_blksize; + + if (bp->bio_cmd == BIO_READ) { + err = lv1_storage_read(devid, rp->r_id, + block, sector_op_count, + rp->r_flags, seg->ds_addr, + (uint64_t *)&bp->bio_driver2); + } else { + bus_dmamap_sync(sc->sc_dmatag, + (bus_dmamap_t)bp->bio_driver1, + BUS_DMASYNC_PREWRITE); + + err = lv1_storage_write(devid, rp->r_id, + block, sector_op_count, + rp->r_flags, seg->ds_addr, + (uint64_t *)&bp->bio_driver2); } + + if (err) { + if (err == LV1_BUSY) { + bioq_remove(&sc->sc_bioq, bp); + bioq_insert_tail(&sc->sc_deferredq, bp); + } else { + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + device_printf(sc->sc_dev, "Could not read " + "sectors (0x%08x)\n", err); + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + } + } + + DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", + __func__, sc->sc_bounce_tag); } #ifdef PS3DISK_DEBUG From nobody Fri Jan 24 19:49:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfpKh51Hsz5lqPv; Fri, 24 Jan 2025 19:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpKh4TKTz3VLv; Fri, 24 Jan 2025 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLuW71iGqOh7O5uZJyEoftCBRg3YlEdXhKfSpQ0bwiI=; b=ow11nMovEXKdz/45HUMQijZpvNIChZFoNcI7T0lKG3oHNaFc8PFP6EdVjjbVd+A9pZAqDD EL8M2Ujz2xQFeQMu8WaWnJpVGABeY9q5bNe9FQgV3F71Lhq6kS66O82trZzJyYLlNmsGB/ 61VgBL1LYwf/ZRh3YDKDyt11k0v3zvXYkAW1w3P2mKW+Gqe+Aa9Nram7hRMlOWwM4m0RXy 8+twYspZdKh4k2YBDN2ynSbIIR/5dyfT39YZWDtT+SnJ28dtWvmyRhi95m0p4Zcoob8g7g qUzTNSIZQbE0WkeENwZqrmW6/fTnWJ7tD4Eg0y8KpKMOmyV/Cu5ZYrc4pxKtLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLuW71iGqOh7O5uZJyEoftCBRg3YlEdXhKfSpQ0bwiI=; b=oQwWQHPflPj+V4YuHo0qhkujwoU5OFCE/JNh0Xd8YLnFnx7pE2JGNZ7EfC5PhzNl2kmdPk pnELuzToJzTRU2Pvfsr6XAlR8SR10kDIxeuO8OEIXheZfW2Q8hjQRRj/OAdioxX2sf+0/b is2cwdU8XW/khQaPyh0PVW8UFklpd2c+yei9+aoQPOqxNO12szljAaTQRQWpRe5A6ODt6l UwUIp8xK7++mne+EBbKp/N0D8q0gI9a6OdbDn7+XGQbfECkuFjNfjHYfPM7hEBjDfMlxLx l/j7iNnFZzFhxGrSGBfHyrze9BxD2SAMERfaUxW9AquY4vN7VyCMVlcnCkqcJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748152; a=rsa-sha256; cv=none; b=wzhsuI/2JxSp0RroQiPeytfWzBCoSNJkJNe0SxjrsNWCPxxcqqK3p9Bp1DbELFxwAW1kZ8 gwuLVsEC0iIUpuaC4GOlJphPc6h8BQc2pVl9I0PyiPx8OwQl47pCZXtv9mfcR7AQOmRHWa AoLQC/94SarD+/vtYWShvsAwNRZ/Q/NbKwv3965LbUgdcIkJGldUP5xpUoD4qXf+RAJSso j+sor01jY+DT/kGDDy3rKc1c3VfA++8EqCWV+jKAOhWCbCr5faE/vLrrJMYayzSYYugZ3P 6Ni5SU+SDA65OS0yMiRCjoQEQ9g3QF/wXUSjaZ3jHT0PUNJKoUJNLZcXfvogrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpKh43Sfzg6k; Fri, 24 Jan 2025 19:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJnCsd087743; Fri, 24 Jan 2025 19:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJnCDV087740; Fri, 24 Jan 2025 19:49:12 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:49:12 GMT Message-Id: <202501241949.50OJnCDV087740@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: 2dd706b9c41e - stable/14 - libelftc: Fix a typo - FreeBSD's riscv port is little-endian. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 commit 2dd706b9c41ec78d5c1f99aba52856dbaa2265c8 Author: Joseph Koshy AuthorDate: 2024-12-31 17:53:16 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:48:56 +0000 libelftc: Fix a typo - FreeBSD's riscv port is little-endian. This change brings the descriptor for target "elf64-riscv-freebsd" in line with its documentation. I missed this somehow when reviewing https://reviews.freebsd.org/D20768. Reported by: Haowu Ge (on elftoolchain-developers) Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D48271 (cherry picked from commit aac74b708b3dc49466b0fb5365bc2923b7727a1c) --- contrib/elftoolchain/libelftc/libelftc_bfdtarget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c index 5bbf89ba78fa..3f2c23708549 100644 --- a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c +++ b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c @@ -334,7 +334,7 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { { .bt_name = "elf64-riscv-freebsd", .bt_type = ETF_ELF, - .bt_byteorder = ELFDATA2MSB, + .bt_byteorder = ELFDATA2LSB, .bt_elfclass = ELFCLASS64, .bt_machine = EM_RISCV, .bt_osabi = ELFOSABI_FREEBSD, From nobody Fri Jan 24 19:50:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfpMc5qynz5lqcR; Fri, 24 Jan 2025 19:50: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpMc5MQKz3W59; Fri, 24 Jan 2025 19:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRsBjXFHkSR6Rs2Pjp45BzstHC1WBhk9QLdQB19KjdI=; b=B9xN7opoivyLKL4DWBP1psnS3cFnK5mJpb3WPdqY0ahuyyraCZl7bx/R9P8/1/XqN9OgRB YIBg6FqKHFPwBvWoL57E7Rhl6gxvaeKcnK9AvGK+oOvLBkQLpXhmOmv0mNTBQPBJAVIBul BW5AD1DtldOIiEh3MtW9Ok0KWwjwAQQaYgo0YXwqGnle4g31PBAIGvUfV3NrGXYDUC1Ycv d5OsU6A/TmLpTfiPiXiZK7pydZ/0BPXxIs2Rf4qFmqNzU6JwJ2T33OzBVkOYZbNuLRaEF5 DpVDODUl76emZDahuEsFaFhm7bYpXjdHsDLFzPBZrlUGuJuPzABc455Z5+QH0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oRsBjXFHkSR6Rs2Pjp45BzstHC1WBhk9QLdQB19KjdI=; b=CikOFzZ9WHlD+qOobDNr83kHJ23g6BKGhJpR4Opmg96K70gAkSviAhOmMTn/xTfuNPWlTa sUrCSXFdhHJ+XaBDMeQFpKdLm+sfH0a5z6sw4js3saaTuVN8+cs6HAmw5TjuTVthYF4iBe L/o31XsyCyjPIijZgOJub//F+XkyEfpFx42efknaw99iPVL7yDtV0flYL2c7H6kDAeTMUn W0asU7NRFlTKsaMOXsXtazHRgwFejhci+uV/CWmytTRu8/JLw44yjv6vx90KIBSr4Lf2K/ NhXPTAwXV8Ri5b5zNTCSZgb8AO6Bji/8zbaQBGu5/h9RrUiK3Bsd0RLLr0Ostg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748252; a=rsa-sha256; cv=none; b=Kr3gO3qYVaK7M05DZUUG/P4RbR3czNIX/Gq5rXuz8cw0BWRJStN74WNN3d9hhvLL0zAECq EFQuuRdNL1BQneuD59ptiGgy9DBGgdXUzVdp9XnRs0fvmt78naPomIhlVB7j36on6vawVl 5LpOG2LMClBqQc3T9cs2u3CqiPuqQae1MG/02A8uoDbSw4jh64ofEZ6I5WZEZrDaSPwJpC oeUjhtG3MTQEA6RFd9cWD1h718JmE09XAqDVVZEXjMJtqv84WGRJ0uXZ/mX+gVyihM1Z/B 522V0granUjPEkV5Uyvcu28SXLO29ad2OPeRUGQUiZ2SzbX8s7+fChrhmsx7rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpMc4xv2zg6x; Fri, 24 Jan 2025 19:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJoqtZ097965; Fri, 24 Jan 2025 19:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJoqB4097962; Fri, 24 Jan 2025 19:50:52 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:50:52 GMT Message-Id: <202501241950.50OJoqB4097962@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: 880f1dee7ea2 - stable/14 - tcp_wrappers: Use default C standard version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 commit 880f1dee7ea25053a1f12effb1ab6dfb5d0321f7 Author: Minsoo Choo AuthorDate: 2024-04-06 00:30:50 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:50:38 +0000 tcp_wrappers: Use default C standard version Reviewed by: emaste, arichardson, jhb Differential Revision: https://reviews.freebsd.org/D43236 (cherry picked from commit 2cadbe468a8e8aef193429565b729d34ec48b266) --- contrib/tcp_wrappers/tcpd.c | 1 + libexec/tcpd/Makefile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/tcpd.c b/contrib/tcp_wrappers/tcpd.c index a0ba42f71f86..164132570a36 100644 --- a/contrib/tcp_wrappers/tcpd.c +++ b/contrib/tcp_wrappers/tcpd.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32"; int allow_severity = SEVERITY; /* run-time adjustable */ int deny_severity = LOG_WARNING; /* ditto */ +int main(int argc, char **argv) { struct request_info request; diff --git a/libexec/tcpd/Makefile b/libexec/tcpd/Makefile index 408db9c39744..892855d1d8a7 100644 --- a/libexec/tcpd/Makefile +++ b/libexec/tcpd/Makefile @@ -7,7 +7,6 @@ PACKAGE= tcpd PROG= tcpd MAN= tcpd.8 -CSTD?= c89 CFLAGS+=-DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" \ -DSEVERITY=LOG_INFO -DRFC931_TIMEOUT=10 \ -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\" \ From nobody Fri Jan 24 19:57:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfpW9348zz5lr1Q; Fri, 24 Jan 2025 19:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfpW91LvPz3XHD; Fri, 24 Jan 2025 19:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9BFLxUv3qZPqZwhW50Q+woLbATuP1JlemHkyzHrNU4=; b=R1EfQOmVaISPoNV76Z97DZI8CJOn4iyJNbdoC2H5Xy+YRlxl5cqiIgvD3TVgtoQaoBiYWJ WoUfxJFugdVp8Eak7047/swdu71wdytblDqkcndilMTOgFpY2bjE5PC11fZXxqYES9Qqy8 phQAb36cDWhoV4hpptgNgTyjB9NWC657lo+FMM5CNEv6yTsuuKUW+tukJwkpZEBFMqfFul 6t69vABcom5sV2UhCJYkW19Qf6Jkq0flY59zvtjmm6Y7dmBdAef4ToEvRUiKcJsMPr1J10 Vdu7/z2VLxGUG38/B6pzbqIVuarNANPPLY4EwT//7E+4CCrna8+Z+aY9aq93+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737748645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9BFLxUv3qZPqZwhW50Q+woLbATuP1JlemHkyzHrNU4=; b=ueQ1vCXrsc7XQoiJ610t8O06uSd0+RXHaiYdN8ho8efz5cg39gsNMqG9DWsE7JgQyfSewO bNBXiYTHICgQHR8p1WZr9uU2uOIyJdXA6CDG872KjMiyMXRhmFpM5t7n1lB1cYkWjZTfOG kUGO87Yl0mkjlvZ1kZmX3VXdxA4WO8Ods0shWtWRD2rrg+e1Y22WTV26EUuI0AUKNuIav3 1Bn1kXcTMW52P9OpEvEHDIPrYqhFB760WLzlqhPiuMEhK4T5sHFk6gPXd2GH9tBTZmPjPQ /CBjonhU1So6KHlchO5CCU+V+4CMe0c6ysDNdP5BGvZ1WDB2gIUqFWvNMazm7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737748645; a=rsa-sha256; cv=none; b=uvzUirEd0rLGFPAUPCxKYHRigOpVEmk2fRypZ0Rr90FRpgwjR4A1wKuJlsil5rxzzsvgOx fvCizBRpevbkKGV8iKHi8EsBBJsRNNRCm5n9/fl8pyU+tXgDjM8Y9VQLLCuJg0FNuIrUG2 qvB+mZVv4La7VMO7M012OtaCT8VOtS/yEauY3KHhByYy8VFoo9T70kPijn6ge143K3qIAl SZ3ZXxrPs6/PrZGMmFequgX+/mFgZPoPieEeJp/BTFexZR70KyBHcBsNqm8sOPxWrIt/Yk M//uu+JLVHIcPYltf3HhWprH69fJVX2YooinbnM7TidwmIiWst2xlayo2JU82w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfpW90Rf9zgm9; Fri, 24 Jan 2025 19:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OJvOE4006353; Fri, 24 Jan 2025 19:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OJvOeD006349; Fri, 24 Jan 2025 19:57:24 GMT (envelope-from git) Date: Fri, 24 Jan 2025 19:57:24 GMT Message-Id: <202501241957.50OJvOeD006349@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: 26336203d32c - stable/14 - contrib/spleen: Update to Spleen 2.1.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/14 X-Git-Reftype: branch X-Git-Commit: 26336203d32c7936d7743cbec20f2da733db227e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=26336203d32c7936d7743cbec20f2da733db227e commit 26336203d32c7936d7743cbec20f2da733db227e Author: Ed Maste AuthorDate: 2025-01-21 02:55:47 +0000 Commit: Ed Maste CommitDate: 2025-01-24 19:57:10 +0000 contrib/spleen: Update to Spleen 2.1.0 Merge commit 'e364562a4012d6d9cb334795b97e929cfa2a5dff' (cherry picked from commit 18270a76e24e7f17f533a7a683eed3327a3c135a) --- contrib/spleen/ChangeLog | 31 + contrib/spleen/LICENSE | 2 +- contrib/spleen/README.md | 69 +- contrib/spleen/spleen-12x24.bdf | 2368 ++- contrib/spleen/spleen-16x32.bdf | 19138 +++++++++++--------- contrib/spleen/spleen-32x64.bdf | 36002 +++++++++++++++++++++----------------- contrib/spleen/spleen-5x8.bdf | 8 +- contrib/spleen/spleen-6x12.bdf | 1456 +- contrib/spleen/spleen-8x16.bdf | 10156 ++++++----- 9 files changed, 39463 insertions(+), 29767 deletions(-) diff --git a/contrib/spleen/ChangeLog b/contrib/spleen/ChangeLog index dd49696db5f4..bbe2cd4d422e 100644 --- a/contrib/spleen/ChangeLog +++ b/contrib/spleen/ChangeLog @@ -1,3 +1,34 @@ +Spleen 2.1.0 (2024-03-22) + +- Document how wsfont header files (for OpenBSD and NetBSD) are generated +- Add base cyrillic (basic alphabet + most used extended) characters (Thanks + Slava Voronzoff!) +- Fix latin small letter 'u' smoothing in the 32x64 version +- Fix smoothing on more variants of 'u' in the 32x64 version + + + +Spleen 2.0.2 (2023-12-25) + +- Fix MALE and FEMALE character ordering in the 16x32 and 32x64 + versions (Thanks Mike Cui) +- Update README to add a link to the Alpine Linux package + + + +Spleen 2.0.1 (2023-11-17) + +- Add a 'com' target to generate SPLEEN.COM, the DOS version of Spleen +- Also add 'com' in the 'all' target +- Update README to add a link to the Guix package +- In the Spleen loader for DOS, put 4C00h in ax and not 4Ch +- README.md: add Gentoo package link +- Switch to using Oxipng as it compresses even more than OptiPNG +- Add a new FAQ file answering frequently asked questions about Spleen +- Remove C0 control characters range in the 8x16, 16x32, and 32x64 versions + + + Spleen 2.0.0 (2023-05-28) - Add full support for CP437 (IBM PC) in the 8x16, 16x32, and 32x64 versions diff --git a/contrib/spleen/LICENSE b/contrib/spleen/LICENSE index 7f639bf61a6d..4387948e8467 100644 --- a/contrib/spleen/LICENSE +++ b/contrib/spleen/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2023, Frederic Cambus +Copyright (c) 2018-2024, Frederic Cambus All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/contrib/spleen/README.md b/contrib/spleen/README.md index ce2e6addc305..a80773ec8420 100644 --- a/contrib/spleen/README.md +++ b/contrib/spleen/README.md @@ -104,6 +104,9 @@ Spleen packages are available for: - [Debian][15] - [Ubuntu][16] - [MacPorts][17] +- [Guix][18] +- [Gentoo][19] +- [Alpine Linux][20] ## Manual installation @@ -114,6 +117,8 @@ Clone the repository, convert the files to the Portable Compiled Format Alternatively, release tarballs provide PCF files for each size. +OTB versions are also available. + ### macOS macOS users should use the `.dfont` files provided in the release tarballs. @@ -150,7 +155,7 @@ Update **.Xdefaults** and add one of the following directives: Launch **xterm**. Ubuntu has bitmap fonts support disabled by default, instructions to enable -it are available [here][18]. +it are available [here][21]. ### Linux console @@ -178,9 +183,12 @@ For example, to load Spleen 16x32: ### OpenType versions Spleen release tarballs now contains OTF versions generated automatically -from the BDF files, using [bdf2sfd][19]. Each font has a different name, +from the BDF files, using [bdf2sfd][22]. Each font has a different name, allowing them to be installed alongside. +Please note that OTF versions should be used as last resort, always prefer +bitmap versions if they are supported on your platform. + They should be used in the exact size specified below, with anti-aliasing disabled. @@ -203,26 +211,27 @@ Spleen is developed by Frederic Cambus. ## Resources -- [Spleen - Monospaced bitmap fonts][20] (2018) -- [New console font Spleen made default][21] (2019) -- [NetBSD, CTWM, and Spleen][22] (2021) +- [Spleen - Monospaced bitmap fonts][23] (2018) +- [New console font Spleen made default][24] (2019) +- [NetBSD, CTWM, and Spleen][25] (2021) +- [Spleen 2.0.0 released with full CP437 support][26] (2023) GitHub: https://github.com/fcambus/spleen ## Trivia -- Spleen was imported in the OpenBSD src tree in [September 2018][23] -- Spleen is the default font for OpenBSD consoles since [January 2019][24] -- Spleen was imported in the NetBSD src tree in [March 2019][25] -- Spleen 12x24 was used in the Haiku [kernel debugger][26] (on high resolution +- Spleen was imported in the OpenBSD src tree in [September 2018][27] +- Spleen is the default font for OpenBSD consoles since [January 2019][28] +- Spleen was imported in the NetBSD src tree in [March 2019][29] +- Spleen 12x24 was used in the Haiku [kernel debugger][30] (on high resolution displays) from May 2021 to June 2022 -- Spleen was imported in the FreeBSD base system in [May 2023][27] -- [msTERM][28], a Terminal program for MailStation devices uses Spleen 5x8 -- [FBInk][29], a library to print text & images to an eInk Linux framebuffer +- Spleen was imported in the FreeBSD base system in [May 2023][31] +- [msTERM][32], a Terminal program for MailStation devices uses Spleen 5x8 +- [FBInk][33], a library to print text & images to an eInk Linux framebuffer embeds Spleen 16x32 -- [U8g2][30], a monochrome graphics library for embedded devices includes +- [U8g2][34], a monochrome graphics library for embedded devices includes all Spleen sizes -- [Ansilove][31], an ANSI and ASCII art to PNG converter includes Spleen +- [Ansilove][35], an ANSI and ASCII art to PNG converter includes Spleen [1]: https://www.cambus.net/content/2018/09/spleen-hello.png [2]: https://www.cambus.net/content/2018/09/spleen-etranger.png @@ -241,17 +250,21 @@ GitHub: https://github.com/fcambus/spleen [15]: https://packages.debian.org/search?keywords=spleen [16]: https://packages.ubuntu.com/search?keywords=spleen [17]: https://ports.macports.org/port/font-spleen/ -[18]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts -[19]: https://github.com/fcambus/bdf2sfd -[20]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ -[21]: https://undeadly.org/cgi?action=article;sid=20190110064857 -[22]: https://www.cambus.net/netbsd-ctwm-and-spleen/ -[23]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H -[24]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm -[25]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB -[26]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 -[27]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 -[28]: https://github.com/jcs/msTERM -[29]: https://github.com/NiLuJe/FBInk -[30]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen -[31]: https://www.ansilove.org +[18]: https://packages.guix.gnu.org/packages/font-spleen/ +[19]: https://packages.gentoo.org/packages/media-fonts/spleen +[20]: https://pkgs.alpinelinux.org/packages?name=font-spleen +[21]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts +[22]: https://github.com/fcambus/bdf2sfd +[23]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ +[24]: https://undeadly.org/cgi?action=article;sid=20190110064857 +[25]: https://www.cambus.net/netbsd-ctwm-and-spleen/ +[26]: https://www.cambus.net/spleen-2.0.0-released-with-full-cp437-support/ +[27]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H +[28]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm +[29]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB +[30]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 +[31]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 +[32]: https://github.com/jcs/msTERM +[33]: https://github.com/NiLuJe/FBInk +[34]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen +[35]: https://www.ansilove.org diff --git a/contrib/spleen/spleen-12x24.bdf b/contrib/spleen/spleen-12x24.bdf index 24ae2e78f4b2..1c4fa12beb9a 100644 --- a/contrib/spleen/spleen-12x24.bdf +++ b/contrib/spleen/spleen-12x24.bdf @@ -1,11 +1,11 @@ STARTFONT 2.1 COMMENT /* -COMMENT * Spleen 12x24 2.0.0 -COMMENT * Copyright (c) 2018-2023, Frederic Cambus +COMMENT * Spleen 12x24 2.1.0 +COMMENT * Copyright (c) 2018-2024, Frederic Cambus COMMENT * https://www.cambus.net/ COMMENT * COMMENT * Created: 2018-08-15 -COMMENT * Last Updated: 2023-04-28 +COMMENT * Last Updated: 2024-03-22 COMMENT * COMMENT * Spleen is released under the BSD 2-Clause license. COMMENT * See LICENSE file for details. @@ -18,7 +18,7 @@ FONTBOUNDINGBOX 12 24 0 -5 STARTPROPERTIES 20 FAMILY_NAME "Spleen" WEIGHT_NAME "Medium" -FONT_VERSION "2.0.0" +FONT_VERSION "2.1.0" FOUNDRY "misc" SLANT "R" SETWIDTH_NAME "Normal" @@ -33,11 +33,11 @@ CHARSET_ENCODING "1" MIN_SPACE 12 FONT_ASCENT 19 FONT_DESCENT 5 -COPYRIGHT "Copyright (c) 2018-2023, Frederic Cambus" +COPYRIGHT "Copyright (c) 2018-2024, Frederic Cambus" DEFAULT_CHAR 32 _GBDFED_INFO "Edited with gbdfed 1.6." ENDPROPERTIES -CHARS 840 +CHARS 916 STARTCHAR SPACE ENCODING 32 SWIDTH 500 0 @@ -11880,6 +11880,2362 @@ BITMAP 0000 0000 ENDCHAR +STARTCHAR COMBINING BREVE +ENCODING 774 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR COMBINING DIAERESIS +ENCODING 776 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER IO +ENCODING 1025 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +7F80 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +ENCODING 1030 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +3FC0 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +3FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER YI +ENCODING 1031 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +30C0 +30C0 +0000 +3FC0 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +0600 +3FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER SHORT U +ENCODING 1038 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +6060 +6060 +6060 +6060 +6060 +6060 +3060 +1FE0 +0060 +0060 +0060 +0060 +0060 +00E0 +7FC0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER A +ENCODING 1040 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1F80 +30C0 +6060 +6060 +6060 +6060 +6060 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER BE +ENCODING 1041 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +6000 +6000 +6000 +6000 +6000 +6000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER VE +ENCODING 1042 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER GHE +ENCODING 1043 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER DE +ENCODING 1044 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +0FC0 +18C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +30C0 +3FC0 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER IE +ENCODING 1045 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +7F80 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ZHE +ENCODING 1046 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6660 +6660 +6660 +6660 +6660 +6660 +36C0 +1F80 +36C0 +6660 +6660 +6660 +6660 +6660 +6660 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ZE +ENCODING 1047 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +00C0 +0060 +0060 +0060 +00C0 +1F80 +00C0 +0060 +0060 +0060 +0060 +0060 +00C0 +7F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER I +ENCODING 1048 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +60E0 +60E0 +61E0 +61E0 +6360 +6360 +6660 +6660 +6C60 +6C60 +7860 +7860 +7060 +7060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER SHORT I +ENCODING 1049 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +1980 +1980 +0F00 +0000 +6060 +60E0 +60E0 +61E0 +61E0 +6360 +6360 +6660 +6660 +6C60 +6C60 +7860 +7860 +7060 +7060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER KA +ENCODING 1050 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +6060 +6060 +6060 +6060 +60C0 +6180 +7F00 +6180 +60C0 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EL +ENCODING 1051 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EM +ENCODING 1052 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +70E0 +79E0 +6F60 +6660 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER EN +ENCODING 1053 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER O +ENCODING 1054 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1F80 +30C0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +30C0 +1F80 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER PE +ENCODING 1055 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7FE0 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +6060 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ER +ENCODING 1056 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +7F80 +60C0 +6060 +6060 +6060 +6060 +60C0 +7F80 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +0000 +0000 +0000 +0000 +0000 +ENDCHAR +STARTCHAR CYRILLIC CAPITAL LETTER ES +ENCODING 1057 +SWIDTH 500 0 +DWIDTH 12 0 +BBX 12 24 0 -5 +BITMAP +0000 +0000 +0000 +0000 +1FE0 +3000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +6000 +3000 +1FE0 +0000 +0000 +0000 +0000 *** 88287 LINES SKIPPED *** From nobody Fri Jan 24 20:17:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfpxs3x8wz5ls20; Fri, 24 Jan 2025 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfpxs3J39z3Ytr; Fri, 24 Jan 2025 20:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737749825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBgAxX5xw8tSQ/YN0O+Trn0lNrZyp5HJJ120Vl7FV8E=; b=UBvM2+uwVy+oyeFcQ5ke9IzlyFau4LDB9qz5ldvHo+aK1xvbckZTGyPbXQxPBAlRDKd4yY KRfGIVeu1EL2P+f2qzfSiaNPf5jennlVkykUeuKzeo1TCighehEON1fAgLcHE9eyTqfDFT QwL/etO6Cb+cnQF0TLatuWx/27zPEjHrOImSRvsHx0HOZ+eFYajxKvRblTmLDFc9SVgjWx f/yXQGLFctmqSjRodLfr/NOh+zKySDh/H1f2HAsj258uIUw78d/oaQVntTCHhD0uPF5ynA /Ym0l3TJcMqTa5QTYrfZR9Wm3AyurnV7JnaauAJ/jCmdWdsaiOg3IU9N4Qewcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737749825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBgAxX5xw8tSQ/YN0O+Trn0lNrZyp5HJJ120Vl7FV8E=; b=atMjLlHxHvoFV57VdvlWOgY73EO6efrHfLLxq5DPLJnDJ+WOQqT341znIaOzQlN1kAx5Ly hnqA4/FaR1eEhICA553QG2zVQ6CPO7DQhUsDV/+pOGGAcgnoz6XLGdgxi1QZurbuaYxyKx UEdbhaQxG0YKinoU47kINSW1msYICOACPlqPAeVt9W9J9xeXAOPeIRnwNKC8/RbEnTgzF4 6vsoapY+CPNeAwdeugIQMNncsUl5kg0/VdCY5wLq+W0muronR8hJSppT/3YO5/FHFNtRLL 2yAV/6/HSPpMD1w6I5v0MQZTPSnGU1dE43McUiu/d9Qs1wrvric3UNKlB876MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737749825; a=rsa-sha256; cv=none; b=gtvoZmQFpGT+s8sKTtwB2XIWGqUdm0C2Zfg4DRWNRQtZazpno7HqiAG488TkDlKeVavUBq Adb6MmxuKyu3VWE3dvfMi4WIrKgQVuwt8hro2UTPmT1/WEvqfY5nIOaW098KnJSQjfBRze Az7CfMNeT9ylILuCTcfuLfTPqBwCWRgtswdP9a73yiWxKWEEUGzYEw1TTtkfklzTAPkDxf SFLlaVhiLPaORHQLCyG5wa5asaFHXHD7v/nMq4TRxJhAdZd7CjGxjUlEK8E50jhI4S8WIZ JIxxCQcZnJ9Ywm77TnTFAEiwvFokxgqkA4MW707j6ONyf6FLs0KvRUh59wX+oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfpxs2hlMzgqD; Fri, 24 Jan 2025 20:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OKH5ll044489; Fri, 24 Jan 2025 20:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OKH5ui044486; Fri, 24 Jan 2025 20:17:05 GMT (envelope-from git) Date: Fri, 24 Jan 2025 20:17:05 GMT Message-Id: <202501242017.50OKH5ui044486@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: c81417289606 - main - open.2: update description for O_PATH List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: c81417289606ca9c808417672c603b5e233856de Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c81417289606ca9c808417672c603b5e233856de commit c81417289606ca9c808417672c603b5e233856de Author: CismonX AuthorDate: 2025-01-03 10:52:34 +0000 Commit: Mark Johnston CommitDate: 2025-01-24 20:15:09 +0000 open.2: update description for O_PATH - Add fstatfs(), fchdir(), fchroot(), extattr_*_fd(), cap_*_get(), cap_*_limit() to the list of syscalls that can take an O_PATH fd. - Remove readlinkat() from the list, since it is already discussed in the first few lines of the paragraph. It was originally added to the list when readlinkat() adds support for non-dir fd with an empty relative path (as if with AT_EMPTY_PATH), however, such use case is also discussed in the next paragraph. - Add funlinkat() to the list, since it accepts an extra fd (of the file to be unlinked), which is worth extra mentioning. - Fix a syntax issue which causes a bogus space to be rendered before a closing parentheses. Signed-off-by: CismonX Reviewed by: markj, jhb MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1564 --- lib/libsys/open.2 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index fe1ad757b5b0..9ad5440bf239 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -393,7 +393,12 @@ but advisory locking is not allowed .It Xr dup 2 .It Xr close 2 .It Xr fstat 2 +.It Xr fstatfs 2 +.It Xr fchdir 2 +.It Xr fchroot 2 .It Xr fexecve 2 +.It Xr funlinkat 2 +can be passed as the third argument .It Dv SCM_RIGHTS can be passed over a .Xr unix 4 @@ -403,16 +408,23 @@ message .It Xr kqueue 2 only with .Dv EVFILT_VNODE -.It Xr readlinkat 2 .It Xr __acl_get_fd 2 .It Xr __acl_aclcheck_fd 2 +.It Xr extattr 2 +.It Xr capsicum 4 +can be passed to +.Fn cap_*_limit +and +.Fn cap_*_get +system calls (such as +.Xr cap_rights_limit 2 ) . .El .Pp Other operations like .Xr read 2 , .Xr ftruncate 2 , and any other that operate on file and not on file descriptor (except -.Xr fstat 2 ), +.Xr fstat 2 ) , are not allowed. .Pp A file descriptor created with the From nobody Fri Jan 24 20:27:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfqB924Z1z5lsRc; Fri, 24 Jan 2025 20:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfqB91L52z3bfZ; Fri, 24 Jan 2025 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737750465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e96JOJ6CBQyGlCgjIAD0IBn1INHUrj/zPgIzP99IrxU=; b=JL3JeXnHf3h4epzJ2OM2jdbYFQBvHccOhUFU93arUyDd/Lq9oIwWzpqGukHuFv8ensxW11 pL9wHcJHn6E2hS0ASTaIuVi14DsbELd/Tu5mi4Du2jKYlc9HcfmX0zad8wHxOHsQEytyhm ot86LwEihcNLjMBb+x4JgFTyy5mVMFgZDLi5YJGr1iinurcWlOPHzc7txOKK9MpFwyISfC YdetNCh+VV8QWZvZm2B2xdQTE+IziW5oy7CbYLI9z8+eove3dhYL3WmLris3UwEMsCL5Pu 6XuTkj3l60YcVIHIcakAW83QH7PSP8Zt4f+1Zko1CzQS8uRJ6S/2hs89Ci1jyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737750465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e96JOJ6CBQyGlCgjIAD0IBn1INHUrj/zPgIzP99IrxU=; b=lUQDj2pvG7NEM38JkliTyQ6jnGufu0CeLeO2B2yz5MB94ttBZkJbp9WWP8ysfAbByfwwXK yY147U0KU1WPwQhwGYlqE92UKW4s04sM80JP1uhxseljq+oFKJOBJzozgvgxGoGzeEaLwu 5FG2WkogKIU2U4Phj7XQQ2/jqL0++Y5tPMhqKihxspg0FfC7TZZqPfJP07l9NI5WgBkApl mAoPtrsEfot+osrYeDVQW4XXzk7xPcpaJxKp/g+XMG7BKdMry5M1Mblc/MKy9k9FUhDsda EMDXkzJL9AgnNe/p+vwOTYFbuTvPy0fScwL9jpyO2SDbKyB5SUmTog+E5kKcxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737750465; a=rsa-sha256; cv=none; b=haqMAa6wkFbv0lz/vr+BSArhU8eFtV06Yz92LqyoaQcwIPO0X+rLQpfet5Mm9yF5LAqi+F FDqT//3t2kyeE6JhWq9iU6X322TgBgN0S4qQ4W0nhkhpPZfPVjUussqnyn3LlNNc/0PSwe IwVJhJfKuZrdRS0l5JnPpSOKA0gkaD1Ooo7Qf5NVOXEmqQ21Qjb1y3lkjH1TB6e7pHS3A2 r4+giF4/kCnBLxh97InNN4gk60REMwKBxh2BOcjGFj81b5XHiWBZRuc2//7Pb9NIrDkva2 Sb6R+YNqz4QwYSbkv0QD28hZx0ORH/x/mFo8J/h47Otp/89Hbz1Ja1f83nMAzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfqB90Ywkzh7Y; Fri, 24 Jan 2025 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OKRiU3064629; Fri, 24 Jan 2025 20:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OKRiIe064626; Fri, 24 Jan 2025 20:27:44 GMT (envelope-from git) Date: Fri, 24 Jan 2025 20:27:44 GMT Message-Id: <202501242027.50OKRiIe064626@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: a9a6a51edac1 - main - github: Add new checklist workflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: a9a6a51edac13aaff5517dd602272152efa6d7bd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a9a6a51edac13aaff5517dd602272152efa6d7bd commit a9a6a51edac13aaff5517dd602272152efa6d7bd Author: Ahmad Khalifa AuthorDate: 2025-01-05 05:01:07 +0000 Commit: Ed Maste CommitDate: 2025-01-24 20:27:08 +0000 github: Add new checklist workflow Add a new 'checklist' workflow that checks the commit messages on pull requests. Currently, the workflow creates a comment on the pull request if any of these conditions are hit: - Missing Signed-off-by - Malformed Signed-off-by - Bad email (i.e *noreply*) Reviewed by: emaste, imp Pull request: https://github.com/freebsd/freebsd-src/pull/1570 Signed-off-by: Ahmad Khalifa --- .github/workflows/checklist.yml | 106 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml new file mode 100644 index 000000000000..9734af4a1a1d --- /dev/null +++ b/.github/workflows/checklist.yml @@ -0,0 +1,106 @@ +name: Checklist + +# Produce a list of things that need to be changed +# for the submission to align with CONTRIBUTING.md + +on: + pull_request: + types: [ opened, reopened, edited, synchronize ] + +permissions: + pull-requests: write + +jobs: + checklist: + name: commit + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + # An asynchronous javascript function + script: | + /* + * Github's API returns the results in pages of 30, so + * pass the function we want, along with it's arguments, + * to paginate() which will handle gathering all the results. + */ + const comments = await github.paginate(github.rest.issues.listComments, { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + }); + + const commits = await github.paginate(github.rest.pulls.listCommits, { + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + let checklist = {}; + let checklist_len = 0; + let comment_id = -1; + + const msg_prefix = "Thank you for taking the time to contribute to FreeBSD!\n"; + const addToChecklist = (msg, sha) => { + if (!checklist[msg]) { + checklist[msg] = []; + checklist_len++; + } + checklist[msg].push(sha); + } + + for (const commit of commits) { + const sob_lines = commit.commit.message.match(/^[^\S\r\n]*signed-off-by:.*/gim); + + if (sob_lines == null && !commit.commit.author.email.toLowerCase().endsWith("freebsd.org")) + addToChecklist("Missing Signed-off-by lines", commit.sha); + else if (sob_lines != null) { + let author_signed = false; + for (const line of sob_lines) { + if (!line.includes("Signed-off-by: ")) + /* Only display the part we care about. */ + addToChecklist("Expected `Signed-off-by: `, got `" + line.match(/^[^\S\r\n]*signed-off-by:./i) + "`", commit.sha); + if (line.includes(commit.commit.author.email)) + author_signed = true; + } + + if (!author_signed) + console.log("::warning title=Missing-Author-Signature::Missing Signed-off-by from author"); + } + + if (commit.commit.author.email.toLowerCase().includes("noreply")) + addToChecklist("Real email address is needed", commit.sha); + } + + /* Check if we've commented before. */ + for (const comment of comments) { + if (comment.user.login == "github-actions[bot]") { + comment_id = comment.id; + break; + } + } + + if (checklist_len != 0) { + let msg = msg_prefix + + "There " + (checklist_len > 1 ? "are a few issues that need " : "is an issue that needs ") + + "to be fixed:\n"; + let comment_func = comment_id == -1 ? github.rest.issues.createComment : github.rest.issues.updateComment; + + /* Loop for each key in "checklist". */ + for (const c in checklist) + msg += "- " + c + "" + checklist[c].join(", ") + "\n"; + + comment_func({ + owner: context.repo.owner, + repo: context.repo.repo, + body: msg, + ...(comment_id == -1 ? {issue_number: context.issue.number} : {comment_id: comment_id}) + }); + } else if (comment_id != -1) { + github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: comment_id, + body: msg_prefix + "All issues resolved." + }); + } From nobody Fri Jan 24 20:27:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfqBB3DN8z5lsRd; Fri, 24 Jan 2025 20:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfqBB1GCdz3btP; Fri, 24 Jan 2025 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737750466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQo1Lp29qZU+vlmzvAUYnrAyCkCtbBtf9+wlu64y6DI=; b=SV+NyFpmnk4/j8ZId6zAH0OCS0jeQGoX42VhITFO42AiSYdwTmwLtSiNY+dfcMkyH7rt/0 /Q5+Hh75re7eYI0J1jqw9wlek3QaBkEjIMx2G1U017XtWJ2/gRZ0ncjpdPn3aKbXs0gp7e RwagPhG0LdmWch2veUC6ttwVMqUz2LDfXYTEKhXziZ8Xo1GtnnLUYi6o1a+OE++X6Rl+eq 7ZUT58/sOQ+IZPpv70UN8RuXf9+KTzsFc9pBCNXnbIbVFOt3naPk1/ehHmFEAxXZZrFEZL /BMynCK1t+0CkF+EeON2tFcoOsr8zm/TtEwDUSLDJhfSk3Wgq0HWsKXLLWe9mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737750466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQo1Lp29qZU+vlmzvAUYnrAyCkCtbBtf9+wlu64y6DI=; b=VQRSO24yL88x7Ig4he+rD7i/mHGtB1Gvz7Uj+qzl+YRsPkyU2QvD9I+ybmtTrSb5QHffxl YvGrEm0qwszlbvzfpQy8iC1BmFhZWy3sPSi2vu04HDrmCLbMRj6JYpEsu3k9Afzqaj8TJz sDZV+w1b6mrQD1EcoKAQhkkfxbqYbHkbKI1QesdqI1Ukb1jO33KsPDsdXZ/t5/noWSOfqz aYAB/zzjj7wLR+0yydqtK92Iq7rQBWw5vWqcH6dk9poPwGu/Dpgb6Z/Vq81aulsHeBi1mU N94++LiaLCq0JeElymLAj1K8+JpRVGKCrQ1U2utHUlH1BO1WzcRLfSW7CoIFvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737750466; a=rsa-sha256; cv=none; b=v/fRF/KYVBzOUaXtquLJHo64m2Zv3wHEvxffNFFOaS66i7ilzwJcv9MTJNvP3Pk8luFngx yU6we6CmSFUcgjiGreU8S1KakvqCMfek8ccI7LEF7IYsNsQIHtlJwN1sH8veH5AG2U9q6l dGd+1S/YBS5XSM3DtxdRpzkz8j0eyDwuOvEv/QjUmPa5RErJxGekAeQH/qxu45BR3hn4qe 8rYTTSLZ3F0lUhf+RNjcqmtQ5WawAMsKqZN1BQicK0IMJ+o8dd9oN+ro1JUfAIckbYhCiO KcrxtjZXTNh15fbsIIhAfAdzwkzWZgI4a4w6Pvl40oIMTPaRSKvX1/TPwjhntA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfqBB0q8QzgYF; Fri, 24 Jan 2025 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OKRkFr064663; Fri, 24 Jan 2025 20:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OKRkOa064660; Fri, 24 Jan 2025 20:27:46 GMT (envelope-from git) Date: Fri, 24 Jan 2025 20:27:46 GMT Message-Id: <202501242027.50OKRkOa064660@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: ca363716fc49 - main - checkstyle9.pl: Remove unneeded checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: ca363716fc492146978c8650b97862f94daab6bf Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ca363716fc492146978c8650b97862f94daab6bf commit ca363716fc492146978c8650b97862f94daab6bf Author: Ahmad Khalifa AuthorDate: 2025-01-06 01:52:06 +0000 Commit: Ed Maste CommitDate: 2025-01-24 20:27:20 +0000 checkstyle9.pl: Remove unneeded checks Both the bad email check and the signoff check are handled in the "checklist" github workflow now. Reviewed by: emaste, imp Pull request: https://github.com/freebsd/freebsd-src/pull/1570 Signed-off-by: Ahmad Khalifa --- tools/build/checkstyle9.pl | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index 5854cf613e01..b40c9810bc93 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -1253,8 +1253,6 @@ sub process { my $in_header_lines = $file ? 0 : 1; my $in_commit_log = 0; #Scanning lines before patch - my $has_sob = 0; - my $author_is_committer = 0; my $non_utf8_charset = 0; our @report = (); @@ -1450,33 +1448,6 @@ sub process { $is_patch = 1; } -# Filter out bad email addresses. - if ($line =~ /^(Author|From): .*noreply.*/) { - ERROR("Real email adress is needed\n" . $herecurr); - } - - if ($line =~ /^Author: .*[a-z-0-9]\@freebsd\.org/i) { - $author_is_committer = 1 - } - -#check the patch for a signoff: - if ($line =~ /^\s*signed-off-by:/i) { - # This is a signoff, if ugly, so do not double report. - $in_commit_log = 0; - $has_sob = 1; - - if (!($line =~ /^\s*Signed-off-by:/)) { - ERROR("The correct form is \"Signed-off-by\"\n" . - $herecurr); - $has_sob = 0; - } - if ($line =~ /^\s*signed-off-by:\S/i) { - ERROR("space required after Signed-off-by:\n" . - $herecurr); - $has_sob = 0; - } - } - # Check for wrappage within a valid hunk of the file if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { ERROR("patch seems to be corrupt (line wrapped?)\n" . @@ -2659,10 +2630,6 @@ sub process { } - if ($has_sob == 0 && $author_is_committer == 0) { - WARN("Missing Signed-off-by: line"); - } - # If we have no input at all, then there is nothing to report on # so just keep quiet. if ($#rawlines == -1) { From nobody Fri Jan 24 20:50:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfqj54m8Zz5ltlJ for ; Fri, 24 Jan 2025 20:51:05 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfqj50kbsz3dp9 for ; Fri, 24 Jan 2025 20:51:05 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3862a921123so1692579f8f.3 for ; Fri, 24 Jan 2025 12:51:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737751863; x=1738356663; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=waEJUfbRTXYqyQG2ZDsWZQGVhv+WfWD/Jf53NnWfcfs=; b=LUgdKAwf2FJahCyLIyA1BoylSXLIgUUaWeFGgnHDz6KRIHZxQ7727qjvP2G2TaWz2Q D8CqviyXhoeitmTtK5oUbFbLezDEo44Sossqudhf1GUsEcGKKXXMb9sttXPOaM8bUtkd IKWGbzNwIL9AzAIyKtVpVLZSSHWJFfr1CLAu4V0hi25iyOzKvcmX/QfDyqBRdf9P6nMU kGZVzSjJuIo16gxX2ZCMLEgqOgv3/0sUxVFxohJyYbjXs6MdRfSAiPLYhbgpB5g4B+DT O2/FhABeqECa81KXcbkngbL2/grK/8t/StK31nambbM8Y97+fsaAG7iRJEOzu2GjfW5E sjVQ== X-Forwarded-Encrypted: i=1; AJvYcCUXWneGKWFyby3b82K7Irg3/Eics8zNGxlQC7mB1a2xPmO3tH/1+jZqMXQkXovF0Y4p5h1zsIry9x8uGXFA6yvKZBWM@freebsd.org X-Gm-Message-State: AOJu0Yy6HP9SAHt3srGw62myzvQMVw0icZ3MzA5CSOtT5FCzP+9vQ4En J+MvN0Hjqjej/wFHvYj/9zsQTdgEz5pwfuBgjbniWzjmo/y+OH54ZfJmA0erXTo= X-Gm-Gg: ASbGncs1FtuOEx+YSyfXeGQidkOt9xVsVDe7j29bOezFkExObf+cl5UnQMVUGUZvqyJ RgxBuuGtCEMHece2EEjyT06LMhAtXKAXFQ41ACApmToxPebqP1iNgGksBE6okPXfcmWwRqi5ELZ t1Nx3KXvAV/4WVIEJKvRbIki2rj0tWPuPFHDggEiAPVHaho2+VEnMfjZUFODBJUU24RM3Kbx/wH ASN3cmQrpqeGEIf4hNyxrCM9ZeBkF8qEQ3SrJqO+ZT3Ghkwew7ga52Dq3lJUmkyP7MMUnbTCnAi SKnwbPR5ACWfYHugvYY= X-Google-Smtp-Source: AGHT+IEiGKN1oRRPgv1zR4Y8Crl48LCkzaF+shATYoUDI6/rFaMfz9rFR/KdNbWU+Y3F+G5NgvYn9Q== X-Received: by 2002:a05:6000:1449:b0:386:3825:2c3b with SMTP id ffacd0b85a97d-38bf5663880mr29643930f8f.18.1737751862731; Fri, 24 Jan 2025 12:51:02 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d6d7sm3757244f8f.31.2025.01.24.12.51.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2025 12:51:02 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: a9a6a51edac1 - main - github: Add new checklist workflow From: Jessica Clarke In-Reply-To: <202501242027.50OKRiIe064626@gitrepo.freebsd.org> Date: Fri, 24 Jan 2025 20:50:51 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202501242027.50OKRiIe064626@gitrepo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4Yfqj50kbsz3dp9 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 24 Jan 2025, at 20:27, Ed Maste wrote: >=20 > The branch main has been updated by emaste: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Da9a6a51edac13aaff5517dd602272152= efa6d7bd >=20 > commit a9a6a51edac13aaff5517dd602272152efa6d7bd > Author: Ahmad Khalifa > AuthorDate: 2025-01-05 05:01:07 +0000 > Commit: Ed Maste > CommitDate: 2025-01-24 20:27:08 +0000 >=20 > github: Add new checklist workflow >=20 > Add a new 'checklist' workflow that checks the commit messages on = pull > requests. Currently, the workflow creates a comment on the pull = request > if any of these conditions are hit: > - Missing Signed-off-by > - Malformed Signed-off-by > - Bad email (i.e *noreply*) >=20 > Reviewed by: emaste, imp > Pull request: https://github.com/freebsd/freebsd-src/pull/1570 >=20 > Signed-off-by: Ahmad Khalifa > --- > .github/workflows/checklist.yml | 106 = ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 106 insertions(+) >=20 > diff --git a/.github/workflows/checklist.yml = b/.github/workflows/checklist.yml > new file mode 100644 > index 000000000000..9734af4a1a1d > --- /dev/null > +++ b/.github/workflows/checklist.yml > @@ -0,0 +1,106 @@ > +name: Checklist > + > +# Produce a list of things that need to be changed > +# for the submission to align with CONTRIBUTING.md > + > +on: > + pull_request: > + types: [ opened, reopened, edited, synchronize ] > + > +permissions: > + pull-requests: write > + > +jobs: > + checklist: > + name: commit > + runs-on: ubuntu-latest Please be careful to restrict these kinds of jobs with if: github.repository_owner =3D=3D 'freebsd' or if: github.repository =3D=3D 'freebsd/freebsd-src' otherwise it=E2=80=99s a pain for forks. Jess > + steps: > + - uses: actions/github-script@v7 > + with: > + # An asynchronous javascript function > + script: | > + /* > + * Github's API returns the results in pages of 30, so > + * pass the function we want, along with it's arguments, > + * to paginate() which will handle gathering all the = results. > + */ > + const comments =3D await = github.paginate(github.rest.issues.listComments, { > + owner: context.repo.owner, > + repo: context.repo.repo, > + issue_number: context.issue.number > + }); > + > + const commits =3D await = github.paginate(github.rest.pulls.listCommits, { > + owner: context.repo.owner, > + repo: context.repo.repo, > + pull_number: context.issue.number > + }); > + > + let checklist =3D {}; > + let checklist_len =3D 0; > + let comment_id =3D -1; > + > + const msg_prefix =3D "Thank you for taking the time to = contribute to FreeBSD!\n"; > + const addToChecklist =3D (msg, sha) =3D> { > + if (!checklist[msg]) { > + checklist[msg] =3D []; > + checklist_len++; > + } > + checklist[msg].push(sha); > + } > + > + for (const commit of commits) { > + const sob_lines =3D = commit.commit.message.match(/^[^\S\r\n]*signed-off-by:.*/gim); > + > + if (sob_lines =3D=3D null && = !commit.commit.author.email.toLowerCase().endsWith("freebsd.org")) > + addToChecklist("Missing Signed-off-by lines", = commit.sha); > + else if (sob_lines !=3D null) { > + let author_signed =3D false; > + for (const line of sob_lines) { > + if (!line.includes("Signed-off-by: ")) > + /* Only display the part we care about. */ > + addToChecklist("Expected `Signed-off-by: `, got = `" + line.match(/^[^\S\r\n]*signed-off-by:./i) + "`", commit.sha); > + if (line.includes(commit.commit.author.email)) > + author_signed =3D true; > + } > + > + if (!author_signed) > + console.log("::warning = title=3DMissing-Author-Signature::Missing Signed-off-by from author"); > + } > + > + if = (commit.commit.author.email.toLowerCase().includes("noreply")) > + addToChecklist("Real email address is needed", = commit.sha); > + } > + > + /* Check if we've commented before. */ > + for (const comment of comments) { > + if (comment.user.login =3D=3D "github-actions[bot]") { > + comment_id =3D comment.id; > + break; > + } > + } > + > + if (checklist_len !=3D 0) { > + let msg =3D msg_prefix + > + "There " + (checklist_len > 1 ? "are a few issues = that need " : "is an issue that needs ") + > + "to be fixed:\n"; > + let comment_func =3D comment_id =3D=3D -1 ? = github.rest.issues.createComment : github.rest.issues.updateComment; > + > + /* Loop for each key in "checklist". */ > + for (const c in checklist) > + msg +=3D "- " + c + "" + checklist[c].join(", ") = + "\n"; > + > + comment_func({ > + owner: context.repo.owner, > + repo: context.repo.repo, > + body: msg, > + ...(comment_id =3D=3D -1 ? {issue_number: = context.issue.number} : {comment_id: comment_id}) > + }); > + } else if (comment_id !=3D -1) { > + github.rest.issues.updateComment({ > + owner: context.repo.owner, > + repo: context.repo.repo, > + comment_id: comment_id, > + body: msg_prefix + "All issues resolved." > + }); > + } From nobody Fri Jan 24 21:07:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfr4B3dnLz5lvf0; Fri, 24 Jan 2025 21:07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfr4B2vTjz3g2R; Fri, 24 Jan 2025 21:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737752858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yJooVuB6/I1GAbSosp99gZnrJNqiugfyGa/sYl0pFFs=; b=UzfW4Cdkav3JcDIEDKRVTxyKaQqJ7tcqVR8rBGIIxNyxZi7PVhCDm10hh61by8m6F3PYf4 3TYlQteTAwLVeSG9ZJMxW/7Hwj6IR3QwOGo2lQ7d+G0lCmg7DZgAf3chEOHjM3fzCAcOhq EJ1gXawwGZehNUjZ2rbaJ470Ulm89Y+zHRKCTpKLVM1GHBOqnjUiuNPswNbFC61hkAttvk m7HaqShS2GR/K97t310VTBo9MZOdnkbqubfIUMN9eTrLB/863gUDX2elUAcamVVukHbH5K XZnGoWUGg1zr0H74sZ1/9g22zdOX1UZsixbn/SfeKdDHRY/HMAJ3Fwvszqwudw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737752858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yJooVuB6/I1GAbSosp99gZnrJNqiugfyGa/sYl0pFFs=; b=dmYyKYyS4tPZJHixe/8dB+TebjGsyqHyz0I/lLulTLWUtb236eghyAPPEJkpD5Oua/Kxbl 0a58UUUKHwAC5/pgnT+RNLJOblEdKhFNDR0e3UKWtpLfUhBrbsskiG/Q38NcJZPnK8oB3s UbEawXEWVk1iUfinscMzHusCOWxp9GNZSNe/0c+DazkOJI8k/VwVbTXkT03rOmJqlca+8p dT26BO37IKprFFm6xTk9mz8wRTh41XXcH7KWs0Xe4CcRfWOohkVKA7unKgdFQteuLgglCh douUtNIeGCGwkmbO7r4Up/L7wFaG5nYN5cKLQD8rr1b4GePmEv2y4gI3UD5J+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737752858; a=rsa-sha256; cv=none; b=Mj2AfgP4wnFOKrc9+6L1+f1K2y8rtkoSfDf3wP748OvcKzs8v9708FRmuX0UIB3Bgslt+B q9XPmjkDftbKy++mf8ddN6XRE+PsvKPzlQbj2fgOnDRP5N9ex3BUZkR0ZjMTMFXKRm0R24 /ztEfwiVkP3cnCCTVu6HX86sHd9qb+WJptfB1nqhCg+w+++psS8ftdm8wQaxNFQu3SGU7S JQ0cqXMzUmJDn44344U4X3M9VvtuXmGBZPgezmpo+du/6J+J3YH4pXa5RHGF52HSM5A/pU 8bmxD1aVVrwF7G4FZuE/QvhIdBVA1p9Zk95ETeZrdI48uzhAxHfKMQCwLEUFcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfr4B2KPzzjDB; Fri, 24 Jan 2025 21:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OL7cBC039520; Fri, 24 Jan 2025 21:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OL7cdA039517; Fri, 24 Jan 2025 21:07:38 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:07:38 GMT Message-Id: <202501242107.50OL7cdA039517@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: 3ad01642fe9e - main - iflib(4): Replace admin taskqueue group with per-interface taskqueues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 3ad01642fe9e241124553f2f18fd365ffea5d20b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3ad01642fe9e241124553f2f18fd365ffea5d20b commit 3ad01642fe9e241124553f2f18fd365ffea5d20b Author: Krzysztof Galazka AuthorDate: 2024-07-05 11:00:13 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:08:12 +0000 iflib(4): Replace admin taskqueue group with per-interface taskqueues Using one taskqueue group with single thread to execute all admin tasks may lead to unexpected timeouts when long running task (e.g. handling a reset after FW update) for one interface prevents tasks from other interfaces being executed. Taskqueue group API doesn't let to dynamically add threads, and pre-allocating thread for each CPU as it's done for traffic queues would be a waste of resources on systems with small number of interfaces. Replace global taskqueue group for admin tasks with taskqueue allocated for each interface to allow independent execution. Signed-off-by: Krzysztof Galazka Reviewed by: imp, jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1336 --- sys/dev/bnxt/bnxt_en/bnxt.h | 2 +- sys/dev/bnxt/bnxt_en/if_bnxt.c | 10 +++--- sys/net/iflib.c | 77 ++++++++++++++++++++++-------------------- sys/net/iflib.h | 6 ++-- 4 files changed, 48 insertions(+), 47 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index c5fadeafa181..e4f866807070 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -1091,7 +1091,7 @@ struct bnxt_softc { struct bnxt_cp_ring def_nq_ring; struct iflib_dma_info def_cp_ring_mem; struct iflib_dma_info def_nq_ring_mem; - struct grouptask def_cp_task; + struct task def_cp_task; int db_size; int legacy_db_size; struct bnxt_doorbell_ops db_ops; diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 00d37f5e0151..efc467a043f9 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -229,7 +229,7 @@ static void bnxt_clear_ids(struct bnxt_softc *softc); static void inline bnxt_do_enable_intr(struct bnxt_cp_ring *cpr); static void inline bnxt_do_disable_intr(struct bnxt_cp_ring *cpr); static void bnxt_mark_cpr_invalid(struct bnxt_cp_ring *cpr); -static void bnxt_def_cp_task(void *context); +static void bnxt_def_cp_task(void *context, int pending); static void bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl); static uint64_t bnxt_get_baudrate(struct bnxt_link_info *link); @@ -2384,8 +2384,7 @@ bnxt_attach_pre(if_ctx_t ctx) &softc->def_cp_ring_mem, 0); softc->def_cp_ring.ring.vaddr = softc->def_cp_ring_mem.idi_vaddr; softc->def_cp_ring.ring.paddr = softc->def_cp_ring_mem.idi_paddr; - iflib_config_gtask_init(ctx, &softc->def_cp_task, bnxt_def_cp_task, - "dflt_cp"); + iflib_config_task_init(ctx, &softc->def_cp_task, bnxt_def_cp_task); rc = bnxt_init_sysctl_ctx(softc); if (rc) @@ -2512,7 +2511,6 @@ bnxt_detach(if_ctx_t ctx) bnxt_free_ctx_mem(softc); bnxt_clear_ids(softc); iflib_irq_free(ctx, &softc->def_cp_ring.irq); - iflib_config_gtask_deinit(&softc->def_cp_task); /* We need to free() these here... */ for (i = softc->nrxqsets-1; i>=0; i--) { if (BNXT_CHIP_P5(softc)) @@ -4348,7 +4346,7 @@ bnxt_handle_def_cp(void *arg) struct bnxt_softc *softc = arg; softc->db_ops.bnxt_db_rx_cq(&softc->def_cp_ring, 0); - GROUPTASK_ENQUEUE(&softc->def_cp_task); + iflib_config_task_enqueue(softc->ctx, &softc->def_cp_task); return FILTER_HANDLED; } @@ -4608,7 +4606,7 @@ async_event_process_exit: } static void -bnxt_def_cp_task(void *context) +bnxt_def_cp_task(void *context, int pending) { if_ctx_t ctx = context; struct bnxt_softc *softc = iflib_get_softc(ctx); diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 6644197f7d5b..1ae2207c9d13 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -178,8 +178,9 @@ struct iflib_ctx { struct resource *ifc_msix_mem; struct if_irq ifc_legacy_irq; - struct grouptask ifc_admin_task; - struct grouptask ifc_vflr_task; + struct task ifc_admin_task; + struct task ifc_vflr_task; + struct taskqueue *ifc_tq; struct iflib_filter_info ifc_filter_info; struct ifmedia ifc_media; struct ifmedia *ifc_mediap; @@ -1640,7 +1641,7 @@ static int iflib_fast_intr_ctx(void *arg) { iflib_filter_info_t info = arg; - struct grouptask *gtask = info->ifi_task; + if_ctx_t ctx = info->ifi_ctx; int result; DBG_COUNTER_INC(fast_intrs); @@ -1650,8 +1651,7 @@ iflib_fast_intr_ctx(void *arg) return (result); } - if (gtask->gt_taskqueue != NULL) - GROUPTASK_ENQUEUE(gtask); + taskqueue_enqueue(ctx->ifc_tq, &ctx->ifc_admin_task); return (FILTER_HANDLED); } @@ -4176,7 +4176,7 @@ skip_rxeof: } static void -_task_fn_admin(void *context) +_task_fn_admin(void *context, int pending) { if_ctx_t ctx = context; if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; @@ -4227,7 +4227,7 @@ _task_fn_admin(void *context) } static void -_task_fn_iov(void *context) +_task_fn_iov(void *context, int pending) { if_ctx_t ctx = context; @@ -5200,6 +5200,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct kobj_method_t *kobj_method; int err, msix, rid; int num_txd, num_rxd; + char namebuf[TASKQUEUE_NAMELEN]; ctx = malloc(sizeof(*ctx), M_IFLIB, M_WAITOK | M_ZERO); @@ -5290,10 +5291,25 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct scctx->isc_rss_table_size = 64; scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1; - GROUPTASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); - /* XXX format name */ - taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, - NULL, NULL, "admin"); + /* Create and start admin taskqueue */ + snprintf(namebuf, TASKQUEUE_NAMELEN, "if_%s_tq", device_get_nameunit(dev)); + ctx->ifc_tq = taskqueue_create_fast(namebuf, M_NOWAIT, + taskqueue_thread_enqueue, &ctx->ifc_tq); + if (ctx->ifc_tq == NULL) { + device_printf(dev, "Unable to create admin taskqueue\n"); + return (ENOMEM); + } + + err = taskqueue_start_threads(&ctx->ifc_tq, 1, PI_NET, "%s", namebuf); + if (err) { + device_printf(dev, + "Unable to start admin taskqueue threads error: %d\n", + err); + taskqueue_free(ctx->ifc_tq); + return (err); + } + + TASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); /* Set up cpu set. If it fails, use the set of all CPUs. */ if (bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus) != 0) { @@ -5430,6 +5446,7 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_queues: + taskqueue_free(ctx->ifc_tq); iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); @@ -5508,6 +5525,9 @@ iflib_device_deregister(if_ctx_t ctx) IFDI_QUEUES_FREE(ctx); CTX_UNLOCK(ctx); + taskqueue_free(ctx->ifc_tq); + ctx->ifc_tq = NULL; + /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ iflib_free_intr_mem(ctx); @@ -5545,11 +5565,6 @@ iflib_tqg_detach(if_ctx_t ctx) if (rxq->ifr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &rxq->ifr_task); } - tqg = qgroup_if_config_tqg; - if (ctx->ifc_admin_task.gt_uniq != NULL) - taskqgroup_detach(tqg, &ctx->ifc_admin_task); - if (ctx->ifc_vflr_task.gt_uniq != NULL) - taskqgroup_detach(tqg, &ctx->ifc_vflr_task); } static void @@ -6324,9 +6339,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, q = ctx; tqrid = -1; info = &ctx->ifc_filter_info; - gtask = &ctx->ifc_admin_task; - tqg = qgroup_if_config_tqg; - fn = _task_fn_admin; + gtask = NULL; intr_fast = iflib_fast_intr_ctx; break; default: @@ -6388,12 +6401,8 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, NET_GROUPTASK_INIT(gtask, 0, fn, q); break; case IFLIB_INTR_IOV: - q = ctx; - gtask = &ctx->ifc_vflr_task; - tqg = qgroup_if_config_tqg; - fn = _task_fn_iov; - GROUPTASK_INIT(gtask, 0, fn, q); - break; + TASK_INIT(&ctx->ifc_vflr_task, 0, _task_fn_iov, ctx); + return; default: panic("unknown net intr type"); } @@ -6483,15 +6492,14 @@ void iflib_admin_intr_deferred(if_ctx_t ctx) { - MPASS(ctx->ifc_admin_task.gt_taskqueue != NULL); - GROUPTASK_ENQUEUE(&ctx->ifc_admin_task); + taskqueue_enqueue(ctx->ifc_tq, &ctx->ifc_admin_task); } void iflib_iov_intr_deferred(if_ctx_t ctx) { - GROUPTASK_ENQUEUE(&ctx->ifc_vflr_task); + taskqueue_enqueue(ctx->ifc_tq, &ctx->ifc_vflr_task); } void @@ -6503,20 +6511,15 @@ iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, const char *name) } void -iflib_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn, - const char *name) +iflib_config_task_init(if_ctx_t ctx, struct task *config_task, task_fn_t *fn) { - - GROUPTASK_INIT(gtask, 0, fn, ctx); - taskqgroup_attach(qgroup_if_config_tqg, gtask, gtask, NULL, NULL, - name); + TASK_INIT(config_task, 0, fn, ctx); } void -iflib_config_gtask_deinit(struct grouptask *gtask) +iflib_config_task_enqueue(if_ctx_t ctx, struct task *config_task) { - - taskqgroup_detach(qgroup_if_config_tqg, gtask); + taskqueue_enqueue(ctx->ifc_tq, config_task); } void diff --git a/sys/net/iflib.h b/sys/net/iflib.h index e3d76fbd3c01..3817445228d0 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -470,9 +470,9 @@ void iflib_irq_free(if_ctx_t ctx, if_irq_t irq); void iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, const char *name); -void iflib_config_gtask_init(void *ctx, struct grouptask *gtask, - gtask_fn_t *fn, const char *name); -void iflib_config_gtask_deinit(struct grouptask *gtask); +void iflib_config_task_init(if_ctx_t ctx, struct task *config_task, + task_fn_t *fn); +void iflib_config_task_enqueue(if_ctx_t ctx, struct task *config_task); void iflib_tx_intr_deferred(if_ctx_t ctx, int txqid); void iflib_rx_intr_deferred(if_ctx_t ctx, int rxqid); From nobody Fri Jan 24 21:37:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfrkJ6frLz5lRsW; Fri, 24 Jan 2025 21:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfrkJ6Lk6z3jqQ; Fri, 24 Jan 2025 21:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNO+gMKarz196l+mz2Yb6afwenZwq02Vsx6HG99ibpc=; b=BAt3l7077zQwMsHvQk/g0ph64bwRDKX5tiBMyS+vZn0JLAdTH7tCa1YP/EKV+zCa2qo8Fz yDDeI5CPCPs3tj7mMtfu63CO8VIrTeiDntqiVkMrZ+yHkT8wxLN+wsJO195Jz0ZeYigOCu K+g5GE6h+JOJA2uc8S3MRb/kOTfZ46IPoRr5IlSNPK6DGfYgIsv4dgkAwuIKXJ0/ZWe3C7 qhNsRryD09idb7lFaGWjeMH2VUij/9aiyZYoC8TQ33Ks35rv42kVZ1CeL5HpM2+rO2lSba JL1ckV2LAdXhowL6qRpPEup/Cmi9m4PYeOvVr0Yo8Ww+V+pP7T8emiC7FbEepg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNO+gMKarz196l+mz2Yb6afwenZwq02Vsx6HG99ibpc=; b=f1Mydaiep4B15oi0/FoL7FCKRPf0wf/nbnT6kDftAmUgcc4pNg08cb0Dy4uoce7+tXYzN4 zq79IynMmZJZwhbSAomtHt2yh5Yacm8OHpxujSjLeXo2sayocLHBQ5nfzhnD+qiSk/Praf evFk4wG0jGBn2eebrP4hEUjjM71Wu2kEcuBW+fhQeHLzoMa0N2eWFtq7xzoSNKCc1UEfSQ HuRB8ycQf90cozkseJ3nuPlc/ADDbPF78MT1tfSUjI9djJEf4MhOKs7XO9TebW9gM4S4YZ ZI6WaIdBXMzhlYx2OQ+qBr8cxfoCXWrsWME7WT1zPRLcPh8i+EZoFOB3SMifxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737754632; a=rsa-sha256; cv=none; b=PbziumkkgfwCSKpC2BLy9joG3p1QB/ohOBJP5c59QLzjgIrDZZTf5hMJ24EK+uTNByK9wE kjjePVB5OTFwoKq66O1W1h+KS5g4JCdiaxra2iaZv6evTCwgUkfPBAeyyarmV9agfpAGU1 frTFNItdp866bCX9FW3V6p0H141O27q87Fd9L9LNYQoGKmsB0OViCYD3x+TJadvK1jKje0 3sjNq5aD/2QWagQSArcx/qeIw9IC92Fqg44hIwcmGS8ufdmSIMNUpAYO34GttmwGlFLbtx IP7U3h+p63X7bf37MPbw8YHrBB19rdhe3y9IJD6S2xeYqiCpiysQqe5IiLQJIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfrkJ5kZYzjfj; Fri, 24 Jan 2025 21:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OLbCdE094772; Fri, 24 Jan 2025 21:37:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OLbCJJ094769; Fri, 24 Jan 2025 21:37:12 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:37:12 GMT Message-Id: <202501242137.50OLbCJJ094769@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: b72ae900d434 - main - sys: make the kernel metadata pointer global List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: b72ae900d4348118829fe04abdc11b620930c30f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b72ae900d4348118829fe04abdc11b620930c30f commit b72ae900d4348118829fe04abdc11b620930c30f Author: Ahmad Khalifa AuthorDate: 2024-08-22 19:05:38 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:25:51 +0000 sys: make the kernel metadata pointer global The way we got the kernel metadata pointer was by calling preload_search_by_type with one of the following three: "elf kernel", "elf32 kernel" and "elf64 kernel". Which one(s) we used wasn't consistent though. Sometimes we would only try "elf kernel", and other times we would try one of the latter two if the first failed. However, the loader only ever sets "elf kernel" as the kernel type. Now, the kmdp is a global, preload_kmdp, and it's initialized using preload_initkmdp in machdep.c (or machdep_boot.c on arm/64). preload_initkmdp takes a single boolean argument that tells us whether not finding the kmdp is fatal or not. Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 --- sys/amd64/amd64/machdep.c | 65 ++++++++++---------------- sys/arm/arm/machdep.c | 8 ++-- sys/arm/arm/machdep_boot.c | 20 ++++---- sys/arm64/arm64/machdep.c | 21 ++++----- sys/arm64/arm64/machdep_boot.c | 20 ++++---- sys/compat/linuxkpi/common/include/linux/efi.h | 8 +--- sys/dev/efidev/efirt.c | 6 +-- sys/dev/hyperv/vmbus/vmbus.c | 8 +--- sys/dev/nvdimm/nvdimm_e820.c | 6 +-- sys/dev/vt/hw/efifb/efifb.c | 12 +---- sys/dev/vt/hw/vbefb/vbefb.c | 12 +---- sys/dev/vt/vt_core.c | 18 ++----- sys/i386/i386/machdep.c | 20 +++----- sys/kern/link_elf.c | 24 ++++------ sys/kern/subr_module.c | 11 ++++- sys/opencrypto/crypto.c | 9 +--- sys/powerpc/powerpc/machdep.c | 55 +++++++++++----------- sys/riscv/riscv/machdep.c | 24 ++++------ sys/sys/linker.h | 5 +- sys/x86/include/init.h | 4 +- sys/x86/x86/fdt_machdep.c | 7 +-- sys/x86/x86/nexus.c | 8 +--- sys/x86/xen/hvm.c | 13 +----- sys/x86/xen/pv.c | 59 +++++++++-------------- 24 files changed, 169 insertions(+), 274 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 73bfdd4d07f5..6d9bc8b7c573 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -169,10 +169,10 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); static void native_clock_source_init(void); /* Preload data parse function */ -static caddr_t native_parse_preload_data(u_int64_t); +static void native_parse_preload_data(u_int64_t); /* Native function to fetch and parse the e820 map */ -static void native_parse_memmap(caddr_t, vm_paddr_t *, int *); +static void native_parse_memmap(vm_paddr_t *, int *); /* Default init_ops implementation. */ struct init_ops init_ops = { @@ -814,7 +814,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap, } static void -native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) +native_parse_memmap(vm_paddr_t *physmap, int *physmap_idx) { struct bios_smap *smap; struct efi_map_header *efihdr; @@ -828,9 +828,9 @@ native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) * ie: an int32_t immediately precedes smap. */ - efihdr = (struct efi_map_header *)preload_search_info(kmdp, + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); - smap = (struct bios_smap *)preload_search_info(kmdp, + smap = (struct bios_smap *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (efihdr == NULL && smap == NULL) panic("No BIOS smap or EFI map info from loader!"); @@ -858,7 +858,7 @@ native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) * XXX first should be vm_paddr_t. */ static void -getmemsize(caddr_t kmdp, u_int64_t first) +getmemsize(u_int64_t first) { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYS_AVAIL_ENTRIES]; @@ -877,7 +877,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) bzero(physmap, sizeof(physmap)); physmap_idx = 0; - init_ops.parse_memmap(kmdp, physmap, &physmap_idx); + init_ops.parse_memmap(physmap, &physmap_idx); physmap_idx -= 2; /* @@ -1127,10 +1127,9 @@ do_next: TSEXIT(); } -static caddr_t +static void native_parse_preload_data(u_int64_t modulep) { - caddr_t kmdp; char *envp; #ifdef DDB vm_offset_t ksym_start; @@ -1139,22 +1138,19 @@ native_parse_preload_data(u_int64_t modulep) preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); preload_bootstrap_relocate(KERNBASE); - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + preload_initkmdp(true); + boothowto = MD_FETCH(preload_kmdp, MODINFOMD_HOWTO, int); + envp = MD_FETCH(preload_kmdp, MODINFOMD_ENVP, char *); if (envp != NULL) envp += KERNBASE; init_static_kenv(envp, 0); #ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + ksym_start = MD_FETCH(preload_kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(preload_kmdp, MODINFOMD_ESYM, uintptr_t); db_fetch_ksymtab(ksym_start, ksym_end, 0); #endif - efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t); - - return (kmdp); + efi_systbl_phys = MD_FETCH(preload_kmdp, MODINFOMD_FW_HANDLE, + vm_paddr_t); } static void @@ -1287,7 +1283,6 @@ amd64_loadaddr(void) u_int64_t hammer_time(u_int64_t modulep, u_int64_t physfree) { - caddr_t kmdp; int gsel_tss, x; struct pcpu *pc; uint64_t rsp0; @@ -1302,9 +1297,10 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) physfree += kernphys; - kmdp = init_ops.parse_preload_data(modulep); + /* Initializes preload_kmdp */ + init_ops.parse_preload_data(modulep); - efi_boot = preload_search_info(kmdp, MODINFO_METADATA | + efi_boot = preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL; if (!efi_boot) { @@ -1350,7 +1346,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } - link_elf_ireloc(kmdp); + link_elf_ireloc(); /* * This may be done better later if it gets more high level @@ -1535,7 +1531,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) amd64_kdb_init(); } - getmemsize(kmdp, physfree); + getmemsize(physfree); init_param2(physmem); /* now running on new page tables, configured,and u/iom is accessible */ @@ -1635,19 +1631,15 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) { struct bios_smap *smapbase; struct bios_smap_xattr smap; - caddr_t kmdp; uint32_t *smapattr; int count, error, i; /* Retrieve the system memory map from the loader. */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - smapbase = (struct bios_smap *)preload_search_info(kmdp, + smapbase = (struct bios_smap *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) return (0); - smapattr = (uint32_t *)preload_search_info(kmdp, + smapattr = (uint32_t *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP_XATTR); count = *((uint32_t *)smapbase - 1) / sizeof(*smapbase); error = 0; @@ -1672,13 +1664,9 @@ static int efi_map_sysctl_handler(SYSCTL_HANDLER_ARGS) { struct efi_map_header *efihdr; - caddr_t kmdp; uint32_t efisize; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efihdr = (struct efi_map_header *)preload_search_info(kmdp, + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr == NULL) return (0); @@ -1694,13 +1682,8 @@ static int efi_arch_sysctl_handler(SYSCTL_HANDLER_ARGS) { char *arch; - caddr_t kmdp; - - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - arch = (char *)preload_search_info(kmdp, + arch = (char *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_ARCH); if (arch == NULL) return (0); diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index fdaf5d3dade8..e45ef9834e81 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -421,7 +421,6 @@ initarm(struct arm_boot_params *abp) vm_paddr_t lastaddr; vm_offset_t dtbp, kernelstack, dpcpu; char *env; - void *kmdp; int err_devmap, mem_regions_sz; phandle_t root; char dts_version[255]; @@ -439,8 +438,7 @@ initarm(struct arm_boot_params *abp) /* * Find the dtb passed in by the boot loader. */ - kmdp = preload_search_by_type("elf kernel"); - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + dtbp = MD_FETCH(preload_kmdp, MODINFOMD_DTBP, vm_offset_t); #if defined(FDT_DTB_STATIC) /* * In case the device tree blob was not retrieved (from metadata) try @@ -461,7 +459,7 @@ initarm(struct arm_boot_params *abp) #endif #ifdef EFI - efihdr = (struct efi_map_header *)preload_search_info(kmdp, + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr != NULL) { arm_add_efi_map_entries(efihdr, mem_regions, &mem_regions_sz); @@ -571,7 +569,7 @@ initarm(struct arm_boot_params *abp) #endif debugf("initarm: console initialized\n"); - debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)preload_kmdp); debugf(" boothowto = 0x%08x\n", boothowto); debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); debugf(" lastaddr1: 0x%08x\n", lastaddr); diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c index 475da7b47ac8..534d34acabe2 100644 --- a/sys/arm/arm/machdep_boot.c +++ b/sys/arm/arm/machdep_boot.c @@ -270,7 +270,6 @@ freebsd_parse_boot_param(struct arm_boot_params *abp) { vm_offset_t lastaddr = 0; void *mdp; - void *kmdp; #ifdef DDB vm_offset_t ksym_start; vm_offset_t ksym_end; @@ -287,17 +286,19 @@ freebsd_parse_boot_param(struct arm_boot_params *abp) if ((mdp = (void *)(abp->abp_r0 & ~PAGE_MASK)) == NULL) return 0; preload_metadata = mdp; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) + + /* Initialize preload_kmdp */ + preload_initkmdp(false); + if (preload_kmdp == NULL) return 0; - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + boothowto = MD_FETCH(preload_kmdp, MODINFOMD_HOWTO, int); + loader_envp = MD_FETCH(preload_kmdp, MODINFOMD_ENVP, char *); init_static_kenv(loader_envp, 0); - lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); + lastaddr = MD_FETCH(preload_kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + ksym_start = MD_FETCH(preload_kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(preload_kmdp, MODINFOMD_ESYM, uintptr_t); db_fetch_ksymtab(ksym_start, ksym_end, 0); #endif return lastaddr; @@ -381,6 +382,9 @@ fake_preload_metadata(struct arm_boot_params *abp __unused, void *dtb_ptr, fake_preload[i] = 0; preload_metadata = (void *)fake_preload; + /* Initialize preload_kmdp */ + preload_initkmdp(true); + init_static_kenv(NULL, 0); return (lastaddr); diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index ff7a88edfe61..22c74b21cf48 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -734,11 +734,11 @@ exclude_efi_memreserve(vm_offset_t efi_systbl_phys) #ifdef FDT static void -try_load_dtb(caddr_t kmdp) +try_load_dtb(void) { vm_offset_t dtbp; - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + dtbp = MD_FETCH(preload_kmdp, MODINFOMD_DTBP, vm_offset_t); #if defined(FDT_DTB_STATIC) /* * In case the device tree blob was not retrieved (from metadata) try @@ -900,7 +900,6 @@ initarm(struct arm64_bootparams *abp) char dts_version[255]; #endif vm_offset_t lastaddr; - caddr_t kmdp; bool valid; TSRAW(&thread0, TS_ENTER, __func__, NULL); @@ -910,11 +909,6 @@ initarm(struct arm64_bootparams *abp) /* Parse loader or FDT boot parameters. Determine last used address. */ lastaddr = parse_boot_param(abp); - /* Find the kernel address */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - identify_cpu(0); identify_hypervisor_smbios(); @@ -936,15 +930,16 @@ initarm(struct arm64_bootparams *abp) PCPU_SET(curthread, &thread0); PCPU_SET(midr, get_midr()); - link_elf_ireloc(kmdp); + link_elf_ireloc(); #ifdef FDT - try_load_dtb(kmdp); + try_load_dtb(); #endif - efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t); + efi_systbl_phys = MD_FETCH(preload_kmdp, MODINFOMD_FW_HANDLE, + vm_paddr_t); /* Load the physical memory ranges */ - efihdr = (struct efi_map_header *)preload_search_info(kmdp, + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr != NULL) add_efi_map_entries(efihdr); @@ -962,7 +957,7 @@ initarm(struct arm64_bootparams *abp) #endif /* Exclude the EFI framebuffer from our view of physical memory. */ - efifb = (struct efi_fb *)preload_search_info(kmdp, + efifb = (struct efi_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); if (efifb != NULL) physmem_exclude_region(efifb->fb_addr, efifb->fb_size, diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index b8e0c734bbb4..029ae23530ff 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -124,6 +124,9 @@ fake_preload_metadata(void *dtb_ptr, size_t dtb_size) preload_metadata = (caddr_t)(uintptr_t)fake_preload; + /* Initialize preload_kmdp */ + preload_initkmdp(true); + init_static_kenv(NULL, 0); return (lastaddr); @@ -188,7 +191,6 @@ static vm_offset_t freebsd_parse_boot_param(struct arm64_bootparams *abp) { vm_offset_t lastaddr = 0; - void *kmdp; #ifdef DDB vm_offset_t ksym_start; vm_offset_t ksym_end; @@ -198,17 +200,19 @@ freebsd_parse_boot_param(struct arm64_bootparams *abp) return (0); preload_metadata = (caddr_t)(uintptr_t)(abp->modulep); - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) + + /* Initialize preload_kmdp */ + preload_initkmdp(false); + if (preload_kmdp == NULL) return (0); - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - loader_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + boothowto = MD_FETCH(preload_kmdp, MODINFOMD_HOWTO, int); + loader_envp = MD_FETCH(preload_kmdp, MODINFOMD_ENVP, char *); init_static_kenv(loader_envp, 0); - lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); + lastaddr = MD_FETCH(preload_kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + ksym_start = MD_FETCH(preload_kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(preload_kmdp, MODINFOMD_ESYM, uintptr_t); db_fetch_ksymtab(ksym_start, ksym_end, 0); #endif return (lastaddr); diff --git a/sys/compat/linuxkpi/common/include/linux/efi.h b/sys/compat/linuxkpi/common/include/linux/efi.h index a485b4b1fd94..aa33371bd0e8 100644 --- a/sys/compat/linuxkpi/common/include/linux/efi.h +++ b/sys/compat/linuxkpi/common/include/linux/efi.h @@ -41,9 +41,6 @@ static inline bool __efi_enabled(int feature) { -#if defined(MODINFOMD_EFI_MAP) && !defined(__amd64__) - caddr_t kmdp; -#endif bool enabled = false; switch (feature) { @@ -52,10 +49,7 @@ __efi_enabled(int feature) /* Use cached value on amd64 */ enabled = efi_boot; #elif defined(MODINFOMD_EFI_MAP) - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - enabled = preload_search_info(kmdp, + enabled = preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL; #endif break; diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index fcbed48af395..5dff2258725d 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -167,7 +167,6 @@ efi_init(void) struct efi_map_header *efihdr; struct efi_md *map; struct efi_rt *rtdm; - caddr_t kmdp; size_t efisz; int ndesc, rt_disabled; @@ -197,10 +196,7 @@ efi_init(void) printf("EFI config table is not present\n"); } - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efihdr = (struct efi_map_header *)preload_search_info(kmdp, + efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); if (efihdr == NULL) { if (bootverbose) diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index 1c620a1f5d84..115d4af599ee 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -1305,18 +1305,14 @@ vmbus_fb_mmio_res(device_t dev) #endif /* aarch64 */ rman_res_t fb_start, fb_end, fb_count; int fb_height, fb_width; - caddr_t kmdp; struct vmbus_softc *sc = device_get_softc(dev); int rid = 0; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efifb = (struct efi_fb *)preload_search_info(kmdp, + efifb = (struct efi_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); #if !defined(__aarch64__) - vbefb = (struct vbe_fb *)preload_search_info(kmdp, + vbefb = (struct vbe_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_VBE_FB); #endif /* aarch64 */ if (efifb != NULL) { diff --git a/sys/dev/nvdimm/nvdimm_e820.c b/sys/dev/nvdimm/nvdimm_e820.c index 2a6f29ebad21..6f9bb4c70f7a 100644 --- a/sys/dev/nvdimm/nvdimm_e820.c +++ b/sys/dev/nvdimm/nvdimm_e820.c @@ -257,7 +257,6 @@ static void nvdimm_e820_identify(driver_t *driver, device_t parent) { device_t child; - caddr_t kmdp; if (resource_disabled(driver->name, 0)) return; @@ -265,10 +264,7 @@ nvdimm_e820_identify(driver_t *driver, device_t parent) if (device_find_child(parent, driver->name, -1) != NULL) return; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - smapbase = (const void *)preload_search_info(kmdp, + smapbase = (const void *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP); /* Only supports BIOS SMAP for now. */ diff --git a/sys/dev/vt/hw/efifb/efifb.c b/sys/dev/vt/hw/efifb/efifb.c index cac6f93b7af1..eda05ec3d203 100644 --- a/sys/dev/vt/hw/efifb/efifb.c +++ b/sys/dev/vt/hw/efifb/efifb.c @@ -77,17 +77,13 @@ vt_efifb_probe(struct vt_device *vd) { int disabled; struct efi_fb *efifb; - caddr_t kmdp; disabled = 0; TUNABLE_INT_FETCH("hw.syscons.disable", &disabled); if (disabled != 0) return (CN_DEAD); - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efifb = (struct efi_fb *)preload_search_info(kmdp, + efifb = (struct efi_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); if (efifb == NULL) return (CN_DEAD); @@ -100,7 +96,6 @@ vt_efifb_init(struct vt_device *vd) { struct fb_info *info; struct efi_fb *efifb; - caddr_t kmdp; int memattr; int roff, goff, boff; char attr[16]; @@ -132,10 +127,7 @@ vt_efifb_init(struct vt_device *vd) if (info == NULL) info = vd->vd_softc = (void *)&local_info; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efifb = (struct efi_fb *)preload_search_info(kmdp, + efifb = (struct efi_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); if (efifb == NULL) return (CN_DEAD); diff --git a/sys/dev/vt/hw/vbefb/vbefb.c b/sys/dev/vt/hw/vbefb/vbefb.c index 2d6ada6002d0..0f9d9257948c 100644 --- a/sys/dev/vt/hw/vbefb/vbefb.c +++ b/sys/dev/vt/hw/vbefb/vbefb.c @@ -77,17 +77,13 @@ vt_vbefb_probe(struct vt_device *vd) { int disabled; struct vbe_fb *vbefb; - caddr_t kmdp; disabled = 0; TUNABLE_INT_FETCH("hw.syscons.disable", &disabled); if (disabled != 0) return (CN_DEAD); - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - vbefb = (struct vbe_fb *)preload_search_info(kmdp, + vbefb = (struct vbe_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_VBE_FB); if (vbefb == NULL) return (CN_DEAD); @@ -100,17 +96,13 @@ vt_vbefb_init(struct vt_device *vd) { struct fb_info *info; struct vbe_fb *vbefb; - caddr_t kmdp; int format, roff, goff, boff; info = vd->vd_softc; if (info == NULL) info = vd->vd_softc = (void *)&local_vbe_info; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - vbefb = (struct vbe_fb *)preload_search_info(kmdp, + vbefb = (struct vbe_fb *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_VBE_FB); if (vbefb == NULL) return (CN_DEAD); diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 1be98466112e..b0f58b38a6f1 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1675,15 +1675,11 @@ vtterm_done(struct terminal *tm) static void vtterm_splash(struct vt_device *vd) { - caddr_t kmdp; struct splash_info *si; uintptr_t image; vt_axis_t top, left; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - si = MD_FETCH(kmdp, MODINFOMD_SPLASH, struct splash_info *); + si = MD_FETCH(preload_kmdp, MODINFOMD_SPLASH, struct splash_info *); if (!(vd->vd_flags & VDF_TEXTMODE) && (boothowto & RB_MUTE)) { if (si == NULL) { top = (vd->vd_height - vt_logo_height) / 2; @@ -1806,14 +1802,10 @@ parse_font_info(struct font_info *fi) static void vt_init_font(void *arg) { - caddr_t kmdp; struct font_info *fi; struct vt_font *font; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - fi = MD_FETCH(kmdp, MODINFOMD_FONT, struct font_info *); + fi = MD_FETCH(preload_kmdp, MODINFOMD_FONT, struct font_info *); font = parse_font_info(fi); if (font != NULL) @@ -1825,14 +1817,10 @@ SYSINIT(vt_init_font, SI_SUB_KMEM, SI_ORDER_ANY, vt_init_font, &vt_consdev); static void vt_init_font_static(void) { - caddr_t kmdp; struct font_info *fi; struct vt_font *font; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - fi = MD_FETCH(kmdp, MODINFOMD_FONT, struct font_info *); + fi = MD_FETCH(preload_kmdp, MODINFOMD_FONT, struct font_info *); font = parse_font_info_static(fi); if (font != NULL) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 008d67017f68..6aac0e968362 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -903,7 +903,6 @@ getmemsize(int first) struct vm86context vmc; vm_paddr_t pa; struct bios_smap *smap, *smapbase; - caddr_t kmdp; has_smap = 0; bzero(&vmf, sizeof(vmf)); @@ -924,10 +923,7 @@ getmemsize(int first) * use that and do not make any VM86 calls. */ physmap_idx = 0; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf32 kernel"); - smapbase = (struct bios_smap *)preload_search_info(kmdp, + smapbase = (struct bios_smap *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { add_smap_entries(smapbase, physmap, &physmap_idx); @@ -1388,7 +1384,6 @@ init386(int first) int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; struct xstate_hdr *xhdr; - caddr_t kmdp; vm_offset_t addend; size_t ucode_len; @@ -1547,8 +1542,9 @@ init386(int first) TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } - kmdp = preload_search_by_type("elf kernel"); - link_elf_ireloc(kmdp); + /* Initialize preload_kmdp */ + preload_initkmdp(!metadata_missing); + link_elf_ireloc(); vm86_initialize(); getmemsize(first); @@ -1734,19 +1730,15 @@ smap_sysctl_handler(SYSCTL_HANDLER_ARGS) { struct bios_smap *smapbase; struct bios_smap_xattr smap; - caddr_t kmdp; uint32_t *smapattr; int count, error, i; /* Retrieve the system memory map from the loader. */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf32 kernel"); - smapbase = (struct bios_smap *)preload_search_info(kmdp, + smapbase = (struct bios_smap *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) return (0); - smapattr = (uint32_t *)preload_search_info(kmdp, + smapattr = (uint32_t *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_SMAP_XATTR); count = *((u_int32_t *)smapbase - 1) / sizeof(*smapbase); error = 0; diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 9f9c10456b60..23a924636ca2 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -450,18 +450,14 @@ link_elf_init(void* arg) Elf_Dyn *dp; Elf_Addr *ctors_addrp; Elf_Size *ctors_sizep; - caddr_t modptr, baseptr, sizeptr; + caddr_t baseptr, sizeptr; elf_file_t ef; const char *modname; linker_add_class(&link_elf_class); dp = (Elf_Dyn *)&_DYNAMIC; - modname = NULL; - modptr = preload_search_by_type("elf" __XSTRING(__ELF_WORD_SIZE) " kernel"); - if (modptr == NULL) - modptr = preload_search_by_type("elf kernel"); - modname = (char *)preload_search_info(modptr, MODINFO_NAME); + modname = (char *)preload_search_info(preload_kmdp, MODINFO_NAME); if (modname == NULL) modname = "kernel"; linker_kernel_file = linker_make_file(modname, &link_elf_class); @@ -493,17 +489,17 @@ link_elf_init(void* arg) linker_kernel_file->size = -(intptr_t)linker_kernel_file->address; #endif - if (modptr != NULL) { - ef->modptr = modptr; - baseptr = preload_search_info(modptr, MODINFO_ADDR); + if (preload_kmdp != NULL) { + ef->modptr = preload_kmdp; + baseptr = preload_search_info(preload_kmdp, MODINFO_ADDR); if (baseptr != NULL) linker_kernel_file->address = *(caddr_t *)baseptr; - sizeptr = preload_search_info(modptr, MODINFO_SIZE); + sizeptr = preload_search_info(preload_kmdp, MODINFO_SIZE); if (sizeptr != NULL) linker_kernel_file->size = *(size_t *)sizeptr; - ctors_addrp = (Elf_Addr *)preload_search_info(modptr, + ctors_addrp = (Elf_Addr *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_CTORS_ADDR); - ctors_sizep = (Elf_Size *)preload_search_info(modptr, + ctors_sizep = (Elf_Size *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_CTORS_SIZE); if (ctors_addrp != NULL && ctors_sizep != NULL) { linker_kernel_file->ctors_addr = ef->address + @@ -2016,7 +2012,7 @@ elf_lookup_ifunc(linker_file_t lf, Elf_Size symidx, int deps __unused, } void -link_elf_ireloc(caddr_t kmdp) +link_elf_ireloc(void) { struct elf_file eff; elf_file_t ef; @@ -2026,7 +2022,7 @@ link_elf_ireloc(caddr_t kmdp) bzero_early(ef, sizeof(*ef)); - ef->modptr = kmdp; + ef->modptr = preload_kmdp; ef->dynamic = (Elf_Dyn *)&_DYNAMIC; #ifdef RELOCATABLE_KERNEL diff --git a/sys/kern/subr_module.c b/sys/kern/subr_module.c index 7f56ed72e1ac..14272bd913f8 100644 --- a/sys/kern/subr_module.c +++ b/sys/kern/subr_module.c @@ -44,7 +44,16 @@ */ vm_offset_t preload_addr_relocate = 0; -caddr_t preload_metadata; +caddr_t preload_metadata, preload_kmdp; + +void +preload_initkmdp(bool fatal) +{ + preload_kmdp = preload_search_by_type("elf kernel"); + + if (preload_kmdp == NULL && fatal) + panic("unable to find kernel metadata"); +} /* * Search for the preloaded module (name) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index e840d514fcd5..3c7299780a38 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -253,14 +253,7 @@ static struct keybuf empty_keybuf = { static void keybuf_init(void) { - caddr_t kmdp; - - kmdp = preload_search_by_type("elf kernel"); - - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - - keybuf = (struct keybuf *)preload_search_info(kmdp, + keybuf = (struct keybuf *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_KEYBUF); if (keybuf == NULL) diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 899fb430e5d9..96f3b292854d 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -264,7 +264,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, struct cpuref bsp; vm_offset_t startkernel, endkernel; char *env; - void *kmdp = NULL; bool ofw_bootargs = false; #ifdef DDB bool symbols_provided = false; @@ -336,33 +335,34 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, preload_metadata += md_offset; preload_bootstrap_relocate(md_offset); } - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) { - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); - if (envp != NULL) - envp += md_offset; - init_static_kenv(envp, 0); - if (fdt == 0) { - fdt = MD_FETCH(kmdp, MODINFOMD_DTBP, uintptr_t); - if (fdt != 0) - fdt += md_offset; - } - /* kernelstartphys is already relocated. */ - kernelendphys = MD_FETCH(kmdp, MODINFOMD_KERNEND, - vm_offset_t); - if (kernelendphys != 0) - kernelendphys += md_offset; - endkernel = ulmax(endkernel, kernelendphys); + + /* Initialize preload_kmdp */ + preload_initkmdp(true); + + boothowto = MD_FETCH(preload_kmdp, MODINFOMD_HOWTO, int); + envp = MD_FETCH(preload_kmdp, MODINFOMD_ENVP, char *); + if (envp != NULL) + envp += md_offset; + init_static_kenv(envp, 0); + if (fdt == 0) { + fdt = MD_FETCH(preload_kmdp, MODINFOMD_DTBP, uintptr_t); + if (fdt != 0) + fdt += md_offset; + } + /* kernelstartphys is already relocated. */ + kernelendphys = MD_FETCH(preload_kmdp, MODINFOMD_KERNEND, + vm_offset_t); + if (kernelendphys != 0) + kernelendphys += md_offset; + endkernel = ulmax(endkernel, kernelendphys); #ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + ksym_start = MD_FETCH(preload_kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(preload_kmdp, MODINFOMD_ESYM, uintptr_t); - db_fetch_ksymtab(ksym_start, ksym_end, md_offset); - /* Symbols provided by loader. */ - symbols_provided = true; + db_fetch_ksymtab(ksym_start, ksym_end, md_offset); + /* Symbols provided by loader. */ + symbols_provided = true; #endif - } } else { /* * Self-loading kernel, we have to fake up metadata. @@ -372,7 +372,8 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, * preload_boostrap_relocate(). */ fake_preload_metadata(); - kmdp = preload_search_by_type("elf kernel"); + /* Initialize preload_kmdp */ + preload_initkmdp(true); init_static_kenv(init_kenv, sizeof(init_kenv)); ofw_bootargs = true; } @@ -466,7 +467,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, * Bring up MMU */ pmap_mmu_init(); - link_elf_ireloc(kmdp); + link_elf_ireloc(); pmap_bootstrap(startkernel, endkernel); mtmsr(psl_kernset & ~PSL_EE); diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index c0d4b7cc2726..a17cff55f2cc 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -307,11 +307,11 @@ init_proc0(vm_offset_t kstack) #ifdef FDT static void -try_load_dtb(caddr_t kmdp) +try_load_dtb(void) { vm_offset_t dtbp; - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + dtbp = MD_FETCH(preload_kmdp, MODINFOMD_DTBP, vm_offset_t); #if defined(FDT_DTB_STATIC) /* @@ -434,34 +434,30 @@ parse_fdt_bootargs(void) static vm_offset_t parse_metadata(void) { - caddr_t kmdp; vm_offset_t lastaddr; #ifdef DDB vm_offset_t ksym_start, ksym_end; #endif char *kern_envp; - /* Find the kernel address */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - KASSERT(kmdp != NULL, ("No preload metadata found!")); + /* Initialize preload_kmdp */ + preload_initkmdp(true); *** 306 LINES SKIPPED *** From nobody Fri Jan 24 21:37:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfrkL0shsz5lS43; Fri, 24 Jan 2025 21:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfrkK74SBz3jf5; Fri, 24 Jan 2025 21:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5USh3nZiDAFTp05j/bWR7T1dRTC7JcySIBer1EVuv+k=; b=dkRFVqIi4emtx/LzXa54Bc4bS1BBAsB/BUw0IztHHJSTBZxq3SDfVEQLUCovmY0jwIWyfa W82l36OMYz7lpZfeD4Qm7DBdiQ93Jn9ezvgyef1MoHYIqwfLJ+42Iew2b8+5EN+9INj3u4 RMdjLJwK832RLQTAu14zkpppWgr5YiJmXk5z6YEZJyvy11Ne6WdGrLK0JEAfk3ZmG1dKQY Pn0bqe5LbC7PwBZJDGXqFRYHlx7s0sdBDUh64M4DFU89q9aQSOJSN6FFCdqMyUpXvYBKQl Zwc3TT6pnpJPmAQcOSXxtlkhpgc3h872xVGECuDmYMb8TnJOKBRkHUAByyMDuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5USh3nZiDAFTp05j/bWR7T1dRTC7JcySIBer1EVuv+k=; b=Ktr8qQyBRme+zMnZfYOqAtGmD44LRJIKAv+/nE9m0N3R8MIdFgloecNs1g9qU/Dhwr57WM MAOm6lNs9RJDMpUy9jgDds9WwD6FUY0FQuHRgSMd4be36mBWT/nff5jza1VyzZvx/RWqT+ R4VJzKt77OUhH/xIQexH09JfBfKS1I5NkJ9wGY+bYuUh6r20eg/px7rQIBr3MD5yoIQt1f pJbrZiVOgrvVgyDbsxShuAjEeD950ntpbZBn5Vz9sm3mDLUYJJ6CsZQMYbdUmTrqB7OfMk i41ZP3GZ80I/F2hMHkKxE4BRstZzFbubYXtYt1Az18cLr+5ey1T2vdRobluRXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737754634; a=rsa-sha256; cv=none; b=cbmsPkI1vND1qnMRNnkzc9VSQVHBQTJAm1zKtrkDm7fk8l6EEmFSpJ7Vq4WqDT+6ubwUFi da4AJk0HZf0yJN/tPWJWw4Y31+HXn/Xk7sIJdYDOx5nOF2lRZ+BVAaf3lrF56YyoHiD6Ce 3ARXn99pC1J6/K/sfXW/uxSMZCfe/TErL36wHHrAs4ZpH6+iZ76AnFUkFnTwX34O0aPtxa RNq90WLgXEuGDEEdKQYNbLDf4XwvjpQYCLs7Jzd4HZbe6Zzz9yAby6FkrCDERQjoYNR+W9 rjeW8mTIucxR7QW2LzPXu1xrGKIMW1TnfwJ3v+6GkKFt2s+nwMTqe0fzoTbGKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfrkK6fHYzjwk; Fri, 24 Jan 2025 21:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OLbDro094812; Fri, 24 Jan 2025 21:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OLbDn2094809; Fri, 24 Jan 2025 21:37:13 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:37:13 GMT Message-Id: <202501242137.50OLbDn2094809@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: 707136024fcc - main - stand: remove unnecessary checks for "elfN kernel" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 707136024fcc64be5008c793cdbdd05720be0e18 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=707136024fcc64be5008c793cdbdd05720be0e18 commit 707136024fcc64be5008c793cdbdd05720be0e18 Author: Ahmad Khalifa AuthorDate: 2024-08-22 19:07:59 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:25:52 +0000 stand: remove unnecessary checks for "elfN kernel" We never set the kernel type to either "elf64 kernel" nor "elf32 kernel". Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 --- stand/common/bootstrap.h | 2 +- stand/common/gfx_fb.c | 4 ---- stand/common/metadata.c | 4 +--- stand/efi/loader/bootinfo.c | 2 -- stand/i386/libi386/bootinfo32.c | 2 -- stand/i386/libi386/bootinfo64.c | 2 -- stand/userboot/userboot/bootinfo32.c | 2 -- stand/userboot/userboot/bootinfo64.c | 2 -- 8 files changed, 2 insertions(+), 18 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index 37cef2956f40..cc198490ac3b 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -230,7 +230,7 @@ struct kernel_module struct preloaded_file { char *f_name; /* file name */ - char *f_type; /* verbose file type, eg 'ELF kernel', 'pnptable', etc. */ + char *f_type; /* verbose file type, eg 'elf kernel', 'pnptable', etc. */ char *f_args; /* arguments for the file */ /* metadata that will be placed in the module directory */ struct file_metadata *f_metadata; diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 9942c629d124..9bda0e7139a9 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -2983,8 +2983,6 @@ build_font_module(vm_offset_t addr) fi.fi_checksum = -checksum; fp = file_findfile(NULL, "elf kernel"); - if (fp == NULL) - fp = file_findfile(NULL, "elf64 kernel"); if (fp == NULL) panic("can't find kernel file"); @@ -3027,8 +3025,6 @@ build_splash_module(vm_offset_t addr) } fp = file_findfile(NULL, "elf kernel"); - if (fp == NULL) - fp = file_findfile(NULL, "elf64 kernel"); if (fp == NULL) panic("can't find kernel file"); diff --git a/stand/common/metadata.c b/stand/common/metadata.c index f95763bfd01b..8962763061dc 100644 --- a/stand/common/metadata.c +++ b/stand/common/metadata.c @@ -146,9 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64) #endif kernend = 0; - kfp = file_findfile(NULL, kern64 ? "elf64 kernel" : "elf32 kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, "elf kernel"); if (kfp == NULL) panic("can't find kernel file"); file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 99a7b1444aca..b7d4070c2ffb 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -421,8 +421,6 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) #endif kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf64 kernel"); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index 535849011b6b..df715e547795 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -130,8 +130,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t addr = roundup(addr, PAGE_SIZE); kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf32 kernel"); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index a55b86eb5ba7..4731b10325fe 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -144,8 +144,6 @@ bi_load64(char *args, vm_offset_t *modulep, module = *modulep = addr; kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf64 kernel"); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c index aae94e6a2370..91f1f81f1181 100644 --- a/stand/userboot/userboot/bootinfo32.c +++ b/stand/userboot/userboot/bootinfo32.c @@ -109,8 +109,6 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t addr = roundup(addr, PAGE_SIZE); kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf32 kernel"); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c index b7c07e152b8a..fb9fd0fb82f1 100644 --- a/stand/userboot/userboot/bootinfo64.c +++ b/stand/userboot/userboot/bootinfo64.c @@ -141,8 +141,6 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) addr = roundup(addr, PAGE_SIZE); kfp = file_findfile(NULL, "elf kernel"); - if (kfp == NULL) - kfp = file_findfile(NULL, "elf64 kernel"); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ From nobody Fri Jan 24 21:37:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfrkM3CLlz5lRn0; Fri, 24 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfrkM19wqz3jms; Fri, 24 Jan 2025 21:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2vyQfT1Gam8rcqMvglZidHUdnYAbUpmlW9OcDDpzPM=; b=dcb2oyQRxfN/6/l2SQzlMOq5WeQdoAv7L4uezU7TVl+qE/n0OCr1fMHdwbRv49GuK9/5XC 6BBwp6xLyNxsATTdlZWa6RjNiHXBJiyh0qQi1jVTyjJjL9dMu4CtHN2SzEiqpI1QeKMJEc 2EhxkiL7vL/ofCn0XILQk+fBFBBZ9YaEp0GmhacHKIKW19Xk49dI75MGqZ512bP56WJfg/ NGwY1po85jjkyN4Tx+ycWYCcW7gx/0RxwpJNrqhLR/LQh3MPxm6lziyf9SSpOZB1nylnve 0RTi5D77pPyAwlwQPs/UjJ6Z3Eef2NCKpWLBzByZnDzdQlg00mdzShDBfKDt+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2vyQfT1Gam8rcqMvglZidHUdnYAbUpmlW9OcDDpzPM=; b=DLhnNpHzTfCa+emhYZJwszEFu/w3WvbjItjDStTqoLirR3dd1/RGqbG5ixU4invxzaWWDA mdCItZiPpu0YGVAWGJ6YQoVwomUxzebFyBdffTLjeUtMKR1UP5YkaZYqwRXjvDcok1LwRO /PFRNQahuQ4qRDqVNi8+EbbH2bf6ODwdhfl63IuDBmaC2Lp7piZGJ4EpFiRCvee8VbnpV4 Iz5fFp/4rIKhxXgc1UjOCdZbf+IEw1Jdg2VnYIR0ElS/SslcAuAGbz/dAcRNKUMkA2b0kS LcsoulMYacsvxWc7786fMEgmLFBNuPPHopcdZLjCmFi7fOc4ASuO7UdX92kR+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737754635; a=rsa-sha256; cv=none; b=LCM8HGUMf033xZmwWpIhSszkwTw0BIi9mzIrlHRM04Px5LUztJmAGknC+k2ue3PCOXK1zG h3yQttkI9Ci99Dowcz22VYj7T0k5wC8sVKLL3LLRLLno17uW+q0txq2j11baOnmHEi2BQT rnlbPvjJqkkZgQZz49nBiljch77+cpvsd4L/nuFdKVWpGnu3HXVupXDe5gQF9h5umFc6NL dTv9mQh/n7tsWXeK3ofohcUTzojXy4MxOIz/kp8oyDjpOzFhIuE5mfEP5H7bTJS1EWYeCe WadBTUsikn6yEK/+53qdW3AW68bjI0qsI6/AX8M5y4621utHpGI5GBJXBr6lLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfrkM0nGKzkDW; Fri, 24 Jan 2025 21:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OLbFDY094853; Fri, 24 Jan 2025 21:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OLbEur094850; Fri, 24 Jan 2025 21:37:14 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:37:14 GMT Message-Id: <202501242137.50OLbEur094850@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: 4d213c595ac3 - main - sys: use globals for the ELF kernel and module type strings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 4d213c595ac3247a85cea5d3ea521db14151a427 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4d213c595ac3247a85cea5d3ea521db14151a427 commit 4d213c595ac3247a85cea5d3ea521db14151a427 Author: Ahmad Khalifa AuthorDate: 2024-08-24 15:12:52 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:29:39 +0000 sys: use globals for the ELF kernel and module type strings Initialize the globals with macros so we can use the same values in the loader. Also remove unnecessary "elfN module" checks. Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 --- sys/arm/arm/machdep_boot.c | 8 ++++---- sys/arm64/arm64/machdep_boot.c | 2 +- sys/kern/link_elf.c | 4 +--- sys/kern/link_elf_obj.c | 5 +---- sys/kern/subr_module.c | 6 +++++- sys/powerpc/powerpc/machdep.c | 9 ++++----- sys/riscv/riscv/machdep.c | 2 +- sys/sys/linker.h | 11 +++++++++++ 8 files changed, 28 insertions(+), 19 deletions(-) diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c index 534d34acabe2..e2416f86ad23 100644 --- a/sys/arm/arm/machdep_boot.c +++ b/sys/arm/arm/machdep_boot.c @@ -356,12 +356,12 @@ fake_preload_metadata(struct arm_boot_params *abp __unused, void *dtb_ptr, fake_preload[i++] = MODINFO_NAME; fake_preload[i++] = strlen("kernel") + 1; - strcpy((char*)&fake_preload[i++], "kernel"); + strcpy((char *)&fake_preload[i++], "kernel"); i += 1; fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; + fake_preload[i++] = strlen(preload_kerntype) + 1; + strcpy((char *)&fake_preload[i], preload_kerntype); + i += howmany(fake_preload[i - 1], sizeof(uint32_t)); fake_preload[i++] = MODINFO_ADDR; fake_preload[i++] = sizeof(vm_offset_t); fake_preload[i++] = KERNVIRTADDR; diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 029ae23530ff..83bd74ea7317 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -98,7 +98,7 @@ fake_preload_metadata(void *dtb_ptr, size_t dtb_size) PRELOAD_PUSH_STRING("kernel"); PRELOAD_PUSH_VALUE(uint32_t, MODINFO_TYPE); - PRELOAD_PUSH_STRING("elf kernel"); + PRELOAD_PUSH_STRING(preload_kerntype); PRELOAD_PUSH_VALUE(uint32_t, MODINFO_ADDR); PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 23a924636ca2..53af1e164980 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -895,9 +895,7 @@ link_elf_link_preload(linker_class_t cls, const char *filename, sizeptr = preload_search_info(modptr, MODINFO_SIZE); dynptr = preload_search_info(modptr, MODINFO_METADATA | MODINFOMD_DYNAMIC); - if (type == NULL || - (strcmp(type, "elf" __XSTRING(__ELF_WORD_SIZE) " module") != 0 && - strcmp(type, "elf module") != 0)) + if (type == NULL || strcmp(type, preload_modtype) != 0) return (EFTYPE); if (baseptr == NULL || sizeptr == NULL || dynptr == NULL) return (EINVAL); diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index a7c7d4826322..02fd4caffcd9 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -365,11 +365,8 @@ link_elf_link_preload(linker_class_t cls, const char *filename, MODINFOMD_ELFHDR); shdr = (Elf_Shdr *)preload_search_info(modptr, MODINFO_METADATA | MODINFOMD_SHDR); - if (type == NULL || (strcmp(type, "elf" __XSTRING(__ELF_WORD_SIZE) - " obj module") != 0 && - strcmp(type, "elf obj module") != 0)) { + if (type == NULL || strcmp(type, preload_modtype_obj) != 0) return (EFTYPE); - } if (baseptr == NULL || sizeptr == NULL || hdr == NULL || shdr == NULL) return (EINVAL); diff --git a/sys/kern/subr_module.c b/sys/kern/subr_module.c index 14272bd913f8..596961606577 100644 --- a/sys/kern/subr_module.c +++ b/sys/kern/subr_module.c @@ -46,10 +46,14 @@ vm_offset_t preload_addr_relocate = 0; caddr_t preload_metadata, preload_kmdp; +const char preload_modtype[] = MODTYPE; +const char preload_kerntype[] = KERNTYPE; +const char preload_modtype_obj[] = MODTYPE_OBJ; + void preload_initkmdp(bool fatal) { - preload_kmdp = preload_search_by_type("elf kernel"); + preload_kmdp = preload_search_by_type(preload_kerntype); if (preload_kmdp == NULL && fatal) panic("unable to find kernel metadata"); diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 96f3b292854d..e9979712aa9c 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -644,15 +644,14 @@ fake_preload_metadata(void) { fake_preload[i++] = MODINFO_NAME; fake_preload[i++] = strlen("kernel") + 1; - strcpy((char*)&fake_preload[i], "kernel"); + strcpy((char *)&fake_preload[i], "kernel"); /* ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ i += 2; fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i], "elf kernel"); - /* ['e' 'l' 'f' ' '] ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ - i += 3; + fake_preload[i++] = strlen(preload_kerntype) + 1; + strcpy((char *)&fake_preload[i], preload_kerntype); + i += howmany(fake_preload[i - 1], sizeof(uint32_t)); #ifdef __powerpc64__ /* Padding -- Fields start on u_long boundaries */ diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index a17cff55f2cc..8d32d348df7d 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -365,7 +365,7 @@ fake_preload_metadata(struct riscv_bootparams *rvbp) PRELOAD_PUSH_VALUE(uint32_t, MODINFO_NAME); PRELOAD_PUSH_STRING("kernel"); PRELOAD_PUSH_VALUE(uint32_t, MODINFO_TYPE); - PRELOAD_PUSH_STRING("elf kernel"); + PRELOAD_PUSH_STRING(preload_kerntype); PRELOAD_PUSH_VALUE(uint32_t, MODINFO_ADDR); PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 77dd437c7ffe..85c50be6c969 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -220,6 +220,14 @@ void linker_kldload_unbusy(int flags); #endif /* _KERNEL */ +/* + * ELF file types + */ +#define KERNTYPE_MB "elf multiboot kernel" +#define KERNTYPE "elf kernel" +#define MODTYPE_OBJ "elf obj module" +#define MODTYPE "elf module" + /* * Module information subtypes */ @@ -273,6 +281,9 @@ void linker_kldload_unbusy(int flags); */ extern vm_offset_t preload_addr_relocate; extern caddr_t preload_metadata, preload_kmdp; +extern const char preload_modtype[]; +extern const char preload_kerntype[]; +extern const char preload_modtype_obj[]; extern void * preload_fetch_addr(caddr_t _mod); extern size_t preload_fetch_size(caddr_t _mod); From nobody Fri Jan 24 21:37:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfrkP4hg2z5lRn8; Fri, 24 Jan 2025 21:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfrkP30bhz3jcb; Fri, 24 Jan 2025 21:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoZPzTw2QsmJ9niSma738YfKITQ3bpRR6HXAQhTIBlA=; b=kH/eLFHtLdPV2uVM3Ctcyt3SawGSCuI3cIkbxMK6nAXKx0b3egqqRRrzF/e1zDlpF0KOOm 8F/VaFWtfSrWymTRXK/TwmPO6lPUCVZCqpstO9d2ush0NzXSLdoxqTcrMRIC2Mi327/xPj yhf0MxN4I7a7yzHPyS1wlTDw6Jx99KaZFtS0CNIlGWwPsBsdVI/PI9MIEZJYr6JShdnZho htF/8Oz5bnZLq0OhaDW2GzSGvRCXrKGBqjxxU4lblB5UYAuID+RelMNuAMJvNOaVQvtYaD n2WBJ7Sse/IlsGK8h8XmuZhPAK4tbEbQcROooLQeJfkR5v9EHsVMcpe9itYJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoZPzTw2QsmJ9niSma738YfKITQ3bpRR6HXAQhTIBlA=; b=LPKmKHO8xaOEHhwsqYRFwdoRQEun/t706hCXY5nd82Kj9RvKW+GV6CiHF373VZlqxT8pGz hl6Hbp21aG25wKsov5Tix5vtKwUtmTdhK/QUC3piCt9V8+kK/rKy3VxOteq1cWdR/4gh2S MQyCbz/O12AL/isaKXJT6NXcuUp9uXZOAgryRS3dJknnpebpPEa6w7kTgzuAolu/pPokY4 zkUh1ZtT2VEYT4JUGbrdaOYh2cIY7nglUXA7GTtQz7Jewrg8wz1lh4PNGjrEAGiinXfLb4 wWpxUvKdJfuwDt3UCLcq1a9nPNBfjS+9RVCufejpnI/EAiJtlykRrqSKzub8cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737754637; a=rsa-sha256; cv=none; b=NQs+ecRMB83WIH0/O0fo9SUyQL7nQg+JljyNB0uQMrVvqgOOJIf4n54TP86qRRG9qDAWGQ 55cvtLEKGtHCT2NHH2kaxONyI0vQW9sek+qs7njfWtMmrW+E9t0WwtuLEBhi+/YBUN/y8j Ocqp8UHPS3dNYJ1JU9nt9DGXMBRzyLNE9O+9g6dqIgW4bPfo8zlSE1jUVqD0lo6ASpq9cz WuRkIPxOGIOZ0hOhK7K9biFgie9SkV2XBp5XU9LwEfUbMFbcmbqYsg+8tukneo3E/Or7H1 SEgo1SFwGuANTgJi2vAX/44nN0eg90tNRkuwXFN8+zpsGU+oThYZa+GemjruVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfrkP22vlzjfk; Fri, 24 Jan 2025 21:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OLbHDm094918; Fri, 24 Jan 2025 21:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OLbHWK094915; Fri, 24 Jan 2025 21:37:17 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:37:17 GMT Message-Id: <202501242137.50OLbHWK094915@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: 86077f4fd110 - main - stand: use globals for the kernel and module types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 86077f4fd11070518a6d04eee7fdb93cbbfb1b52 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86077f4fd11070518a6d04eee7fdb93cbbfb1b52 commit 86077f4fd11070518a6d04eee7fdb93cbbfb1b52 Author: Ahmad Khalifa AuthorDate: 2024-08-24 15:16:09 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:29:39 +0000 stand: use globals for the kernel and module types Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 --- stand/common/gfx_fb.c | 6 ++++-- stand/common/load_elf.c | 12 +++++------- stand/common/load_elf_obj.c | 8 +++----- stand/common/metadata.c | 2 +- stand/common/modinfo.c | 5 +++++ stand/common/modinfo.h | 5 +++++ stand/efi/loader/arch/amd64/multiboot2.c | 9 +++++---- stand/efi/loader/bootinfo.c | 2 +- stand/i386/libi386/bootinfo32.c | 2 +- stand/i386/libi386/bootinfo64.c | 2 +- stand/i386/libi386/multiboot.c | 9 +++++---- stand/powerpc/ofw/elf_freebsd.c | 2 +- stand/powerpc/ofw/ppc64_elf_freebsd.c | 2 +- stand/uboot/arch/powerpc/ppc64_elf_freebsd.c | 2 +- stand/uboot/elf_freebsd.c | 2 +- stand/userboot/userboot/bootinfo32.c | 2 +- stand/userboot/userboot/bootinfo64.c | 2 +- 17 files changed, 42 insertions(+), 32 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 9bda0e7139a9..63036f3c07f6 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -102,6 +102,8 @@ #include #endif +#include "modinfo.h" + /* VGA text mode does use bold font. */ #if !defined(VGA_8X16_FONT) #define VGA_8X16_FONT "/boot/fonts/8x16b.fnt" @@ -2982,7 +2984,7 @@ build_font_module(vm_offset_t addr) fi.fi_checksum = -checksum; - fp = file_findfile(NULL, "elf kernel"); + fp = file_findfile(NULL, md_kerntype); if (fp == NULL) panic("can't find kernel file"); @@ -3024,7 +3026,7 @@ build_splash_module(vm_offset_t addr) return (addr); } - fp = file_findfile(NULL, "elf kernel"); + fp = file_findfile(NULL, md_kerntype); if (fp == NULL) panic("can't find kernel file"); diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index d3775b9f0017..e19aefa121e7 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -37,6 +37,7 @@ #include #include "bootstrap.h" +#include "modinfo.h" #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) @@ -89,9 +90,6 @@ static int __elfN(parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef, static symaddr_fn __elfN(symaddr); static char *fake_modname(const char *name); -const char *__elfN(kerneltype) = "elf kernel"; -const char *__elfN(moduletype) = "elf module"; - uint64_t __elfN(relocation_offset) = 0; #ifdef __powerpc__ @@ -384,7 +382,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, /* * Check to see what sort of module we are. */ - kfp = file_findfile(NULL, __elfN(kerneltype)); + kfp = file_findfile(NULL, md_kerntype); #ifdef __powerpc__ /* * Kernels can be ET_DYN, so just assume the first loaded object is the @@ -435,7 +433,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, err = EPERM; goto oerr; } - if (strcmp(__elfN(kerneltype), kfp->f_type)) { + if (strcmp(md_kerntype, kfp->f_type)) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: can't load module with kernel type '%s'\n", kfp->f_type); @@ -470,9 +468,9 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, fp->f_name = strdup(filename); if (multiboot == 0) fp->f_type = strdup(ef.kernel ? - __elfN(kerneltype) : __elfN(moduletype)); + md_kerntype : md_modtype); else - fp->f_type = strdup("elf multiboot kernel"); + fp->f_type = strdup(md_kerntype_mb); if (module_verbose >= MODULE_VERBOSE_FULL) { if (ef.kernel) diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c index 9ff1d238b8c8..1e07828dd8ac 100644 --- a/stand/common/load_elf_obj.c +++ b/stand/common/load_elf_obj.c @@ -37,6 +37,7 @@ #include #include "bootstrap.h" +#include "modinfo.h" #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) @@ -77,9 +78,6 @@ static int __elfN(obj_parse_modmetadata)(struct preloaded_file *mp, elf_file_t ef); static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symidx); -const char *__elfN(obj_kerneltype) = "elf kernel"; -const char *__elfN(obj_moduletype) = "elf obj module"; - /* * Attempt to load the file (file) as an ELF module. It will be stored at * (dest), and a pointer to a module structure describing the loaded object @@ -154,7 +152,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest, } #endif - kfp = file_findfile(NULL, __elfN(obj_kerneltype)); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadfile: can't load module before kernel\n"); @@ -178,7 +176,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest, goto out; } fp->f_name = strdup(filename); - fp->f_type = strdup(__elfN(obj_moduletype)); + fp->f_type = strdup(md_modtype_obj); if (module_verbose > MODULE_VERBOSE_SILENT) printf("%s ", filename); diff --git a/stand/common/metadata.c b/stand/common/metadata.c index 8962763061dc..22df6f175791 100644 --- a/stand/common/metadata.c +++ b/stand/common/metadata.c @@ -146,7 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64) #endif kernend = 0; - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c index 381bd9dfd719..d00548c91c57 100644 --- a/stand/common/modinfo.c +++ b/stand/common/modinfo.c @@ -109,6 +109,11 @@ #define MOD_ALIGN(l) roundup(l, align) +const char md_modtype[] = MODTYPE; +const char md_kerntype[] = KERNTYPE; +const char md_modtype_obj[] = MODTYPE_OBJ; +const char md_kerntype_mb[] = KERNTYPE_MB; + vm_offset_t md_copymodules(vm_offset_t addr, bool kern64) { diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h index 967367beeeb0..d26129089fb6 100644 --- a/stand/common/modinfo.h +++ b/stand/common/modinfo.h @@ -6,6 +6,11 @@ #ifndef COMMON_MODINFO_H #define COMMON_MODINFO_H +extern const char md_modtype[]; +extern const char md_kerntype[]; +extern const char md_modtype_obj[]; +extern const char md_kerntype_mb[]; + int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/loader/arch/amd64/multiboot2.c index d09b01fce1fc..eb7362293406 100644 --- a/stand/efi/loader/arch/amd64/multiboot2.c +++ b/stand/efi/loader/arch/amd64/multiboot2.c @@ -51,6 +51,7 @@ #include "bootstrap.h" #include "multiboot2.h" #include "loader_efi.h" +#include "modinfo.h" extern int elf32_loadfile_raw(char *filename, uint64_t dest, struct preloaded_file **result, int multiboot); @@ -436,7 +437,7 @@ exec(struct preloaded_file *fp) * module 0 module 1 */ - fp = file_findfile(NULL, "elf kernel"); + fp = file_findfile(NULL, md_kerntype); if (fp == NULL) { printf("No FreeBSD kernel provided, aborting\n"); error = EINVAL; @@ -498,7 +499,7 @@ obj_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) int error; /* See if there's a multiboot kernel loaded */ - mfp = file_findfile(NULL, "elf multiboot kernel"); + mfp = file_findfile(NULL, md_kerntype_mb); if (mfp == NULL) return (EFTYPE); @@ -506,14 +507,14 @@ obj_loadfile(char *filename, uint64_t dest, struct preloaded_file **result) * We have a multiboot kernel loaded, see if there's a FreeBSD * kernel loaded also. */ - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) { /* * No kernel loaded, this must be it. The kernel has to * be loaded as a raw file, it will be processed by * Xen and correctly loaded as an ELF file. */ - rfp = file_loadraw(filename, "elf kernel", 0); + rfp = file_loadraw(filename, md_kerntype, 0); if (rfp == NULL) { printf( "Unable to load %s as a multiboot payload kernel\n", diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index b7d4070c2ffb..3e74a9228b5e 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -420,7 +420,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) addr += roundup(dtb_size, PAGE_SIZE); #endif - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index df715e547795..37b227b913bd 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -129,7 +129,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 4731b10325fe..f7181dcd599f 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -143,7 +143,7 @@ bi_load64(char *args, vm_offset_t *modulep, /* place the metadata before anything */ module = *modulep = addr; - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multiboot.c index b69895de9706..e2bd44fe83f5 100644 --- a/stand/i386/libi386/multiboot.c +++ b/stand/i386/libi386/multiboot.c @@ -48,6 +48,7 @@ #include "bootstrap.h" #include "multiboot.h" #include "libi386.h" +#include "modinfo.h" #include #define MULTIBOOT_SUPPORTED_FLAGS \ @@ -256,7 +257,7 @@ multiboot_exec(struct preloaded_file *fp) * module 0 module 1 */ - fp = file_findfile(NULL, "elf kernel"); + fp = file_findfile(NULL, md_kerntype); if (fp == NULL) { printf("No FreeBSD kernel provided, aborting\n"); error = EINVAL; @@ -324,7 +325,7 @@ multiboot_obj_loadfile(char *filename, uint64_t dest, int error, mod_num; /* See if there's a multiboot kernel loaded */ - mfp = file_findfile(NULL, "elf multiboot kernel"); + mfp = file_findfile(NULL, md_kerntype_mb); if (mfp == NULL) return (EFTYPE); @@ -332,14 +333,14 @@ multiboot_obj_loadfile(char *filename, uint64_t dest, * We have a multiboot kernel loaded, see if there's a FreeBSD * kernel loaded also. */ - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) { /* * No kernel loaded, this must be it. The kernel has to * be loaded as a raw file, it will be processed by * Xen and correctly loaded as an ELF file. */ - rfp = file_loadraw(filename, "elf kernel", 0); + rfp = file_loadraw(filename, md_kerntype, 0); if (rfp == NULL) { printf( "Unable to load %s as a multiboot payload kernel\n", diff --git a/stand/powerpc/ofw/elf_freebsd.c b/stand/powerpc/ofw/elf_freebsd.c index 21ab834f76fa..4d34fa18c5dd 100644 --- a/stand/powerpc/ofw/elf_freebsd.c +++ b/stand/powerpc/ofw/elf_freebsd.c @@ -58,7 +58,7 @@ __elfN(ofw_loadfile)(char *filename, uint64_t dest, * No need to sync the icache for modules: this will * be done by the kernel after relocation. */ - if (!strcmp((*result)->f_type, "elf kernel")) + if (!strcmp((*result)->f_type, md_kerntype)) __syncicache((void *) (*result)->f_addr, (*result)->f_size); #endif return (0); diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c b/stand/powerpc/ofw/ppc64_elf_freebsd.c index e0518abe2283..bc68d129f353 100644 --- a/stand/powerpc/ofw/ppc64_elf_freebsd.c +++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c @@ -57,7 +57,7 @@ ppc64_ofw_elf_loadfile(char *filename, uint64_t dest, * No need to sync the icache for modules: this will * be done by the kernel after relocation. */ - if (!strcmp((*result)->f_type, "elf kernel")) + if (!strcmp((*result)->f_type, md_kerntype)) __syncicache((void *) (*result)->f_addr, (*result)->f_size); return (0); } diff --git a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c index 291fe6b944fb..e500b862de2e 100644 --- a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c +++ b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c @@ -53,7 +53,7 @@ ppc64_uboot_elf_loadfile(char *filename, uint64_t dest, * No need to sync the icache for modules: this will * be done by the kernel after relocation. */ - if (!strcmp((*result)->f_type, "elf kernel")) + if (!strcmp((*result)->f_type, md_kerntype)) __syncicache((void *) (*result)->f_addr, (*result)->f_size); return (0); } diff --git a/stand/uboot/elf_freebsd.c b/stand/uboot/elf_freebsd.c index 6c764d143881..3b1bdc542538 100644 --- a/stand/uboot/elf_freebsd.c +++ b/stand/uboot/elf_freebsd.c @@ -53,7 +53,7 @@ __elfN(uboot_load)(char *filename, uint64_t dest, * No need to sync the icache for modules: this will * be done by the kernel after relocation. */ - if (!strcmp((*result)->f_type, "elf kernel")) + if (!strcmp((*result)->f_type, md_kerntype)) __syncicache((void *) (*result)->f_addr, (*result)->f_size); #endif return (0); diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c index 91f1f81f1181..750574912172 100644 --- a/stand/userboot/userboot/bootinfo32.c +++ b/stand/userboot/userboot/bootinfo32.c @@ -108,7 +108,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c index fb9fd0fb82f1..d20202bf4fbb 100644 --- a/stand/userboot/userboot/bootinfo64.c +++ b/stand/userboot/userboot/bootinfo64.c @@ -140,7 +140,7 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); - kfp = file_findfile(NULL, "elf kernel"); + kfp = file_findfile(NULL, md_kerntype); if (kfp == NULL) panic("can't find kernel file"); kernend = 0; /* fill it in later */ From nobody Fri Jan 24 21:43:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfrs35ZKWz5lSN0; Fri, 24 Jan 2025 21:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfrs32S5Nz3lQy; Fri, 24 Jan 2025 21:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epzHe+UpRnfMHZDtwg6V6BuXMqcUJaUk5dAJ2n/GnYI=; b=F/litTajukGXxt1Pl3zXdIYGBED31dA7mg6rRsE/wfBDZNhZ1RJ1LaYEHa+k3G8Q+ipqXb kN9SBOb/98dmHCyOT2Qi/XblRDXc7Blv4qhpwbu8TlzpUlyeyXxToMcMzfLRZ9dYA/Np9T FpuiyDn6mIhk2lvMfPctEJa/kbkfhphfRGhaeHlbMh5PsRKms+J4bCjuIxhcd9jNIYyxfK ijWCdTh0HveEXHWNhh6HlBJi0O3I0/oCjQr1PPFLjw9+c431rZtVsaRFEh6mIeG/PZw97x GpGIgS0ysapRJYJBdTC4pk6Z/PoX3gSC56+25+O30nUAEgkr8MebWtk8T5DQbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737754983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epzHe+UpRnfMHZDtwg6V6BuXMqcUJaUk5dAJ2n/GnYI=; b=DBdam54MKd7rfJ1jm6cK/UfNe00+hntTf1o/Cctn20GS1zXMgUKYvoBAIVw4PXgKajXkV0 rLjfoIiXjme6vFos59lNdtmoJZ0E2zeMeWXU6Drtr5cDK+26WBA0UZTfrnkX4uDNNoKir/ 6v6G7tWYto3RObny6yZ1lRW+xYIJbfVytb9nlPeKQVkxhslRMnLH4ezuGrKegqY1Pcmsl5 zgsDRRy1+AredyuH2Vn+RVVbbtY+PGGzypr2ZbpdJXMZFRiaAhJvD3els2kkpRw09V+JNI h0YqoZScmzTEPJiihny0GFPugbdjQc+B1dbXKhn3zuvE1ouugacRyMEY46iDYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737754983; a=rsa-sha256; cv=none; b=YJt3ZYYSj8iktkxGROkYtf8RXuGJFLrf+OXgpMNSiJCZxUs1o7ttibCt/qBAopYNxPbVn7 KcLcX0GDb6FwbBwl7+n59cXWFHvDRiaGgXtyUEIL/jyyDQwF0lYbELktpMxcmviukfeWAo LbrTB697KxC6ubjlW3X8LuX9GCvhsHXKlOeMke2HjewpL4QoHCH1bYGmDbEq49//4WtATP jGfwHeacfHtEpmxGDYNhmISzWLUqe1qQ6pN93KRAoywOl2IDGuWJEqCswmSh6H8fecTkB1 9QU6hY8XNPXPRalwudNXijbX2jROxH5laemSNvpG/QHY/jQgsGo2SRh1pj9SGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfrs321Q7zjw0; Fri, 24 Jan 2025 21:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OLh3Hq012743; Fri, 24 Jan 2025 21:43:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OLh3Kv012740; Fri, 24 Jan 2025 21:43:03 GMT (envelope-from git) Date: Fri, 24 Jan 2025 21:43:03 GMT Message-Id: <202501242143.50OLh3Kv012740@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: b2a49e88d1c6 - main - intpm: use MMIO for AMD EFCH CPUs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: b2a49e88d1c65ee41279b593fe0d50ce4ec31f75 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b2a49e88d1c65ee41279b593fe0d50ce4ec31f75 commit b2a49e88d1c65ee41279b593fe0d50ce4ec31f75 Author: Brian Poole AuthorDate: 2024-10-07 13:09:35 +0000 Commit: Warner Losh CommitDate: 2025-01-24 21:42:40 +0000 intpm: use MMIO for AMD EFCH CPUs Recent AMD CPUs (SMBus PCI revision ID >= 0x51) can disable port-mapped IO and only support memory-mapped IO. In practice this was observed on a Zen 3 CPU where PMIO reads all returned 0xff. Update the driver to use MMIO for these processors while continuing to use PMIO by default. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1437 --- sys/dev/amdsbwd/amd_chipset.h | 2 ++ sys/dev/intpm/intpm.c | 44 ++++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/sys/dev/amdsbwd/amd_chipset.h b/sys/dev/amdsbwd/amd_chipset.h index 1bc637a30845..44db7b3168d0 100644 --- a/sys/dev/amdsbwd/amd_chipset.h +++ b/sys/dev/amdsbwd/amd_chipset.h @@ -123,6 +123,7 @@ */ #define AMDFCH41_WDT_FIXED_ADDR 0xfeb00000u #define AMDFCH41_MMIO_ADDR 0xfed80000u +#define AMDFCH41_MMIO_PM_OFF 0x0300 #define AMDFCH41_MMIO_SMBUS_OFF 0x0a00 #define AMDFCH41_MMIO_WDT_OFF 0x0b00 @@ -143,5 +144,6 @@ #define AMDFCH41_SMBUS_REVID 0x41 #define AMDCZ_SMBUS_DEVID 0x790b1022 #define AMDCZ49_SMBUS_REVID 0x49 +#define AMDCZ51_SMBUS_REVID 0x51 #define HYGONCZ_SMBUS_DEVID 0x790b1d94 diff --git a/sys/dev/intpm/intpm.c b/sys/dev/intpm/intpm.c index 3aa76ff48263..2f12e0dcf49b 100644 --- a/sys/dev/intpm/intpm.c +++ b/sys/dev/intpm/intpm.c @@ -55,6 +55,7 @@ struct intsmb_softc { int cfg_irq9; int sb8xx; int poll; + int type; struct mtx lock; }; @@ -135,28 +136,44 @@ sb8xx_attach(device_t dev) struct resource *res; uint32_t devid; uint8_t revid; - uint16_t addr; + uint32_t addr; int rid; int rc; bool enabled; sc = device_get_softc(dev); + devid = pci_get_devid(dev); + revid = pci_get_revid(dev); + + /* + * Comment from Linux i2c-piix4.c: + * + * cd6h/cd7h port I/O accesses can be disabled on AMD processors + * w/ SMBus PCI revision ID 0x51 or greater. MMIO is supported on + * the same processors and is the recommended access method. + */ + if (devid == AMDCZ_SMBUS_DEVID && revid >= AMDCZ51_SMBUS_REVID) { + sc->type = SYS_RES_MEMORY; + addr = AMDFCH41_MMIO_ADDR + AMDFCH41_MMIO_PM_OFF; + } else { + sc->type = SYS_RES_IOPORT; + addr = AMDSB_PMIO_INDEX; + } + rid = 0; - rc = bus_set_resource(dev, SYS_RES_IOPORT, rid, AMDSB_PMIO_INDEX, + rc = bus_set_resource(dev, sc->type, rid, addr, AMDSB_PMIO_WIDTH); if (rc != 0) { device_printf(dev, "bus_set_resource for PM IO failed\n"); return (ENXIO); } - res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + res = bus_alloc_resource_any(dev, sc->type, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, "bus_alloc_resource for PM IO failed\n"); return (ENXIO); } - devid = pci_get_devid(dev); - revid = pci_get_revid(dev); if (devid == AMDSB_SMBUS_DEVID || (devid == AMDFCH_SMBUS_DEVID && revid < AMDFCH41_SMBUS_REVID) || (devid == AMDCZ_SMBUS_DEVID && revid < AMDCZ49_SMBUS_REVID)) { @@ -165,6 +182,10 @@ sb8xx_attach(device_t dev) addr |= amd_pmio_read(res, AMDSB8_PM_SMBUS_EN); enabled = (addr & AMDSB8_SMBUS_EN) != 0; addr &= AMDSB8_SMBUS_ADDR_MASK; + } else if (devid == AMDCZ_SMBUS_DEVID && revid >= AMDCZ51_SMBUS_REVID) { + addr = bus_read_1(res, AMDFCH41_PM_DECODE_EN0); + enabled = (addr & AMDFCH41_SMBUS_EN) != 0; + addr = AMDFCH41_MMIO_ADDR + AMDFCH41_MMIO_SMBUS_OFF; } else { addr = amd_pmio_read(res, AMDFCH41_PM_DECODE_EN0); enabled = (addr & AMDFCH41_SMBUS_EN) != 0; @@ -172,8 +193,8 @@ sb8xx_attach(device_t dev) addr <<= 8; } - bus_release_resource(dev, SYS_RES_IOPORT, rid, res); - bus_delete_resource(dev, SYS_RES_IOPORT, rid); + bus_release_resource(dev, sc->type, rid, res); + bus_delete_resource(dev, sc->type, rid); if (!enabled) { device_printf(dev, "SB8xx/SB9xx/FCH SMBus not enabled\n"); @@ -181,13 +202,13 @@ sb8xx_attach(device_t dev) } sc->io_rid = 0; - rc = bus_set_resource(dev, SYS_RES_IOPORT, sc->io_rid, addr, + rc = bus_set_resource(dev, sc->type, sc->io_rid, addr, AMDSB_SMBIO_WIDTH); if (rc != 0) { device_printf(dev, "bus_set_resource for SMBus IO failed\n"); return (ENXIO); } - sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, + sc->io_res = bus_alloc_resource_any(dev, sc->type, &sc->io_rid, RF_ACTIVE); if (sc->io_res == NULL) { device_printf(dev, "Could not allocate I/O space\n"); @@ -208,7 +229,7 @@ intsmb_release_resources(device_t dev) if (sc->irq_res) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); if (sc->io_res) - bus_release_resource(dev, SYS_RES_IOPORT, sc->io_rid, + bus_release_resource(dev, sc->type, sc->io_rid, sc->io_res); mtx_destroy(&sc->lock); } @@ -226,6 +247,7 @@ intsmb_attach(device_t dev) mtx_init(&sc->lock, device_get_nameunit(dev), "intsmb", MTX_DEF); sc->cfg_irq9 = 0; + sc->type = SYS_RES_IOPORT; switch (pci_get_devid(dev)) { #ifndef NO_CHANGE_PCICONF case 0x71138086: /* Intel 82371AB */ @@ -254,7 +276,7 @@ intsmb_attach(device_t dev) } sc->io_rid = PCI_BASE_ADDR_SMB; - sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, + sc->io_res = bus_alloc_resource_any(dev, sc->type, &sc->io_rid, RF_ACTIVE); if (sc->io_res == NULL) { device_printf(dev, "Could not allocate I/O space\n"); From nobody Fri Jan 24 21:53:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfs5x1WdJz5lT01 for ; Fri, 24 Jan 2025 21:54:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfs5w1b1hz3mdb for ; Fri, 24 Jan 2025 21:54:12 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso16856095e9.0 for ; Fri, 24 Jan 2025 13:54:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737755650; x=1738360450; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+atPXhcjdb+wiLPqosVItcbvpbpO5RxaV2onX1zPZMU=; b=O0xXFUMR3EDptfvQYSdYzeexwNCZ2ouYHfJkwHjZtrOCopr2+j/ZsCbLtnCGbomXsi yGod0cgkCF9O47wZLlavxM5nXW9T0F1wou43ey2gWflXIj/arYx2esnnxXAc7/lAEWe4 HlcymZVKmyK0C1ZylU05LHy5uwYw05OvStnXg8f5idPpwnGW48ock5v63n8ZlZInHBFO PmAXX+Go6Vbl5HAzDu0WLtuQ/a+cDZgZWgJHKLm6YQYAG2tApG0LtKUMk34ZwgtZMbq4 za/rjKtI0nRySz/quLWGxcaBxskyfP6Ax668VU4Hy26Yk0xr0SII0sdeD3ujixzUCRjQ MwlA== X-Forwarded-Encrypted: i=1; AJvYcCUUU+VMMwryLoJjBt9edCmbnmgRwMgTE8IeAoPIw9Tbit8rafXbX7UUw91NCfddegZBqwRtZuIe4vL2eOVZi3jkwcl5@freebsd.org X-Gm-Message-State: AOJu0YxFOIjt0guOEZtsg16jqSMgrlqXYJ2cCboCnPlAhd6xtlbf5XhM AzFENxTPLEX9X449DFJyYmq0FdlGHumPQvKIxPSXj3pkxYgSToIt4hh0tuGcU8A= X-Gm-Gg: ASbGnctjV+FBTj7+VeSSsBH2SggZAF8n0fxakVe9YqfYQLCHXEIh6PsMpcpkunsBECg aAv2+9r4L53NFA6pTCGarjDicXlFHNDnbNCmNR8SEPyKWvVxVHufbyNNS77amKnl/ZGWg6XpmUk 6dXKHb1A/P4J+zM9gMnLyUnQpHWIoZoBB6jU4q2BldiJZCMjFHQLWGvQ/ExFAaxJZEx8QBHPT+s dgFkaoc19wux5RSl+/33eD/iOWHEdQPeLB5BulSbMVXjQO/1DRREdwgZg/Fcy5u/z+VYTqSNbzC amfxerIGh31aWcGI2XmH22T/nQ2H8g== X-Google-Smtp-Source: AGHT+IH2K2BTVALY2EBj5DUGShHoBclCbPlKKfietiKmkSNyyi17/FYJYxoE0I5H7nIgMepTqUa9aw== X-Received: by 2002:adf:e005:0:b0:38a:41f8:8abf with SMTP id ffacd0b85a97d-38bf566d296mr21829301f8f.31.1737755649484; Fri, 24 Jan 2025 13:54:09 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176449sm3892529f8f.11.2025.01.24.13.54.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2025 13:54:08 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 4d213c595ac3 - main - sys: use globals for the ELF kernel and module type strings From: Jessica Clarke In-Reply-To: <202501242137.50OLbEur094850@gitrepo.freebsd.org> Date: Fri, 24 Jan 2025 21:53:57 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5156861D-A6F2-4CB2-A0CD-C8568D3A6A6A@freebsd.org> References: <202501242137.50OLbEur094850@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4Yfs5w1b1hz3mdb X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 24 Jan 2025, at 21:37, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D4d213c595ac3247a85cea5d3ea521db1= 4151a427 >=20 > commit 4d213c595ac3247a85cea5d3ea521db14151a427 > Author: Ahmad Khalifa > AuthorDate: 2024-08-24 15:12:52 +0000 > Commit: Warner Losh > CommitDate: 2025-01-24 21:29:39 +0000 >=20 > sys: use globals for the ELF kernel and module type strings Why do we need the globals rather than just using the macros? String literals, via the macros, have the advantage that they can be merged by the linker, whereas initialising a global requires allocating a non-overlapping object for it. I see kib@ argued for doing this, but the justification is flawed. Unless you explicitly pass -O0 to the linker, string literals are at least as efficient as named globals. The only advantages of the named global are: (a) guaranteeing only one copy of the string exists (i.e. for when you require address equality), but any worthwhile linker will perform that optimisation for SHF_MERGE sections anyway so if it=E2=80=99s just for optimisation then that=E2=80=99s not worthwhile (b) guaranteeing the address is unique compared with other unrelated instances of the string The downside is it cannot be merged with other strings (and in some cases you can end up with less efficient code due to symbol preemption, though that=E2=80=99s not true here). That is, if you have: foo("more than a short string", "a short string"); then the string literals can, and with ld.lld -O2 (I believe the default in GNU ld; LLD defaults to -O1 which only merges identical strings) will, be combined such that the second is a pointer to the tail substring of the first. So I don=E2=80=99t see a good reason for using explicit globals here. = Using the macros directly should be just as performant whilst being simpler and shorter. Jess > Initialize the globals with macros so we can use the same values in = the > loader. >=20 > Also remove unnecessary "elfN module" checks. >=20 > Reviewed by: imp, kib > Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 > --- > sys/arm/arm/machdep_boot.c | 8 ++++---- > sys/arm64/arm64/machdep_boot.c | 2 +- > sys/kern/link_elf.c | 4 +--- > sys/kern/link_elf_obj.c | 5 +---- > sys/kern/subr_module.c | 6 +++++- > sys/powerpc/powerpc/machdep.c | 9 ++++----- > sys/riscv/riscv/machdep.c | 2 +- > sys/sys/linker.h | 11 +++++++++++ > 8 files changed, 28 insertions(+), 19 deletions(-) >=20 > diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c > index 534d34acabe2..e2416f86ad23 100644 > --- a/sys/arm/arm/machdep_boot.c > +++ b/sys/arm/arm/machdep_boot.c > @@ -356,12 +356,12 @@ fake_preload_metadata(struct arm_boot_params = *abp __unused, void *dtb_ptr, >=20 > fake_preload[i++] =3D MODINFO_NAME; > fake_preload[i++] =3D strlen("kernel") + 1; > - strcpy((char*)&fake_preload[i++], "kernel"); > + strcpy((char *)&fake_preload[i++], "kernel"); > i +=3D 1; > fake_preload[i++] =3D MODINFO_TYPE; > - fake_preload[i++] =3D strlen("elf kernel") + 1; > - strcpy((char*)&fake_preload[i++], "elf kernel"); > - i +=3D 2; > + fake_preload[i++] =3D strlen(preload_kerntype) + 1; > + strcpy((char *)&fake_preload[i], preload_kerntype); > + i +=3D howmany(fake_preload[i - 1], sizeof(uint32_t)); > fake_preload[i++] =3D MODINFO_ADDR; > fake_preload[i++] =3D sizeof(vm_offset_t); > fake_preload[i++] =3D KERNVIRTADDR; > diff --git a/sys/arm64/arm64/machdep_boot.c = b/sys/arm64/arm64/machdep_boot.c > index 029ae23530ff..83bd74ea7317 100644 > --- a/sys/arm64/arm64/machdep_boot.c > +++ b/sys/arm64/arm64/machdep_boot.c > @@ -98,7 +98,7 @@ fake_preload_metadata(void *dtb_ptr, size_t = dtb_size) > PRELOAD_PUSH_STRING("kernel"); >=20 > PRELOAD_PUSH_VALUE(uint32_t, MODINFO_TYPE); > - PRELOAD_PUSH_STRING("elf kernel"); > + PRELOAD_PUSH_STRING(preload_kerntype); >=20 > PRELOAD_PUSH_VALUE(uint32_t, MODINFO_ADDR); > PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); > diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c > index 23a924636ca2..53af1e164980 100644 > --- a/sys/kern/link_elf.c > +++ b/sys/kern/link_elf.c > @@ -895,9 +895,7 @@ link_elf_link_preload(linker_class_t cls, const = char *filename, > sizeptr =3D preload_search_info(modptr, MODINFO_SIZE); > dynptr =3D preload_search_info(modptr, > MODINFO_METADATA | MODINFOMD_DYNAMIC); > - if (type =3D=3D NULL || > - (strcmp(type, "elf" __XSTRING(__ELF_WORD_SIZE) " module") !=3D 0 = && > - strcmp(type, "elf module") !=3D 0)) > + if (type =3D=3D NULL || strcmp(type, preload_modtype) !=3D 0) > return (EFTYPE); > if (baseptr =3D=3D NULL || sizeptr =3D=3D NULL || dynptr =3D=3D NULL) > return (EINVAL); > diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c > index a7c7d4826322..02fd4caffcd9 100644 > --- a/sys/kern/link_elf_obj.c > +++ b/sys/kern/link_elf_obj.c > @@ -365,11 +365,8 @@ link_elf_link_preload(linker_class_t cls, const = char *filename, > MODINFOMD_ELFHDR); > shdr =3D (Elf_Shdr *)preload_search_info(modptr, MODINFO_METADATA | > MODINFOMD_SHDR); > - if (type =3D=3D NULL || (strcmp(type, "elf" = __XSTRING(__ELF_WORD_SIZE) > - " obj module") !=3D 0 && > - strcmp(type, "elf obj module") !=3D 0)) { > + if (type =3D=3D NULL || strcmp(type, preload_modtype_obj) !=3D 0) > return (EFTYPE); > - } > if (baseptr =3D=3D NULL || sizeptr =3D=3D NULL || hdr =3D=3D NULL || > shdr =3D=3D NULL) > return (EINVAL); > diff --git a/sys/kern/subr_module.c b/sys/kern/subr_module.c > index 14272bd913f8..596961606577 100644 > --- a/sys/kern/subr_module.c > +++ b/sys/kern/subr_module.c > @@ -46,10 +46,14 @@ > vm_offset_t preload_addr_relocate =3D 0; > caddr_t preload_metadata, preload_kmdp; >=20 > +const char preload_modtype[] =3D MODTYPE; > +const char preload_kerntype[] =3D KERNTYPE; > +const char preload_modtype_obj[] =3D MODTYPE_OBJ; > + > void > preload_initkmdp(bool fatal) > { > - preload_kmdp =3D preload_search_by_type("elf kernel"); > + preload_kmdp =3D preload_search_by_type(preload_kerntype); >=20 > if (preload_kmdp =3D=3D NULL && fatal) > panic("unable to find kernel metadata"); > diff --git a/sys/powerpc/powerpc/machdep.c = b/sys/powerpc/powerpc/machdep.c > index 96f3b292854d..e9979712aa9c 100644 > --- a/sys/powerpc/powerpc/machdep.c > +++ b/sys/powerpc/powerpc/machdep.c > @@ -644,15 +644,14 @@ fake_preload_metadata(void) { >=20 > fake_preload[i++] =3D MODINFO_NAME; > fake_preload[i++] =3D strlen("kernel") + 1; > - strcpy((char*)&fake_preload[i], "kernel"); > + strcpy((char *)&fake_preload[i], "kernel"); > /* ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ > i +=3D 2; >=20 > fake_preload[i++] =3D MODINFO_TYPE; > - fake_preload[i++] =3D strlen("elf kernel") + 1; > - strcpy((char*)&fake_preload[i], "elf kernel"); > - /* ['e' 'l' 'f' ' '] ['k' 'e' 'r' 'n'] ['e' 'l' '\0' ..] */ > - i +=3D 3; > + fake_preload[i++] =3D strlen(preload_kerntype) + 1; > + strcpy((char *)&fake_preload[i], preload_kerntype); > + i +=3D howmany(fake_preload[i - 1], sizeof(uint32_t)); >=20 > #ifdef __powerpc64__ > /* Padding -- Fields start on u_long boundaries */ > diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c > index a17cff55f2cc..8d32d348df7d 100644 > --- a/sys/riscv/riscv/machdep.c > +++ b/sys/riscv/riscv/machdep.c > @@ -365,7 +365,7 @@ fake_preload_metadata(struct riscv_bootparams = *rvbp) > PRELOAD_PUSH_VALUE(uint32_t, MODINFO_NAME); > PRELOAD_PUSH_STRING("kernel"); > PRELOAD_PUSH_VALUE(uint32_t, MODINFO_TYPE); > - PRELOAD_PUSH_STRING("elf kernel"); > + PRELOAD_PUSH_STRING(preload_kerntype); >=20 > PRELOAD_PUSH_VALUE(uint32_t, MODINFO_ADDR); > PRELOAD_PUSH_VALUE(uint32_t, sizeof(vm_offset_t)); > diff --git a/sys/sys/linker.h b/sys/sys/linker.h > index 77dd437c7ffe..85c50be6c969 100644 > --- a/sys/sys/linker.h > +++ b/sys/sys/linker.h > @@ -220,6 +220,14 @@ void linker_kldload_unbusy(int flags); >=20 > #endif /* _KERNEL */ >=20 > +/* > + * ELF file types > + */ > +#define KERNTYPE_MB "elf multiboot kernel" > +#define KERNTYPE "elf kernel" > +#define MODTYPE_OBJ "elf obj module" > +#define MODTYPE "elf module" > + > /* > * Module information subtypes > */ > @@ -273,6 +281,9 @@ void linker_kldload_unbusy(int flags); > */ > extern vm_offset_t preload_addr_relocate; > extern caddr_t preload_metadata, preload_kmdp; > +extern const char preload_modtype[]; > +extern const char preload_kerntype[]; > +extern const char preload_modtype_obj[]; >=20 > extern void * preload_fetch_addr(caddr_t _mod); > extern size_t preload_fetch_size(caddr_t _mod); From nobody Fri Jan 24 21:54:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfs746hpNz5lSs9 for ; Fri, 24 Jan 2025 21:55:12 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfs744vrqz3mwJ for ; Fri, 24 Jan 2025 21:55:12 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3862d16b4f5so1605439f8f.0 for ; Fri, 24 Jan 2025 13:55:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737755711; x=1738360511; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KSuAQqOOl9206rGQ8LlCKeEAze2DIjInBoerxos+6Uk=; b=OUHID2SERrch/y3uIqjegXZ/9sNQ0J9sQHKoYvDAJGvMok1kXu6jgOo3lPl0gCt2ni 44+WZS8I0e0mA29/83sOSXXs+VyvGeCegdLmJZ5jEmsxtEvg4bfocWXVrD8U7Xw39VlB aU2PquXCypChvGr13yQYzXpfY+fyEr/+b8sXGBSXaYtPaLlVFDNK0h0UW9/HcvLWG3Ls +lIT+6W+AXxaG8EFI6y0ewbe036kvt8MmozSFX66ExdtnsJwJn7vRyxF3Jj4dPdgOUN/ sJNriXR7dOUK/fAnSuFb2HZrQWAbvhzH3b1Uom0xE8ARlBi1yd+MXSgfnelrGxHDlI/0 V5mA== X-Forwarded-Encrypted: i=1; AJvYcCXv6xmoU3CPmK+1eMH1O+bfXhK55pG0T0Gusmzsih64VcntEqe01SeJ1VZUgTiNt/FvpAIRh57pQuekUJtMNH6fj/F4@freebsd.org X-Gm-Message-State: AOJu0YzYU14bYPGP6p6dmrhtbntrAUp2aumd1IdLe6K9tF46CZWFPjts iEhJl+It2arq+cc8iwQrJccepfiQzVHg8N4Ves+TDmokmADDMIT4X/NZBFf7gXgkOJk3CP+rDCU M X-Gm-Gg: ASbGncvCUbDdDQ8hjjayFGVzkw+7/l5X1rN+lnlukHUxnCbQvl6qwNr22xg79PM7jNV lEs4i/fdm5HCOTPGR04a/1RF5EzDK9JD2IAxvpPwCILdaxa1KOFC3PsH/waLAxk4erXZdz8ma4Z I9Dao/3q1UT4TAYsyFIrZ4KmXIygyi4ScCuwVCPTNP388xYyXkbvTYmGSF1eLkj8c+OKam2/f7G tUQsi9oJRLkj8TDBqw3Lo0zNtZiLbdbNpvlO1i+1baeSGGwZA9rAosSyJ/oJKqNEhU1a71fLIOf 5KcVT2JFPcPZNL6f+w4= X-Google-Smtp-Source: AGHT+IHuttRPMKDmwTGcGIUuvmlGFz1ROYnk34oNssmkYg7cjBLa/pU9b8cpKjDZl8L+AbhV9/iS2Q== X-Received: by 2002:a05:6000:ecd:b0:38a:888c:a635 with SMTP id ffacd0b85a97d-38c2227545emr7660908f8f.14.1737755711121; Fri, 24 Jan 2025 13:55:11 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176449sm3892529f8f.11.2025.01.24.13.55.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2025 13:55:09 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 86077f4fd110 - main - stand: use globals for the kernel and module types From: Jessica Clarke In-Reply-To: <202501242137.50OLbHWK094915@gitrepo.freebsd.org> Date: Fri, 24 Jan 2025 21:54:58 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4ED8708B-32AF-4D7D-B1DC-6D790FB586C4@freebsd.org> References: <202501242137.50OLbHWK094915@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4Yfs744vrqz3mwJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 24 Jan 2025, at 21:37, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D86077f4fd11070518a6d04eee7fdb93c= bbfb1b52 >=20 > commit 86077f4fd11070518a6d04eee7fdb93cbbfb1b52 > Author: Ahmad Khalifa > AuthorDate: 2024-08-24 15:16:09 +0000 > Commit: Warner Losh > CommitDate: 2025-01-24 21:29:39 +0000 >=20 > stand: use globals for the kernel and module types As with the kernel, please just use the macros directly. Jess > Reviewed by: imp, kib > Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 > --- > stand/common/gfx_fb.c | 6 ++++-- > stand/common/load_elf.c | 12 +++++------- > stand/common/load_elf_obj.c | 8 +++----- > stand/common/metadata.c | 2 +- > stand/common/modinfo.c | 5 +++++ > stand/common/modinfo.h | 5 +++++ > stand/efi/loader/arch/amd64/multiboot2.c | 9 +++++---- > stand/efi/loader/bootinfo.c | 2 +- > stand/i386/libi386/bootinfo32.c | 2 +- > stand/i386/libi386/bootinfo64.c | 2 +- > stand/i386/libi386/multiboot.c | 9 +++++---- > stand/powerpc/ofw/elf_freebsd.c | 2 +- > stand/powerpc/ofw/ppc64_elf_freebsd.c | 2 +- > stand/uboot/arch/powerpc/ppc64_elf_freebsd.c | 2 +- > stand/uboot/elf_freebsd.c | 2 +- > stand/userboot/userboot/bootinfo32.c | 2 +- > stand/userboot/userboot/bootinfo64.c | 2 +- > 17 files changed, 42 insertions(+), 32 deletions(-) >=20 > diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c > index 9bda0e7139a9..63036f3c07f6 100644 > --- a/stand/common/gfx_fb.c > +++ b/stand/common/gfx_fb.c > @@ -102,6 +102,8 @@ > #include > #endif >=20 > +#include "modinfo.h" > + > /* VGA text mode does use bold font. */ > #if !defined(VGA_8X16_FONT) > #define VGA_8X16_FONT "/boot/fonts/8x16b.fnt" > @@ -2982,7 +2984,7 @@ build_font_module(vm_offset_t addr) >=20 > fi.fi_checksum =3D -checksum; >=20 > - fp =3D file_findfile(NULL, "elf kernel"); > + fp =3D file_findfile(NULL, md_kerntype); > if (fp =3D=3D NULL) > panic("can't find kernel file"); >=20 > @@ -3024,7 +3026,7 @@ build_splash_module(vm_offset_t addr) > return (addr); > } >=20 > - fp =3D file_findfile(NULL, "elf kernel"); > + fp =3D file_findfile(NULL, md_kerntype); > if (fp =3D=3D NULL) > panic("can't find kernel file"); >=20 > diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c > index d3775b9f0017..e19aefa121e7 100644 > --- a/stand/common/load_elf.c > +++ b/stand/common/load_elf.c > @@ -37,6 +37,7 @@ > #include >=20 > #include "bootstrap.h" > +#include "modinfo.h" >=20 > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) >=20 > @@ -89,9 +90,6 @@ static int __elfN(parse_modmetadata)(struct = preloaded_file *mp, elf_file_t ef, > static symaddr_fn __elfN(symaddr); > static char *fake_modname(const char *name); >=20 > -const char *__elfN(kerneltype) =3D "elf kernel"; > -const char *__elfN(moduletype) =3D "elf module"; > - > uint64_t __elfN(relocation_offset) =3D 0; >=20 > #ifdef __powerpc__ > @@ -384,7 +382,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t = dest, > /* > * Check to see what sort of module we are. > */ > - kfp =3D file_findfile(NULL, __elfN(kerneltype)); > + kfp =3D file_findfile(NULL, md_kerntype); > #ifdef __powerpc__ > /* > * Kernels can be ET_DYN, so just assume the first loaded object is the > @@ -435,7 +433,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t = dest, > err =3D EPERM; > goto oerr; > } > - if (strcmp(__elfN(kerneltype), kfp->f_type)) { > + if (strcmp(md_kerntype, kfp->f_type)) { > printf("elf" __XSTRING(__ELF_WORD_SIZE) > "_loadfile: can't load module with kernel type '%s'\n", > kfp->f_type); > @@ -470,9 +468,9 @@ __elfN(loadfile_raw)(char *filename, uint64_t = dest, > fp->f_name =3D strdup(filename); > if (multiboot =3D=3D 0) > fp->f_type =3D strdup(ef.kernel ? > - __elfN(kerneltype) : __elfN(moduletype)); > + md_kerntype : md_modtype); > else > - fp->f_type =3D strdup("elf multiboot kernel"); > + fp->f_type =3D strdup(md_kerntype_mb); >=20 > if (module_verbose >=3D MODULE_VERBOSE_FULL) { > if (ef.kernel) > diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c > index 9ff1d238b8c8..1e07828dd8ac 100644 > --- a/stand/common/load_elf_obj.c > +++ b/stand/common/load_elf_obj.c > @@ -37,6 +37,7 @@ > #include >=20 > #include "bootstrap.h" > +#include "modinfo.h" >=20 > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) >=20 > @@ -77,9 +78,6 @@ static int __elfN(obj_parse_modmetadata)(struct = preloaded_file *mp, > elf_file_t ef); > static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size = symidx); >=20 > -const char *__elfN(obj_kerneltype) =3D "elf kernel"; > -const char *__elfN(obj_moduletype) =3D "elf obj module"; > - > /* > * Attempt to load the file (file) as an ELF module. It will be = stored at > * (dest), and a pointer to a module structure describing the loaded = object > @@ -154,7 +152,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t = dest, > } > #endif >=20 > - kfp =3D file_findfile(NULL, __elfN(obj_kerneltype)); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) { > printf("elf" __XSTRING(__ELF_WORD_SIZE) > "_obj_loadfile: can't load module before kernel\n"); > @@ -178,7 +176,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t = dest, > goto out; > } > fp->f_name =3D strdup(filename); > - fp->f_type =3D strdup(__elfN(obj_moduletype)); > + fp->f_type =3D strdup(md_modtype_obj); >=20 > if (module_verbose > MODULE_VERBOSE_SILENT) > printf("%s ", filename); > diff --git a/stand/common/metadata.c b/stand/common/metadata.c > index 8962763061dc..22df6f175791 100644 > --- a/stand/common/metadata.c > +++ b/stand/common/metadata.c > @@ -146,7 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, = vm_offset_t *dtb, int kern64) > #endif >=20 > kernend =3D 0; > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); > diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c > index 381bd9dfd719..d00548c91c57 100644 > --- a/stand/common/modinfo.c > +++ b/stand/common/modinfo.c > @@ -109,6 +109,11 @@ >=20 > #define MOD_ALIGN(l) roundup(l, align) >=20 > +const char md_modtype[] =3D MODTYPE; > +const char md_kerntype[] =3D KERNTYPE; > +const char md_modtype_obj[] =3D MODTYPE_OBJ; > +const char md_kerntype_mb[] =3D KERNTYPE_MB; > + > vm_offset_t > md_copymodules(vm_offset_t addr, bool kern64) > { > diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h > index 967367beeeb0..d26129089fb6 100644 > --- a/stand/common/modinfo.h > +++ b/stand/common/modinfo.h > @@ -6,6 +6,11 @@ > #ifndef COMMON_MODINFO_H > #define COMMON_MODINFO_H >=20 > +extern const char md_modtype[]; > +extern const char md_kerntype[]; > +extern const char md_modtype_obj[]; > +extern const char md_kerntype_mb[]; > + > int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); > int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); >=20 > diff --git a/stand/efi/loader/arch/amd64/multiboot2.c = b/stand/efi/loader/arch/amd64/multiboot2.c > index d09b01fce1fc..eb7362293406 100644 > --- a/stand/efi/loader/arch/amd64/multiboot2.c > +++ b/stand/efi/loader/arch/amd64/multiboot2.c > @@ -51,6 +51,7 @@ > #include "bootstrap.h" > #include "multiboot2.h" > #include "loader_efi.h" > +#include "modinfo.h" >=20 > extern int elf32_loadfile_raw(char *filename, uint64_t dest, > struct preloaded_file **result, int multiboot); > @@ -436,7 +437,7 @@ exec(struct preloaded_file *fp) > * module 0 module 1 > */ >=20 > - fp =3D file_findfile(NULL, "elf kernel"); > + fp =3D file_findfile(NULL, md_kerntype); > if (fp =3D=3D NULL) { > printf("No FreeBSD kernel provided, aborting\n"); > error =3D EINVAL; > @@ -498,7 +499,7 @@ obj_loadfile(char *filename, uint64_t dest, struct = preloaded_file **result) > int error; >=20 > /* See if there's a multiboot kernel loaded */ > - mfp =3D file_findfile(NULL, "elf multiboot kernel"); > + mfp =3D file_findfile(NULL, md_kerntype_mb); > if (mfp =3D=3D NULL) > return (EFTYPE); >=20 > @@ -506,14 +507,14 @@ obj_loadfile(char *filename, uint64_t dest, = struct preloaded_file **result) > * We have a multiboot kernel loaded, see if there's a FreeBSD > * kernel loaded also. > */ > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) { > /* > * No kernel loaded, this must be it. The kernel has to > * be loaded as a raw file, it will be processed by > * Xen and correctly loaded as an ELF file. > */ > - rfp =3D file_loadraw(filename, "elf kernel", 0); > + rfp =3D file_loadraw(filename, md_kerntype, 0); > if (rfp =3D=3D NULL) { > printf( > "Unable to load %s as a multiboot payload kernel\n", > diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c > index b7d4070c2ffb..3e74a9228b5e 100644 > --- a/stand/efi/loader/bootinfo.c > +++ b/stand/efi/loader/bootinfo.c > @@ -420,7 +420,7 @@ bi_load(char *args, vm_offset_t *modulep, = vm_offset_t *kernendp, bool exit_bs) > addr +=3D roundup(dtb_size, PAGE_SIZE); > #endif >=20 > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > kernend =3D 0; /* fill it in later */ > diff --git a/stand/i386/libi386/bootinfo32.c = b/stand/i386/libi386/bootinfo32.c > index df715e547795..37b227b913bd 100644 > --- a/stand/i386/libi386/bootinfo32.c > +++ b/stand/i386/libi386/bootinfo32.c > @@ -129,7 +129,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, = vm_offset_t *bip, vm_offset_t > /* pad to a page boundary */ > addr =3D roundup(addr, PAGE_SIZE); >=20 > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > kernend =3D 0; /* fill it in later */ > diff --git a/stand/i386/libi386/bootinfo64.c = b/stand/i386/libi386/bootinfo64.c > index 4731b10325fe..f7181dcd599f 100644 > --- a/stand/i386/libi386/bootinfo64.c > +++ b/stand/i386/libi386/bootinfo64.c > @@ -143,7 +143,7 @@ bi_load64(char *args, vm_offset_t *modulep, > /* place the metadata before anything */ > module =3D *modulep =3D addr; >=20 > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > kernend =3D 0; /* fill it in later */ > diff --git a/stand/i386/libi386/multiboot.c = b/stand/i386/libi386/multiboot.c > index b69895de9706..e2bd44fe83f5 100644 > --- a/stand/i386/libi386/multiboot.c > +++ b/stand/i386/libi386/multiboot.c > @@ -48,6 +48,7 @@ > #include "bootstrap.h" > #include "multiboot.h" > #include "libi386.h" > +#include "modinfo.h" > #include >=20 > #define MULTIBOOT_SUPPORTED_FLAGS \ > @@ -256,7 +257,7 @@ multiboot_exec(struct preloaded_file *fp) > * module 0 module 1 > */ >=20 > - fp =3D file_findfile(NULL, "elf kernel"); > + fp =3D file_findfile(NULL, md_kerntype); > if (fp =3D=3D NULL) { > printf("No FreeBSD kernel provided, aborting\n"); > error =3D EINVAL; > @@ -324,7 +325,7 @@ multiboot_obj_loadfile(char *filename, uint64_t = dest, > int error, mod_num; >=20 > /* See if there's a multiboot kernel loaded */ > - mfp =3D file_findfile(NULL, "elf multiboot kernel"); > + mfp =3D file_findfile(NULL, md_kerntype_mb); > if (mfp =3D=3D NULL) > return (EFTYPE); >=20 > @@ -332,14 +333,14 @@ multiboot_obj_loadfile(char *filename, uint64_t = dest, > * We have a multiboot kernel loaded, see if there's a FreeBSD > * kernel loaded also. > */ > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) { > /* > * No kernel loaded, this must be it. The kernel has to > * be loaded as a raw file, it will be processed by > * Xen and correctly loaded as an ELF file. > */ > - rfp =3D file_loadraw(filename, "elf kernel", 0); > + rfp =3D file_loadraw(filename, md_kerntype, 0); > if (rfp =3D=3D NULL) { > printf( > "Unable to load %s as a multiboot payload kernel\n", > diff --git a/stand/powerpc/ofw/elf_freebsd.c = b/stand/powerpc/ofw/elf_freebsd.c > index 21ab834f76fa..4d34fa18c5dd 100644 > --- a/stand/powerpc/ofw/elf_freebsd.c > +++ b/stand/powerpc/ofw/elf_freebsd.c > @@ -58,7 +58,7 @@ __elfN(ofw_loadfile)(char *filename, uint64_t dest, > * No need to sync the icache for modules: this will > * be done by the kernel after relocation. > */ > - if (!strcmp((*result)->f_type, "elf kernel")) > + if (!strcmp((*result)->f_type, md_kerntype)) > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > #endif > return (0); > diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c = b/stand/powerpc/ofw/ppc64_elf_freebsd.c > index e0518abe2283..bc68d129f353 100644 > --- a/stand/powerpc/ofw/ppc64_elf_freebsd.c > +++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c > @@ -57,7 +57,7 @@ ppc64_ofw_elf_loadfile(char *filename, uint64_t = dest, > * No need to sync the icache for modules: this will > * be done by the kernel after relocation. > */ > - if (!strcmp((*result)->f_type, "elf kernel")) > + if (!strcmp((*result)->f_type, md_kerntype)) > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > return (0); > } > diff --git a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c = b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > index 291fe6b944fb..e500b862de2e 100644 > --- a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > +++ b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > @@ -53,7 +53,7 @@ ppc64_uboot_elf_loadfile(char *filename, uint64_t = dest, > * No need to sync the icache for modules: this will > * be done by the kernel after relocation. > */ > - if (!strcmp((*result)->f_type, "elf kernel")) > + if (!strcmp((*result)->f_type, md_kerntype)) > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > return (0); > } > diff --git a/stand/uboot/elf_freebsd.c b/stand/uboot/elf_freebsd.c > index 6c764d143881..3b1bdc542538 100644 > --- a/stand/uboot/elf_freebsd.c > +++ b/stand/uboot/elf_freebsd.c > @@ -53,7 +53,7 @@ __elfN(uboot_load)(char *filename, uint64_t dest, > * No need to sync the icache for modules: this will > * be done by the kernel after relocation. > */ > - if (!strcmp((*result)->f_type, "elf kernel")) > + if (!strcmp((*result)->f_type, md_kerntype)) > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > #endif > return (0); > diff --git a/stand/userboot/userboot/bootinfo32.c = b/stand/userboot/userboot/bootinfo32.c > index 91f1f81f1181..750574912172 100644 > --- a/stand/userboot/userboot/bootinfo32.c > +++ b/stand/userboot/userboot/bootinfo32.c > @@ -108,7 +108,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, = vm_offset_t *bip, vm_offset_t > /* pad to a page boundary */ > addr =3D roundup(addr, PAGE_SIZE); >=20 > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > kernend =3D 0; /* fill it in later */ > diff --git a/stand/userboot/userboot/bootinfo64.c = b/stand/userboot/userboot/bootinfo64.c > index fb9fd0fb82f1..d20202bf4fbb 100644 > --- a/stand/userboot/userboot/bootinfo64.c > +++ b/stand/userboot/userboot/bootinfo64.c > @@ -140,7 +140,7 @@ bi_load64(char *args, vm_offset_t *modulep, = vm_offset_t *kernendp) > /* pad to a page boundary */ > addr =3D roundup(addr, PAGE_SIZE); >=20 > - kfp =3D file_findfile(NULL, "elf kernel"); > + kfp =3D file_findfile(NULL, md_kerntype); > if (kfp =3D=3D NULL) > panic("can't find kernel file"); > kernend =3D 0; /* fill it in later */ From nobody Fri Jan 24 22:13:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfsXF01dmz5lTvF for ; Fri, 24 Jan 2025 22:13:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfsXD4sw7z3nlT for ; Fri, 24 Jan 2025 22:13:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2f42992f608so3888753a91.0 for ; Fri, 24 Jan 2025 14:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1737756811; x=1738361611; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FaQ7nvOortELnV7zUsIVwAVvFb2XoGkSHmo6rtHc3m8=; b=C0zZQmHe1JNt1V/ZUEIMAwPiYu0pPHtV+LNKKanqrMHO0tBqJtZdvTFfEpeNRHThYv PFeCzzk+fZxjPR+S5CkP6JFiW3T36SreadL6T7IVRrKqUHBKTDsqdEwQXyqwV8eh0ba/ jOT/LScfrzBAPlUFPUdez0NuCFXBv8VZ0O+c7bpx8WfI4IGj4A6j0mZMtakKX6izawX9 7ycJcxq0Dn3kw0v0UH8Tqou8hnv+SSW7t6CzcypiKW9pkijXC6/p/g4EVpWnBAI32GHx 8lRtJRleZWwOEVXgKrPMdvlh74JJJqvQs1SeiUXcMaunWUk/kmbIWdNm1okS4sbQdzrC tAZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737756811; x=1738361611; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FaQ7nvOortELnV7zUsIVwAVvFb2XoGkSHmo6rtHc3m8=; b=Jbexvhbq6JrEAu/6ELBsHs0jZHmIB+quUV2PKTlvtUcpND09dURX8PzKhUfhlsyvjQ 7UfW0ZcasMYSblM2nH+BVUhh1wQJihiGvgz49hYXup0QphIyKBPKPxgGenzR9Fdghyw+ 9kkyuJqsP4inBWCqsVtH5LxHdoFxOUNp/0kYpdOz1j5VdPYZoYRinqno4fJAZsM3n1G0 u42crBdZDkJne+SJ6AhLKcGn1IGk1KwTXUfH6XlA6JUy/tJkM2MftNyPY7zSmdR6s3da bciQQWHylQCYFsA76so5WaX7GYB7F/zBsylsjNrP+sn28kmeCqR6qkabKAqsjjp792VQ 0sfA== X-Forwarded-Encrypted: i=1; AJvYcCW30I1Xf3+32SHB9opgsHtdYgUmwvtGE1Cg0jnjwJc6rzEf9t3Qb/UrNEUNU1WKfROApGbbh76iLI5P74DWT5sRwVYd@freebsd.org X-Gm-Message-State: AOJu0Yx+EcqZ/dKwzy7CCpeKrVTwr8GUpaeMSyk4B2VRadEYSXhXSFPi Znytx4K2Lz6LNywP0pMYwghHC+JXmE7K2iA0Vlk7qhikO27PZqkxel7uA7lOp2Q6Q0ZK9mukCs2 VXV09F5e+4IQyy+oHyDncn3QhO/Tx9uy7MgAF6w== X-Gm-Gg: ASbGncsMbqy8GkLhugT2Vri0k1q3KF3lx5PSsjV++IVtTx4Qn10q03CYvVvuuA30GTF n9dLoPjZkyj7Fp4xEUkTm2tJdzDLNgAVbCA/ktue4rmzU5JgT04+fbh7SnQ7+2Q== X-Google-Smtp-Source: AGHT+IGPoSlKDoBm0DSemyqowfy4kPuiQxncqJPfmVAKcksMfo7e5bglCQMmX/eNX5du8DDLAhHZhghUZWzlEfWB8OE= X-Received: by 2002:a17:90b:3a0c:b0:2ee:e113:815d with SMTP id 98e67ed59e1d1-2f782c70168mr45162351a91.8.1737756811091; Fri, 24 Jan 2025 14:13:31 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202501242137.50OLbHWK094915@gitrepo.freebsd.org> <4ED8708B-32AF-4D7D-B1DC-6D790FB586C4@freebsd.org> In-Reply-To: <4ED8708B-32AF-4D7D-B1DC-6D790FB586C4@freebsd.org> From: Warner Losh Date: Fri, 24 Jan 2025 15:13:19 -0700 X-Gm-Features: AWEUYZkC_TGpQcC_xcc0yRzctn5NuIv2H5AyBbK-xuxT0os4ka6pqw-p7cN7xxI Message-ID: Subject: Re: git: 86077f4fd110 - main - stand: use globals for the kernel and module types To: Jessica Clarke Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000006e7b3d062c7b090f" X-Rspamd-Queue-Id: 4YfsXD4sw7z3nlT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --0000000000006e7b3d062c7b090f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 24, 2025 at 2:55=E2=80=AFPM Jessica Clarke = wrote: > On 24 Jan 2025, at 21:37, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D86077f4fd11070518a6d04eee7fdb93= cbbfb1b52 > > > > commit 86077f4fd11070518a6d04eee7fdb93cbbfb1b52 > > Author: Ahmad Khalifa > > AuthorDate: 2024-08-24 15:16:09 +0000 > > Commit: Warner Losh > > CommitDate: 2025-01-24 21:29:39 +0000 > > > > stand: use globals for the kernel and module types > > As with the kernel, please just use the macros directly. > Both are fine as is, which is why I didn't push the issue in the code review. Either a macro or global is fine, and doesn't materially change anything doing it one way or the other. But if someone wants to convert them to macros, that's cool too. It's likely marginally better, but both are light-years ahead of a dozen strings, some inexplicably different. Warner > Jess > > > Reviewed by: imp, kib > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1394 > > --- > > stand/common/gfx_fb.c | 6 ++++-- > > stand/common/load_elf.c | 12 +++++------- > > stand/common/load_elf_obj.c | 8 +++----- > > stand/common/metadata.c | 2 +- > > stand/common/modinfo.c | 5 +++++ > > stand/common/modinfo.h | 5 +++++ > > stand/efi/loader/arch/amd64/multiboot2.c | 9 +++++---- > > stand/efi/loader/bootinfo.c | 2 +- > > stand/i386/libi386/bootinfo32.c | 2 +- > > stand/i386/libi386/bootinfo64.c | 2 +- > > stand/i386/libi386/multiboot.c | 9 +++++---- > > stand/powerpc/ofw/elf_freebsd.c | 2 +- > > stand/powerpc/ofw/ppc64_elf_freebsd.c | 2 +- > > stand/uboot/arch/powerpc/ppc64_elf_freebsd.c | 2 +- > > stand/uboot/elf_freebsd.c | 2 +- > > stand/userboot/userboot/bootinfo32.c | 2 +- > > stand/userboot/userboot/bootinfo64.c | 2 +- > > 17 files changed, 42 insertions(+), 32 deletions(-) > > > > diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c > > index 9bda0e7139a9..63036f3c07f6 100644 > > --- a/stand/common/gfx_fb.c > > +++ b/stand/common/gfx_fb.c > > @@ -102,6 +102,8 @@ > > #include > > #endif > > > > +#include "modinfo.h" > > + > > /* VGA text mode does use bold font. */ > > #if !defined(VGA_8X16_FONT) > > #define VGA_8X16_FONT "/boot/fonts/8x16b.fnt" > > @@ -2982,7 +2984,7 @@ build_font_module(vm_offset_t addr) > > > > fi.fi_checksum =3D -checksum; > > > > - fp =3D file_findfile(NULL, "elf kernel"); > > + fp =3D file_findfile(NULL, md_kerntype); > > if (fp =3D=3D NULL) > > panic("can't find kernel file"); > > > > @@ -3024,7 +3026,7 @@ build_splash_module(vm_offset_t addr) > > return (addr); > > } > > > > - fp =3D file_findfile(NULL, "elf kernel"); > > + fp =3D file_findfile(NULL, md_kerntype); > > if (fp =3D=3D NULL) > > panic("can't find kernel file"); > > > > diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c > > index d3775b9f0017..e19aefa121e7 100644 > > --- a/stand/common/load_elf.c > > +++ b/stand/common/load_elf.c > > @@ -37,6 +37,7 @@ > > #include > > > > #include "bootstrap.h" > > +#include "modinfo.h" > > > > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) > > > > @@ -89,9 +90,6 @@ static int __elfN(parse_modmetadata)(struct > preloaded_file *mp, elf_file_t ef, > > static symaddr_fn __elfN(symaddr); > > static char *fake_modname(const char *name); > > > > -const char *__elfN(kerneltype) =3D "elf kernel"; > > -const char *__elfN(moduletype) =3D "elf module"; > > - > > uint64_t __elfN(relocation_offset) =3D 0; > > > > #ifdef __powerpc__ > > @@ -384,7 +382,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, > > /* > > * Check to see what sort of module we are. > > */ > > - kfp =3D file_findfile(NULL, __elfN(kerneltype)); > > + kfp =3D file_findfile(NULL, md_kerntype); > > #ifdef __powerpc__ > > /* > > * Kernels can be ET_DYN, so just assume the first loaded object is the > > @@ -435,7 +433,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, > > err =3D EPERM; > > goto oerr; > > } > > - if (strcmp(__elfN(kerneltype), kfp->f_type)) { > > + if (strcmp(md_kerntype, kfp->f_type)) { > > printf("elf" __XSTRING(__ELF_WORD_SIZE) > > "_loadfile: can't load module with kernel type '%s'\n", > > kfp->f_type); > > @@ -470,9 +468,9 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, > > fp->f_name =3D strdup(filename); > > if (multiboot =3D=3D 0) > > fp->f_type =3D strdup(ef.kernel ? > > - __elfN(kerneltype) : __elfN(moduletype)); > > + md_kerntype : md_modtype); > > else > > - fp->f_type =3D strdup("elf multiboot kernel"); > > + fp->f_type =3D strdup(md_kerntype_mb); > > > > if (module_verbose >=3D MODULE_VERBOSE_FULL) { > > if (ef.kernel) > > diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c > > index 9ff1d238b8c8..1e07828dd8ac 100644 > > --- a/stand/common/load_elf_obj.c > > +++ b/stand/common/load_elf_obj.c > > @@ -37,6 +37,7 @@ > > #include > > > > #include "bootstrap.h" > > +#include "modinfo.h" > > > > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) > > > > @@ -77,9 +78,6 @@ static int __elfN(obj_parse_modmetadata)(struct > preloaded_file *mp, > > elf_file_t ef); > > static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size > symidx); > > > > -const char *__elfN(obj_kerneltype) =3D "elf kernel"; > > -const char *__elfN(obj_moduletype) =3D "elf obj module"; > > - > > /* > > * Attempt to load the file (file) as an ELF module. It will be stored > at > > * (dest), and a pointer to a module structure describing the loaded > object > > @@ -154,7 +152,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest, > > } > > #endif > > > > - kfp =3D file_findfile(NULL, __elfN(obj_kerneltype)); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) { > > printf("elf" __XSTRING(__ELF_WORD_SIZE) > > "_obj_loadfile: can't load module before kernel\n"); > > @@ -178,7 +176,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest, > > goto out; > > } > > fp->f_name =3D strdup(filename); > > - fp->f_type =3D strdup(__elfN(obj_moduletype)); > > + fp->f_type =3D strdup(md_modtype_obj); > > > > if (module_verbose > MODULE_VERBOSE_SILENT) > > printf("%s ", filename); > > diff --git a/stand/common/metadata.c b/stand/common/metadata.c > > index 8962763061dc..22df6f175791 100644 > > --- a/stand/common/metadata.c > > +++ b/stand/common/metadata.c > > @@ -146,7 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, > vm_offset_t *dtb, int kern64) > > #endif > > > > kernend =3D 0; > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); > > diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c > > index 381bd9dfd719..d00548c91c57 100644 > > --- a/stand/common/modinfo.c > > +++ b/stand/common/modinfo.c > > @@ -109,6 +109,11 @@ > > > > #define MOD_ALIGN(l) roundup(l, align) > > > > +const char md_modtype[] =3D MODTYPE; > > +const char md_kerntype[] =3D KERNTYPE; > > +const char md_modtype_obj[] =3D MODTYPE_OBJ; > > +const char md_kerntype_mb[] =3D KERNTYPE_MB; > > + > > vm_offset_t > > md_copymodules(vm_offset_t addr, bool kern64) > > { > > diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h > > index 967367beeeb0..d26129089fb6 100644 > > --- a/stand/common/modinfo.h > > +++ b/stand/common/modinfo.h > > @@ -6,6 +6,11 @@ > > #ifndef COMMON_MODINFO_H > > #define COMMON_MODINFO_H > > > > +extern const char md_modtype[]; > > +extern const char md_kerntype[]; > > +extern const char md_modtype_obj[]; > > +extern const char md_kerntype_mb[]; > > + > > int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb); > > int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb); > > > > diff --git a/stand/efi/loader/arch/amd64/multiboot2.c > b/stand/efi/loader/arch/amd64/multiboot2.c > > index d09b01fce1fc..eb7362293406 100644 > > --- a/stand/efi/loader/arch/amd64/multiboot2.c > > +++ b/stand/efi/loader/arch/amd64/multiboot2.c > > @@ -51,6 +51,7 @@ > > #include "bootstrap.h" > > #include "multiboot2.h" > > #include "loader_efi.h" > > +#include "modinfo.h" > > > > extern int elf32_loadfile_raw(char *filename, uint64_t dest, > > struct preloaded_file **result, int multiboot); > > @@ -436,7 +437,7 @@ exec(struct preloaded_file *fp) > > * module 0 module 1 > > */ > > > > - fp =3D file_findfile(NULL, "elf kernel"); > > + fp =3D file_findfile(NULL, md_kerntype); > > if (fp =3D=3D NULL) { > > printf("No FreeBSD kernel provided, aborting\n"); > > error =3D EINVAL; > > @@ -498,7 +499,7 @@ obj_loadfile(char *filename, uint64_t dest, struct > preloaded_file **result) > > int error; > > > > /* See if there's a multiboot kernel loaded */ > > - mfp =3D file_findfile(NULL, "elf multiboot kernel"); > > + mfp =3D file_findfile(NULL, md_kerntype_mb); > > if (mfp =3D=3D NULL) > > return (EFTYPE); > > > > @@ -506,14 +507,14 @@ obj_loadfile(char *filename, uint64_t dest, struc= t > preloaded_file **result) > > * We have a multiboot kernel loaded, see if there's a FreeBSD > > * kernel loaded also. > > */ > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) { > > /* > > * No kernel loaded, this must be it. The kernel has to > > * be loaded as a raw file, it will be processed by > > * Xen and correctly loaded as an ELF file. > > */ > > - rfp =3D file_loadraw(filename, "elf kernel", 0); > > + rfp =3D file_loadraw(filename, md_kerntype, 0); > > if (rfp =3D=3D NULL) { > > printf( > > "Unable to load %s as a multiboot payload kernel\n", > > diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c > > index b7d4070c2ffb..3e74a9228b5e 100644 > > --- a/stand/efi/loader/bootinfo.c > > +++ b/stand/efi/loader/bootinfo.c > > @@ -420,7 +420,7 @@ bi_load(char *args, vm_offset_t *modulep, > vm_offset_t *kernendp, bool exit_bs) > > addr +=3D roundup(dtb_size, PAGE_SIZE); > > #endif > > > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > kernend =3D 0; /* fill it in later */ > > diff --git a/stand/i386/libi386/bootinfo32.c > b/stand/i386/libi386/bootinfo32.c > > index df715e547795..37b227b913bd 100644 > > --- a/stand/i386/libi386/bootinfo32.c > > +++ b/stand/i386/libi386/bootinfo32.c > > @@ -129,7 +129,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, > vm_offset_t *bip, vm_offset_t > > /* pad to a page boundary */ > > addr =3D roundup(addr, PAGE_SIZE); > > > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > kernend =3D 0; /* fill it in later */ > > diff --git a/stand/i386/libi386/bootinfo64.c > b/stand/i386/libi386/bootinfo64.c > > index 4731b10325fe..f7181dcd599f 100644 > > --- a/stand/i386/libi386/bootinfo64.c > > +++ b/stand/i386/libi386/bootinfo64.c > > @@ -143,7 +143,7 @@ bi_load64(char *args, vm_offset_t *modulep, > > /* place the metadata before anything */ > > module =3D *modulep =3D addr; > > > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > kernend =3D 0; /* fill it in later */ > > diff --git a/stand/i386/libi386/multiboot.c > b/stand/i386/libi386/multiboot.c > > index b69895de9706..e2bd44fe83f5 100644 > > --- a/stand/i386/libi386/multiboot.c > > +++ b/stand/i386/libi386/multiboot.c > > @@ -48,6 +48,7 @@ > > #include "bootstrap.h" > > #include "multiboot.h" > > #include "libi386.h" > > +#include "modinfo.h" > > #include > > > > #define MULTIBOOT_SUPPORTED_FLAGS \ > > @@ -256,7 +257,7 @@ multiboot_exec(struct preloaded_file *fp) > > * module 0 module 1 > > */ > > > > - fp =3D file_findfile(NULL, "elf kernel"); > > + fp =3D file_findfile(NULL, md_kerntype); > > if (fp =3D=3D NULL) { > > printf("No FreeBSD kernel provided, aborting\n"); > > error =3D EINVAL; > > @@ -324,7 +325,7 @@ multiboot_obj_loadfile(char *filename, uint64_t des= t, > > int error, mod_num; > > > > /* See if there's a multiboot kernel loaded */ > > - mfp =3D file_findfile(NULL, "elf multiboot kernel"); > > + mfp =3D file_findfile(NULL, md_kerntype_mb); > > if (mfp =3D=3D NULL) > > return (EFTYPE); > > > > @@ -332,14 +333,14 @@ multiboot_obj_loadfile(char *filename, uint64_t > dest, > > * We have a multiboot kernel loaded, see if there's a FreeBSD > > * kernel loaded also. > > */ > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) { > > /* > > * No kernel loaded, this must be it. The kernel has to > > * be loaded as a raw file, it will be processed by > > * Xen and correctly loaded as an ELF file. > > */ > > - rfp =3D file_loadraw(filename, "elf kernel", 0); > > + rfp =3D file_loadraw(filename, md_kerntype, 0); > > if (rfp =3D=3D NULL) { > > printf( > > "Unable to load %s as a multiboot payload kernel\n", > > diff --git a/stand/powerpc/ofw/elf_freebsd.c > b/stand/powerpc/ofw/elf_freebsd.c > > index 21ab834f76fa..4d34fa18c5dd 100644 > > --- a/stand/powerpc/ofw/elf_freebsd.c > > +++ b/stand/powerpc/ofw/elf_freebsd.c > > @@ -58,7 +58,7 @@ __elfN(ofw_loadfile)(char *filename, uint64_t dest, > > * No need to sync the icache for modules: this will > > * be done by the kernel after relocation. > > */ > > - if (!strcmp((*result)->f_type, "elf kernel")) > > + if (!strcmp((*result)->f_type, md_kerntype)) > > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > > #endif > > return (0); > > diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c > b/stand/powerpc/ofw/ppc64_elf_freebsd.c > > index e0518abe2283..bc68d129f353 100644 > > --- a/stand/powerpc/ofw/ppc64_elf_freebsd.c > > +++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c > > @@ -57,7 +57,7 @@ ppc64_ofw_elf_loadfile(char *filename, uint64_t dest, > > * No need to sync the icache for modules: this will > > * be done by the kernel after relocation. > > */ > > - if (!strcmp((*result)->f_type, "elf kernel")) > > + if (!strcmp((*result)->f_type, md_kerntype)) > > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > > return (0); > > } > > diff --git a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > > index 291fe6b944fb..e500b862de2e 100644 > > --- a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > > +++ b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c > > @@ -53,7 +53,7 @@ ppc64_uboot_elf_loadfile(char *filename, uint64_t des= t, > > * No need to sync the icache for modules: this will > > * be done by the kernel after relocation. > > */ > > - if (!strcmp((*result)->f_type, "elf kernel")) > > + if (!strcmp((*result)->f_type, md_kerntype)) > > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > > return (0); > > } > > diff --git a/stand/uboot/elf_freebsd.c b/stand/uboot/elf_freebsd.c > > index 6c764d143881..3b1bdc542538 100644 > > --- a/stand/uboot/elf_freebsd.c > > +++ b/stand/uboot/elf_freebsd.c > > @@ -53,7 +53,7 @@ __elfN(uboot_load)(char *filename, uint64_t dest, > > * No need to sync the icache for modules: this will > > * be done by the kernel after relocation. > > */ > > - if (!strcmp((*result)->f_type, "elf kernel")) > > + if (!strcmp((*result)->f_type, md_kerntype)) > > __syncicache((void *) (*result)->f_addr, (*result)->f_size); > > #endif > > return (0); > > diff --git a/stand/userboot/userboot/bootinfo32.c > b/stand/userboot/userboot/bootinfo32.c > > index 91f1f81f1181..750574912172 100644 > > --- a/stand/userboot/userboot/bootinfo32.c > > +++ b/stand/userboot/userboot/bootinfo32.c > > @@ -108,7 +108,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, > vm_offset_t *bip, vm_offset_t > > /* pad to a page boundary */ > > addr =3D roundup(addr, PAGE_SIZE); > > > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > kernend =3D 0; /* fill it in later */ > > diff --git a/stand/userboot/userboot/bootinfo64.c > b/stand/userboot/userboot/bootinfo64.c > > index fb9fd0fb82f1..d20202bf4fbb 100644 > > --- a/stand/userboot/userboot/bootinfo64.c > > +++ b/stand/userboot/userboot/bootinfo64.c > > @@ -140,7 +140,7 @@ bi_load64(char *args, vm_offset_t *modulep, > vm_offset_t *kernendp) > > /* pad to a page boundary */ > > addr =3D roundup(addr, PAGE_SIZE); > > > > - kfp =3D file_findfile(NULL, "elf kernel"); > > + kfp =3D file_findfile(NULL, md_kerntype); > > if (kfp =3D=3D NULL) > > panic("can't find kernel file"); > > kernend =3D 0; /* fill it in later */ > > --0000000000006e7b3d062c7b090f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


    On Fri, Jan 24,= 2025 at 2:55=E2=80=AFPM Jessica Clarke <jrtc27@freebsd.org> wrote:
    On 24 Jan 2025, at 21:37, Warner Losh <imp@Free= BSD.org> wrote:
    >
    > The branch main has been updated by imp:
    >
    > URL: https://= cgit.FreeBSD.org/src/commit/?id=3D86077f4fd11070518a6d04eee7fdb93cbbfb1b52<= /a>
    >
    > commit 86077f4fd11070518a6d04eee7fdb93cbbfb1b52
    > Author:=C2=A0 =C2=A0 =C2=A0Ahmad Khalifa <
    ahmadkhalifa570@gmail.com>
    > AuthorDate: 2024-08-24 15:16:09 +0000
    > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
    > CommitDate: 2025-01-24 21:29:39 +0000
    >
    >=C2=A0 =C2=A0 stand: use globals for the kernel and module types

    As with the kernel, please just use the macros directly.

    Both are fine as is, which is why I didn't push the i= ssue in the code review.
    Either a macro or global is fine, and do= esn't materially change=C2=A0anything
    doing it one way or the= other. But if someone wants to convert them to
    macros, that'= s cool too. It's likely marginally better, but both are light-years
    ahead of a dozen strings, some inexplicably=C2=A0different.

    Warner
    =C2=A0
    Jess

    >=C2=A0 =C2=A0 Reviewed by: imp, kib
    >=C2=A0 =C2=A0 Pull Request: https://github.com/f= reebsd/freebsd-src/pull/1394
    > ---
    > stand/common/gfx_fb.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 6 ++++--
    > stand/common/load_elf.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 12 +++++-------
    > stand/common/load_elf_obj.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |=C2=A0 8 +++-----
    > stand/common/metadata.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-
    > stand/common/modinfo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 5 +++++
    > stand/common/modinfo.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 5 +++++
    > stand/efi/loader/arch/amd64/multiboot2.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 9 = +++++----
    > stand/efi/loader/bootinfo.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-
    > stand/i386/libi386/bootinfo32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 2 +-
    > stand/i386/libi386/bootinfo64.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 2 +-
    > stand/i386/libi386/multiboot.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0|=C2=A0 9 +++++----
    > stand/powerpc/ofw/elf_freebsd.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |=C2=A0 2 +-
    > stand/powerpc/ofw/ppc64_elf_freebsd.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 2 +-
    > stand/uboot/arch/powerpc/ppc64_elf_freebsd.c |=C2=A0 2 +-
    > stand/uboot/elf_freebsd.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-
    > stand/userboot/userboot/bootinfo32.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 2 +-
    > stand/userboot/userboot/bootinfo64.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 2 +-
    > 17 files changed, 42 insertions(+), 32 deletions(-)
    >
    > diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c
    > index 9bda0e7139a9..63036f3c07f6 100644
    > --- a/stand/common/gfx_fb.c
    > +++ b/stand/common/gfx_fb.c
    > @@ -102,6 +102,8 @@
    > #include <vbe.h>
    > #endif
    >
    > +#include "modinfo.h"
    > +
    > /* VGA text mode does use bold font. */
    > #if !defined(VGA_8X16_FONT)
    > #define VGA_8X16_FONT "/boot/fonts/8x16b.fnt"
    > @@ -2982,7 +2984,7 @@ build_font_module(vm_offset_t addr)
    >
    > fi.fi_checksum =3D -checksum;
    >
    > - fp =3D file_findfile(NULL, "elf kernel");
    > + fp =3D file_findfile(NULL, md_kerntype);
    > if (fp =3D=3D NULL)
    > panic("can't find kernel file");
    >
    > @@ -3024,7 +3026,7 @@ build_splash_module(vm_offset_t addr)
    > return (addr);
    > }
    >
    > - fp =3D file_findfile(NULL, "elf kernel");
    > + fp =3D file_findfile(NULL, md_kerntype);
    > if (fp =3D=3D NULL)
    > panic("can't find kernel file");
    >
    > diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c
    > index d3775b9f0017..e19aefa121e7 100644
    > --- a/stand/common/load_elf.c
    > +++ b/stand/common/load_elf.c
    > @@ -37,6 +37,7 @@
    > #include <sys/link_elf.h>
    >
    > #include "bootstrap.h"
    > +#include "modinfo.h"
    >
    > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l)
    >
    > @@ -89,9 +90,6 @@ static int __elfN(parse_modmetadata)(struct preloade= d_file *mp, elf_file_t ef,
    > static symaddr_fn __elfN(symaddr);
    > static char *fake_modname(const char *name);
    >
    > -const char *__elfN(kerneltype) =3D "elf kernel";
    > -const char *__elfN(moduletype) =3D "elf module";
    > -
    > uint64_t __elfN(relocation_offset) =3D 0;
    >
    > #ifdef __powerpc__
    > @@ -384,7 +382,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest= ,
    > /*
    > * Check to see what sort of module we are.
    > */
    > - kfp =3D file_findfile(NULL, __elfN(kerneltype));
    > + kfp =3D file_findfile(NULL, md_kerntype);
    > #ifdef __powerpc__
    > /*
    > * Kernels can be ET_DYN, so just assume the first loaded object is the=
    > @@ -435,7 +433,7 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest= ,
    > err =3D EPERM;
    > goto oerr;
    > }
    > - if (strcmp(__elfN(kerneltype), kfp->f_type)) {
    > + if (strcmp(md_kerntype, kfp->f_type)) {
    > printf("elf" __XSTRING(__ELF_WORD_SIZE)
    > "_loadfile: can't load module with kernel type '%s'\n= ",
    >=C2=A0 =C2=A0 kfp->f_type);
    > @@ -470,9 +468,9 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest= ,
    > fp->f_name =3D strdup(filename);
    > if (multiboot =3D=3D 0)
    > fp->f_type =3D strdup(ef.kernel ?
    > -=C2=A0 =C2=A0 __elfN(kerneltype) : __elfN(moduletype));
    > +=C2=A0 =C2=A0 md_kerntype : md_modtype);
    > else
    > - fp->f_type =3D strdup("elf multiboot kernel");
    > + fp->f_type =3D strdup(md_kerntype_mb);
    >
    > if (module_verbose >=3D MODULE_VERBOSE_FULL) {
    > if (ef.kernel)
    > diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c=
    > index 9ff1d238b8c8..1e07828dd8ac 100644
    > --- a/stand/common/load_elf_obj.c
    > +++ b/stand/common/load_elf_obj.c
    > @@ -37,6 +37,7 @@
    > #include <sys/link_elf.h>
    >
    > #include "bootstrap.h"
    > +#include "modinfo.h"
    >
    > #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l)
    >
    > @@ -77,9 +78,6 @@ static int __elfN(obj_parse_modmetadata)(struct prel= oaded_file *mp,
    >=C2=A0 =C2=A0 =C2=A0elf_file_t ef);
    > static Elf_Addr __elfN(obj_symaddr)(struct elf_file *ef, Elf_Size symi= dx);
    >
    > -const char *__elfN(obj_kerneltype) =3D "elf kernel";
    > -const char *__elfN(obj_moduletype) =3D "elf obj module"; > -
    > /*
    >=C2=A0 * Attempt to load the file (file) as an ELF module.=C2=A0 It wil= l be stored at
    >=C2=A0 * (dest), and a pointer to a module structure describing the loa= ded object
    > @@ -154,7 +152,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest= ,
    > }
    > #endif
    >
    > - kfp =3D file_findfile(NULL, __elfN(obj_kerneltype));
    > + kfp =3D file_findfile(NULL, md_kerntype);
    > if (kfp =3D=3D NULL) {
    > printf("elf" __XSTRING(__ELF_WORD_SIZE)
    >=C2=A0 =C2=A0 "_obj_loadfile: can't load module before kernel\= n");
    > @@ -178,7 +176,7 @@ __elfN(obj_loadfile)(char *filename, uint64_t dest= ,
    > goto out;
    > }
    > fp->f_name =3D strdup(filename);
    > - fp->f_type =3D strdup(__elfN(obj_moduletype));
    > + fp->f_type =3D strdup(md_modtype_obj);
    >
    > if (module_verbose > MODULE_VERBOSE_SILENT)
    > printf("%s ", filename);
    > diff --git a/stand/common/metadata.c b/stand/common/metadata.c
    > index 8962763061dc..22df6f175791 100644
    > --- a/stand/common/metadata.c
    > +++ b/stand/common/metadata.c
    > @@ -146,7 +146,7 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_= offset_t *dtb, int kern64)
    > #endif
    >
    >=C2=A0 =C2=A0 =C2=A0kernend =3D 0;
    > -=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, "elf kernel"); > +=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, md_kerntype);
    >=C2=A0 =C2=A0 =C2=A0if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    >=C2=A0 =C2=A0 =C2=A0file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto= , &howto);
    > diff --git a/stand/common/modinfo.c b/stand/common/modinfo.c
    > index 381bd9dfd719..d00548c91c57 100644
    > --- a/stand/common/modinfo.c
    > +++ b/stand/common/modinfo.c
    > @@ -109,6 +109,11 @@
    >
    > #define MOD_ALIGN(l) roundup(l, align)
    >
    > +const char md_modtype[] =3D MODTYPE;
    > +const char md_kerntype[] =3D KERNTYPE;
    > +const char md_modtype_obj[] =3D MODTYPE_OBJ;
    > +const char md_kerntype_mb[] =3D KERNTYPE_MB;
    > +
    > vm_offset_t
    > md_copymodules(vm_offset_t addr, bool kern64)
    > {
    > diff --git a/stand/common/modinfo.h b/stand/common/modinfo.h
    > index 967367beeeb0..d26129089fb6 100644
    > --- a/stand/common/modinfo.h
    > +++ b/stand/common/modinfo.h
    > @@ -6,6 +6,11 @@
    > #ifndef COMMON_MODINFO_H
    > #define COMMON_MODINFO_H
    >
    > +extern const char md_modtype[];
    > +extern const char md_kerntype[];
    > +extern const char md_modtype_obj[];
    > +extern const char md_kerntype_mb[];
    > +
    > int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
    > int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
    >
    > diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/load= er/arch/amd64/multiboot2.c
    > index d09b01fce1fc..eb7362293406 100644
    > --- a/stand/efi/loader/arch/amd64/multiboot2.c
    > +++ b/stand/efi/loader/arch/amd64/multiboot2.c
    > @@ -51,6 +51,7 @@
    > #include "bootstrap.h"
    > #include "multiboot2.h"
    > #include "loader_efi.h"
    > +#include "modinfo.h"
    >
    > extern int elf32_loadfile_raw(char *filename, uint64_t dest,
    >=C2=A0 =C2=A0 =C2=A0struct preloaded_file **result, int multiboot);
    > @@ -436,7 +437,7 @@ exec(struct preloaded_file *fp)
    > *=C2=A0 module 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0module 1
    > */
    >
    > - fp =3D file_findfile(NULL, "elf kernel");
    > + fp =3D file_findfile(NULL, md_kerntype);
    > if (fp =3D=3D NULL) {
    > printf("No FreeBSD kernel provided, aborting\n");
    > error =3D EINVAL;
    > @@ -498,7 +499,7 @@ obj_loadfile(char *filename, uint64_t dest, struct= preloaded_file **result)
    > int error;
    >
    > /* See if there's a multiboot kernel loaded */
    > - mfp =3D file_findfile(NULL, "elf multiboot kernel");
    > + mfp =3D file_findfile(NULL, md_kerntype_mb);
    > if (mfp =3D=3D NULL)
    > return (EFTYPE);
    >
    > @@ -506,14 +507,14 @@ obj_loadfile(char *filename, uint64_t dest, stru= ct preloaded_file **result)
    > * We have a multiboot kernel loaded, see if there's a FreeBSD
    > * kernel loaded also.
    > */
    > - kfp =3D file_findfile(NULL, "elf kernel");
    > + kfp =3D file_findfile(NULL, md_kerntype);
    > if (kfp =3D=3D NULL) {
    > /*
    > * No kernel loaded, this must be it. The kernel has to
    > * be loaded as a raw file, it will be processed by
    > * Xen and correctly loaded as an ELF file.
    > */
    > - rfp =3D file_loadraw(filename, "elf kernel", 0);
    > + rfp =3D file_loadraw(filename, md_kerntype, 0);
    > if (rfp =3D=3D NULL) {
    > printf(
    > "Unable to load %s as a multiboot payload kernel\n",
    > diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c=
    > index b7d4070c2ffb..3e74a9228b5e 100644
    > --- a/stand/efi/loader/bootinfo.c
    > +++ b/stand/efi/loader/bootinfo.c
    > @@ -420,7 +420,7 @@ bi_load(char *args, vm_offset_t *modulep, vm_offse= t_t *kernendp, bool exit_bs)
    > addr +=3D roundup(dtb_size, PAGE_SIZE);
    > #endif
    >
    > - kfp =3D file_findfile(NULL, "elf kernel");
    > + kfp =3D file_findfile(NULL, md_kerntype);
    > if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    > kernend =3D 0; /* fill it in later */
    > diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/boot= info32.c
    > index df715e547795..37b227b913bd 100644
    > --- a/stand/i386/libi386/bootinfo32.c
    > +++ b/stand/i386/libi386/bootinfo32.c
    > @@ -129,7 +129,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, = vm_offset_t *bip, vm_offset_t
    >=C2=A0 =C2=A0 =C2=A0/* pad to a page boundary */
    >=C2=A0 =C2=A0 =C2=A0addr =3D roundup(addr, PAGE_SIZE);
    >
    > -=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, "elf kernel"); > +=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, md_kerntype);
    >=C2=A0 =C2=A0 =C2=A0if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    >=C2=A0 =C2=A0 =C2=A0kernend =3D 0; /* fill it in later */
    > diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/boot= info64.c
    > index 4731b10325fe..f7181dcd599f 100644
    > --- a/stand/i386/libi386/bootinfo64.c
    > +++ b/stand/i386/libi386/bootinfo64.c
    > @@ -143,7 +143,7 @@ bi_load64(char *args, vm_offset_t *modulep,
    >=C2=A0 =C2=A0 =C2=A0/* place the metadata before anything */
    >=C2=A0 =C2=A0 =C2=A0module =3D *modulep =3D addr;
    >
    > -=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, "elf kernel"); > +=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, md_kerntype);
    >=C2=A0 =C2=A0 =C2=A0if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    >=C2=A0 =C2=A0 =C2=A0kernend =3D 0; /* fill it in later */
    > diff --git a/stand/i386/libi386/multiboot.c b/stand/i386/libi386/multi= boot.c
    > index b69895de9706..e2bd44fe83f5 100644
    > --- a/stand/i386/libi386/multiboot.c
    > +++ b/stand/i386/libi386/multiboot.c
    > @@ -48,6 +48,7 @@
    > #include "bootstrap.h"
    > #include "multiboot.h"
    > #include "libi386.h"
    > +#include "modinfo.h"
    > #include <btxv86.h>
    >
    > #define MULTIBOOT_SUPPORTED_FLAGS \
    > @@ -256,7 +257,7 @@ multiboot_exec(struct preloaded_file *fp)
    > *=C2=A0 module 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0module 1
    > */
    >
    > - fp =3D file_findfile(NULL, "elf kernel");
    > + fp =3D file_findfile(NULL, md_kerntype);
    > if (fp =3D=3D NULL) {
    > printf("No FreeBSD kernel provided, aborting\n");
    > error =3D EINVAL;
    > @@ -324,7 +325,7 @@ multiboot_obj_loadfile(char *filename, uint64_t de= st,
    > int error, mod_num;
    >
    > /* See if there's a multiboot kernel loaded */
    > - mfp =3D file_findfile(NULL, "elf multiboot kernel");
    > + mfp =3D file_findfile(NULL, md_kerntype_mb);
    > if (mfp =3D=3D NULL)
    > return (EFTYPE);
    >
    > @@ -332,14 +333,14 @@ multiboot_obj_loadfile(char *filename, uint64_t = dest,
    > * We have a multiboot kernel loaded, see if there's a FreeBSD
    > * kernel loaded also.
    > */
    > - kfp =3D file_findfile(NULL, "elf kernel");
    > + kfp =3D file_findfile(NULL, md_kerntype);
    > if (kfp =3D=3D NULL) {
    > /*
    > * No kernel loaded, this must be it. The kernel has to
    > * be loaded as a raw file, it will be processed by
    > * Xen and correctly loaded as an ELF file.
    > */
    > - rfp =3D file_loadraw(filename, "elf kernel", 0);
    > + rfp =3D file_loadraw(filename, md_kerntype, 0);
    > if (rfp =3D=3D NULL) {
    > printf(
    > "Unable to load %s as a multiboot payload kernel\n",
    > diff --git a/stand/powerpc/ofw/elf_freebsd.c b/stand/powerpc/ofw/elf_f= reebsd.c
    > index 21ab834f76fa..4d34fa18c5dd 100644
    > --- a/stand/powerpc/ofw/elf_freebsd.c
    > +++ b/stand/powerpc/ofw/elf_freebsd.c
    > @@ -58,7 +58,7 @@ __elfN(ofw_loadfile)(char *filename, uint64_t dest,<= br> > * No need to sync the icache for modules: this will
    > * be done by the kernel after relocation.
    > */
    > - if (!strcmp((*result)->f_type, "elf kernel"))
    > + if (!strcmp((*result)->f_type, md_kerntype))
    > __syncicache((void *) (*result)->f_addr, (*result)->f_size);
    > #endif
    > return (0);
    > diff --git a/stand/powerpc/ofw/ppc64_elf_freebsd.c b/stand/powerpc/ofw= /ppc64_elf_freebsd.c
    > index e0518abe2283..bc68d129f353 100644
    > --- a/stand/powerpc/ofw/ppc64_elf_freebsd.c
    > +++ b/stand/powerpc/ofw/ppc64_elf_freebsd.c
    > @@ -57,7 +57,7 @@ ppc64_ofw_elf_loadfile(char *filename, uint64_t dest= ,
    > * No need to sync the icache for modules: this will
    > * be done by the kernel after relocation.
    > */
    > - if (!strcmp((*result)->f_type, "elf kernel"))
    > + if (!strcmp((*result)->f_type, md_kerntype))
    > __syncicache((void *) (*result)->f_addr, (*result)->f_size);
    > return (0);
    > }
    > diff --git a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c b/stand/uboo= t/arch/powerpc/ppc64_elf_freebsd.c
    > index 291fe6b944fb..e500b862de2e 100644
    > --- a/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c
    > +++ b/stand/uboot/arch/powerpc/ppc64_elf_freebsd.c
    > @@ -53,7 +53,7 @@ ppc64_uboot_elf_loadfile(char *filename, uint64_t de= st,
    > * No need to sync the icache for modules: this will
    > * be done by the kernel after relocation.
    > */
    > - if (!strcmp((*result)->f_type, "elf kernel"))
    > + if (!strcmp((*result)->f_type, md_kerntype))
    > __syncicache((void *) (*result)->f_addr, (*result)->f_size);
    > return (0);
    > }
    > diff --git a/stand/uboot/elf_freebsd.c b/stand/uboot/elf_freebsd.c
    > index 6c764d143881..3b1bdc542538 100644
    > --- a/stand/uboot/elf_freebsd.c
    > +++ b/stand/uboot/elf_freebsd.c
    > @@ -53,7 +53,7 @@ __elfN(uboot_load)(char *filename, uint64_t dest, > * No need to sync the icache for modules: this will
    > * be done by the kernel after relocation.
    > */
    > - if (!strcmp((*result)->f_type, "elf kernel"))
    > + if (!strcmp((*result)->f_type, md_kerntype))
    > __syncicache((void *) (*result)->f_addr, (*result)->f_size);
    > #endif
    > return (0);
    > diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/use= rboot/bootinfo32.c
    > index 91f1f81f1181..750574912172 100644
    > --- a/stand/userboot/userboot/bootinfo32.c
    > +++ b/stand/userboot/userboot/bootinfo32.c
    > @@ -108,7 +108,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, = vm_offset_t *bip, vm_offset_t
    >=C2=A0 =C2=A0 =C2=A0/* pad to a page boundary */
    >=C2=A0 =C2=A0 =C2=A0addr =3D roundup(addr, PAGE_SIZE);
    >
    > -=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, "elf kernel"); > +=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, md_kerntype);
    >=C2=A0 =C2=A0 =C2=A0if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    >=C2=A0 =C2=A0 =C2=A0kernend =3D 0; /* fill it in later */
    > diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/use= rboot/bootinfo64.c
    > index fb9fd0fb82f1..d20202bf4fbb 100644
    > --- a/stand/userboot/userboot/bootinfo64.c
    > +++ b/stand/userboot/userboot/bootinfo64.c
    > @@ -140,7 +140,7 @@ bi_load64(char *args, vm_offset_t *modulep, vm_off= set_t *kernendp)
    >=C2=A0 =C2=A0 =C2=A0/* pad to a page boundary */
    >=C2=A0 =C2=A0 =C2=A0addr =3D roundup(addr, PAGE_SIZE);
    >
    > -=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, "elf kernel"); > +=C2=A0 =C2=A0 kfp =3D file_findfile(NULL, md_kerntype);
    >=C2=A0 =C2=A0 =C2=A0if (kfp =3D=3D NULL)
    > panic("can't find kernel file");
    >=C2=A0 =C2=A0 =C2=A0kernend =3D 0; /* fill it in later */

    --0000000000006e7b3d062c7b090f-- From nobody Fri Jan 24 22:33:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfszX58dBz5lVnv; Fri, 24 Jan 2025 22:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfszX3yHwz3rYt; Fri, 24 Jan 2025 22:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhxSNBBcca2fpUbFTGPehWTe4kl29Qz38xLDVCYiExQ=; b=BLzewX7FE+Dr0vyp3yv4ObShGsx9IyCkiu8uIfGXG8jaa51mCENnADBC7Otp8kHl1ZLBtr JaQGrXFdCaVnxZ7wPrV30lqDc6w7Tvqh/cSSWXUrwGXv1AP5MNP/wH8grzYID21+S+1EK4 IMITKrDm7GgVT1fndz3omIWBcLdcYbzzfM9Lgqapo2B5TRNNIlZIDmyNr3sVVwC0dGD+wj 9tXP+jN5EfTWEPvdCBm0q/UlmR9WhcbjD+15zPILzScxD9P7J6RMd7Qi2CBlW8fw2SRx+F 7FsACJ1xxebTpZ8RJwv3+DSLUP6DQXLhYi/e4Sn6P6bdXIeU05AJt0oRijdSEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VhxSNBBcca2fpUbFTGPehWTe4kl29Qz38xLDVCYiExQ=; b=wZRuRN1D3mhs1JzgD+K6Li1rpzyp9xHCkvlmUw9kRN5fhxT40D02aX4O8F3xIhubAyz0VT bBk8ddAUk3fDwWuOeeF9pUKz0HPPqsgm2o+QKeC7hloHyW5uSl4FOwVPr6dFFAKlCiru7R hXgAC6pQ/byHT9+cycr5fAk5vPQfXSvzRIPPXZqmR6HryBvwqddO1hm5UZ9twiVTUS7eWN jXJxt50gn0E3ySpZ2jylQbOoCGxr9VThvFDE2M4xLKGA/Y77LWFfkXLLvoYYVC3vptRSJX 7pOfKaJO8Sqwj2Bvz2hMDc4djITrOJuzPUsfLW773d/a46iktFfLK+4AYbdiGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737758024; a=rsa-sha256; cv=none; b=Odbo3mmDEcgjIsw42zk1qXVNlpKBtnvHd18qx5AA/8/dSe1+ca87+17xQUZoTpa8Mea+LL PqTJqOZ5+sfh3oBcr5RWZrbLlmyAIQRc3ezim2OZAO5INWyyeYj7Qas/Wr1W5Ve73ylLDq zn76CY/100Ui0yCcLfF6BK2o41YcqYwhG/KPImHfupoBzDSg8QBhRJvKCfDPxkhTb8WcsC QFazjwStzNVRz9IsFA4QKF15t9DVVoOOvYuiJclgRMgyRJQcIrhJQ7YNX/2b8C4RuG/chK i/8Q1SLYbt8lQkAEaoQ4+DxYPemkKsG1Op4nI6gB1/eU0k6bgnsEY/6+61+/Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YfszX3Pv0zl7w; Fri, 24 Jan 2025 22:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OMXibd007074; Fri, 24 Jan 2025 22:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OMXiPc007071; Fri, 24 Jan 2025 22:33:44 GMT (envelope-from git) Date: Fri, 24 Jan 2025 22:33:44 GMT Message-Id: <202501242233.50OMXiPc007071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6a0afbcbf6a0 - stable/14 - cam: Add 3e/3 as a fatal code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 commit 6a0afbcbf6a0aec6392ee9357428ac5b140bbdc1 Author: Warner Losh AuthorDate: 2025-01-17 21:06:32 +0000 Commit: Warner Losh CommitDate: 2025-01-24 22:34:19 +0000 cam: Add 3e/3 as a fatal code We see this error: (da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test) for drives that have failed. Our vendor tells us there's no recovery from that state, though we can still grab logs from the drives and run their diagnostics. Drives in this state need to bascially be remanufactured because some part of them has failed. The prior default behavior is to retry, and retrying takes a long time to work out. Instead, short-circuit the retries and fail right away. I selected ENXIO because no I/O to LBAs is possible for drives in this state (both my experience and per vendor). Some googling suggests that other vendors behave identically, but it was inconclusive. Should this be too pessimistic, we can adjust in the future. Also, this is with some aging drives in our fleet, and if we have more than one drive in this state, our systems take so long to get to mountroot that the watchdog fires sometimes. Adding this patch makes them boot reliably again. MFC After: 1 week Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D48505 (cherry picked from commit a8b49e7c66292852339481536f039719e7914200) --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 0e42403d74a6..20c1e961bf63 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2309,7 +2309,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x3E, 0x02, SS_RDEF, "Timeout on logical unit") }, /* DTLPWROMAEBKVF */ - { SST(0x3E, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x3E, 0x03, SS_FATAL | ENXIO, "Logical unit failed self-test") }, /* DTLPWROMAEBKVF */ { SST(0x3E, 0x04, SS_RDEF, /* XXX TBD */ From nobody Fri Jan 24 22:34:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yft050W2pz5lW7d; Fri, 24 Jan 2025 22:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yft046zQHz3rm2; Fri, 24 Jan 2025 22:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN48Ah3/uhJZ/dSE4An+NudGtJ4JY78et5LJ5uKnoYU=; b=VLTUjH5HnMMX499fxK1CWe2/D9sFq0rpV2y4MTcOdPTUgPYcu02xkoYaAlWvUA0+p9zp+7 Z1nROHqqWKqRvraXwDhbTxC4SlljS9oYzbZcnKHmW1lihWONZPpfvDIPs+pYXe2NVgTGqG Gkx3Lpz8NARukT2cBCIUK5vxV/qy51S0pqwcpEKlT5DWLBpKcqc/0uFw5aRWP0MzpN6KVL wXJmS3O13Cy/dat9TM+Uo3com0Ha+Lk+a92v0V6ErSVPzXW3GwjAu8UX0td1qu18XUW8oA +TBrtleSpGObI+6+1TD7CX0+6p/kf7jM0KDOCRMNNMZ0ZhVL8OKsRx20nIiCWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737758053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QN48Ah3/uhJZ/dSE4An+NudGtJ4JY78et5LJ5uKnoYU=; b=BuKSUnehsOZ5SG97BA6nDkA/5NpOll4aQAVeocMP6NzwXhvt0H0ZLPo2QqtKOLvD+hyrcT UBcMEY8tqSSz+I1z0ub1BJ7GQ3cK3QsSfsrOCxA3Inf1QRBfauV8CD4jroTUKxoDAk95pY al27zKa98oknRFkBC7nlJzZceV7wVroJT5RTtMELoHOfy8UTprRIAHJzeCF6HcuTsdjVP9 ET2dE3n9++jF2q4KnveaZFxTtrBB5j/RyH1Qfb4vBi/1XzxiB14DJRlUDlqVbYFGgpkWqY 6R6yhyH+yvUyjiBNQu7/kvGLthIM8DOj2eqetj6UzxD0Pf+Cr9VhpYIBLAXBPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737758053; a=rsa-sha256; cv=none; b=XMm3AvgYLB+VKV43oz9eBRKd6iMOtPj0J4PY+oqsr1tKGoxmYuoAcgjW2G2bkwcGwAsURi 4yx5eRLG+Vx4cmhc11F0GGosFv2+e1lnztdDtHpfMhuUdToka0AaJXQjaFdE3bXYhep7oZ 9P6tHwGLXAwQdOb3Gi/tYNQp63iQO543wHn/hV4S2czV/nkAyCZkGOySsxrc256Muiqwjw iOOs29cTbsd//ItfzI7Ftrnf2b5AnjfaseXYSRymaUuQqOem37/bQMsfk52+Hpeyh5Ewkh Eyk1QmybQ7GR7+RUMYncQXujjnPwYg6vrBv6VoI+7e1TyJxEBHIQzNj+AfiPMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yft046LD0zlhr; Fri, 24 Jan 2025 22:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50OMYC2c007349; Fri, 24 Jan 2025 22:34:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50OMYCRQ007346; Fri, 24 Jan 2025 22:34:12 GMT (envelope-from git) Date: Fri, 24 Jan 2025 22:34:12 GMT Message-Id: <202501242234.50OMYCRQ007346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 98983f3c9dec - stable/13 - cam: Add 3e/3 as a fatal code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 98983f3c9dec93285609c6ec5a615d6159b4ab65 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=98983f3c9dec93285609c6ec5a615d6159b4ab65 commit 98983f3c9dec93285609c6ec5a615d6159b4ab65 Author: Warner Losh AuthorDate: 2025-01-17 21:06:32 +0000 Commit: Warner Losh CommitDate: 2025-01-24 22:34:47 +0000 cam: Add 3e/3 as a fatal code We see this error: (da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test) for drives that have failed. Our vendor tells us there's no recovery from that state, though we can still grab logs from the drives and run their diagnostics. Drives in this state need to bascially be remanufactured because some part of them has failed. The prior default behavior is to retry, and retrying takes a long time to work out. Instead, short-circuit the retries and fail right away. I selected ENXIO because no I/O to LBAs is possible for drives in this state (both my experience and per vendor). Some googling suggests that other vendors behave identically, but it was inconclusive. Should this be too pessimistic, we can adjust in the future. Also, this is with some aging drives in our fleet, and if we have more than one drive in this state, our systems take so long to get to mountroot that the watchdog fires sometimes. Adding this patch makes them boot reliably again. MFC After: 1 week Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D48505 (cherry picked from commit a8b49e7c66292852339481536f039719e7914200) --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 3c5e509c99ad..0593dd627fda 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2249,7 +2249,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x3E, 0x02, SS_RDEF, "Timeout on logical unit") }, /* DTLPWROMAEBKVF */ - { SST(0x3E, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x3E, 0x03, SS_FATAL | ENXIO, "Logical unit failed self-test") }, /* DTLPWROMAEBKVF */ { SST(0x3E, 0x04, SS_RDEF, /* XXX TBD */ From nobody Fri Jan 24 23:10:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yftp45h6xz5lYDp; Fri, 24 Jan 2025 23:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yftp45FG4z3tR5; Fri, 24 Jan 2025 23:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737760236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AV96HPw+eIWFT3k1jdAu9OHgSOPIZZK2sVns5H00Hug=; b=gRoHsHiIAhLarnkQJkBM/VWhNpqubgUpTVRQLpndbBmdrwJbreGg16CU0nbPxcGo44jxUk RjSPJxdTqO2C5W5arqvhNUcAxa9t/zJtZtf9tVZwYj2bpNoPXSlnomDB7ApQ3yRA5SllJQ /cHaLi7DHIlIEmkXKwZ0b/TIPiNkS+kx4oKyEcAlKrjEPFRX06lZNOFQDy7aaFlQT4LxD+ WbNeATcokpH40Y4QHiXBmNjfcjOfN4ipugSA4DaNmzk2C6k1pxAmlbvdl4vsHV3QWQTFF/ 6MKsHK1HjScaF5QzW97AJ9vRG+nws/DX2BCWhAF0qZ50fZbeUU+9pJ0cLY5mNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737760236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AV96HPw+eIWFT3k1jdAu9OHgSOPIZZK2sVns5H00Hug=; b=N1WMxjrnby1fj7wNNdP+DSsant/xepANJvC88xnDy4H6GqIjSRC1uLJz2HGM5tetJ6lWYU uKkWa7VqLMvDUoqP3iuxX4YnIrhv1VsbdYWDUZ/RmcgsSIAlG+CmhLR25taWkl9/kcUSrr dkrfRDt8BflBm3To5R87ov+HkW8cTgPhKSXFJhvihriRPVyyvCGM4Ngge+lLNJQgK7iBly 0qyPVJyhg01HoWSrA/hQLA66a17AAtJyJTocSyDS/kwB5BZxgzgV/mkasamraFs0uvVQ3p OdNgsqFw9OGBmdDoA174dxSfRNoclSpGyvXVaJr5yIVCxQzF1mn1QJ6rFxCZVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737760236; a=rsa-sha256; cv=none; b=p9FH9fLo1H+88juCzTktCcaEAuXGhe+u5xkn7LuoJ/PRczHdajSm7Rgpz0G51Mz3qrMei2 JvlAwkRcdrJLWEmK7C3eihFtQUU9Bzye6lKY7bi8RqyBbS7ZOFOUQ6bXM+WfeSWYHryRCb yR8R3C+TgObdz86EQ2tmSrbAlsOUi7ao9N7NXDQaRISnI4l3lEEZcf5NCrQ7QTI0WY1DWF 1Y2lSIWjtG5JNy8PXMsoSzCcFXcSyZaUxEtV0pyezMOITlOt9mH9c4TyeSs7NUqXTn8NtT ULhifNaDVgamE6SmZ1V/E6tlQ9jSMbpEMXpeOgSsgHKLmiMlrDJsUJ4J8MhUFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yftp44NMFzmB9; Fri, 24 Jan 2025 23:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ONAaUr074475; Fri, 24 Jan 2025 23:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ONAa45074472; Fri, 24 Jan 2025 23:10:36 GMT (envelope-from git) Date: Fri, 24 Jan 2025 23:10:36 GMT Message-Id: <202501242310.50ONAa45074472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: e7142d455eeb - main - mtree: Align BSD.usr.dist keywords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7142d455eeb6bce6e90e5e6031bf1e868e6f5b6 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=e7142d455eeb6bce6e90e5e6031bf1e868e6f5b6 commit e7142d455eeb6bce6e90e5e6031bf1e868e6f5b6 Author: Jose Luis Duran AuthorDate: 2025-01-24 23:09:41 +0000 Commit: Jose Luis Duran CommitDate: 2025-01-24 23:09:41 +0000 mtree: Align BSD.usr.dist keywords Reviewed by: emaste Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47721 --- etc/mtree/BSD.usr.dist | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 9fd0cf326bdf..91500c99271c 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -210,9 +210,9 @@ calendar .. certs - trusted tags=package=caroot + trusted tags=package=caroot .. - untrusted tags=package=caroot + untrusted tags=package=caroot .. .. dict @@ -222,7 +222,7 @@ .. atf tags=package=tests .. - kyua tags=package=tests + kyua tags=package=tests .. legal .. @@ -318,7 +318,7 @@ .. .. .. - kyua tags=package=tests + kyua tags=package=tests .. libusb20 .. @@ -455,16 +455,16 @@ .. keys pkg - revoked tags=package=runtime + revoked tags=package=runtime .. - trusted tags=package=runtime + trusted tags=package=runtime .. .. .. - kyua tags=package=tests - misc tags=package=tests + kyua tags=package=tests + misc tags=package=tests .. - store tags=package=tests + store tags=package=tests .. .. locale From nobody Fri Jan 24 23:10:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yftp56fNpz5lY83; Fri, 24 Jan 2025 23:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yftp55BMSz3tkq; Fri, 24 Jan 2025 23:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737760237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=geKoixrXUS7R9xAHP3wI4UUZzvf/gAd/PH4eWEMEkhE=; b=uw4unK0HebuO1NdHrINT6zJiXF0QCDqGOp3VE3+qQ4LQFXeTI+S+K4GVuJFw2MqWWaUfD1 Qk/rcxFUxwZYTY4so3VJQ3DyW90EipaiTDhxqHCrZT1Od1uF+l1UyDEI7sqoOJm8fKdR6o 7EH6FIRxfofHkEqloC0Ir3FQ7OcVW44PkLGhIVHb75BQG5OSzQo9h4DViAFsoN4DWngv5n OYGOiFUByR0KfHF+6wmmilhPyNv51b9a93/jp8BU08CmtKigys5/qieE8udvEouaDQGZ0E 0TBYBBui0u2DnnqtbdJ1tyXuSb2Is0fYvuPVZwnsooZxn1wzlNMrxNPn40fwtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737760237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=geKoixrXUS7R9xAHP3wI4UUZzvf/gAd/PH4eWEMEkhE=; b=vZav0TF0xlR8WSNmCsuzEDSmWxMeNSAADlSk3pwgwCqudET2NQTUD3KEJa5al/gusTctzJ nDPYgA/9HzGRNhQ1ELlqVVfCR8Hq6d0YhuWqPpxky7X0Mx84A7Z5U87lvA9QdaC+8I96MZ Ln+3drawEWa8pDFWSN1x13aDOeBkSGgE7l8AecW7GL0KExMs29KzZKsiJnnaA7aM+QLem4 PDiUI4ddrGOTET8zbjOf3wkunoMNX81Nz0MLqy3SMiQOch5Bch+grhyOZsioo8CyAPnyli 7gnEzN4mQE3c+7Fb5Jb02ZHmRJNozrZWgwBc4KjaDXHXdyDvWY8zbn3r6lgOfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737760237; a=rsa-sha256; cv=none; b=yQx+H/hJtju/FtASlY6QEr6l95wHnlXwuLacw5wiJg9Cdi0bQq/ZqhvYT1w5eCpwnf2918 xe9P2sIZ/kFUDir9cShIAp59tEM5m/92AYrM/gEahEAlAhhlZ64Swj5MuaxYEBSpz0kS8D wB/EWbyTWqm3hnaEcS8hOIpy06yqkz6RquQlBv6Bj/f282P56JUmVFzzmtcTA75PSN3VBj 01l5+8NELQRnQmUwlViRo6FrC9PirpzmT1xe7v3TZIcqj/iokkC6tXt8K1ki0f8xT0K+Sx vH5sS69nGSO7hDzKqlqJae2jBd8RmT2QR+H14ihr1aOv2s9V/hJouMW7wAu+Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yftp54lrKzlvw; Fri, 24 Jan 2025 23:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ONAbc8074512; Fri, 24 Jan 2025 23:10:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ONAbvN074509; Fri, 24 Jan 2025 23:10:37 GMT (envelope-from git) Date: Fri, 24 Jan 2025 23:10:37 GMT Message-Id: <202501242310.50ONAbvN074509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 01ff67f4bdf5 - main - mtree: TESTSBASE directory always starts with a / List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01ff67f4bdf5959a719a6511a855f6a60c0e3a93 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=01ff67f4bdf5959a719a6511a855f6a60c0e3a93 commit 01ff67f4bdf5959a719a6511a855f6a60c0e3a93 Author: Jose Luis Duran AuthorDate: 2025-01-24 23:10:05 +0000 Commit: Jose Luis Duran CommitDate: 2025-01-24 23:10:05 +0000 mtree: TESTSBASE directory always starts with a / Remove the extra forward slash ("/"), otherwise the mtree specification file will have the double slash and will not be parsed by makefs when attempting to build NanoBSD with NO_ROOT privileges. Fixes: 07670b30fa43 ("Create /usr/tests *.debug file directory hierarchy") Reviewed by: emaste Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47722 --- Makefile.inc1 | 2 +- etc/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index efa1299b76a7..4383b4bfe30a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1506,7 +1506,7 @@ distributeworld installworld stageworld: _installcheck_world .PHONY -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null .if ${MK_DEBUG_FILES} != "no" ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/null + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} >/dev/null .endif .endif ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ diff --git a/etc/Makefile b/etc/Makefile index fdcad75911c8..d3cb6b679dc5 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -112,7 +112,7 @@ MTREES+= mtree/BSD.lib${libcompat}.dist /usr/lib/debug/usr .endfor .if ${MK_TESTS} != "no" MTREES+= mtree/BSD.tests.dist ${TESTSBASE} -MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} +MTREES+= mtree/BSD.tests.dist /usr/lib/debug${TESTSBASE} .endif .if ${MK_SENDMAIL} != "no" MTREES+= mtree/BSD.sendmail.dist / From nobody Fri Jan 24 23:22:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfv3y6fl8z5lYq4 for ; Fri, 24 Jan 2025 23:22:38 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfv3y3TBWz3wGx for ; Fri, 24 Jan 2025 23:22:38 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43624b2d453so27760145e9.2 for ; Fri, 24 Jan 2025 15:22:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737760956; x=1738365756; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4yOIwFP9tIaXY3rlOwjSJHGZQH1vIu9fAgJsxenS3zg=; b=iaSnM6qrtW9O6gY+dkiq/h9/27qlQZGCvKoTErsSSdzoUv61aIvJ2R/5cJpDjCjK01 cIWGZQ6VQk9ITR3rrTu1jGDXlZNWEL+gXMeNV2E7t9BU/r1nzIf7TrxcNTKSBO5EJac+ URu0yBeIn6/TWF+CBKPWGfz7AgnyTCeAjfXr69qXTR6S9k7QDexZXa1BqXHJ/kXHm2ZF nSBTWqKcicYY6bLFEjRaUBVHBiyThrKZ3ixhvje4d2L8lgG5wYwoOwk4iGEivKb5MKAn EWxrD0jRLMgTjXbCTIpkH+DMKoqyFfKGDfVh14tGXExeH2g7j6uLt7e+aRjWVnCSCAYl HY8g== X-Forwarded-Encrypted: i=1; AJvYcCUr2OgIgTP6L3/EzXaM/agwcqI2omAFGIuI0Qe7zTVmFoaLKOaztVNr3JQWuh6ZjS59+8QlevuBRa51kQUkjCVSFnXT@freebsd.org X-Gm-Message-State: AOJu0YyLeerCyZcxhEz5ON/LhPjeUeXGHZdKDX/eD0CBOI5zb6wzCzNq piXE3HVA2bOyUZlCuBK0GGBQOsnJTmGWOvMp+OfhhJ6qm00TgXSoUihOTLzkzII= X-Gm-Gg: ASbGncsWVEcfXiP2mJGYAXfEH0Cn+Lm9XLs0zWIsBYBh+4vynCYll5nEZUlb6gMrV9M gnC7hMxla+gYRkexWzh6CWaAQd1YVqNFGvpu5Z3q0RVVzH/OtV43sBYDf991ZrORkyK/CMCofYZ Lvg+cc0j7+1RlVJlJc2Bs650a1qbnhADDh9LETZc/Syd128TUFnG+aNt349qBA1TYUXv4DIlWZ2 f8z6Ggu1qUXMYGBpym09ecy9EWC/HAbOcgr8sdPIzgGtmndV97ER/F1XzMjpXk8jIDbltbrIa1Q 1ylWJUs+YkdW9xdDVx28evlgmCedEA== X-Google-Smtp-Source: AGHT+IGk47TqCu7dfUmtjgzIwBYJ7EMcr4Yk76ix5uQMRH3S3dJI4hEVwpEJJMpprzeIpIO5XFyWrA== X-Received: by 2002:a05:600c:468d:b0:431:542d:2599 with SMTP id 5b1f17b1804b1-4389143b715mr289751535e9.22.1737760956480; Fri, 24 Jan 2025 15:22:36 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd501c2dsm40719945e9.13.2025.01.24.15.22.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2025 15:22:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 01ff67f4bdf5 - main - mtree: TESTSBASE directory always starts with a / From: Jessica Clarke In-Reply-To: <202501242310.50ONAbvN074509@gitrepo.freebsd.org> Date: Fri, 24 Jan 2025 23:22:24 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202501242310.50ONAbvN074509@gitrepo.freebsd.org> To: Jose Luis Duran X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4Yfv3y3TBWz3wGx X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 24 Jan 2025, at 23:10, Jose Luis Duran wrote: >=20 > The branch main has been updated by jlduran: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D01ff67f4bdf5959a719a6511a855f6a6= 0c0e3a93 >=20 > commit 01ff67f4bdf5959a719a6511a855f6a60c0e3a93 > Author: Jose Luis Duran > AuthorDate: 2025-01-24 23:10:05 +0000 > Commit: Jose Luis Duran > CommitDate: 2025-01-24 23:10:05 +0000 >=20 > mtree: TESTSBASE directory always starts with a / >=20 > Remove the extra forward slash ("/"), otherwise the mtree = specification > file will have the double slash and will not be parsed by makefs = when > attempting to build NanoBSD with NO_ROOT privileges. Not sure why you=E2=80=99re having issues with this. I can see the = duplicate slashes do indeed end up in CheriBSD=E2=80=99s METALOG, but the in-tree = makefs produces a disk image just fine from that. Doesn=E2=80=99t mean I=E2=80=99m against fixing our build though :) Jess > Fixes: 07670b30fa43 ("Create /usr/tests *.debug file directory = hierarchy") > Reviewed by: emaste > Approved by: emaste (mentor) > Differential Revision: https://reviews.freebsd.org/D47722 > --- > Makefile.inc1 | 2 +- > etc/Makefile | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/Makefile.inc1 b/Makefile.inc1 > index efa1299b76a7..4383b4bfe30a 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -1506,7 +1506,7 @@ distributeworld installworld stageworld: = _installcheck_world .PHONY > -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null > .if ${MK_DEBUG_FILES} !=3D "no" > ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ > - -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} = >/dev/null > + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} = >/dev/null > .endif > .endif > ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | = \ > diff --git a/etc/Makefile b/etc/Makefile > index fdcad75911c8..d3cb6b679dc5 100644 > --- a/etc/Makefile > +++ b/etc/Makefile > @@ -112,7 +112,7 @@ MTREES+=3D mtree/BSD.lib${libcompat}.dist = /usr/lib/debug/usr > .endfor > .if ${MK_TESTS} !=3D "no" > MTREES+=3D mtree/BSD.tests.dist ${TESTSBASE} > -MTREES+=3D mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} > +MTREES+=3D mtree/BSD.tests.dist /usr/lib/debug${TESTSBASE} > .endif > .if ${MK_SENDMAIL} !=3D "no" > MTREES+=3D mtree/BSD.sendmail.dist / From nobody Fri Jan 24 23:39:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YfvS45D4Fz5lZJC; Fri, 24 Jan 2025 23:40:04 +0000 (UTC) (envelope-from jlduran@gmail.com) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YfvS418Zmz3xmS; Fri, 24 Jan 2025 23:40:04 +0000 (UTC) (envelope-from jlduran@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e3c88163a00so453864276.2; Fri, 24 Jan 2025 15:40:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737762003; x=1738366803; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cHYA+1PUIDy1xM70KT++xD2NnG1PZv+Mv75fCj+YG20=; b=PePWi3cj6NbN5tdvROElbSMVt8+/nPLf6U/B4zNvrSR6IHkfEzHd6KrIewLUZDlx21 wg8n196os86tvl081qhK1YPMM6sBetpUSXs3mrANewMZ8yiL9gCzqJnLXYG3+YOgxwaS zV6xDHYmYl6FH3fkLuTTpRwPOw+cF2m+APAwQ2CGijf9PQxU+Yu0RIps9a1Q5rPqQH7y 6PEsqp3B/6Hyo4EQhVGrI9aQ7N0xV8TD/Bov8TfqdteK/LKls/XCOFcm/kCHLblDL+8i tAwxlrmTrUpxXHodT/SPIZrWCP7qew0fzAjkSRjCtQFxYgPC0MNMLWbVe1hG+alzVwdE Ry1Q== X-Forwarded-Encrypted: i=1; AJvYcCWJdKVOQ++34muveTk5/61ASKERZsMVj5Y9jsuIy4pxc/HWJG/Bu7O2pzrbQKjfwdUsrOe2GY4zVU2Ku05xEoDE68Oq3+4=@freebsd.org, AJvYcCWLgUkhEy6xGFoelLiKEIJiir73qczKV/Np/CKxSZ2KLfryvMe6bp8y2X91CRKNEHkhEOUKnXdWCZkWLPu1/TsfSytB@freebsd.org X-Gm-Message-State: AOJu0YxU4myfU/m6hSollf6nOL26vPYlJazDxqACIpxbyISBaik9/+v7 uQDoz0eLcvkjxH8k0CU8XlwccHWmjMqhH5qk5hEuvxy+k25p6CQGmGL0jg== X-Gm-Gg: ASbGncu7qqgceS2aR1NkCm7dhdL1E97N559/9cX1A95Nw7yqnJAoJffiwUVY9cxauAA G6LGZOs3S6sXi8f8Ch3VLccH82aIsrwiBPqrZMJmQA3ly55U8NSKynustD9kvhiSe7Mb8cfVC0q +UxNG84DxxaT4lBvRtWiSy+JsWnAzV0xzfnswobpSu6eaDj98IlZSCu50Iz+kp5V0sVJTLSeHXL BUs5omG5W/5msYRIbXeiBB96dpcr03+OVUP2PJLrVGVW39VEw83rFVwrq7T11hX4iM/bGm54SvG PKhiThnrxAl2L9JxUWFS6DNkDVmyUhzf2BMNZzaOm1awNw== X-Google-Smtp-Source: AGHT+IGNjPUj502m+WbTEphvFp4yDPKVvE3nMvf9jtdPqOxj++Qoe1fSQsoIOkXUr6yV0vCJwkFGeQ== X-Received: by 2002:a05:6902:1614:b0:e38:b7b8:51a8 with SMTP id 3f1490d57ef6-e57b1364842mr10618598276.7.1737762002860; Fri, 24 Jan 2025 15:40:02 -0800 (PST) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e583b746626sm554152276.7.2025.01.24.15.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jan 2025 15:40:02 -0800 (PST) Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-e422de4d1c5so425232276.3; Fri, 24 Jan 2025 15:40:02 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX1KdfaBc3tPoeQ8asXBMHtYyBdKQYVjQMwRI6OTnQCTuf+XyEvVtBAz5LDNX/pbP8N9Sj90wG0+WHD7Sh7Sf4VzMmG@freebsd.org, AJvYcCXI6AlJ+0uTvdAWB/o+YJn9Fjfs3e4LJd5Hb5KFvL8rABPKzO4fA/5oTKRvRO9p1IJhGDLUYebv0b5BybnJH3aMZjH75yg=@freebsd.org X-Received: by 2002:a05:690c:7342:b0:6f2:9533:8fb6 with SMTP id 00721157ae682-6f6eb661175mr102909067b3.1.1737762002245; Fri, 24 Jan 2025 15:40:02 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202501242310.50ONAbvN074509@gitrepo.freebsd.org> In-Reply-To: Reply-To: jlduran@freebsd.org From: Jose Luis Duran Date: Fri, 24 Jan 2025 20:39:51 -0300 X-Gmail-Original-Message-ID: X-Gm-Features: AWEUYZkQkULc-iVrJ_DxAmKP-Kx8sij6ZxrxI14x_g8I7IhYrHDZx5yK6HsBKa0 Message-ID: Subject: Re: git: 01ff67f4bdf5 - main - mtree: TESTSBASE directory always starts with a / To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4YfvS418Zmz3xmS X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Fri, Jan 24, 2025 at 8:22=E2=80=AFPM Jessica Clarke = wrote: > > On 24 Jan 2025, at 23:10, Jose Luis Duran wrote: > > > > The branch main has been updated by jlduran: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D01ff67f4bdf5959a719a6511= a855f6a60c0e3a93 > > > > commit 01ff67f4bdf5959a719a6511a855f6a60c0e3a93 > > Author: Jose Luis Duran > > AuthorDate: 2025-01-24 23:10:05 +0000 > > Commit: Jose Luis Duran > > CommitDate: 2025-01-24 23:10:05 +0000 > > > > mtree: TESTSBASE directory always starts with a / > > > > Remove the extra forward slash ("/"), otherwise the mtree specificat= ion > > file will have the double slash and will not be parsed by makefs whe= n > > attempting to build NanoBSD with NO_ROOT privileges. > > Not sure why you=E2=80=99re having issues with this. I can see the duplic= ate > slashes do indeed end up in CheriBSD=E2=80=99s METALOG, but the in-tree m= akefs > produces a disk image just fine from that. In my case, I receive the following error: makefs: ./usr/lib/debug//usr: missing directory in specification makefs: failed at line 5988 of the specification I have yet to dig deeper, as a double slash should not be considered invalid by makefs' mtree. The "right" thing to do is what brooks suggested, to create libmtree, and just use it for everything mtree-related. For now, the simplest thing is just to remove it. Regards, > > Doesn=E2=80=99t mean I=E2=80=99m against fixing our build though :) > > Jess > > > Fixes: 07670b30fa43 ("Create /usr/tests *.debug file directory hier= archy") > > Reviewed by: emaste > > Approved by: emaste (mentor) > > Differential Revision: https://reviews.freebsd.org/D47722 > > --- > > Makefile.inc1 | 2 +- > > etc/Makefile | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/Makefile.inc1 b/Makefile.inc1 > > index efa1299b76a7..4383b4bfe30a 100644 > > --- a/Makefile.inc1 > > +++ b/Makefile.inc1 > > @@ -1506,7 +1506,7 @@ distributeworld installworld stageworld: _install= check_world .PHONY > > -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null > > .if ${MK_DEBUG_FILES} !=3D "no" > > ${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ > > - -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug/${TESTSBASE} >/dev/= null > > + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib/debug${TESTSBASE} >/dev/n= ull > > .endif > > .endif > > ${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ > > diff --git a/etc/Makefile b/etc/Makefile > > index fdcad75911c8..d3cb6b679dc5 100644 > > --- a/etc/Makefile > > +++ b/etc/Makefile > > @@ -112,7 +112,7 @@ MTREES+=3D mtree/BSD.lib${libcompat}.dist /usr/lib/= debug/usr > > .endfor > > .if ${MK_TESTS} !=3D "no" > > MTREES+=3D mtree/BSD.tests.dist ${TESTSBASE} > > -MTREES+=3D mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} > > +MTREES+=3D mtree/BSD.tests.dist /usr/lib/debug${TESTSBASE} > > .endif > > .if ${MK_SENDMAIL} !=3D "no" > > MTREES+=3D mtree/BSD.sendmail.dist / > --=20 Jose Luis Duran From nobody Sat Jan 25 00:10:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yfw6c6rLGz5lcgH; Sat, 25 Jan 2025 00:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yfw6c66P7z45VW; Sat, 25 Jan 2025 00:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737763800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uhVxWp5Ac6iWreiqJigkvpPnk15NVry3bwuu1+ArluI=; b=RJ2tUfFP6/jz9wol7CZjNPXt5Na1AcH55bvjY+PUrhCbTgPaSvXUsRbIHfI/dCwpUmw685 Q0XJU7DveWzTtPTDFB8yVt+MP6DPC6bvoCG7d7lpjHFFBpI0In44AqWA6st2MJ94MNdPHB nWqRX6OhI7pSW8PcL0ShKdkXwhhr1/O9TLo2jiaWJScVqxHk7BhB/bgR+1ceY1qG1aRtKd d9Ef1xn289ZHUaN5t7SPxKg8nGcSKF5dtSrDXsrsYLJGjLBr3KCq5qfBFk7ypLBeuAQHMA ZymesNr4EN4C5WNrKTj1QH4R2f25JsAOaVq9paTHvC2PZLosrSXj8oo4JYvNVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737763800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uhVxWp5Ac6iWreiqJigkvpPnk15NVry3bwuu1+ArluI=; b=o6XAw032S1sBAF7+hRzE36BHcYtgvaWeEzM5yoN2FLq2UjUOVMrxGYvSC1M37uhZkOrr7W DGU8/La4z5bt3Mg1cV3Dy9RE6ZHv7I1J0/egGaR8Jvnf3t+NNRueI/9wB1T3fyM+PLh9mt +iqWvSSzHN7qgIgMaBwryJDRsbL4sIQEX+nxd0fbmGXju7IjJZpeUsXHmK2j6gepmAcqcq BCxZm7GxW9wVoMH6yKAzx1mM79amXvtU6DbqgNGxCPc6jR0HZPDGIgTja/WG2105LU1NdG uZe9CkwBGn5hxqkuwJbnyqOPZNk48HvtlRnjAdSWz4WgfqiQPBejXEFVGXN8zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737763800; a=rsa-sha256; cv=none; b=xQpNcZNPnW6z2sc4jryr5drPTkSaqPlxwkYXvJJusSBbScMO/2ZM1ooAlR66oa+Hh/nEvN AwA0LwtxcO0G/4wnuMd5TTm+EvTO2kKj1vZDSfBa892K6CGlW3ZQI5ip3wqhz8OhbbP/IF HigSLNz8dxjqwzGQRd2hVpaJjNqXSSNlsvTpiBrNHAZUR5VUw6XB7cdd2m9COXa+AjD0WZ WtjzTyukC0FpT0OKCamnwOhuMdOyA+UTNSADb9GXF7FJ/AGsBsK8t3tB86LWpX9Pus/Q+C G5JwXpPAft6iOsGktNwYFS7AY4getfkgflJzUQCv4EmzVB70+2OS+50dy1PZGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yfw6c58N9zp1q; Sat, 25 Jan 2025 00:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50P0A0bF079303; Sat, 25 Jan 2025 00:10:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50P0A0te079279; Sat, 25 Jan 2025 00:10:00 GMT (envelope-from git) Date: Sat, 25 Jan 2025 00:10:00 GMT Message-Id: <202501250010.50P0A0te079279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 46a9fb7287f4 - main - man.1: Improve search + spdx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46a9fb7287f41eedf321d81a68a826f231d11bfe Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=46a9fb7287f41eedf321d81a68a826f231d11bfe commit 46a9fb7287f41eedf321d81a68a826f231d11bfe Author: Alexander Ziaee AuthorDate: 2024-09-28 03:07:07 +0000 Commit: Alexander Ziaee CommitDate: 2025-01-25 00:07:01 +0000 man.1: Improve search + spdx People are often stunned by robust manual search functionality on the community discord, so improve introductory doc regarding search by: + explain what search related flags do instead of using similies + consolidate and standardize search options in synopsis and usage + mention that a page or file can be specified in synopsis and example + call regular expressions `expression`, which searches to re_format(7) + crossreference the regular expression manual instead of egrep(1) + improve MANPATH xref flow and explanation, matching MAILPATH in sh(1) + mark up aditional semantics for their inclusion in apropos While here: + use consistent spacing and form (Ql) for quoted literals + clean a few linter errors regarding self xref and nospace + reset a list width to indent for consistency with style.mdoc + tidy examples + align files + tag spdx Outstanding: - example 3 shows no results on a typical bsdinstall'd system MFC after: 3 days Reviewed by: elliejs, emaste, imp, Jessica Hawkwell, jlduran Approved by: imp --- usr.bin/man/man.1 | 140 ++++++++++++++++++++++++++--------------------------- usr.bin/man/man.sh | 5 +- 2 files changed, 71 insertions(+), 74 deletions(-) diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 index 24d9214682f1..820d6a5b33a9 100644 --- a/usr.bin/man/man.1 +++ b/usr.bin/man/man.1 @@ -1,4 +1,6 @@ .\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2010 Gordon Tetlow .\" All rights reserved. .\" @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 26, 2022 +.Dd January 24, 2025 .Dt MAN 1 .Os .Sh NAME @@ -39,16 +41,10 @@ .Op Fl m Ar arch Ns Op : Ns Ar machine .Op Fl p Op Ar eprtv .Op Ar mansect -.Ar page ... -.Nm -.Fl K -.Ar regexp ... -.Nm -.Fl f -.Ar keyword ... +.Ar page | Ar .Nm -.Fl k -.Ar keyword ... +.Fl K | f | k +.Ar expression ... .Sh DESCRIPTION The .Nm @@ -60,6 +56,7 @@ is provided, restricts the search to the specific section of the manual. .Pp The sections of the manual are: +.Pp .Bl -enum -offset indent -compact .It .Fx @@ -94,37 +91,36 @@ Options that .Nm understands: .Bl -tag -width indent -.It Fl K Ar regexp -Does a full text search in all manual pages. -.Ar regexp -is a regular expression as understood by -.Dq Li "grep -E" . +.It Fl K Ar expression +Search full text of all manual pages for an extended regular +.Ar expression , +as described in +.Xr re_format 7 . This option requires .Xr mandoc 1 . This is a slow operation. .It Fl M Ar manpath -Forces a specific colon separated manual path instead of the default +Force a specific colon separated manual path instead of the default search path. See -.Xr manpath 1 . -Overrides the .Ev MANPATH -environment variable. +in +.Sx ENVIRONMENT . .It Fl P Ar pager Use specified pager. Defaults to -.Dq Li "less -sR" +.Ql less -sR if color support is enabled, or -.Dq Li "less -s" . +.Ql less -s . Overrides the .Ev MANPAGER environment variable, which in turn overrides the .Ev PAGER environment variable. .It Fl S Ar mansect -Restricts manual sections searched to the specified colon delimited list. +Restrict manual sections searched to the specified colon delimited list. Defaults to -.Dq Li 1:8:2:3:3lua:n:4:5:6:7:9:l . +.Ql 1:8:2:3:3lua:n:4:5:6:7:9:l . Overrides the .Ev MANSECT environment variable. @@ -136,13 +132,17 @@ argument. Print extra debugging information. Repeat for increased verbosity. Does not display the manual page. -.It Fl f -Emulate +.It Fl f Ar expression +Search names of all manual pages for an extended regular +.Ar expression , +emulating .Xr whatis 1 . .It Fl h Display short help message and exit. -.It Fl k -Emulate +.It Fl k Ar expression +Search names and descriptions of all manual pages for an extended regular +.Ar expression , +emulating basic functionality of .Xr apropos 1 . .It Fl m Ar arch Ns Op : Ns Ar machine Override the default architecture and machine settings allowing lookup of @@ -212,17 +212,17 @@ will search for locale specific manual pages using the following logic: .Pp .Bl -item -offset indent -compact .It -.Va lang Ns _ Ns Va country Ns . Ns Va charset +.Va lang Ns _ Ns Va country . Ns Va charset .It -.Va lang Ns . Ns Va charset +.Va lang . Ns Va charset .It -.Li en Ns . Ns Va charset +.Li en . Ns Va charset .El .Pp For example, if .Ev LC_ALL is set to -.Dq Li ja_JP.eucJP , +.Ql ja_JP.eucJP , .Nm will search the following paths when considering section 1 manual pages in .Pa /usr/share/man : @@ -251,11 +251,11 @@ environment variables. For example, if .Ev MACHINE_ARCH is set to -.Dq Li aarch64 +.Ql aarch64 and .Ev MACHINE is set to -.Dq Li arm64 , +.Ql arm64 , .Nm will search the following paths when considering section 4 manual pages in .Pa /usr/share/man : @@ -278,8 +278,8 @@ character. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev MANROFFSEQ" -.It Ev LC_ALL , LC_CTYPE , LANG +.Bl -tag -width indent +.It Ev LC_ALL , Ev LC_CTYPE , Ev LANG Used to find locale specific manual pages. Valid values can be found by running the .Xr locale 1 @@ -290,12 +290,12 @@ for details. Influenced by the .Fl o option. -.It Ev MACHINE_ARCH , MACHINE +.It Ev MACHINE_ARCH , Ev MACHINE Used to find platform specific manual pages. If unset, the output of -.Dq Li "sysctl hw.machine_arch" +.Ql sysctl Va hw.machine_arch and -.Dq Li "sysctl hw.machine" +.Ql sysctl Va hw.machine is used respectively. See .Sx IMPLEMENTATION NOTES @@ -304,11 +304,9 @@ Corresponds to the .Fl m option. .It Ev MANPATH -The standard search path used by -.Xr man 1 -may be changed by specifying a path in the -.Ev MANPATH -environment variable. +A colon +.Pq Ql \&: +separated list of directories to check for manual pages. Invalid paths, or paths without manual databases, are ignored. Overridden by .Fl M . @@ -320,6 +318,8 @@ or if it contains two adjacent colons, the standard search path is inserted between the colons. If none of these conditions are met, it overrides the standard search path. +See +.Xr manpath 1 . .It Ev MANROFFSEQ Used to determine the preprocessors for the manual source before running .Xr nroff 1 Pq Pa ports/textproc/groff @@ -338,7 +338,7 @@ option. .It Ev MANWIDTH If set to a numeric value, used as the width manpages should be displayed. Otherwise, if set to a special value -.Dq Li tty , +.Ql tty , and output is to a terminal, the pages may be displayed over the whole width of the screen. .It Ev MANCOLOR @@ -347,68 +347,65 @@ If set, enables color support. Program used to display files. .Pp If unset, and color support is enabled, -.Dq Li "less -sR" +.Ql less -sR is used. .Pp If unset, and color support is disabled, then .Ev PAGER is used. If that has no value either, -.Dq Li "less -s" +.Ql less -s is used. .El .Sh FILES -.Bl -tag -width indent -compact +.Bl -tag -width "/usr/local/etc/man.d/*.conf" -compact .It Pa /etc/man.conf -System configuration file. +System configuration file .It Pa /usr/local/etc/man.d/*.conf -Local configuration files. +Local configuration files .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Show the manual page for .Xr stat 2 : -.Bd -literal -offset indent -$ man 2 stat -.Ed +.Pp +.Dl $ man 2 stat .Pp Show all manual pages for -.Ql stat . -.Bd -literal -offset indent -$ man -a stat -.Ed +.Ql stat : +.Pp +.Dl $ man -a stat .Pp List manual pages which match the regular expression either in the title or in the body: -.Bd -literal -offset indent -$ man -k '\e.*archive' -.Ed +.Pp +.Dl $ man -k '\e.*archive' .Pp Show the manual page for .Xr ls 1 -and use +using .Xr cat 1 -as pager: -.Bd -literal -offset indent -$ man -P cat ls -.Ed +as the pager: +.Pp +.Dl $ man -P cat ls .Pp Show the location of the .Xr ls 1 manual page: -.Bd -literal -offset indent -$ man -w ls -.Ed +.Pp +.Dl $ man -w ls +.Pp +Show a manual page in the current working directory: +.Pp +.Dl $ man ./man.1 .Pp Show the location of manual pages in sections 1 and 8 which contain the word .Ql arm : -.Bd -literal -offset indent -$ ./man -w -K '\e' -S 1:8 -.Ed +.Pp +.Dl $ man -w -K '\e' -S 1:8 .Sh SEE ALSO .Xr apropos 1 , -.Xr egrep 1 , .Xr intro 1 , .Xr mandoc 1 , .Xr manpath 1 , @@ -422,5 +419,6 @@ $ ./man -w -K '\e' -S 1:8 .Xr intro 6 , .Xr intro 7 , .Xr mdoc 7 , +.Xr re_format 7 , .Xr intro 8 , .Xr intro 9 diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index f4037ed92215..68a4b3a40588 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -739,10 +739,9 @@ man_setup_locale() { # Display usage for the man utility. man_usage() { echo 'Usage:' - echo ' man [-adho] [-t | -w] [-K regexp] [-M manpath] [-P pager] [-S mansect]' + echo ' man [-adho] [-t | -w] [-M manpath] [-P pager] [-S mansect]' echo ' [-m arch[:machine]] [-p [eprtv]] [mansect] page [...]' - echo ' man -f page [...] -- Emulates whatis(1)' - echo ' man -k page [...] -- Emulates apropos(1)' + echo ' man -K | -f | -k expression [...] -- Search manual pages' # When exit'ing with -h, it's not an error. exit ${1:-1} From nobody Sat Jan 25 03:41:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yg0pf0wW4z5lt1f; Sat, 25 Jan 2025 03:41:30 +0000 (UTC) (envelope-from maxim@freebsd.org) Received: from maxim.int.ru (maxim.int.ru [167.71.75.67]) (using TLSv1.3 with cipher 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 "maxim.int.ru", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yg0pd5S1xz43Cf; Sat, 25 Jan 2025 03:41:29 +0000 (UTC) (envelope-from maxim@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (localhost [127.0.0.1]) by maxim.int.ru (8.18.1/8.18.1) with ESMTPS id 50P3fLRL040343 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 25 Jan 2025 03:41:21 GMT (envelope-from maxim@freebsd.org) Date: Sat, 25 Jan 2025 03:41:21 +0000 (UTC) From: Maxim Konovalov To: Mark Johnston cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 04a3ca71ead6 - main - netcat: Add a flag to enable the use of SO_REUSEPORT_LB In-Reply-To: <202501241648.50OGmSre051436@gitrepo.freebsd.org> Message-ID: <2a951d1e-8796-6096-19ad-d0d98a84e5ec@maxim.int.ru> References: <202501241648.50OGmSre051436@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4Yg0pd5S1xz43Cf X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14061, ipnet:167.71.64.0/20, country:US] On Fri, 24 Jan 2025, 16:48-0000, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=04a3ca71ead61b4ced23a791d3a5e2633ca1ef72 > > commit 04a3ca71ead61b4ced23a791d3a5e2633ca1ef72 > Author: Mark Johnston > AuthorDate: 2025-01-24 16:37:43 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-24 16:37:43 +0000 > > netcat: Add a flag to enable the use of SO_REUSEPORT_LB > > This is handy for testing purposes. Hide it behind a long option so > that it doesn't conflict with upstream, like we do with several other > flags. > > Reviewed by: imp, glebius, delphij > MFC after: 2 weeks > Sponsored by: Klara, Inc. > Sponsored by: Stormshield > Differential Revision: https://reviews.freebsd.org/D48543 [...] A nice one! -- Maxim Konovalov From nobody Sat Jan 25 10:32:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yg9x80ylYz5mMcC; Sat, 25 Jan 2025 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yg9x80PtQz3cbp; Sat, 25 Jan 2025 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737801164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hs7eH2Fy6k+MqT0mXuvovmvYZdFvu7jyE5QGpsBtOVw=; b=IBjNk/gJfBMG/chH4Vk6Yl6tB/q0w58BR38YQxNJerX5RNezjd89OCLWlqOdDChEPBvMJy c0gRE5/qRIewNEQ5jxbV0WvquF7+0qyjKDDb+RcQN764okzTR0tDsGbevN21cozncfmFjZ MiELNo42tQfCfFk7BhD3Y5D6TRDE7tEWftJCZomeAS376fmq0pcrUQa7y7soXD+OC9mqIc ydxd2vZWc1BhGTrJiK2lcMzw5AwpIjsdkSE96IQA6ZmzPqVfEakScP3JYfLJrLqKXxt2Ww dbbWQO0bikp8Kwot56Rqoda/e1dCVQJPlXm9sdcz7G+zRlF7vgbr05JXAzN7pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737801164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hs7eH2Fy6k+MqT0mXuvovmvYZdFvu7jyE5QGpsBtOVw=; b=XFvt5+kq24Pd8GOjIqhx43plcRWnpUHf4IMk2+Aae5eqPcyJu+EZ/dFcoN86uDS+8mYT87 z2glr4CRqM/r5fVWitv+0YQGvE/jNi9sIK2GPL5+bqHWlRfXOH43gDNCydNUuW6MOGqnUA SADxlLM3pCzoVA58VlHyDdLzFOX4Z4NTx7MWWE7mEYjGh0U0zin8d4JJ0XzezylMSxj2Mx rFjd+HbtchgWz7yY1BTOTzjuVGQFXMDQJsYHVthRw3jImmdMHn5kiFRLZEEJGAM8c2JuKm BxIxv91AOirvPrXH6xJX8VHJTrUqGX/j+flXYokfcEzVj7p6uuJbbUnP+pNTvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737801164; a=rsa-sha256; cv=none; b=GYAaZ7wDg66qR0HGUymtUDg5aSrXfNO3FVN/Rq8F1V/URXD0izxUog5Bhg2SPRf9o/Zssx H9OnrzOxZXLDtisRuG8hb0OAioa9PRA+L2OcI39zL2Ukyx8blTX4N3dCf+poM3y28q2HVZ 9+XOOVtdzyciwxwuJe6AebDOLcfvqypsxamtWfp7UqcUkPGB14+HtemGuonc93/Ycxqyt/ Meu0+D4QnpBPa43KloodQBDIhHd98lAJmSJcQr8AifDi/3nIk8GjxiIMsetfE21l8fiZkK fHiYMLq31RPHUu8W0uno5XWYJAC1CGoXjTwSV2mjGbQ2lh3lyTNc+UsfRiwxVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yg9x800wTz17QV; Sat, 25 Jan 2025 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PAWhnO057766; Sat, 25 Jan 2025 10:32:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PAWhFG057763; Sat, 25 Jan 2025 10:32:43 GMT (envelope-from git) Date: Sat, 25 Jan 2025 10:32:43 GMT Message-Id: <202501251032.50PAWhFG057763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7bb9ba61d357 - main - ip6addrctl(8): Use static initializer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bb9ba61d35703c8a819c3745b8a2b1feb56923d Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7bb9ba61d35703c8a819c3745b8a2b1feb56923d commit 7bb9ba61d35703c8a819c3745b8a2b1feb56923d Author: Zhenlei Huang AuthorDate: 2025-01-25 10:31:55 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-25 10:31:55 +0000 ip6addrctl(8): Use static initializer MFC after: 1 week --- usr.sbin/ip6addrctl/ip6addrctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c index 13413fefa8ce..146b2f1ad3e0 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.c +++ b/usr.sbin/ip6addrctl/ip6addrctl.c @@ -58,7 +58,7 @@ struct policyqueue { struct in6_addrpolicy pc_policy; }; TAILQ_HEAD(policyhead, policyqueue); -static struct policyhead policyhead; +static struct policyhead policyhead = TAILQ_HEAD_INITIALIZER(policyhead); static void usage(void) __dead2; static void get_policy(void); @@ -75,8 +75,6 @@ static void flush_policy(void); int main(int argc, char *argv[]) { - TAILQ_INIT(&policyhead); - if (argc == 1 || strcasecmp(argv[1], "show") == 0) { get_policy(); dump_policy(); From nobody Sat Jan 25 12:00:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgCst0FKfz5lDNp; Sat, 25 Jan 2025 12:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgCss59JQz3mr1; Sat, 25 Jan 2025 12:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737806401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD0jZNuDjp2Q2EsTmMQNxF5TnsnoF/A6xaw5ZkdplJM=; b=Q3+1BomkSZaytpyCUNtHg1dVPUIVjs4DNCn8xX7b8RFtLENK0ouSErjVBhQ5FrPsVimcHV zigD6g9CIkZJf/JxozWdOFAEo7hPF/D8qLT9QNtKXdXZfQDBouH6Swff+MRSDbQGxaSjQR KNJ4bYL1X/POx8GoMUwsYdW2x4VZYt+65lxosZLJSwowyCk3BeQ6pdDHwDxLmzvcyoCmmX 9EEc+db4JzKzku0zgANHhF8ogkyHrBnGex93Z3sGMAA06xE+RHrWgCTY3UnIxWTjQO7k8I j0yP8qV9kWonr/sbWkVFOMXuURpaEZ8PJIgw7pbbncXR7R0YuePQKKaFFtQXBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737806401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD0jZNuDjp2Q2EsTmMQNxF5TnsnoF/A6xaw5ZkdplJM=; b=QHAMqdEiB8CRHRBHZw3B/xz7jmi/STgJUz6Oxhffcp4x1Ko+k2OQoqvWRrIR3GCBxEOvGD BnTKazjNc9k5Zbtx2Q6nEmKuba9VMbC49gYhdTRgc5cC8WRtVmBJjK73e67M/vgtG8O+qa TxmDLtjLmN7T1hPLIaAbGUkwqZvCX1fphvPrFSUne1t3Den2pZ7Ysg0M04iolD8ZVlTAlK Q5+k2LOkLaHNC9AhxYDlYSgi6WldTJLOJXiVK3KCMKaHw04Y2O6+UCoY5EY7CWX0e19bFb cB1daiNZMHaXhUVRlP4K7cam47U6HD8MovcZ61atGIR2x74+RS6/svl3kOZ3hQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737806401; a=rsa-sha256; cv=none; b=Zi0p1YVLMQBXvWdUGDW+9DVWdMfHHPgJL+PoSLFqkPrZIiN4mOZI/YV1+IJqmJ+DBzC3RY H/HrMBKl5/CCDarzHjdRcDmfDdLbqZggbqLPt20Dns3dW0T68Xfb1d1XeMvHe2DNsg4+LP MF4iZkmQxu89s+zzPHTZbE1XWnBRvd/XTegANpZXb3pkYQJc9t0M72Q77QMRHFMikKs7/v CQn9j6PBFk0CVgIRXf/D/6OB0gHLY0sAjIUUAz314Bl/KQf8zAc1jSo205qLqS02MteL82 YdVTLx1geF1EZp3f6hcNtXQ5JJ2+bZrETGXnjHb0XHA5zEJHEC4T8LgegT1hbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgCss4dGFz19jx; Sat, 25 Jan 2025 12:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PC01an013065; Sat, 25 Jan 2025 12:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PC01oR013057; Sat, 25 Jan 2025 12:00:01 GMT (envelope-from git) Date: Sat, 25 Jan 2025 12:00:01 GMT Message-Id: <202501251200.50PC01oR013057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 47560d54be59 - stable/13 - sysctl: Fix usage() and SYNOPSIS section of man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47560d54be59f89e1768e7b4d81f5c599a9c59ef Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=47560d54be59f89e1768e7b4d81f5c599a9c59ef commit 47560d54be59f89e1768e7b4d81f5c599a9c59ef Author: Zhenlei Huang AuthorDate: 2025-01-23 07:24:15 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-25 11:56:41 +0000 sysctl: Fix usage() and SYNOPSIS section of man page I forgot to update the usage() and SYNOPSIS section of man page when adding the two options -J and -V. While here, fix the options sort order in SYNOPSIS section. Fixes: 5ec83c660aca sysctl: Add flags to filter jail prison and vnet variables MFC after: 1 day (cherry picked from commit 0ee3e29e1d9ee3ed22441c0d580d2d1e57a1d9e3) (cherry picked from commit 1d890d546b064f2c7753b949f5dbf00d79cde292) --- sbin/sysctl/sysctl.8 | 6 +++--- sbin/sysctl/sysctl.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index ff0a8cea266d..a7af56720361 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd October 29, 2024 +.Dd January 23, 2025 .Dt SYSCTL 8 .Os .Sh NAME @@ -35,13 +35,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoTtqWx +.Op Fl bdehiJNnoqTtVWx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoTtqWx +.Op Fl bdehJNnoqTtVWx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 0fe6c92dc386..887de78d269b 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -122,8 +122,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdehNnoqTtWx] [ -B ] -a"); + "usage: sysctl [-bdehiJNnoqTtVWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdehJNnoqTtVWx] [ -B ] -a"); exit(1); } From nobody Sat Jan 25 13:08:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgFNp4qr3z5lKFJ; Sat, 25 Jan 2025 13:08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgFNp49lrz3vGT; Sat, 25 Jan 2025 13:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737810506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BwAoiZW+R18xuKuhwnEDcTt+QDCD/93WMBa7ewAMc2w=; b=HWTcy4GRDucufR6Ml2SY26dho1imRMCR9wvL+WvY/u2zT0zr/hFt2fzj2r+7tBENkm52fP YM84vjoUjFUryHfh5OVelddNelB1sPDUUbWrdBQhgfgAoLnhR17PCoHL+SKN25OYom4mCC HvI1+OZazVCS0qABN4IXMOe2JD//62OUYO2x9CEh9h4A5h0guKMBi4tg/p4pqC7ZTebdmU q0gNIukIZ434RcqtkOx8yicSCNSyAqfcAuXi1E7adH15Vlg14tQpbdwR/R9wP6uQP5eRjs UflS4LZFPD1gwo7NJhAzVXau7DaTXafMKzH1QOup7gpWIcNKbF+vUm+ou5LJ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737810506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BwAoiZW+R18xuKuhwnEDcTt+QDCD/93WMBa7ewAMc2w=; b=Qg3YVO+zDcAAZObr++QuxfLDzgTK5YpvWZjZjCxan8wsVGkXAfKOV4FgTDh0LZcKJZi4lv 5LoguLIbV2fx9do6cY9k6OPmL7B5mrBYWWnWcLbHJ5XYFqDVkb8wECy+kQ2V/gO7YmK/kO jJHsGVKAC2pGS7bWU3JbI+yM1If9vqsfuzSkke/O5bWu7O+y1ZwG2Nc4sKu0yL+X120Xpl bPzgytJ2kQKhuc5xItDmGuk5VQJuyq8F+3vD3MLqpKhGg6WNbo/ejyELNpwHl0BEBWCSTU /wpPB/OpxQxv8wRbmpLzvcjN6xZkdNxarPgjUAe9mnULiSQxDTGa+1fDVqpBJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737810506; a=rsa-sha256; cv=none; b=k5ieFdaka88Ubw4nH+in3PGkwowF6pHsBN93FphnzjUcOMo4Fipv+XN8nWQ7yFJDR+kkDN 8DRNIEFaywLXtUbOCtk8D08PPVOMj0SlVhjQxoyRfBd9PC0YHsps0y8lhcHSqPgoGd6ujd PNnDDVq4ugLCFEx+cHbeNAKpzhuQtlkls1R4oCsMImXx1Xs/NozjEiDMf2yl0GdzgSDYAs lwHhqhPtd6lGGAJuwlMXftwaL1wujj7v+tlkRYy6m+0s/zxPkISUYKxqT/lFHvakRXJ9FE BOd9VYUuzEgR412DbDolepgAmFtB9g4vHO2jiRYEtzgoz2Fy4lUkUn0659UIVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgFNp3G4Qz1CPQ; Sat, 25 Jan 2025 13:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PD8QjO042263; Sat, 25 Jan 2025 13:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PD8Qsg042260; Sat, 25 Jan 2025 13:08:26 GMT (envelope-from git) Date: Sat, 25 Jan 2025 13:08:26 GMT Message-Id: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f934e629dc22b859efabd3cdebc23b63b04fa2bb Auto-Submitted: auto-generated The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=f934e629dc22b859efabd3cdebc23b63b04fa2bb commit f934e629dc22b859efabd3cdebc23b63b04fa2bb Author: Alexander Leidinger AuthorDate: 2025-01-25 12:43:39 +0000 Commit: Alexander Leidinger CommitDate: 2025-01-25 12:45:53 +0000 Add stack clash protection to the WITH_SSP flag Some background info availabe in: https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3 https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/ Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D48651 --- share/man/man7/mitigations.7 | 14 ++++++++++---- share/mk/bsd.sys.mk | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index c487e4e1000b..4db6589cdcf1 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 23, 2024 +.Dd January 25, 2025 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -244,9 +244,13 @@ and it is possible that some applications may not function correctly. .Fx supports stack overflow protection using the Stack Smashing Protector .Pq SSP -compiler feature. +compiler feature, +and stack clash protection. In userland, SSP adds a per-process randomized canary at the end of every stack -frame which is checked for corruption upon return from the function. +frame which is checked for corruption upon return from the function, +and stack probing in +.Dv PAGE_SIZE +chunks. In the kernel, a single randomized canary is used globally except on aarch64, which has a .Dv PERTHREAD_SSP @@ -264,7 +268,9 @@ When .Va WITH_SSP is enabled, which is the default, world is built with the .Fl fstack-protector-strong -compiler option. +and +.Fl fstack-clash-protection +compiler options. The kernel is built with the .Fl fstack-protector option. diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 63774e857167..06f8e6e9fe78 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -304,7 +304,7 @@ CXXFLAGS.clang+= -Wno-c++11-extensions FORTIFY_SOURCE?= 0 .if ${MK_SSP} != "no" # Don't use -Wstack-protector as it breaks world with -Werror. -SSP_CFLAGS?= -fstack-protector-strong +SSP_CFLAGS?= -fstack-protector-strong -fstack-clash-protection CFLAGS+= ${SSP_CFLAGS} .endif # SSP .if ${FORTIFY_SOURCE} > 0 From nobody Sat Jan 25 16:02:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgKGD04brz5lY7d; Sat, 25 Jan 2025 16:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgKGC6SFBz4BLP; Sat, 25 Jan 2025 16:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737820979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14im0GGkfkhSF2R4qblpXX9T9z/OYUbgvrfl6hPEW8g=; b=VLHa7/RAGYUk976TjAsbzx/A4zyAHiEyIVm/+8c61Vt6x0gceTZgdetlYscxARzsLnC9gB WvME0VInZyR/+6xu0VebDEUJ1xf8kYsWmFW0RrkzCwWwxEK/iMxpZF9yACmC3xEsHFkgFs Xn5518X1lITcFgO39AkNvmsxNd+//WoKLQwjpVRoO0NhRk7dVv0KMQLD4gnnK+MBXKawBV EBgC+DG7D2bnjzvCnLAEQiQyz74fUuVn1felJTqG520dqewXu0EBtYiNIjFpcjz08+Ef2B ipij4MwKRQLekGUc7MoEo3/fc+ROULlIRJqkVRNwbzrSTIUKFeMBPkOGfDTtCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737820979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14im0GGkfkhSF2R4qblpXX9T9z/OYUbgvrfl6hPEW8g=; b=pic3AxN2j6yeT5TdCtHi0XLFYNE34utcEwGkSGa2BzW2koOmz07x5ImphA/UUR3DjW+NlO CH6ViKVcpg2CEtnsJ3d66YU7qGtWPjOSfYvLrgX5dKLHy/yyyIa71shbKun08Tx4fAg9HM Tb5VwxMjXW9Esfd+aT8du8fZzLwe7BQh09akx86pke4zQak9DttZn90kShsGDly654AWLd Cg25YDjHGf8RfS5QmGwCZx1CoMFwTJhQWgjU5kl29NSmCzQvKYcGIe/Zvf/VEuy7OueLDD A98NyIhfyjCLFizmXF+xPq5TJrAbTy+Bri3sOwXihl9/VbFTNre4ScRI62fMbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737820979; a=rsa-sha256; cv=none; b=kXzSkty2D0ZpUWaY47ocPFabRqYpmqpJ6CE45wtvaSp6rwN4FizRy5ZIM9ygVmhYFpFead /FN6Nl3kKAMWgdjaia59hP06vsraMvx0dgsGs0tnhRkpOSTyCIOHf80+6fc8Ou0UjEg+2P 37Uf6nrPdZWZ1vbkXKQz1CqYeHq5QqkLCSP8nueTTo28kyRv4VzFAT/0yk9ZzEBVrMdLiC a2vJ3DyeHBw+IEDAuYShddGD5MurhSoBRaGrkoCrJYkVLAM9KOki3Kxkp7GYq2CVNEuPaV 7UhhAT1Qi5L6cekgq3MvRRkZynnw25+8o6KBG6WPSscIbOQZz+c/hETbaPKhmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgKGC5vbbz1J6y; Sat, 25 Jan 2025 16:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PG2xwX076809; Sat, 25 Jan 2025 16:02:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PG2xLk076806; Sat, 25 Jan 2025 16:02:59 GMT (envelope-from git) Date: Sat, 25 Jan 2025 16:02:59 GMT Message-Id: <202501251602.50PG2xLk076806@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: 096a5c6cd28c - main - libdtrace: Generalize handling of data models a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 096a5c6cd28c417456d5ce3598be15e6b656af5c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=096a5c6cd28c417456d5ce3598be15e6b656af5c commit 096a5c6cd28c417456d5ce3598be15e6b656af5c Author: Mark Johnston AuthorDate: 2025-01-25 15:57:37 +0000 Commit: Mark Johnston CommitDate: 2025-01-25 16:02:41 +0000 libdtrace: Generalize handling of data models a bit Make it easier to support data models other than ILP32 and LP64 by avoiding constructs which assume that it must be one or the other. No functional change intended. MFC after: 2 weeks Sponsored by: Innovate UK --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 7 +++---- cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c | 8 +++++++- cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index dc68c6ef5f72..162224478ec0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -1378,7 +1378,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_LP64; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_ILP32; break; @@ -1389,7 +1389,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_ILP32; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_LP64; break; @@ -1460,8 +1460,7 @@ main(int argc, char *argv[]) * files. We ignore certain errors since we'll catch them later when * we actually process the object files. */ - if (g_mode == DMODE_LINK && - (g_oflags & (DTRACE_O_ILP32 | DTRACE_O_LP64)) == 0 && + if (g_mode == DMODE_LINK && (g_oflags & DTRACE_O_MODEL_MASK) == 0 && elf_version(EV_CURRENT) != EV_NONE) { int fd; Elf *elf; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 8f8d20298e4c..40200771fd4d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1073,8 +1073,14 @@ dt_vopen(int version, int flags, int *errp, if (flags & ~DTRACE_O_MASK) return (set_open_errno(dtp, errp, EINVAL)); - if ((flags & DTRACE_O_LP64) && (flags & DTRACE_O_ILP32)) + switch (flags & DTRACE_O_MODEL_MASK) { + case 0: /* native model */ + case DTRACE_O_ILP32: + case DTRACE_O_LP64: + break; + default: return (set_open_errno(dtp, errp, EINVAL)); + } if (vector == NULL && arg != NULL) return (set_open_errno(dtp, errp, EINVAL)); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index b380f5eb3313..1f4c5a2efd6b 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -70,6 +70,7 @@ typedef struct dtrace_aggdata dtrace_aggdata_t; #define DTRACE_O_NOSYS 0x02 /* do not load /system/object modules */ #define DTRACE_O_LP64 0x04 /* force D compiler to be LP64 */ #define DTRACE_O_ILP32 0x08 /* force D compiler to be ILP32 */ +#define DTRACE_O_MODEL_MASK (DTRACE_O_LP64 | DTRACE_O_ILP32) #define DTRACE_O_MASK 0x0f /* mask of valid flags to dtrace_open */ extern dtrace_hdl_t *dtrace_open(int, int, int *); From nobody Sat Jan 25 17:34:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgMHQ11jqz5lfVw; Sat, 25 Jan 2025 17:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgMHQ0G7qz4PfW; Sat, 25 Jan 2025 17:34:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737826450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZc2+jybeAXs3RzHzs9+04Lq47zTec2SLrGsaYfyfDE=; b=dYK75maHPufh4Bpop4WupNKoiCAQ9TGxcKlP/Y7exRqSuuird9YT5rjXzG102zyTgNKat/ a7mNWrmsVbJ5NtbLGV/39mWXi29gHSqLrybx2MELuqShEiONBSkiUqX6s9BRDAw/YFU4cL ClnBYoKEcEh4sGmSqgaFJJwYd5/K/8OZhSTO2ZaBlB0XVGFcVj3QA9UgFA2dO8mTodjyB9 PCD4ncen940KszZkjR8VsO3ZvPhrZY98DpUrmVFbquT/C7x+r+Y9YisQnj6JzcJ8fQl18X R/tHM48/USam1VjweEMLQyGVpl9VvMjePlF+kwTqoGqxGNJyGmFuPsfNMUueBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737826450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZc2+jybeAXs3RzHzs9+04Lq47zTec2SLrGsaYfyfDE=; b=pEl3sYmet2DKXOFxaCWU4SHjoaxkDvmz8vQuXj+J3/hJ4cIM1l52+UVnfIl4Afye742IE0 jAP43xH1t2EAc6YN2lz6t2IH8fbRVF2fsbQyt3gORoJdDnfG/jFcVCjweaqkztFk3xGnOa HsgU4y4xq0Y/XYSrXu07Dil4QqPvoZtpZTd60lrQuUE4bMdleXTwxiFShJl0aoZOCFWXED F88dtMxMvCvutj1ES8EMV+zFasuWGCRbGr+wTZwpy66HKLjgG+FmA3SeAGMqn/ww9dcmLk wilSVe4yfSWWM8A91fie0gScaBzn6vOLmQQozqKgXeJD+4NfL106iid1ETscKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737826450; a=rsa-sha256; cv=none; b=Xmc4qXVkYSN5TR1WJaXrgh65w8hKNTMMyJBz8c05QZt/6vSHbawmJVJq6AREIm/DDvbe2d P8nDlkTJssMFY09RNOqbYNq7ri/Ld0za1Nj0riGfdMf9ShEweG99Y2Da3CvaGsK3Sohd/o RmyHmnnEsOKPhNBcyuY7YzEZgOBexDzm/N5P4mUAx/NwDFWAW1mCLrS7FdMs7SAudNgHDL yH4AlX8+GwcCj7H/J/ZsVhE4zQDD1bSTxxoKQHUXvW1TIekRV4fYNQbQawZrsmVBcB03ri 3CtunyUDFGVq/q5MVOsr/8EMtSeqhDZ1h8Wd9UfvGqAZYgqwV6kPfXOIgpzGQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgMHP6mT5z1LDy; Sat, 25 Jan 2025 17:34:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PHY9KR044716; Sat, 25 Jan 2025 17:34:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PHY9No044713; Sat, 25 Jan 2025 17:34:09 GMT (envelope-from git) Date: Sat, 25 Jan 2025 17:34:09 GMT Message-Id: <202501251734.50PHY9No044713@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: 853cd8723494 - main - arm64: Clean up usage of the dtrace invop handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 853cd8723494ccc2e972aaa09e7d04ede1508c95 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=853cd8723494ccc2e972aaa09e7d04ede1508c95 commit 853cd8723494ccc2e972aaa09e7d04ede1508c95 Author: Mark Johnston AuthorDate: 2025-01-25 16:17:03 +0000 Commit: Mark Johnston CommitDate: 2025-01-25 16:17:03 +0000 arm64: Clean up usage of the dtrace invop handler - Don't consume the breakpoint if all invop handlers returned a non-zero value. - Fix style nits. MFC after: 2 weeks Sponsored by: Innovate UK --- sys/arm64/arm64/trap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 544189964ef0..d612905b77c8 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -548,11 +548,10 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) break; case EXCP_BRK: #ifdef KDTRACE_HOOKS - if ((esr & ESR_ELx_ISS_MASK) == 0x40d && \ - dtrace_invop_jump_addr != 0) { - dtrace_invop_jump_addr(frame); + if ((esr & ESR_ELx_ISS_MASK) == 0x40d /* BRK_IMM16_VAL */ && + dtrace_invop_jump_addr != NULL && + dtrace_invop_jump_addr(frame) == 0) break; - } #endif #ifdef KDB kdb_trap(exception, 0, frame); From nobody Sat Jan 25 17:34:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgMHR2PJLz5lfFK; Sat, 25 Jan 2025 17:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgMHR17HVz4PfX; Sat, 25 Jan 2025 17:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737826451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMdgVzdAbY1sCyZpPMsmoQbd+/Dgva9woVSvdD8IN8g=; b=BwzORlpDj6DIMqBWeT9nsrcUO22Mfuub3E2/mNUmQuUjU8+k9Yj21dxSAkmhnPaf7/sGTu DqIOdFNAfYEm+dNGoV0MMppIaQaPnw9O6Jyph61kPukxztv0pph/Qy9BP9sIl+TT4cUKSp C+smQYoh0uWZYnhUnf+AKnqWYcAZgCkPD1+1WTBKi0BVB+6Y77G8jvwSndIieYNZMK/rQ4 R2RLMJOHfAhJSrfzRxgnS0XfIOAEQmqmsOCYlveLPFthyOe/SsYPfp+wDgARyCYBYpnE/Y DUCgtvVjRKEj4USisUX19MM6/cvucCzWaCjfZ03ZVqYJTPtGTQ8kKWNuwkuW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737826451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMdgVzdAbY1sCyZpPMsmoQbd+/Dgva9woVSvdD8IN8g=; b=nYekHQeGCQ+M7QID2Kd3IpJwMpig06qjGsuHAAyFQXO9Gl27knaVqmdcsAajOaAK5wFryW o5dT1lLXsKCb9zrPlW9c3kOn3fEVlaxEyE5IbbM/dZw79C2HNJ3LS0y7RTDpJNcjMSbSgx 6hKqMCqQMt/MfHBfubWJkUuuKWMqR+em6zf+6hkUvAny/348h/9X8sIzIYsd+9ObDRjhwU ickeCKZHTjmGbMz/I2QMkdMkfhy+c9nEEzvKmp6rquhJIPuIzHLROtrGgk5vqHNmZtOZhv qGT08aFkdmAxWwwu2LI7CcH6jxXvjHSE9gS/g+en2XuN40yPIsJT+J8OBp/Sjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737826451; a=rsa-sha256; cv=none; b=yjK0/N1HJyYmwfODUBtscePZdQ5+JozVCjp+35GrOeNLUqGadzRAS4crjB0hgTCDI6iMSM I4J4Bf1IqUZD897xyFv26GfdxBWIQOH0fuh6hDPM2SaUD1IoTgtFDPM2TIzDMg6AfcMERT 4d8vVjCmC6PwZkvkrdKS7XDocbAN+u+EKXzG2AJg63XyaAJQH1VKWVeE+il6K6kaNVa2QA v8emiWpovPOmzLhTUUp82729kHXTJJnAR0OpQmgZPzesEC+A6jK1aFPZU5Qtcuuj+4PBWO 2cit7vKP/6hNGkh9aIEE7RQaSgg1JtdEpMoJNCvuEMflTuisU82Ct2Bt7sf3cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgMHR0bGTz1L4k; Sat, 25 Jan 2025 17:34:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PHYA0N044748; Sat, 25 Jan 2025 17:34:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PHYA5s044745; Sat, 25 Jan 2025 17:34:10 GMT (envelope-from git) Date: Sat, 25 Jan 2025 17:34:10 GMT Message-Id: <202501251734.50PHYA5s044745@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: 494a2b14722e - main - dtrace: Remove the noinline qualifier from dtrace_getarg() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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: 494a2b14722e8955af54e306305f462e5765c1e4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=494a2b14722e8955af54e306305f462e5765c1e4 commit 494a2b14722e8955af54e306305f462e5765c1e4 Author: Mark Johnston AuthorDate: 2025-01-25 17:22:02 +0000 Commit: Mark Johnston CommitDate: 2025-01-25 17:33:43 +0000 dtrace: Remove the noinline qualifier from dtrace_getarg() It serves no purpose after commit 82283cad12a4. No functional change intended. Fixes: 82283cad12a4 ("dtrace: Avoid including dtrace_isa.c directly into dtrace.c") MFC after: 2 weeks --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 222f8e206da1..10ba0d37ac1b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -1272,11 +1272,7 @@ typedef struct dtrace_toxrange { uintptr_t dtt_limit; /* limit of toxic range */ } dtrace_toxrange_t; -#ifdef illumos extern uint64_t dtrace_getarg(int, int); -#else -extern uint64_t __noinline dtrace_getarg(int, int); -#endif extern greg_t dtrace_getfp(void); extern int dtrace_getipl(void); extern uintptr_t dtrace_caller(int); From nobody Sat Jan 25 18:00:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgMsb1FXYz5lh8x; Sat, 25 Jan 2025 18:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgMsZ6vNdz3FJn; Sat, 25 Jan 2025 18:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737828019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfMEyyPMgIMpLORkhr8Dq0J7QDApL8hRO1ZqZgbtJqQ=; b=sRfIwRpIxDLT4KWJlukWFQJyLKOrfDZksRq3wWs7ftgpAPlo8QZbwQIBCQ/sxCikbyQkxJ IkaU7h90JANX2Ft4juoCgo1uMBdkyxuWBmmvd7wNJ1dnthm5v/AXwjkhshWguPv1C39Wpa cKo7pHYL3kogOpeaeFTlKafwA7PM/riMXym3E7L2VOIcZOsDlAv1IRxdLGCuRMC4EG6z9J z3Pjh1FWJ+Vrv2gEV8e/5NXDr+CCfP6mBbV49vXSzN+wzSfYbg2sQVbbnaGCWoDs6LUWmW Fxj8Z9/P0dXCWS49cUSD6MsD+vijssraLEL2xxa1MTHCYxg2TpPEfTj/5bOLdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737828019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfMEyyPMgIMpLORkhr8Dq0J7QDApL8hRO1ZqZgbtJqQ=; b=F7isNVC5TWYuPvBiwJsNy4WyAUzCJG6yvHAjP3kfDeX/nsF8J88Snnm46mivx0nomElIOW NpHFZ1CaJcPe9xLMU9PMiU4zrFz9URA4eHDTUNBKZo4sraTku2mglYS5lbz/9KNRKVrG0U u8rMifcb5wyCwlBhMwBACG5tWRzTTGScLru66IWgT8YZKyYZkNdf83I4Up5ZcuE/dMSSCN Sd10zZXpGPlzYwXXcV+bY/DPV63dgWNXgADnRP4JVlD0NmvFKDvFeniuXiRyNdUvFm/W9O RK54/hN4AVhaqJRvJhPskcbUPa27PXfPV+MRvp0WwOxu0q7IZvgCPcMQg8jC6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737828019; a=rsa-sha256; cv=none; b=P7g+hLzK0sFQ1DZa9u+VjYe6GMat2cKVmKmwfvZX3l7amaRfn15c9bxucyxf5UhTAmcoJy +RmVWRiZdrmvVrYPWKgJNlAnxeBVBOZ5dE9FO4HAtnI+oWoOpJQkwro8QiIXiyMTFTANvT 74hW0q1cpEtUy65XGBl6AD0kFY2ruJLw74bRuphoubwwy+XfWnBrj8wvwNkqv/elIGXFLv Gpnw8hby+WJl4nUk+YFMcR/I7yASDlTfhHoaGcYaLNzdpKi9jacBYAvki08d8JaJpfKS2C VRdUgXdhJ04OMtDGNvqP+FxbZaTzNvUkBa+NlvZfesZAvJ8cI5cDxlLAqghgmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgMsZ6FX6z1LWJ; Sat, 25 Jan 2025 18:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PI0I3l093056; Sat, 25 Jan 2025 18:00:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PI0IO2093053; Sat, 25 Jan 2025 18:00:18 GMT (envelope-from git) Date: Sat, 25 Jan 2025 18:00:18 GMT Message-Id: <202501251800.50PI0IO2093053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: faa845aab611 - main - kern_sysctl: Fix printing function name in the re-use sysctl leaf warning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: faa845aab6113190ba8c75a171b2cca8673a6214 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=faa845aab6113190ba8c75a171b2cca8673a6214 commit faa845aab6113190ba8c75a171b2cca8673a6214 Author: Zhenlei Huang AuthorDate: 2025-01-25 17:59:33 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-25 17:59:33 +0000 kern_sysctl: Fix printing function name in the re-use sysctl leaf warning The helper function sysctl_warn_reuse() is intended to print the name of the caller rather than that of itself. PR: 221853 Fixes: 4ae2ade11426 Enhance debugibility of sysctl leaf re-use warnings MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48645 --- sys/kern/kern_sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 9d824fbd3cbd..da09aaed5558 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -411,7 +411,7 @@ sysctl_warn_reuse(const char *func, struct sysctl_oid *leaf) (void)sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL); sbuf_set_drain(&sb, sbuf_printf_drain, NULL); - sbuf_printf(&sb, "%s: can't re-use a leaf (", __func__); + sbuf_printf(&sb, "%s: can't re-use a leaf (", func); rc = sysctl_search_oid(nodes, leaf); if (rc > 0) { From nobody Sat Jan 25 18:32:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgNZj2fByz5lkTp for ; Sat, 25 Jan 2025 18:32:29 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgNZh52qQz3K7P for ; Sat, 25 Jan 2025 18:32:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so35806705e9.0 for ; Sat, 25 Jan 2025 10:32:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737829947; x=1738434747; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qsYfUNl64lPxOW/AlxpPZJEM7nSj/mRKIfvUirn+BAM=; b=KPfQK/uimIAopxjkbHF0Vove+viT8Out2ZiIR9/HGrMTdMU+K5WFenxztJsyDxDluF +rGvhnqXONiqRUyKNorAaFHJtETEUWRqh6nFLo6FXphDO9O9Ly0Ho+BqNx9lE0EJRaOi eb+tmmPn7f5Le0a/hlHgElC4G1L+ehgVuh3aM17x+9My5wW5cHvcwfAdoANoSJ4ewF4Y 2qEQk1EyQrRpSy8RvFdj/G5zftZjhO/sBt0063IPhnlk26p04+KtX/MR4W9cDBQ4vxu4 dLgsRKSA5eE3vcuAW4Fy9CyIPQgTnov7ieIOQab9H6A1CsJgz4NAtNvo/M5xgJN9ps/s PViw== X-Forwarded-Encrypted: i=1; AJvYcCWoq+D71hZYdtj0OHeuOgHkeSsNXMlRk+MRRaTuVP0fiX65XqrWVQEJDjq983aQhDoOBdrB6RF8/7rBcmQH855Bih9f@freebsd.org X-Gm-Message-State: AOJu0YzoMcwHQODbXc6fI7PI8ssnv77mN3xalc8SHfevVySQ672dsHgg gEQ+/m1bEpf+6npIBSgByfsCHhPcm72JyqLQT81H2r5VD6u6G0cLMFgL9TMYu5bLwNPAHONkqyL K X-Gm-Gg: ASbGncukZ5STPcfPXRkH2mVFcRZPBC891TJdcMnYVBzdiroIfsZebAadSjePCAtXi8m 0p6u4NwCJEL4JE0Q5kXI/SbQk7kWkRgAnScaorNl+8KYBm7MA4s8y0DCxy5spFctYea9xORmotL 10c3dR0z1C+pKDUnSbY4bquiVVNSK/N++M25b1zrgPr8DDZeS9eIrmRWyj/Y7kc+hx7oGAIxJ0P 4EKLJDjbpD1EaBL515x8f9aj1rx0+rlf8FUkTufSNRqVTXWcuoCRe2gyLuOKeWYyl/W1JnSdgyf SpSY5Gdv3ylg7nmwOHA= X-Google-Smtp-Source: AGHT+IFKo5XZvDuY1BN8ykcl4MlrE8vID70XlTgRLh6KSIX1DtmNeatvZ4Db3Y8TGzLwkYsVg1yiKw== X-Received: by 2002:a05:600c:4c86:b0:436:6ddf:7a27 with SMTP id 5b1f17b1804b1-4389141c412mr297158285e9.23.1737829946970; Sat, 25 Jan 2025 10:32:26 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54bfa5sm68415115e9.25.2025.01.25.10.32.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jan 2025 10:32:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag From: Jessica Clarke In-Reply-To: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> Date: Sat, 25 Jan 2025 18:32:15 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> References: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> To: Alexander Leidinger X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4YgNZh52qQz3K7P X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 25 Jan 2025, at 13:08, Alexander Leidinger = wrote: >=20 > The branch main has been updated by netchild: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df934e629dc22b859efabd3cdebc23b63= b04fa2bb >=20 > commit f934e629dc22b859efabd3cdebc23b63b04fa2bb > Author: Alexander Leidinger > AuthorDate: 2025-01-25 12:43:39 +0000 > Commit: Alexander Leidinger > CommitDate: 2025-01-25 12:45:53 +0000 >=20 > Add stack clash protection to the WITH_SSP flag >=20 > Some background info availabe in: > = https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Harden= ing-Guide-for-C-and-C++.html > = https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gc= c-part-3 > https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/ >=20 > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D48651 Uh, it does require architecture-specific compiler support, which = isn=E2=80=99t implemented for all architectures in LLVM at least. RISC-V has only recently (as in 1.5 months ago so not even released yet) gained support, for example. So this is just going to spew out -Wunused-command-line-argument warnings, and errors with -Werror, no? Jess > --- > share/man/man7/mitigations.7 | 14 ++++++++++---- > share/mk/bsd.sys.mk | 2 +- > 2 files changed, 11 insertions(+), 5 deletions(-) >=20 > diff --git a/share/man/man7/mitigations.7 = b/share/man/man7/mitigations.7 > index c487e4e1000b..4db6589cdcf1 100644 > --- a/share/man/man7/mitigations.7 > +++ b/share/man/man7/mitigations.7 > @@ -28,7 +28,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE = POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > -.Dd July 23, 2024 > +.Dd January 25, 2025 > .Dt MITIGATIONS 7 > .Os > .Sh NAME > @@ -244,9 +244,13 @@ and it is possible that some applications may not = function correctly. > .Fx > supports stack overflow protection using the Stack Smashing Protector > .Pq SSP > -compiler feature. > +compiler feature, > +and stack clash protection. > In userland, SSP adds a per-process randomized canary at the end of = every stack > -frame which is checked for corruption upon return from the function. > +frame which is checked for corruption upon return from the function, > +and stack probing in > +.Dv PAGE_SIZE > +chunks. > In the kernel, a single randomized canary is used globally except on = aarch64, > which has a > .Dv PERTHREAD_SSP > @@ -264,7 +268,9 @@ When > .Va WITH_SSP > is enabled, which is the default, world is built with the > .Fl fstack-protector-strong > -compiler option. > +and > +.Fl fstack-clash-protection > +compiler options. > The kernel is built with the > .Fl fstack-protector > option. > diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk > index 63774e857167..06f8e6e9fe78 100644 > --- a/share/mk/bsd.sys.mk > +++ b/share/mk/bsd.sys.mk > @@ -304,7 +304,7 @@ CXXFLAGS.clang+=3D -Wno-c++11-extensions > FORTIFY_SOURCE?=3D 0 > .if ${MK_SSP} !=3D "no" > # Don't use -Wstack-protector as it breaks world with -Werror. > -SSP_CFLAGS?=3D -fstack-protector-strong > +SSP_CFLAGS?=3D -fstack-protector-strong -fstack-clash-protection > CFLAGS+=3D ${SSP_CFLAGS} > .endif # SSP > .if ${FORTIFY_SOURCE} > 0 From nobody Sat Jan 25 19:09:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgPPZ5mVfz5lmH5; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgPPZ58cgz3Pg7; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737832178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VdYxXwGRLdlTN9KjJtViEzZ49sVVEpkFy3O11IKzeHo=; b=w54Kg1t+qpL+90bdDqVBlsodStXx6gNY5CeOHT+2S4SG72Wal8Pk5u1EPZMFRwwo8KDl8p hcLaqKM8m03U7hVRBgbsMkxhhW1GSTe2SxQqsC44D8/Xlg4LyWck+0dK/J6d7+pP6yUH73 g7XA7o7V92iuVittbKVnTk6xPzATCP3Nnuru2etpN1KPxoC/G7KREXczwEmELboaZrvyMM v451X8WWkuYwcxrF7kBeiY6zd5b42WBX2Y5xgRHcfxrUWhRDnt7doTrGSribj7TcWotWN9 KRxBoSe37GsopQ26K6bPf6+O8FjsqI3sDX3ZQSp4s6ztQ99LzwSIQf5YVarYrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737832178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VdYxXwGRLdlTN9KjJtViEzZ49sVVEpkFy3O11IKzeHo=; b=O5mg/YOGQIe+bBQIdG6u6XSxvJuzrHG8fcfY1ZtpFU5+jj+OYKxbHCJvbAlpicgBJOUDBb fmON36jyoNgDgHK+t+zxFTcAugo7qhi6ycW8jG0hQBzWTolJzeI/Io3zQ5bMJU3kOacIgf hNtQYEHSFn6PXrVS9J+ht9oKLeZWLv6m3Bk0V/YYmvKu5o6c/6HucRGd+nVkvgF+zmV9wV ZiNfsbg3K8TTXMi0cjeWB+m0gKv4vF8rW7f1bEzTVozerlx6lr6ss6Bgtt5Lb+g5zvabRp WQJvNPzxC9EyjtvqpUmke5avUr8GcPePjo3NbVDjcfSVdNilNQ9qJ2WU/Ct/Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737832178; a=rsa-sha256; cv=none; b=TpUPwwznf2flBZxfiCZOUhWpiTAp4OOXGvN/naXRQAXkC/Rh8Lj5AE5q6ASJEpYEpxCDRy 60z3FOaEadJ6/VVjEs0f+lgI1EwowR2wMjkM+tu3cGrZU6OYcbZ0zaAb9CgJivAD/XAafd WAKllx5KtmqiGX1juNIInc5tG1NHVBlaPx9Z+XcH7FGl2d5KosKz5F+cQ7PE5tlC/NFwbJ qDkiUI9+uU/Y4jp2d54QaOxMhyylXlGfJnUOvt5g+T8oxWbL7/vtgw29STADOvx5Rtkvun FBEHESRc4mUb147VgqRF+0Sx/GTa2NujFXWJchFemqS8+vw9MAs5+BVgyjRR/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b16583a.dip0.t-ipconnect.de [91.22.88.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "E5" (verified OK)) (Authenticated sender: netchild) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YgPPZ2KDQzFHm; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from webmail.leidinger.net (roundcube.Leidinger.net [192.168.1.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: alexander@leidinger.net) by outgoing.leidinger.net (Postfix) with ESMTPSA id 84F383A0; Sat, 25 Jan 2025 20:09:32 +0100 (CET) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Date: Sat, 25 Jan 2025 20:09:14 +0100 From: Alexander Leidinger To: Jessica Clarke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag In-Reply-To: <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> References: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> Message-ID: <9fec6bfae287dfc123a359c3e1164ae2@FreeBSD.org> Organization: FreeBSD Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_dfebb1064ab7e7467e9facd0bf4792ce"; micalg=pgp-sha256 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_dfebb1064ab7e7467e9facd0bf4792ce Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Am 2025-01-25 19:32, schrieb Jessica Clarke: > On 25 Jan 2025, at 13:08, Alexander Leidinger > wrote: >> >> The branch main has been updated by netchild: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=f934e629dc22b859efabd3cdebc23b63b04fa2bb >> >> commit f934e629dc22b859efabd3cdebc23b63b04fa2bb >> Author: Alexander Leidinger >> AuthorDate: 2025-01-25 12:43:39 +0000 >> Commit: Alexander Leidinger >> CommitDate: 2025-01-25 12:45:53 +0000 >> >> Add stack clash protection to the WITH_SSP flag >> >> Some background info availabe in: >> >> https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html >> >> https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3 >> https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/ >> >> Reviewed by: emaste >> Differential Revision: https://reviews.freebsd.org/D48651 > > Uh, it does require architecture-specific compiler support, which isn’t > implemented for all architectures in LLVM at least. RISC-V has only > recently (as in 1.5 months ago so not even released yet) gained > support, for example. So this is just going to spew out > -Wunused-command-line-argument warnings, and errors with -Werror, no? The online docs for gcc (https://gcc.gnu.org/onlinedocs/gcc//Instrumentation-Options.html) tell this: ---snip--- Most targets do not fully support stack clash protection. However, on those targets -fstack-clash-protection will protect dynamic stack allocations. -fstack-clash-protection may also provide limited protection for static stack allocations if the target supports -fstack-check=specific. ---snip--- I read this as it should not spill such warnings. Additionally other options there are listed as limited to some architectures, but this one is not listed as such. The online docs of clang (https://clang.llvm.org/docs/ClangCommandLineReference.html) do not limit this option for some architectures while for other options (e.g. -fzero-call-used-regs) it tells about architecture limits. In a discussion on -current in November there was the opinion it may depend on run time support, as I've searched but I've read only that this option depends on stack guard pages in the kernel. I have not found info about any required run-time support in e.g. libc or such (like for -fstack-protector(-strong)). If those docs are missing listing limits for this option, we can off course enable this with a little bit of code in bsd.compiler.mk only for those architectures where we do not get such warnings. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_dfebb1064ab7e7467e9facd0bf4792ce Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmeVNusACgkQEg2wmwP4 2Ib1Lg/+NG5tAoqBMw2gnKjEMAV7P9lIgTE4k7M0aK019rJykVPiqdGS9VZpUMWD geO6jpocQ5E2yiLzoRJyBmwHpIdiz4Ic+GTgHS9U2MqdPUa+JDh9owbM/1UHNBHD t9cGBXtcFjowP05iNJ7xnidH1ey0o99aVWvv0ymm4yCCu538EBW5Ra2ZA7Z1qEZd buSLxGE+A6UT+/lA6LGmkLLtZXwDm5IkWbr01JxrGCv19vh9QyNZ9zNj45TuPhcd xc0jtiUmNu0ReFw8oXklwcR5wVtcN7CUTzH4Ua+GuyGvmEHn6cM7fRBsHH8eNSqY kLZqit4iyt2sBA3zBGAhFNhhxIoRLuKG8oVf+1qbDyYe97tAPwPqiGyYaZ45gwvS CcTCy+jVzcyWawlJdiO5dvxzANRwKRAeMHLQJ2i+NtO0+qPx4M5mCYP4nm6zYYOE Qf1WcLeqZPXqx+F66ziKT9kUSm6vzZjIiKSIHkVdDfd+ZPebgEdAxO62Bc+vr6rb fWje0SAytOOQmDXxvKQRuCUBc0eSTThspNL+RisKYp/XHAuAK5ULO4eKoLC37ket Oi4ZfD+7FYEDe/+jK6xV5PN1PIUMsjPa8vU9zxhboHzXuAbpogFyv4STJdAF3ijG 1bFmT3YCirr8NG9K8kpqtxQuxjGLHGoScjw5zk5zQQFZpgjtOqo= =aYvF -----END PGP SIGNATURE----- --=_dfebb1064ab7e7467e9facd0bf4792ce-- From nobody Sat Jan 25 19:21:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgPg85hm2z5lnDY for ; Sat, 25 Jan 2025 19:21:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgPg823mLz3RKn for ; Sat, 25 Jan 2025 19:21:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso20430045e9.0 for ; Sat, 25 Jan 2025 11:21:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737832883; x=1738437683; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VclXzKBju5iabiBtttyZeeDfBXmN/CGWIY8MYZijmqg=; b=B7nJ6y3QF5JZu7n4D9LXJ12ItPt+S8M7F8n/MSvHIKhnRu13oK//TvtkkmqBXyBvSE oARJsGphnpksGH1DqTS7IVmeKiakuVLADSaX7hTZhmDd1zQs/bropa0/k8WIx5BLRbwL NOIHMQrLygbAUYJ/aer1v3lQ4hqoboiPNWEKqZ8nJn3XzoMb0fbhuvjEzqQAkTKJqq0Y X1OXIP3edg2u6u4p0y8WnTFMa4TYbOhIZod9d37vQ+0qcf8ybwnQnoWQDyakxs098VSz qX486bbGZ0EoewuH3wEocdtTdwHe6sJBiwgImTomofy7krljcT0jJDndTSNDAvY3ol/C 69vA== X-Forwarded-Encrypted: i=1; AJvYcCXBKXOJofQfbcXk4T7QKht+Aog3Q4Fd3i/2Q8mzC1kTDpCbXkCetJmPICZ5P+bGBNjCasPa2+Es1CIgE8uqpJZk2mpd@freebsd.org X-Gm-Message-State: AOJu0Yzh9XA/e5Y3le85whLa2ZEK9X3XLCGv7oTjk+9wSJXi0PGJWoi3 mCYpDUa0rHi+/euy5gZejqmq7SwkuCXQKmHAaSlQJvNGFk/SYEPL6HwR5U+YknE= X-Gm-Gg: ASbGnctoFITJGRf9qBSHMcXvV84LxMIa3iNRcwQi34JgLIoOcnEn+SO347Yee0R9jt1 BX2lHoDdiqG8VRpVZrEWZyBa/BNz8QwL86EgHeP/GisGYTQCWv2NgoNL+05jrGpZOiUOx8MLa6Z IenRoj9TPbsqEAg+RYdQmkb4aGO2nXIj2Dv6H5lrIgW6PucX5r4aCN2k0h/V54ce3uTzFMEETGv r9FQgo0gnEnvnqqUlBPfbioDxZc6MedvOMSNQoLtYG6jZkNqxfxx68N+9TEvtWfOQd/JmlzRD4z GYuA7Rj0sjFsvOb16gM= X-Google-Smtp-Source: AGHT+IFzhRqQQnxznawyLk7leh5fUEMixsDLRBoEbEFO06kBHUvT/u/1U0z+PiKJ+GqFZ7uj4JO55g== X-Received: by 2002:a7b:c00f:0:b0:434:f5c0:32b1 with SMTP id 5b1f17b1804b1-4389eecb1f5mr311059915e9.15.1737832882700; Sat, 25 Jan 2025 11:21:22 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4b9984sm70125435e9.28.2025.01.25.11.21.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jan 2025 11:21:22 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag From: Jessica Clarke In-Reply-To: <9fec6bfae287dfc123a359c3e1164ae2@FreeBSD.org> Date: Sat, 25 Jan 2025 19:21:11 +0000 Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6C70A3E0-CC6D-4B0B-96A8-70636F08AC6B@freebsd.org> References: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> <9fec6bfae287dfc123a359c3e1164ae2@FreeBSD.org> To: Alexander Leidinger X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Rspamd-Queue-Id: 4YgPg823mLz3RKn X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 25 Jan 2025, at 19:09, Alexander Leidinger = wrote: >=20 > Am 2025-01-25 19:32, schrieb Jessica Clarke: >> On 25 Jan 2025, at 13:08, Alexander Leidinger = wrote: >>> The branch main has been updated by netchild: >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Df934e629dc22b859efabd3cdebc23b63= b04fa2bb >>> commit f934e629dc22b859efabd3cdebc23b63b04fa2bb >>> Author: Alexander Leidinger >>> AuthorDate: 2025-01-25 12:43:39 +0000 >>> Commit: Alexander Leidinger >>> CommitDate: 2025-01-25 12:45:53 +0000 >>> Add stack clash protection to the WITH_SSP flag >>> Some background info availabe in: >>> = https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Harden= ing-Guide-for-C-and-C++.html >>> = https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gc= c-part-3 >>> https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/ >>> Reviewed by: emaste >>> Differential Revision: https://reviews.freebsd.org/D48651 >> Uh, it does require architecture-specific compiler support, which = isn=E2=80=99t >> implemented for all architectures in LLVM at least. RISC-V has only >> recently (as in 1.5 months ago so not even released yet) gained >> support, for example. So this is just going to spew out >> -Wunused-command-line-argument warnings, and errors with -Werror, no? >=20 > The online docs for gcc = (https://gcc.gnu.org/onlinedocs/gcc//Instrumentation-Options.html) tell = this: > ---snip--- > Most targets do not fully support stack clash protection. However, on = those targets -fstack-clash-protection will protect dynamic stack = allocations. -fstack-clash-protection may also provide limited = protection for static stack allocations if the target supports = -fstack-check=3Dspecific. > ---snip--- >=20 > I read this as it should not spill such warnings. Additionally other = options there are listed as limited to some architectures, but this one = is not listed as such. >=20 > The online docs of clang = (https://clang.llvm.org/docs/ClangCommandLineReference.html) do not = limit this option for some architectures while for other options (e.g. = -fzero-call-used-regs) it tells about architecture limits. >=20 > In a discussion on -current in November there was the opinion it may = depend on run time support, as I've searched but I've read only that = this option depends on stack guard pages in the kernel. I have not found = info about any required run-time support in e.g. libc or such (like for = -fstack-protector(-strong)). >=20 > If those docs are missing listing limits for this option, we can off = course enable this with a little bit of code in bsd.compiler.mk only for = those architectures where we do not get such warnings. Clang=E2=80=99s docs are just deficient here. If you go and read the = actual code[1] you can see that architectures have to opt in to the flag even being checked. Even AArch64 didn=E2=80=99t support it until LLVM 18, if = you look at the history. It looks like with Clang we end up using -Qunused-arguments so the warning/error is suppressed. That at least means the build doesn=E2=80=99t= fail, which I suppose is good, but I=E2=80=99m not sure we should be = promising that WITH_SSP will protect against stack clash then having the compiler silently emit unprotected code (for which we=E2=80=99re to blame, by = telling it to ignore the fact it=E2=80=99s not supported). This at least needs to = be documented that the protection will only be provided if supported by the compiler. Jess [1] = https://github.com/llvm/llvm-project/blob/4bcd8184a093d2d9f0aad1053dbb1367= 891da6a5/clang/lib/Driver/ToolChains/Clang.cpp#L3790 From nobody Sat Jan 25 19:46:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgQDg3tVpz5lqGB; Sat, 25 Jan 2025 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgQDg2pf8z3VB7; Sat, 25 Jan 2025 19:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737834419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHWsm3KrDMGos0Xf85z5Z130f/rC3mM2D0z0o1WQqeY=; b=W7wrR8atA3sNm9YKvWUfG2lJDzp7pipmfJ864sZOSndHlA7sD4jT3uK1Fe69TdpXtWjhCN 4kMHdzFkuAdT4vBvoKjoZYN6IeWFGF+QMvOHiytJZ78Hq+p89k1nhoELDfv50NddkLk4Cp st1IUN3q5Jw3leeM1mN9UcNiqm/RCw7mEVKOas0SmsmXB/x6fM4kMdbf7479IfJz29GBvb AQFHnrVnmiBmHHRBpfQXMVQDqorbQqX2DNfUHHBq9NJHNlLMxZrz6yY8eUESQRGXuIgN1l VOktjBzRyzmqtY6uZNr/kftpggi4mG9gU3SrWqz6rrB5fqaqSskh/ySHj9PBtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737834419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHWsm3KrDMGos0Xf85z5Z130f/rC3mM2D0z0o1WQqeY=; b=H6tTh7eEop3VO8IFTl3uHsFxuqNxVXz+yc3u/4trwxH4Pa7OJn4swJlgC5dexGk7d1tihK CH1/zS0HnZ2frLpOBRYbW8w19ixptrpTKO2ZOjkXgZEeJz0PMX0+4kSA9h3pV+Rw4K4I1u VkIxMXExz13Uco9PIBIx6+Fu26Wo0AfHQhJo1h1+YZP/+f0d+8QC66x+VCILG3C/D5py0n PdXKVAuPSBpxCQrO0JXNTaIuuOHm8QwXdbeO1t+59ADfJps2yCeSAv+d3BD9GnJWFaQfTj rLcWltsJHBdhhMbPtdDrWS3gOONcp2yRpy8tJVX25HjsUSTYmdROv8UFwUHzzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737834419; a=rsa-sha256; cv=none; b=n4lE5gVncLWv9ptBDBHKFbXwK5Jy52n83Bp0spWh8Eo+DVsSTqkkm5K7tHZeI8zds0VoVz 9pjOtUjwAmVeTMMRRtlQoBD0CyjS2rF+KReVkTppDFeD4kTlwpj5Q38yUr5vhs4GtDetCK rb/FAfoAZBbBkOcAP68mJ0Y1S6LIejAaV9FaNGCSvygHE6pzM8uGYBYCOgrF9vlFL17MUV JwhMgBhoXkYWMRmU9PAIu+YfcTHamz+OMLTAyO2IjMNBll96AmII3ngDTO4xxzhcAC8vb9 VcS8cCMYzFdXvUJ+Qfa1XPInOPT8t/LoWPOuJFceFpuPw2/aXZgZSM3sF+cJAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgQDg2M9Kz1PbT; Sat, 25 Jan 2025 19:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PJkxIL088454; Sat, 25 Jan 2025 19:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PJkxpK088450; Sat, 25 Jan 2025 19:46:59 GMT (envelope-from git) Date: Sat, 25 Jan 2025 19:46:59 GMT Message-Id: <202501251946.50PJkxpK088450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Igor Ostapenko Subject: git: b40ca26721d7 - stable/14 - kyua: Support is_exclusive metadata coming from an ATF test case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b40ca26721d70c76a4a4953ebe90b27daf0b3d58 Auto-Submitted: auto-generated The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=b40ca26721d70c76a4a4953ebe90b27daf0b3d58 commit b40ca26721d70c76a4a4953ebe90b27daf0b3d58 Author: Igor Ostapenko AuthorDate: 2024-12-24 08:36:33 +0000 Commit: Igor Ostapenko CommitDate: 2025-01-25 19:42:59 +0000 kyua: Support is_exclusive metadata coming from an ATF test case On ATF side it is named "is.exclusive". Reviewed by: ngie, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47671 (cherry picked from commit 2ed24e28d1d95c62cc37ca3534d4d33360b4cef2) --- contrib/kyua/engine/atf_list.cpp | 2 ++ contrib/kyua/engine/atf_list_test.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/contrib/kyua/engine/atf_list.cpp b/contrib/kyua/engine/atf_list.cpp index c9c2fed70175..c4f348ada2f6 100644 --- a/contrib/kyua/engine/atf_list.cpp +++ b/contrib/kyua/engine/atf_list.cpp @@ -125,6 +125,8 @@ engine::parse_atf_metadata(const model::properties_map& props) mdbuilder.set_string("execenv", value); } else if (name == "execenv.jail.params") { mdbuilder.set_string("execenv_jail_params", value); + } else if (name == "is.exclusive") { + mdbuilder.set_string("is_exclusive", value); } else if (name == "require.config") { mdbuilder.set_string("required_configs", value); } else if (name == "require.files") { diff --git a/contrib/kyua/engine/atf_list_test.cpp b/contrib/kyua/engine/atf_list_test.cpp index 7f19ca8fbec5..7648ee2c6a80 100644 --- a/contrib/kyua/engine/atf_list_test.cpp +++ b/contrib/kyua/engine/atf_list_test.cpp @@ -64,6 +64,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) model::properties_map properties; properties["descr"] = "Some text"; properties["has.cleanup"] = "true"; + properties["is.exclusive"] = "true"; properties["require.arch"] = "i386 x86_64"; properties["require.config"] = "var1 var2 var3"; properties["require.files"] = "/file1 /dir/file2"; @@ -93,6 +94,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) .add_required_program(fs::path("svn")) .set_description("Some text") .set_has_cleanup(true) + .set_is_exclusive(true) .set_required_memory(units::bytes::parse("1m")) .set_required_user("root") .set_timeout(datetime::delta(123, 0)) @@ -261,6 +263,36 @@ ATF_TEST_CASE_BODY(parse_atf_list__many_test_cases) } +ATF_TEST_CASE_WITHOUT_HEAD(parse_atf_list__is_exclusive_support); +ATF_TEST_CASE_BODY(parse_atf_list__is_exclusive_support) +{ + const std::string text = + "Content-Type: application/X-atf-tp; version=\"1\"\n" + "\n" + "ident: first\n" + "is.exclusive: false\n" + "descr: This is the descr\n" + "\n" + "ident: second\n" + "is.exclusive: true\n" + "\n" + "ident: third\n"; + std::istringstream input(text); + const model::test_cases_map tests = engine::parse_atf_list(input); + + const model::test_cases_map exp_tests = model::test_cases_map_builder() + .add("first", model::metadata_builder() + .set_description("This is the descr") + .build()) + .add("second", model::metadata_builder() + .set_is_exclusive(true) + .build()) + .add("third") + .build(); + ATF_REQUIRE_EQ(exp_tests, tests); +} + + ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, parse_atf_metadata__defaults); @@ -275,4 +307,5 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_syntax); ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_properties); ATF_ADD_TEST_CASE(tcs, parse_atf_list__many_test_cases); + ATF_ADD_TEST_CASE(tcs, parse_atf_list__is_exclusive_support); } From nobody Sat Jan 25 21:11:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgS5c4cW1z5lwL9; Sat, 25 Jan 2025 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgS5c3vX8z3gWy; Sat, 25 Jan 2025 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737839460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gu3xC3TRWOavB3iEUoUPbUKjAhxNsialJ+zFf0Cqd8k=; b=jidrPyXV08e9P/eTwylSjeySIDbGPUFd45Th2tNew49Edv+cc7kz0WwLDLYswsrTJlRBxA NKw5lVNdkS8uZ4zHPUbNtINhoaQwTp3PED8zxoDDfcHJ5SH8FTlNHhoZsayHqT5OMFwqxo r2sakmoKTBUCde6/djFr15rXwFWOnRncmUvsbSHXE0qNAXLlHk7VyyKf1bh/SnyD/r/Jzg eiQTE0FooG4Yt0spn9ZsRqxahZYkyhL+fbcRWmpN6MqtGxVOYLy0yMNSVhmPbMnv4O5W7P osXHrzU8d6i2Q6oel6Z4Wmfl4JniYJKe43CYlKqsArsF0z1FKqHxkgEltuSjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737839460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gu3xC3TRWOavB3iEUoUPbUKjAhxNsialJ+zFf0Cqd8k=; b=GSR2hENorBTys4FA4iTYSzTOuRJVMjSxLQ8WEU2PXMi3TM0rWiTMm9h9az9UwTWxMOkQu0 DIPKRTBP9PqPRacyEicgx3weYnKQR2t/i9VHaxtxavoipUVhA3hLKqeIH6nSgyqO8wRilH 9RjLIPSXzJXEa049JQ3KapAWTjFa76XDmpsGgT+B7/9TeYs8o9ZoY715eSqULzBQoaPnq4 W3KbTV3LkdfIQ7SIvPO6d9/NeB8n5Y743CaRNE8AyU817AywJDHTqpXJW4wjfxw/mGZl1E 71l969as0A0x4QHsWu290YXajVka4CG/Xz4hUzkUYCndAuTcpym7+BjGIsSZ5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737839460; a=rsa-sha256; cv=none; b=K3YzmThpLZmJ1XpwYWpP7+YJv7V2HEIBey1w50nXmAWqyKOyklPmNF0Eh1vzwCZtVG/41d u9vxIjrCEYhb0MFU5GRTQMf/KqxofMSai3hDd0GOIpdSJxDOW5ONtZwmBYJTef0+ncssoX 5zEdSJOpe1gtnodv30iP0Mn16AaYO+x1dMpSat7mQIvCJcQ7/HL3Gz9v81Tl8/lp1lfRQ4 mjEOXTK4cX19LIi1Aw/zusn7akfLu6CwoZdwjikdT+0OqNftawzK307JGUUrDJMdKlr8p6 Brnu3uqtJimMzV7PSQonBC3o00wPVAX4jLs7pQZ1O8oC3L14j0/gdB9mpzjcpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgS5c3Vhbz1RSl; Sat, 25 Jan 2025 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50PLB05n048125; Sat, 25 Jan 2025 21:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50PLB0Ih048122; Sat, 25 Jan 2025 21:11:00 GMT (envelope-from git) Date: Sat, 25 Jan 2025 21:11:00 GMT Message-Id: <202501252111.50PLB0Ih048122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 6a356edd4fc3 - stable/13 - Fix backward compatibility with UFS1 filesystems created before June 2002 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a356edd4fc3c8d7959fcc6a2447c7193d830392 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=6a356edd4fc3c8d7959fcc6a2447c7193d830392 commit 6a356edd4fc3c8d7959fcc6a2447c7193d830392 Author: Kirk McKusick AuthorDate: 2025-01-16 18:43:48 +0000 Commit: Kirk McKusick CommitDate: 2025-01-25 21:10:20 +0000 Fix backward compatibility with UFS1 filesystems created before June 2002 See the Pahabricator review for more details. Reviewed-by: kib Tested-by: Peter Holm Differential-Revision: https://reviews.freebsd.org/D48472 (cherry picked from commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31) --- sbin/growfs/debug.c | 2 - sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_snapshot.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 +- sys/ufs/ffs/ffs_subr.c | 81 +++++++++++++++++++++++++++++++++++++- sys/ufs/ffs/ffs_vfsops.c | 96 +--------------------------------------------- sys/ufs/ffs/fs.h | 5 ++- 7 files changed, 88 insertions(+), 104 deletions(-) diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 456e67dbc5c2..ab4539d06a69 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -305,8 +305,6 @@ dbg_dump_fs(struct fs *sb, const char *comment) sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", sb->fs_avgfpdir); - fprintf(dbg_log, "save_cgsize int32_t 0x%08x\n", - sb->fs_save_cgsize); fprintf(dbg_log, "flags int32_t 0x%08x\n", sb->fs_flags); fprintf(dbg_log, "contigsumsize int32_t 0x%08x\n", diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 89ef325b87e3..2e9b485d482b 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -84,7 +84,7 @@ int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **, int); int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t); -void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +void ffs_oldfscompat_write(struct fs *); int ffs_own_mount(const struct mount *mp); int ffs_reallocblks(struct vop_reallocblks_args *); int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t, diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index bc4dbdf52e5b..6e2a8d66b54f 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -840,7 +840,7 @@ resumefs: copy_fs->fs_fmod = 0; bpfs = (struct fs *)&nbp->b_data[loc]; bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize); - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 62af80d7eb40..e14e333f70bb 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9932,7 +9932,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) if (pino == 0) { bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, @@ -9964,7 +9964,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index ca595ed5bd80..351559882ca2 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -130,6 +130,7 @@ ffs_update_dinode_ckhash(struct fs *fs, struct ufs2_dinode *dip) static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int, int (*)(void *, off_t, void **, int)); +static void ffs_oldfscompat_read(struct fs *, ufs2_daddr_t); static int validate_sblock(struct fs *, int); /* @@ -273,6 +274,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, if (fs->fs_magic == FS_UFS1_MAGIC && !isaltsblk && fs->fs_bsize == SBLOCK_UFS2 && sblockloc == SBLOCK_UFS2) return (ENOENT); + ffs_oldfscompat_read(fs, sblockloc); if ((error = validate_sblock(fs, isaltsblk)) > 0) return (error); /* @@ -317,6 +319,83 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, return (0); } +/* + * Sanity checks for loading old filesystem superblocks. + * See ffs_oldfscompat_write below for unwound actions. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +static void +ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc) +{ + uint64_t maxfilesize; + + /* + * If not yet done, update fs_flags location and value of fs_sblockloc. + */ + if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { + fs->fs_flags = fs->fs_old_flags; + fs->fs_old_flags |= FS_FLAGS_UPDATED; + fs->fs_sblockloc = sblockloc; + } + /* + * If not yet done, update UFS1 superblock with new wider fields. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { + fs->fs_maxbsize = fs->fs_bsize; + fs->fs_time = fs->fs_old_time; + fs->fs_size = fs->fs_old_size; + fs->fs_dsize = fs->fs_old_dsize; + fs->fs_csaddr = fs->fs_old_csaddr; + fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; + fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; + fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; + fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; + } + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_inodefmt < FS_44INODEFMT) { + fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; + fs->fs_qbmask = ~fs->fs_bmask; + fs->fs_qfmask = ~fs->fs_fmask; + } + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_save_maxfilesize = fs->fs_maxfilesize; + maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } + /* Compatibility for old filesystems */ + if (fs->fs_avgfilesize <= 0) + fs->fs_avgfilesize = AVFILESIZ; + if (fs->fs_avgfpdir <= 0) + fs->fs_avgfpdir = AFPDIR; +} + +/* + * Unwinding superblock updates for old filesystems. + * See ffs_oldfscompat_read above for details. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +void +ffs_oldfscompat_write(struct fs *fs) +{ + + /* + * Copy back UFS2 updated fields that UFS1 inspects. + */ + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_old_time = fs->fs_time; + fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; + fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; + fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; + fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = fs->fs_save_maxfilesize; + } +} + /* * Verify the filesystem values. */ @@ -482,7 +561,7 @@ validate_sblock(struct fs *fs, int isaltsblk) sizepb *= NINDIR(fs); maxfilesize += sizepb; } - CHK(fs->fs_maxfilesize, !=, maxfilesize, %jd); + CHK(fs->fs_maxfilesize, >, maxfilesize, %jd); /* * These values have a tight interaction with each other that * makes it hard to tightly bound them. So we can only check diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index d97f5413c647..62d63210531a 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -85,8 +85,6 @@ static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); -static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, - ufs2_daddr_t); static void ffs_ifree(struct ufsmount *ump, struct inode *ip); static int ffs_sync_lazy(struct mount *mp); static int ffs_use_bread(void *devfd, off_t loc, void **bufp, int size); @@ -823,7 +821,6 @@ ffs_reload(struct mount *mp, int flags) free(fs, M_UFSMNT); fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -1040,7 +1037,6 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); sx_init(&ump->um_checkpath_lock, "uchpth"); - ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; mp->mnt_data = ump; @@ -1251,96 +1247,6 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int size) return (0); } -static int bigcgs = 0; -SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, ""); - -/* - * Sanity checks for loading old filesystem superblocks. - * See ffs_oldfscompat_write below for unwound actions. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -static void -ffs_oldfscompat_read(struct fs *fs, - struct ufsmount *ump, - ufs2_daddr_t sblockloc) -{ - off_t maxfilesize; - - /* - * If not yet done, update fs_flags location and value of fs_sblockloc. - */ - if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { - fs->fs_flags = fs->fs_old_flags; - fs->fs_old_flags |= FS_FLAGS_UPDATED; - fs->fs_sblockloc = sblockloc; - } - /* - * If not yet done, update UFS1 superblock with new wider fields. - */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { - fs->fs_maxbsize = fs->fs_bsize; - fs->fs_time = fs->fs_old_time; - fs->fs_size = fs->fs_old_size; - fs->fs_dsize = fs->fs_old_dsize; - fs->fs_csaddr = fs->fs_old_csaddr; - fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; - fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; - fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; - fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; - } - if (fs->fs_magic == FS_UFS1_MAGIC && - fs->fs_old_inodefmt < FS_44INODEFMT) { - fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; - fs->fs_qbmask = ~fs->fs_bmask; - fs->fs_qfmask = ~fs->fs_fmask; - } - if (fs->fs_magic == FS_UFS1_MAGIC) { - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; - } - /* Compatibility for old filesystems */ - if (fs->fs_avgfilesize <= 0) - fs->fs_avgfilesize = AVFILESIZ; - if (fs->fs_avgfpdir <= 0) - fs->fs_avgfpdir = AFPDIR; - if (bigcgs) { - fs->fs_save_cgsize = fs->fs_cgsize; - fs->fs_cgsize = fs->fs_bsize; - } -} - -/* - * Unwinding superblock updates for old filesystems. - * See ffs_oldfscompat_read above for details. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -void -ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump) -{ - - /* - * Copy back UFS2 updated fields that UFS1 inspects. - */ - if (fs->fs_magic == FS_UFS1_MAGIC) { - fs->fs_old_time = fs->fs_time; - fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; - fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; - fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; - fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; - fs->fs_maxfilesize = ump->um_savedmaxfilesize; - } - if (bigcgs) { - fs->fs_cgsize = fs->fs_save_cgsize; - fs->fs_save_cgsize = 0; - } -} - /* * unmount system call */ @@ -2224,7 +2130,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size) UFS_UNLOCK(ump); fs = (struct fs *)bp->b_data; fs->fs_fmod = 0; - ffs_oldfscompat_write(fs, ump); + ffs_oldfscompat_write(fs); fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index cc89df9aca66..1c8890fa94ff 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -374,7 +374,8 @@ struct fs { int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ int64_t fs_metaspace; /* size of area reserved for metadata */ - int64_t fs_sparecon64[13]; /* old rotation block list head */ + uint64_t fs_save_maxfilesize; /* save old UFS1 maxfilesize */ + int64_t fs_sparecon64[12]; /* old rotation block list head */ int64_t fs_sblockactualloc; /* byte offset of this superblock */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ @@ -387,7 +388,7 @@ struct fs { uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ uint32_t fs_avgfilesize; /* expected average file size */ uint32_t fs_avgfpdir; /* expected # of files per directory */ - int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ + uint32_t fs_available_spare; /* old scratch space */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ int32_t fs_sparecon32[21]; /* reserved for future constants */ From nobody Sun Jan 26 12:11:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ygr4z38DJz5ljPK; Sun, 26 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ygr4z1t3zz3wpr; Sun, 26 Jan 2025 12:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GlmZk75mKk2OnXtbkgmJVi0mxicdXncciyMSSfyIZPU=; b=e+nLdrdAT4OcwkFk9teO3bkLzsuK2lA/gxgZbcY66tkT3yxBqrfoaUmY2fFD4+RtovgUJ9 g/WA0QGpfRXaQuCbufeLX5yHZb2GGYZxdIRqEYloxJxqHAULqhIUQBgh2EVG4bPacTHAkR /YhclZc5HgQvdXe0iooQ47B/EBFvXfrDJ6xLiE+dWiqgxERNz7fZ4SDHlhHGy/HfXKbxHF I7hGHR4Jc7iZ1J0mSk9147wLT5D9tdFeN7GSNBFmtQ3gCAzY+St4nmUGSR2AIR4HSUJJ2M ESSEo809z6SKOVvI6MclrzAtZI+bNycqE2hjohESRn+jZl7xvy+6YgZihTt41A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GlmZk75mKk2OnXtbkgmJVi0mxicdXncciyMSSfyIZPU=; b=AQFCUi0JNRAhbWF+w7OfqKBYhy7TL2ITI/Gi68bGoYHtDx34W/0Vop+xdDrUGrnTII/6db mZhraz4UxPP5MKiGI1lGD4PvGoDQHvmS8Mpfvkle4CNFK3MGMjXxVIHIMyKEThbGsRoWDu REercg9j2jjqEvkoT8KY9QfqFzJb3Z/KqdS7RIo07xQ+6R+2fD1+X8GPnVH8dEbXWNR0ZU aSvlRfKrKGmx9cAR3mimkF9zNMUCrLadn3/tCNuIO06+YVARKH+jVz/jPifjxqlv/uVw0u /36oom4Nput/EVcMqjBN0JU+RWe1n+6l6LsNbQfevJiWwhonthoB58AzruIOpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737893507; a=rsa-sha256; cv=none; b=WV9kaslU4O24ICHOCt2zHECPP0IkcBzhHOwGuwSCvXWCNb3ZkYeype6Do5i/NJTpMo5ayO 9ZmYxSZZwmgfRZ7svMgW77mIbx6euluRGTvYoDSGNoUTNf+I6DdWOoSxt9DtsX8XUJRoEi 43r84D5iQFg8zbEKJbLVyhGpg6W6hTkomkzmSr/gi1KOp6bpa4UxavyUANtf8WzOovgPcv faMldY6N2fIwoKZ794gxpfNEB+lIXzLbG2XWPvJ0kzsi1pjxFMIk+SAaOUo6LniyzWN02W xIL0Efb6NquoqVRJL8f5zH4b+fM41cHlM6dNaWEKLqhGDQTsonhRt9bRpW5H5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ygr4z1PfBzhR2; Sun, 26 Jan 2025 12:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QCBlLp025231; Sun, 26 Jan 2025 12:11:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QCBloS025228; Sun, 26 Jan 2025 12:11:47 GMT (envelope-from git) Date: Sun, 26 Jan 2025 12:11:47 GMT Message-Id: <202501261211.50QCBloS025228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 5da0eee3d842 - main - bootptest: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5da0eee3d842bd0bef2c95553e75e462cda27ee6 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=5da0eee3d842bd0bef2c95553e75e462cda27ee6 commit 5da0eee3d842bd0bef2c95553e75e462cda27ee6 Author: Gordon Bergling AuthorDate: 2025-01-26 12:06:55 +0000 Commit: Gordon Bergling CommitDate: 2025-01-26 12:06:55 +0000 bootptest: Fix a typo in a source code comment - s/tralier/trailer/ MFC after: 3 days --- libexec/bootpd/tools/bootptest/print-bootp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/bootpd/tools/bootptest/print-bootp.c b/libexec/bootpd/tools/bootptest/print-bootp.c index ba1c02563ab0..dabab8115313 100644 --- a/libexec/bootpd/tools/bootptest/print-bootp.c +++ b/libexec/bootpd/tools/bootptest/print-bootp.c @@ -242,7 +242,7 @@ rfc1048_opts[] = { "iIP-routes", /* 33: IP static routes (dst,router) */ /* Link Layer parameters, per-interface (RFC-1533, sect. 6) */ - "bLL-trailer", /* 34: do tralier encapsulation */ + "bLL-trailer", /* 34: do trailer encapsulation */ "lLL-arp-tmo", /* 35: ARP cache timeout */ "bLL-ether2", /* 36: Ethernet version 2 (IEEE 802.3) */ From nobody Sun Jan 26 12:11:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ygr504hJhz5ljMC; Sun, 26 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ygr502l2Pz3wps; Sun, 26 Jan 2025 12:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AZ3kC1HMEpJ3bjC2VTJcZ+slLhJQOwitw7IL1LnJILY=; b=ZvMbYPuKx07UfAjAKCGQM7Zn3eFFAFPFDDAKU2EpS/AmQnK+6RGpwe37mCKwpQd0J9fgIG 0YQAckFS4SBSeHim0OG+W+GHFBsDxvkKIdQKKT/sejzCoPzCOoJBvVZgqTvhYYXKL0x/Vs xIM/TU/Xlz0dEyEOvbwEe0elGSbafXMSFqBOZ2SYNhntASTvKLkAEmWIxeGmu402MSiHUp GO+3SA7wU8/6JM6V58E8/+q0ARA8R47ufAMZoGSMqRJFEcnIqBVZSXCPPoX2yYS74DV/oz MP2mSHAvTDU4FpGV/Mv2VDJbgZ8rCy8x+B8DRzcVww1H2+4JM7qURLJPfF5VSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AZ3kC1HMEpJ3bjC2VTJcZ+slLhJQOwitw7IL1LnJILY=; b=KsRFhv1SmmlAe/s8p8XNxrD2PU47MUHZ9FemEjfQnwe3zuZjYURLQXOhm4RK2QI+UOQ7+u VmgaUEUtIsxClG0PnyU5VfedkBGleeamuXpAll8dGwMWvyMbzcKJZHZ6k9ewYZ7Kqzrw0Q yIyA033LRBOKR8NmJ0N0INBTh/UiBvMgOG68Ogo0qjymsRFIOEcxOcR8lYizQqwTMcGDws P7S2tNrclWn4r86gBGNDQiDk/pr2Ibu7bP1gJvi2U5JpFnuctsL3yJhYtJgl895/tjt5+U abAJBXp5jymx0+X7WyRb9NYhtM0ia1Z2z9nqxENQNUrck+YsmIDSwiyWYTM80g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737893508; a=rsa-sha256; cv=none; b=ntDlG4O/A4hRMRkNwWYTvuir/eWL5+iQSd+ttOLtZ1k596SZj8tBJo5S6tH0smi2A8aES7 +1JACuitDwTx9KPjEX3iJWVs5jKpgUzLV21QgRpDSnv1X/1HpiyxorBUHrD9TtMlKIdSwd F8IyzUITnkNNJixsiBYyGuAUIHtD5p3Gmc5UuDUsTc2YPdXzxRr9gEvSeTjqTMAYnvFj0D 9WAL88nOW3wplMjP0oj745DmLU4pMCg8Ae7bXxncLyVcptUfY2Xh3NnNjSln5aWPs+zOV6 BUpZvi4kq+ZnY3sVy9p7WjKoRCyD5W3PF0ZVn/GqRQSJAsViodX2rfha0uf+vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ygr502M2Xzhdf; Sun, 26 Jan 2025 12:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QCBmUJ025264; Sun, 26 Jan 2025 12:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QCBmBD025261; Sun, 26 Jan 2025 12:11:48 GMT (envelope-from git) Date: Sun, 26 Jan 2025 12:11:48 GMT Message-Id: <202501261211.50QCBmBD025261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 6fbf8502a500 - main - ath(4): Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fbf8502a5004a99847bda57b4875b567c7ca018 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=6fbf8502a5004a99847bda57b4875b567c7ca018 commit 6fbf8502a5004a99847bda57b4875b567c7ca018 Author: Gordon Bergling AuthorDate: 2025-01-26 12:08:23 +0000 Commit: Gordon Bergling CommitDate: 2025-01-26 12:08:23 +0000 ath(4): Fix a typo in a source code comment - s/isnt/isn’t/ MFC after: 3 days --- sys/dev/ath/if_ath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 094517da5689..934024ddfbcf 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -2446,7 +2446,7 @@ ath_bmiss_vap(struct ieee80211vap *vap) * against the next beacon. * * This handles three common beacon miss cases in STA powersave mode - - * (a) the beacon TBTT isnt a multiple of bintval; + * (a) the beacon TBTT isn't a multiple of bintval; * (b) the beacon was missed; and * (c) the beacons are being delayed because the AP is busy and * isn't reliably able to meet its TBTT. From nobody Sun Jan 26 12:11:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ygr515zSSz5ljBG; Sun, 26 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ygr514NlVz3wmb; Sun, 26 Jan 2025 12:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hqny1Y4RaxnpuiaBsNz4XFZmabpweXOHizQ+MHZ8Z+8=; b=tWuGb27Wrc9mLnm9MvEEG9RKj1Vrh/F8qWf4aAnBpI6gNJVr78s0lExR+wL7D9js+9o0NC L/GIVp7Koxc0zAxo7blbtuT+LH4aoKQ3V+bMesx6/4x4oIwd2+TEuu5wd/3g76O7Hk5Bo/ ZZmeZ74i0ZD6B9+hBu3oWTvSxbMn1mG1v0wr4rgzwM3IbJm/vZMCj9mI/pkchCLrmIbs6U 2XaDVlcQdh9ZwrEkV6eD2/J9y7HPYo/hRG2yOPvEYbZqO8mmMFYX6pzdNsh6IxgvNJVT4W T8i8hZFwqZz5TUT5OqzOo6UReU+71ENywX9ZQZxXTYNBXza5+uVe6lKvgJDgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hqny1Y4RaxnpuiaBsNz4XFZmabpweXOHizQ+MHZ8Z+8=; b=mx2bByaThIePzenR8QQ6gzjl++Uh3qQo3xV+uT+vRGPnK1gMe5r3yVMYqgyf8reHz7Lzjg LFiMQ4CDfOOjyDlju7Z6nYenIUbu8VcyczWUUbRl4kCp1mG3YNSzyCpwBDym569eaRH7Tf KLzYGmtYm+zWinlR6mYsmfsbJVlRgO3SIBnknvkQ6HCNQ8Q6JAQmcNhF0N2gR73yl1vWnG 6YnktGWsgZ4h652re2VtOZ7+hAJLDHfT2OyAy8hFqsAMYL/yYoi5Abl2/2yFEiEgFTCYt5 fKeJla+P51lKYgA+5E8vq/LLcSNGjMqNq5XhD9e2QA3r9+1Yv1OGGBc0VJ2jxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737893509; a=rsa-sha256; cv=none; b=aosG522SjJJTgaAZBFCHAeG8M5S4hQqf2p2WyhznyUInWwbR05ogrlzMDS9ATBDGFQ1I0J nrWKovHbKxaH/POxuSz+OhmHO/V2jQ5ExiHR2U16msD/1rEEe/u8f4uwAjMboch4ggCxE2 4KW1MFZWdSIpwdhBOgcBxyQuRCkp/kjyQy3UsjozMjt2BNS3H8lEVhGnEkA45fw5CCwXd8 TNWWl+u4tEcKPrfRy1sKcFntePdBPHdHARXQO3DhyIReiIUEr72floNxmxc6OybwPlP8K6 6y1YkwtkqcjS72gt31JfW2+COwauKxpYmF7OKlvS4gXE5R4ZZe7SQFftS7eiAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ygr513Ptzzj4V; Sun, 26 Jan 2025 12:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QCBn76025297; Sun, 26 Jan 2025 12:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QCBnTV025294; Sun, 26 Jan 2025 12:11:49 GMT (envelope-from git) Date: Sun, 26 Jan 2025 12:11:49 GMT Message-Id: <202501261211.50QCBnTV025294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: b0c318efdde7 - main - smartpqi(4): Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0c318efdde7c1b059b26f1ab6d4c75e838b6652 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=b0c318efdde7c1b059b26f1ab6d4c75e838b6652 commit b0c318efdde7c1b059b26f1ab6d4c75e838b6652 Author: Gordon Bergling AuthorDate: 2025-01-26 12:09:34 +0000 Commit: Gordon Bergling CommitDate: 2025-01-26 12:09:34 +0000 smartpqi(4): Fix a typo in a source code comment - s/isnt/isn’t/ MFC after: 3 days --- sys/dev/smartpqi/smartpqi_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/smartpqi/smartpqi_request.c b/sys/dev/smartpqi/smartpqi_request.c index 1c0bbc2a1db5..d3c4fb989a99 100644 --- a/sys/dev/smartpqi/smartpqi_request.c +++ b/sys/dev/smartpqi/smartpqi_request.c @@ -1284,7 +1284,7 @@ pqisrc_calc_disk_params(pqisrc_softstate_t *softs, aio_req_locator_t *l, rcb_t return true; } -/* Not AIO-eligible if it isnt' a single row/column. */ +/* Not AIO-eligible if it isn't a single row/column. */ static inline boolean_t pqisrc_is_single_row_column(pqisrc_softstate_t *softs, aio_req_locator_t *l) { From nobody Sun Jan 26 12:11:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ygr531DLFz5ljMG; Sun, 26 Jan 2025 12:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ygr524Sjfz3x0w; Sun, 26 Jan 2025 12:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWLtCcMi8UAFO+HZA6es9+hre8/iqETxltf6oj9oLxQ=; b=bDLf9S8m08r1+tz6Ed+GjImKf+gioKiQqwErkbWbLkuZ+IE0DeP1zQnFs9pNhupav+aKYE 43SruzkK1eRxNcOf+hiYyz1G1B0EQFvBWJ1csAyEA2Bu0xkUlqAlw0pC4K+hF6d4O8ik3m bOm2FufcnHU0dlKhN+5iZ9gnojIEPsp2htOB8OEDV/DUA8B+4DxiJmiu7995gXdiOSxt+J YASZFazvXWdgYehUh67QJekUeMoYct9OW7EvvK6p/FvUO2O/JAdnJHSqCoAY1Y8EeZpPOT 4L4/jhNUruKe7PNBXgrz7KOAPavT2xdZucJPGFOZr4OsCt9lFj1zgft6LVwoaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737893510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWLtCcMi8UAFO+HZA6es9+hre8/iqETxltf6oj9oLxQ=; b=OVq1Ax8QPDnwb2OMExZA6uwlsUVFaZCheW7bDFkyTujjHytAStBvoAkp1+RGdlEEPBRSrD 81mDfltqZ3+S4APjiGDLcwXRanLVPaKTRb0PFsu/u17ww1595O8tNK9dZMtae7nQ8wtmn4 9T0T5C7uPXpp78m3opN2WbSbIeFh/c320AuH38VB5NmgkiUqdmls2kAcQ01nMazpVH1vt8 EqPbzVbgS08pA/HY501qZQcjpSzrOI58hRjQYw9CtHdRkI0JXTBh+PoMWHDXlqkfR2Sw/3 UpHOXfyOZcsqSjAXT/1B6uBzt16MbTGXKYtA/QdVSCqT2xNwSxiVG1NLCk7Vew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737893510; a=rsa-sha256; cv=none; b=T5010PR36PmH3Wodp5UcKodKbSMKxBnDnKn8rVZhuZZ7qxOKg29vlRX5278lkN6RTTesBl IPXBz6BMrfb/XjHVaLOCgRpC9rSwp8NY9Dbp8mCZtyePZJ4mhUMp+D/xK4LMd49q7D1YAT RMj4/YuA1EOB2FXBv506AxeUg3dA49bwcleCOL7nXTy7RoKsgucTnOu9eEF5Ky3AOhUHMI qE7R2LdbT71MO5aeqHwesR4TcdNyr4cFau6daA6by7itg3e50KFuH4eg5G+eR3fI8qymLs HiBjHg/ltSdgTylLxTyL4rdCgHaRyNNdNxOc/mkuuqXFAVouiwvTIIVGr173JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ygr523yCSzj4W; Sun, 26 Jan 2025 12:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QCBo8q025331; Sun, 26 Jan 2025 12:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QCBoMv025328; Sun, 26 Jan 2025 12:11:50 GMT (envelope-from git) Date: Sun, 26 Jan 2025 12:11:50 GMT Message-Id: <202501261211.50QCBoMv025328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: abcbde5d68f1 - main - net80211: Fix a typo in a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abcbde5d68f1fb6fa21fe2c24e04901a53f15798 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=abcbde5d68f1fb6fa21fe2c24e04901a53f15798 commit abcbde5d68f1fb6fa21fe2c24e04901a53f15798 Author: Gordon Bergling AuthorDate: 2025-01-26 12:10:14 +0000 Commit: Gordon Bergling CommitDate: 2025-01-26 12:10:14 +0000 net80211: Fix a typo in a source code comment - s/isnt/isn’t/ MFC after: 3 days --- sys/net80211/ieee80211_sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index ca06546abdb9..9e4e1013fd2f 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1373,7 +1373,7 @@ startbgscan(struct ieee80211vap *vap) /* * Compare two quiet IEs and return if they are equivalent. * - * The tbttcount isnt checked - that's not part of the configuration. + * The tbttcount isn't checked - that's not part of the configuration. */ static int compare_quiet_ie(const struct ieee80211_quiet_ie *q1, From nobody Sun Jan 26 12:38:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ygrgh6YWPz5ll0N; Sun, 26 Jan 2025 12:38:24 +0000 (UTC) (envelope-from netchild@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ygrgh5jr0z43v5; Sun, 26 Jan 2025 12:38:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737895104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=px3kIxz7Y252xmbT3lpLYmt3x9vSjULT5Z2/Q/b9q8g=; b=igx+WQkcKpj0NXd/zQexdqfpQFhVgtlELOxhRtLePZcewLHnBhYzWrIJNjLmmrnJ3MWP2O bLMyt2YFPZ1UfpsLFxXMm6IY77Awi5slxuJK/PYgklPBJ1lQ/wkqLLXEdIe80USIbGmNh1 TsDVwpj+UeLvh+p+hosDC+Yy/t6QcYNP5BDGr74HkQhrooAgMjjFROByKvN6BKP9cY9qrT 2juZHXL4isTQKiNAXQhUAsHs/K9w2j0L+tt5PEOUJz8pnp09fbPQHI/ZwS8KiSDjXG2fBd iwpmYOSgqCTl3dY9GHstG232/lSOE66ENpLPqM9Y97RMHrVPa3D2KzzeMjtZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737895104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=px3kIxz7Y252xmbT3lpLYmt3x9vSjULT5Z2/Q/b9q8g=; b=yw5EBfuNt3H57b8pmnfG8k1Az2M0d8WIzZ069OO/KQ/VhVDUn27SzqdrcM9MrkB4/WgM+F qTa6K2TOve+T/j57xlEnbyoPOp98U2ZhczDaJvYX/Al2Q948XCixj8lupWhaZmVJUAm0F8 f4eugbwvivrSxB3rDWW5d3+wlWzJ1ob8upOm+JuiS3Uujpao4vb/1FPChNPAWs92uo2sdK RUikaTJJd2/A0nY5ZoSzdS5kYGrshO7eijydewUQGR6Qyc6V6phaa74dmbr/s5zWhdw3U5 +FUKPY2VpIlTGEKUsdJsE+lUO0kG1h7aPSrVqGDrhy+X0yOHoMwWG2gSGAQEWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737895104; a=rsa-sha256; cv=none; b=omxLR/sxkkKRjwp1ZyqVa2BBB2cTyy9SPIqE1WOtU8fjE40lP456F+niVgwlo0sg5NO6Hc lzaeXX4c/xvSUFRq5UhcErj7BLLv5VLIW173+8UMKPKufSiwBxNea1Jrs+r9Jay+zqr0Uy wLmekjhyhAcDE3RP2Q4/eKxCXOWUn4CFhCgPmrmszlPpXK4DjClWtVAdLPKVwoMPpvRIAY i5F3ShXKY8cWMN50sljCRaEpDBo0D/Pt+Vf9I94dZnwBqrtFxJIhagc/gZkLmjEDyI8Pud XNGtkfpxfHs/K5wX3mBp3FrjiSeeWvPPFs/d+B++FuhcTMdtTXz9jB1IIsuE7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b165f59.dip0.t-ipconnect.de [91.22.95.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "E5" (verified OK)) (Authenticated sender: netchild) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Ygrgg2ZJzzvHM; Sun, 26 Jan 2025 12:38:23 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from webmail.leidinger.net (roundcube.Leidinger.net [192.168.1.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: alexander@leidinger.net) by outgoing.leidinger.net (Postfix) with ESMTPSA id 557037AE; Sun, 26 Jan 2025 13:38:20 +0100 (CET) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Date: Sun, 26 Jan 2025 13:38:00 +0100 From: Alexander Leidinger To: Jessica Clarke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag In-Reply-To: <6C70A3E0-CC6D-4B0B-96A8-70636F08AC6B@freebsd.org> References: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> <9fec6bfae287dfc123a359c3e1164ae2@FreeBSD.org> <6C70A3E0-CC6D-4B0B-96A8-70636F08AC6B@freebsd.org> Message-ID: <3e0e88c0031d9c3e1f6232f2949f8909@FreeBSD.org> Organization: FreeBSD Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_5085ee47075ddbc0f028b7423686aebd"; micalg=pgp-sha256 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_5085ee47075ddbc0f028b7423686aebd Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Am 2025-01-25 20:21, schrieb Jessica Clarke: > It looks like with Clang we end up using -Qunused-arguments so the > warning/error is suppressed. That at least means the build doesn’t > fail, which I suppose is good, but I’m not sure we should be promising > that WITH_SSP will protect against stack clash then having the compiler > silently emit unprotected code (for which we’re to blame, by telling it > to ignore the fact it’s not supported). This at least needs to be > documented that the protection will only be provided if supported by > the compiler. Like this? diff --git share/man/man7/mitigations.7 share/man/man7/mitigations.7 index 4db6589cdcf1..82a8e3a2c1c2 100644 --- share/man/man7/mitigations.7 +++ share/man/man7/mitigations.7 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 25, 2025 +.Dd January 26, 2025 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -245,7 +245,7 @@ and it is possible that some applications may not function correctly. supports stack overflow protection using the Stack Smashing Protector .Pq SSP compiler feature, -and stack clash protection. +and stack clash protection (if supported by the compiler for the given architecture). In userland, SSP adds a per-process randomized canary at the end of every stack frame which is checked for corruption upon return from the function, and stack probing in Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_5085ee47075ddbc0f028b7423686aebd Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmeWLLoACgkQEg2wmwP4 2IYDzw/6A11VzeYbkFH/RqFHF+IzX47mBT7YUzNqB9Ipf0ahw3STb6irrjpkPNVD Jc2SL77VkRgBLR5aadYgPSpuTUeT/tfZMg0J40erZZn7+VAdDlYHpz39zzVAXDPe c5NJA98IE4JpiKn1J2h24j44a6mYIhTL0j94UsUJiw4yMV8qyRlwd7hRinK/qcC+ jw/5xQnKruM8W06S4+3EOwO/Dnx4CSlQOQAE75FskArRXDpb5wraUUM4oVRriWHf rzQU3XEp9cjjEn+BqQ03yzeClKbzWf9L2+gGcTriFDAn/LlQw0yYHjaNsrGZkBX1 H7mgdaUXanjnn30upYhhaQWG7WFTmpyso2neg3K3lMhiZLjQlWeJsqymeMS00VAV nvlVvLwsBMFJpMXYskF5g/v42nUOxl2I25IzdBy7aY+z6CHRQdSyR3y3eeBFj43n ZmUWlh9+QqIqb4yEpzaAds9wjjK+f4KRT810WlXrZMqK3k1bmWhzjZvqwy3gE4uR zJExfTk2B2gTNn6IB7aGfcpmyv7jG4d1OsRZyPmJtoQP9u/g9FG36irgQ3feP1jL EtzCI8w8IAozZbCzzY9Bz3OmI/6ckKOxZIDV88Z1rC6KOxT46qw4H4iHvGIC+02I sZO3CgVIn61fGfAslyrnhA27ibL8assvjmXGTD01X1WPZuqIJkA= =ORyb -----END PGP SIGNATURE----- --=_5085ee47075ddbc0f028b7423686aebd-- From nobody Sun Jan 26 17:36:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YgzHR5G1Fz5m4kP; Sun, 26 Jan 2025 17:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgzHR4gYWz3sBS; Sun, 26 Jan 2025 17:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737912979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ztdmw5560le/0j3HaGoIt0ixrYlz0jTT2YIpvOTAAM4=; b=nspKFJBmGAfAxicVzm2OlAMPsmrHjLoa5lroPhnF0DshfXGsa709Mqd9dKdiLp/Efoowhn 4iyvJeKqpTvURQj4FWAvY8Wm74Eu/4vLu7XXr2DA2oBsuzb+kwTEcJEuNr9U8HyyO5NK7y 75gBGNm+gPUJCtT9wK9VJXd4LqNDKIQN1HEKRbyrpsue6TIyHZT3W3DHop9/4o9u8hRquz 9FTt2vfnmd0npHrw7CYgVnsnTSPYjM9Al8gLoquqNcBdfqoND/Eh9tS7Q/u1kwV73iytfS LfEaH8gyClCJ4zmj1KRZzux0stnjYWUu/jVME9y++fZ4+1hyK3CdB4OyOon6Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737912979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ztdmw5560le/0j3HaGoIt0ixrYlz0jTT2YIpvOTAAM4=; b=nF6Jj4kHPftE44pa6K8ZvYxehDEESGPulc+cymUCw40OsXjp3xntoWcioitz+jZ4pSRBHr Uvs2cOTcmrERC6iwQn+xQY3PvnlKRJkHd73u/bWPEne4TFqMD5Y+u57sJfu8zWlzgB3Xh7 YW59ZBoA+Jkatd4DSQvpjnPc/ujosx2vJnk596I9IgoiUHVeIXmkDFexB7b+Mfw9XdGgg7 1/m2+ozVAOV60CsabwUV0NtqK7FwkWehuGJMeolYb+Pcro36tG3xbYi3znuGSUerxH4lnI /uniS8XTUtK1Qa+MuvOC4plNRYs505v5xKnsUGv67+OL1JENbq7FvpmN2xmVTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737912979; a=rsa-sha256; cv=none; b=r89EcbGLr9Ox2m/ExN/CMktbprTkBfArQEWNoKLcxym3nZ84VMp4z287U0ldMytzGu1ptA wEZW76v4kAcR2USWnotL0mqy+X85+iCL0C0pz9eeI77X3KBQ9zYt0lDvykEw9hmZ3sUunc KRuuROQhBGN+3cx1/uY7XS7NuxjLv6TLBRQtlnv7yOasY7dfV/OQETHT+pDXyavipz+LHF PO+AqTjLT1VAkBFmEHJ/mpac+WinxoYc7L5lzE92vulY0O+dhdPf3bv5kYCj+pL23nI7Vt fYR7kq20+UJ9a6IiGaO8OkSRNQXWljjFh5OXnkWaXJSaFUOC5LXgsklvoHwvdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YgzHR3nHTzsQT; Sun, 26 Jan 2025 17:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QHaJZ2028480; Sun, 26 Jan 2025 17:36:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QHaJqt028477; Sun, 26 Jan 2025 17:36:19 GMT (envelope-from git) Date: Sun, 26 Jan 2025 17:36:19 GMT Message-Id: <202501261736.50QHaJqt028477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 68206add1173 - main - kyuafile.5: ATF metadata mapping reference List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68206add1173920065092c06eea40c90bb73b5c5 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=68206add1173920065092c06eea40c90bb73b5c5 commit 68206add1173920065092c06eea40c90bb73b5c5 Author: Igor Ostapenko AuthorDate: 2025-01-26 17:15:32 +0000 Commit: Igor Ostapenko CommitDate: 2025-01-26 17:15:32 +0000 kyuafile.5: ATF metadata mapping reference Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48190 --- contrib/kyua/doc/kyuafile.5.in | 45 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index a667f5dc2816..4fe5f12fd9b1 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -122,6 +122,7 @@ of the test program and a collection of optional metadata settings for all the test cases in the test program. Any metadata properties defined by the test cases themselves override the metadata values defined here. +The mapping to ATF metadata naming for each property is provided below. .Pp .Em Plain test programs are those that return 0 on success and non-0 on failure; in general, most test @@ -153,10 +154,16 @@ The following metadata properties can be passed to any test program definition: Whitespace-separated list of machine architecture names allowed by the test. If empty or not defined, the test is allowed to run on any machine architecture. +.Pp +ATF: +.Va require.arch .It Va allowed_platforms Whitespace-separated list of machine platform names allowed by the test. If empty or not defined, the test is allowed to run on any machine platform. +.Pp +ATF: +.Va require.machine .It Va custom.NAME Custom variable defined by the test where .Sq NAME @@ -171,8 +178,14 @@ in it, you will have to use a special Lua syntax to define the property. Refer to the .Sx EXAMPLES section below for clarification. +.Pp +ATF: +.Va X-NAME .It Va description Textual description of the test. +.Pp +ATF: +.Va descr .It Va execenv The name of the execution environment to be used for running the test. If empty or not defined, the @@ -220,6 +233,9 @@ All non-alphanumeric characters are replaced with .Sq kyua_usr_tests_sys_netpfil_pf_pass_block_v4 is an example for /usr/tests/sys/netpfil/pf/pass_block:v4 test case. .El +.Pp +ATF: +.Va execenv .It Va execenv_jail_params Additional test-specific whitespace-separated parameters of .Fx @@ -242,6 +258,9 @@ configuration. It can be overridden via .Va execenv_jail_params if needed. +.Pp +ATF: +.Va execenv.jail.params .It Va is_exclusive If true, indicates that this test program cannot be executed along any other programs at the same time. @@ -251,19 +270,36 @@ value of a setting, must set themselves as exclusive to prevent failures due to race conditions. Defaults to false. +.Pp +ATF: +.Va is.exclusive .It Va required_configs Whitespace-separated list of configuration variables that the test requires to be defined before it can run. +.Pp +ATF: +.Va require.config .It Va required_disk_space Amount of available disk space that the test needs to run successfully. +.Pp +ATF: not mapped .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. +.Pp +ATF: +.Va require.files .It Va required_memory Amount of physical memory that the test needs to run successfully. +.Pp +ATF: +.Va require.memory .It Va required_programs Whitespace-separated list of basenames or absolute paths pointing to executable binaries that the test requires to exist before it can run. +.Pp +ATF: +.Va require.progs .It Va required_user If empty, the test has no restrictions on the calling user for it to run. If set to @@ -272,8 +308,14 @@ the test needs to not run as root. If set to .Sq root , the test must run as root. +.Pp +ATF: +.Va require.user .It Va timeout Amount of seconds that the test is allowed to execute before being killed. +.Pp +ATF: +.Va timeout .El .Ss Recursion To reference test programs in another subdirectory, a different @@ -450,7 +492,8 @@ but required_user='root' metadata property reminds that the jail execution environment requires .Xr kyua 1 being running with root privileges, and the test is skipped otherwise with -the respective message. The combination of +the respective message. +The combination of .Va execenv set to .Sq jail From nobody Sun Jan 26 21:27:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yh4Ql3RMgz5lbwC; Sun, 26 Jan 2025 21:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yh4Qk5VMbz3hfQ; Sun, 26 Jan 2025 21:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737926878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zA6k6vWExKoGr+8NeVSj2E1P6soXprgkvB3wPxzv84M=; b=en9RRjXDGoCtenI8uow1r3rF73OVD59KXlDXMDO+ETBCgWkXLcmV6iZp0TvKRRoar99Bnc zWk8a31SZQU2IIRleLPUiLKcIRkyOaZJkhUJCGBTOzlB2eWtPdwq3+kmgMfOzgHST17ozJ Y2uTdwJs62k2Zjc4g5dIl/5yXkgq9ddPOz1uKbudgFBOeD/FhTVlGPsRVCppGtr4+CgJjT Sa1X+v0F4vCGUCXvXNc545aAh9BecFShuWF7ZNpH54qzYTaro/1U3hJQm62RtFJe0m2xHJ gmqQ4QryzpEIHprvG+JGwyOGBPaGssQXWYO03hY/d6R1B2f2CB1B3eRN2VAcZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737926878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zA6k6vWExKoGr+8NeVSj2E1P6soXprgkvB3wPxzv84M=; b=Wx6LHjizcd9gczMS6CXEYPEPXyxIDXP/rjT4xAjZCwKd3J+znT9/6wGj3b4gktdUR15+3L 7670UK+xFUc7l0y+RvEsmYlNvNevz3QJsMI7tCNsZZZikvi6eeNJk47g5XhpywbaO6q2ub KHtspm0kxHOKW7YUIOv3dLdkQcvP6+kb8D97Aml/X3/eeFgFIP7H5AIIdvbZ35mFLHSVIA m9a5xa+iUJRTYASRXaErJNik3lleiL6oKCsDG4aIvAAzOMneoAI1Npt6MW8P5EDNTI1Uok 1rhBXzqtz5MlM2bW4vPojU/1xkU5nrru7MmA/DbTLoyQE7QyOJugUcQoQAyi+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737926878; a=rsa-sha256; cv=none; b=UGzB2XvB0WdVqDXtoQ+YtXML5DdfzTTxtXAJR4PfDPu1yeKlVkvbDCUtuzS2MtxstGaEOn rewtIq5FPhF9ulh4qEOT7KnZwhsO/PGFt5DRVgpfVbUTkPvXZ5QTLFu15WNiJ1OCCaqoPg NqvD8zqrzeS3400DUcMt71nadjV0xfoUbYc/Gvxcd/rAUdK1kBk2XkZHCMblhxNvOGn/NH zKwDBcbKCTZksN6XVm2by6Ss3e07f/fv0lsJtuDnMY4qiZ3Lyfrlg+kMDB23nrcNOy7DAi RBWaRqBTLngu6UoYGG9LLMeA3Ofq3VC0w/FBIQa31xuKEvR/uOeGD3Eh/ySsFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yh4Qk4NQCz10gw; Sun, 26 Jan 2025 21:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50QLRwB2059022; Sun, 26 Jan 2025 21:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50QLRwdf059019; Sun, 26 Jan 2025 21:27:58 GMT (envelope-from git) Date: Sun, 26 Jan 2025 21:27:58 GMT Message-Id: <202501262127.50QLRwdf059019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Austin Shafer Subject: git: bd0510a4213e - main - Add myself as ports committer with mentor kbowling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ashafer X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd0510a4213e34470a6987f51a5d89958550963e Auto-Submitted: auto-generated The branch main has been updated by ashafer: URL: https://cgit.FreeBSD.org/src/commit/?id=bd0510a4213e34470a6987f51a5d89958550963e commit bd0510a4213e34470a6987f51a5d89958550963e Author: Austin Shafer AuthorDate: 2025-01-26 19:06:06 +0000 Commit: Austin Shafer CommitDate: 2025-01-26 21:26:20 +0000 Add myself as ports committer with mentor kbowling This completes step 5 from Committer's Guide. Approved by: kbowling Differential Revision: https://reviews.freebsd.org/D48695 --- share/misc/committers-ports.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index f13e6d3a7984..3fd8d12796c6 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -35,6 +35,7 @@ alonso [label="Alonso Schaich\nalonso@FreeBSD.org\n2014/08/14\n2017/08/07"] anray [label="Andrey Slusar\nanray@FreeBSD.org\n2005/12/11\n2011/01/14"] araujo [label="Marcelo Araujo\naraujo@FreeBSD.org\n2007/04/26\n2020/11/03"] asami [label="Satoshi Asami\nasami@FreeBSD.org\n1994/11/18\n2001/09/11"] +ashafer [label="Austin Shafer\nashafer@FreeBSD.org\n2025/01/26"] avilla [label="Alberto Villa\navilla@FreeBSD.org\n2010/01/24\n2018/10/01"] avl [label="Alexander Logvinov\navl@FreeBSD.org\n2009/05/27\n2013/12/02"] az [label="Andrej Zverev\naz@FreeBSD.org\n2005/10/03\n2019/11/04"] @@ -546,6 +547,8 @@ jrm -> michaelo junovitch -> tz +kbowling -> ashafer + kmoore -> jhixson knu -> daichi