From nobody Mon Apr 1 02:11:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7Dz131c8z5GxHQ; Mon, 1 Apr 2024 02:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7Dz05tq1z49VT; Mon, 1 Apr 2024 02:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711937500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N38aq129gxwc9ngT595oPbzrsRZ0zJhGQOkGXSjU7oo=; b=JLN0cF831q7kMudNPjZRLz8WfM7cSkcC5s4xPMN0rw0vtUzatC5hJ8zpsf/vA29GcOdwEh Brl9bw7Dtbami0HobTpc6cxxNlxb/JPFaGdKyC8ykSYpCm2zS9yEQnfB3WEyW8w5eT46L1 sNpO6MukiVjcnqaq7Z7eeLqWHU8kUoasdFrRgnl7kZHthYkkNrTv0cAw0RaCIKdfD6LnR7 H8U0jzxh+QcVq0iWY4YnmJXJmLnKtiN19ZhKaGlDfsWIWpfZrCENfwlBnTcU32eXezacs/ g4ZcDUre/C48cpLWZy4qms7DBCzdctjIO2NvSQB9/sas2ekpetdtfhVt57yWHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711937500; a=rsa-sha256; cv=none; b=I9YwR0ELLjr9hv1RkUp6giCLhJm1LkF2qtYcES9jkvDxx5MYerIHGg2zqfDKzGR+5mGSvL 88ceF2hbD2KQi3bk5QxaUPSEOTjQIhX/gEnXmsYaSfQ8ZhA1lgJbKoWHn0dAE6TvXY93su L86kUX3DSTYTex2BloxZFiAk7PP2U4VCayiwGJviBZYGJMMeMF8d7ak1Z85dt0/9v/dY0a mxzu17YjjTXRuzAD/QgRqCHtfrlo3V2n3i+z6yPUJDStcLlyTRVS9z0d8dZOOWALrOHhU2 Uy741d0ODQxkcfZzB8m9GUXpGuPKsHF1PzySU5wjA7VU4G2sgjJ/CgqlOXtLXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711937500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N38aq129gxwc9ngT595oPbzrsRZ0zJhGQOkGXSjU7oo=; b=HWI/uAnZET4WoBRmQtR3puLaZe9yVAANfSGiMoNNEFL+5th0ARAGcT5ODtCLvf/TykufhI XE3JdyidpPp1E3Pqcm1qYryoDcFXMEluvKEZRItuxr0alxbDwQgMmuHoR7dLpVz1zH+yzM V8DGRJ9iC4s9wRByzktYAW30H8h58o8Y9PX8vhNCGKunkpOHM3HUZhnaMKJqANCVnYyXcL spqxlLL+m0lKRm2gPn+XlZbOx6aB6Q64HczoiBHDyTOPnvyzEDNM4AFYM1KOs4IDjDEh3x 3Em1tJRtw/xeMkTWbFKbg5VRNOr0EySkwbyYCZ7oJodmTQNAbS9DqrKX+ccVpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7Dz05PWNz13F4; Mon, 1 Apr 2024 02:11:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4312BeBv090808; Mon, 1 Apr 2024 02:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4312BepR090805; Mon, 1 Apr 2024 02:11:40 GMT (envelope-from git) Date: Mon, 1 Apr 2024 02:11:40 GMT Message-Id: <202404010211.4312BepR090805@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: 71f16d2efe7e - stable/14 - nfsd.8: Document ways to minimize Copy operation times List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 71f16d2efe7e9e6ba15620d5ecf6c22051feebfd Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=71f16d2efe7e9e6ba15620d5ecf6c22051feebfd commit 71f16d2efe7e9e6ba15620d5ecf6c22051feebfd Author: Rick Macklem AuthorDate: 2024-03-18 22:40:41 +0000 Commit: Rick Macklem CommitDate: 2024-04-01 02:10:40 +0000 nfsd.8: Document ways to minimize Copy operation times For NFSv4.2, a Copy operation can take a long time to complete. If there is a concurrent ExchangeID or DelegReturn operation which requires the exclusive lock on all NFSv4 state, this can result in a stall of the nfsd server. This patch documents ways to avoid this problem. This is a content change. (cherry picked from commit 8f13abb4fd2f3c5d25bde830607a4aec6cec42d9) --- usr.sbin/nfsd/nfsd.8 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 0a9f6f82c85f..1c04bad3a042 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.sbin/nfsd/nfsd.8 @@ -27,7 +27,7 @@ .\" .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" -.Dd March 22, 2023 +.Dd March 16, 2024 .Dt NFSD 8 .Os .Sh NAME @@ -355,3 +355,25 @@ to be set to one on the MDS as a workaround. Linux 5.n kernels appear to have been patched such that this .Xr sysctl 8 does not need to be set. +.Pp +For NFSv4.2, a Copy operation can take a long time to complete. +If there is a concurrent ExchangeID or DelegReturn operation +which requires the exclusive lock on all NFSv4 state, this can +result in a +.Dq stall +of the +.Nm +server. +If your storage is on ZFS without block cloning enabled, +setting the +.Xr sysctl 8 +.Va vfs.zfs.dmu_offset_next_sync +to 0 can often avoid this problem. +It is also possible to set the +.Xr sysctl 8 +.Va vfs.nfsd.maxcopyrange +to 10-100 megabytes to try and reduce Copy operation times. +As a last resort, setting +.Xr sysctl 8 +.Va vfs.nfsd.maxcopyrange +to 0 disables the Copy operation. From nobody Mon Apr 1 02:17:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7F5S2hcbz5GxlT; Mon, 1 Apr 2024 02:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7F5S1tzdz4BsG; Mon, 1 Apr 2024 02:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711937836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x0y1Rk67ZktnnbzUn/SdhCuMpvd1OfPhPLedj8bPc80=; b=I/v95hBAvZM3Me2vxn3kQbhTGj7S/d8EE41t8dGL3Wj8nouKzOY/x1x7orUvgzUK51gQNR M6GL7QE1+8FMTZUrlvdNtpoioyJB2bz3+5Bbtbx8jvSJT0JRCEAted/PHFpoeNyz3o6LSB W1hJDHEGJ52/TbkQ9/oNH5olLwTbV4fbiewMishxmPhvg9AVj57XZmy8f8wETF1zB7GiJC +02yukxwSvtylGQAxofaF3PvowlZxjrCVivGP+m4bvRd7P+sXCuWPxAJ+lW5LiDa3JB25L D3qbCyodsoiDjisN+zz5kFQlnTjQA5vE0InzTCLW3jZbNBun8Tp8dw9zoWYFkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711937836; a=rsa-sha256; cv=none; b=S8jFdvUKu18656JOJtUyCTBavXK5al9sjx3kOEAaV/MP/3LnHbGlsxsKAzCXA1uchwimRs V84vLL6baMa657G0ARDvIpJhsat3Aq6kbWHZLLv8k9ZlWndxqEix+FPS9pdNaLiFf1QKip eVilB2i4m3dDACz4Wau4Tdvn0HQuGWRkrMCABGIdW8eHlMfwZAAdv6dIoQHC+NLNUNSBXk 6xMtuuIqzDpmYKhoOGnL6QIbVeRyYryji9NggnL/paOn7m4vICvTaPElLYndOlpVFM7bXO Sc1tHMPv4+4SZssbbZnMl5E0XOACK04wD5k7K7abLeBHa7GgDErhbqDr5yEu0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711937836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x0y1Rk67ZktnnbzUn/SdhCuMpvd1OfPhPLedj8bPc80=; b=kstxErgzP8hQVKqTSmmCZFqRBA5KRwOPLU96A54yRTHZD6KsQt/8t7FnCxUlGch3FSeUJf F8qnIytMcSvUYSkVhzLRSI7TX74XWvZIQCy2EStvcKsbeblfJ4fzTFrOmw0X31gpn/z+OR 16CCYMm/BW3Tw51PJZTLjWLDISsc/+tWyHdrwj9qIcPlao+3PupI5QUns4KoL/aep9P9l5 eoD9MbZIt35aETcX9qi+HLns1Hm/3UpWodYCxWPytSAkN/5P0mAA7dSY2Nrje0GPlAuJl8 iXBLkRqnYbaAmgV5LhMG313HnGcQ1oVvmxKL2r1Kg9NMkibkXRhSBv12s7niBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7F5S1VlKz12pV; Mon, 1 Apr 2024 02:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4312HGe3093509; Mon, 1 Apr 2024 02:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4312HGRp093506; Mon, 1 Apr 2024 02:17:16 GMT (envelope-from git) Date: Mon, 1 Apr 2024 02:17:16 GMT Message-Id: <202404010217.4312HGRp093506@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: 23a48a469a4e - stable/13 - nfsd.8: Document ways to minimize Copy operation times List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 23a48a469a4e6ce7b69620084513a7bf9b0fb939 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=23a48a469a4e6ce7b69620084513a7bf9b0fb939 commit 23a48a469a4e6ce7b69620084513a7bf9b0fb939 Author: Rick Macklem AuthorDate: 2024-03-18 22:40:41 +0000 Commit: Rick Macklem CommitDate: 2024-04-01 02:16:36 +0000 nfsd.8: Document ways to minimize Copy operation times For NFSv4.2, a Copy operation can take a long time to complete. If there is a concurrent ExchangeID or DelegReturn operation which requires the exclusive lock on all NFSv4 state, this can result in a stall of the nfsd server. This patch documents ways to avoid this problem. This is a content change. (cherry picked from commit 8f13abb4fd2f3c5d25bde830607a4aec6cec42d9) --- usr.sbin/nfsd/nfsd.8 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 0a9f6f82c85f..1c04bad3a042 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.sbin/nfsd/nfsd.8 @@ -27,7 +27,7 @@ .\" .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" -.Dd March 22, 2023 +.Dd March 16, 2024 .Dt NFSD 8 .Os .Sh NAME @@ -355,3 +355,25 @@ to be set to one on the MDS as a workaround. Linux 5.n kernels appear to have been patched such that this .Xr sysctl 8 does not need to be set. +.Pp +For NFSv4.2, a Copy operation can take a long time to complete. +If there is a concurrent ExchangeID or DelegReturn operation +which requires the exclusive lock on all NFSv4 state, this can +result in a +.Dq stall +of the +.Nm +server. +If your storage is on ZFS without block cloning enabled, +setting the +.Xr sysctl 8 +.Va vfs.zfs.dmu_offset_next_sync +to 0 can often avoid this problem. +It is also possible to set the +.Xr sysctl 8 +.Va vfs.nfsd.maxcopyrange +to 10-100 megabytes to try and reduce Copy operation times. +As a last resort, setting +.Xr sysctl 8 +.Va vfs.nfsd.maxcopyrange +to 0 disables the Copy operation. From nobody Mon Apr 1 07:34:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7N7c0JYYz5Fqk5; Mon, 1 Apr 2024 07:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7N7b6WjGz4k6B; Mon, 1 Apr 2024 07:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Dux3zrwOGtt5R3l+cIy7iNZBn7eWD7GPIzfQC2DjPc=; b=e+So13rsYvwe2YwSip2YQ1fMUv6RcVNfLqzp4IEx+DBxzSiwQl4PH2749DD/Qer/19uG9F WJDW7YUNfpsCOMLs5qoXqoVxlvxN4uhMvt8Gpr1YK8otX5GbJmjDK+XouD9UC87fpPtKbi BaeLuMrnyRCAFtTiDsbdDn/LQhiOu/Sc/t1FAElOmRS8UcCukrPwFTW9lDWJUsQuIZNGIt Sqb2VGtbih0qlYZD6CLiyqN0C6wssf8wWuyXvUFfxISpNwsCvggZ09vW5xF8XHGTYEIvbY 1/l5WBU/OMxb9w5e1Id+yliZqPr1UqrnQwvEKTUNie64Avg7UOnQAA+l/sDEvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711956875; a=rsa-sha256; cv=none; b=gBtxi6mSljWfsBhgljTBy0ZQuvIzNLsXm+4PknbIXR8O+zqI0R6hKJgS5q0QsDwVveQkAT F/QjismOFzICSSFQAM2rH4EY3T0EWg158B4p+ZREJkZ+x4vZlwpRp8T5IuhbmouAcAt42i G50uBT/OQFRigIsGuuq4uOs/7jyNPufp/pcatoigJuSQY4Wtpsaec9Kdo+Ezndbc+b/cYj agJnpw8wuri+RmXYC2aX9jKxsCoHpA7Pa9ktPotnVVV9cxIu0Z16Y1v3dhuAR/jfEhBSyz h661O1qpPYPdPAM1l/58mvIPI3THm4MpUciY5T9H0A1yqKC2mXoBs0cWyHSYPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Dux3zrwOGtt5R3l+cIy7iNZBn7eWD7GPIzfQC2DjPc=; b=oOovrqnoogKAoyZl0a2s93JbXmxRaLgooMFuSq2HlSdtQdM1AIiFnWA3R2m21qharPs1UF xGzmyATtQ56hmdBRWnWGPVFJSnEflp5Cf8WNP4uR+b665OmzbmIKbWoVebfMtV+X5q49vY MDogYRUKs+JtMnbylNFrAA7g4KUxZUMBLDlk2aIGl8W1Cjk12FPxlqlJlUw8E7udBr+l/R YkIbVCwsQS9LvCdk80+vqob8YuwvdT+naPWrmL2czZv1+gArJzRNb7/lFfcRDmLw+1dzKE 3GUhpYxQK8jCMYQ6+LTjqyPsASdoV4Sd6QbbgBnZa3/wTKXHGIc64UVKJ6Boew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7N7b67CWz1Bym; Mon, 1 Apr 2024 07:34:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4317YZnT037611; Mon, 1 Apr 2024 07:34:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4317YZke037607; Mon, 1 Apr 2024 07:34:35 GMT (envelope-from git) Date: Mon, 1 Apr 2024 07:34:35 GMT Message-Id: <202404010734.4317YZke037607@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: 0ade521bac78 - stable/13 - pfsync: fix use of invalidated stack variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 0ade521bac78929941081b6757e45316befd79f7 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0ade521bac78929941081b6757e45316befd79f7 commit 0ade521bac78929941081b6757e45316befd79f7 Author: Kristof Provost AuthorDate: 2024-03-24 08:46:31 +0000 Commit: Kristof Provost CommitDate: 2024-04-01 07:33:36 +0000 pfsync: fix use of invalidated stack variable Calls to pfsync_send_plus() pass pointers to stack variables. If pfsync_sendout() then fails it retains the pointer to these stack variables, accesing them later. Allocate a buffer and copy the data instead, so that we can retain the pointer safely. Reported by: CI KASAN, markj MFC after: 1 week (cherry picked from commit 81debbd60e5773e812e9227a2003ea88699580be) --- sys/netpfil/pf/if_pfsync.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 939a4d5451a9..a08a8334683a 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -419,6 +419,9 @@ pfsync_clone_destroy(struct ifnet *ifp) MPASS(TAILQ_EMPTY(&b->b_deferrals)); PFSYNC_BUCKET_UNLOCK(b); + free(b->b_plus, M_PFSYNC); + b->b_plus = NULL; + callout_drain(&b->b_tmo); } @@ -1557,6 +1560,7 @@ pfsync_drop(struct pfsync_softc *sc) } b->b_len = PFSYNC_MINPKT; + free(b->b_plus, M_PFSYNC); b->b_plus = NULL; } } @@ -1669,6 +1673,7 @@ pfsync_sendout(int schedswi, int c) bcopy(b->b_plus, m->m_data + offset, b->b_pluslen); offset += b->b_pluslen; + free(b->b_plus, M_PFSYNC); b->b_plus = NULL; } @@ -2287,13 +2292,21 @@ pfsync_send_plus(void *plus, size_t pluslen) PFSYNC_BUCKET_LOCK(b); + MPASS(b->b_plus == NULL); + if (b->b_len + pluslen > sc->sc_ifp->if_mtu) pfsync_sendout(1, b->b_id); - b->b_plus = plus; + b->b_plus = malloc(pluslen, M_PFSYNC, M_NOWAIT); + if (b->b_plus == NULL) + goto out; + + memcpy(b->b_plus, plus, pluslen); b->b_len += (b->b_pluslen = pluslen); pfsync_sendout(1, b->b_id); + +out: PFSYNC_BUCKET_UNLOCK(b); } From nobody Mon Apr 1 07:34:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7N7c3Ydrz5FqpY; Mon, 1 Apr 2024 07:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7N7c2ncJz4kMP; Mon, 1 Apr 2024 07:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BhoVhRDOmuklbYJafNPgym+h00R78tBluonLl1lYlmI=; b=vdKVP3OOJ8QGZnHD5E2H5Lr0Xui/tF5yg6pCx5o9vs2v2oyy5zP/QOfn9d1oY0q2OGoL3X 8dLGVKFBbY05a381eSv1qgzhSWHO8U/Ir0k3SpwEsrTMo1/orMc0+7sVUHYQ8b6UjuHK1z BN36I0plzrJc212CfDWW47eKyfqB85KydbCfTQ8rJVJXx6E0EJ8Kp5gEwXR/wQs8ocVdCd JDGVTmS48HBUdJJykLg9I+ynEZjOxJ8U9xfTr3/afeIpeuzZRAvKCO8LUkTz8jzhTLGBt9 ML+Q+cIIAZRF5jU0EJ019XMzXSYVGzWIh+JLOuQW36w8ZqSYc5YdyyVvV9y0HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711956876; a=rsa-sha256; cv=none; b=QvA93uDRksO08lFq6ZtYSS2wyOj3wET6NkSBoiwtdC7wv+YJTK4Y6iokKHhiWz5HgtQtRi DKYafQVCEvq8p7gB7mVUoKDpyHLcCtULg2Hn0HacHhqfQFioAogh/j7IQc14dNSc5A156R NE7lXAY3f+f9BOA/SR/nx4Wppn7dadzoaIL1V2qQMzFdRUobZSIgGIv6DKK6J6B6tr2jSk EHYzYdv1sWHQeR89R+Zf7gzP7kURPYMcAUFrt4oHA6Vkodpe/TImGNrYxw4MiaWwDctvqK YxMehYn1GOEYVGeT+dXcwvhQvmwHlA2RxZNf0uDwApgU337kMpyX4BfvXnq4KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BhoVhRDOmuklbYJafNPgym+h00R78tBluonLl1lYlmI=; b=cmx6CguvB7BVECXY1ePxVqRCZ09qWo0IiV5oG2AJC+tcy8MyRRzoscHVreumii1MNxwMfg DQhIh1n9cZcqV2V2oGcj3qLT1+Z7xRRQk90dATetGF3y3hj8PBS+ahDeA6GqrK7Xe/djaG dCcbVfqn6iblB/FzMTorAAQh9IymhHp3PvqAZEO8XvSkXX44Y2lEX4TvXMetbnZTpdgZ9D mHSKC9U8qxFBLIcM63LD7ytep2LNnVq3XHcQ2ZAqojLCwxPPhXE6bWLtkQZGw7I2S4U455 Fzhut+XxjlGsEcUH030M30NMBsd7edE4G7Bz8Tiz5DBA9MPtcwPT9U9Rt8DXIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7N7c2Nnpz1C8Y; Mon, 1 Apr 2024 07:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4317YaG1037708; Mon, 1 Apr 2024 07:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4317YaWQ037705; Mon, 1 Apr 2024 07:34:36 GMT (envelope-from git) Date: Mon, 1 Apr 2024 07:34:36 GMT Message-Id: <202404010734.4317YaWQ037705@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: 2fed983ceb66 - stable/14 - pf: fix use-after-free List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 2fed983ceb6678fbe2facb20627248a5fae6cf7a Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2fed983ceb6678fbe2facb20627248a5fae6cf7a commit 2fed983ceb6678fbe2facb20627248a5fae6cf7a Author: Kristof Provost AuthorDate: 2024-03-23 16:02:50 +0000 Commit: Kristof Provost CommitDate: 2024-04-01 07:33:32 +0000 pf: fix use-after-free If we fragment the packet in pf_route() the first transmitted packet will free the pf_mtag we have stored in pf_pdesc (pd). Ensure we update that pointer for every packet to avoid using a freed pointer in pf_dummynet_route(). Reported by: CI KASAN, markj MFC after: 1 week (cherry picked from commit a1ecbc57011758257b85c3e9f51efc93ac93169d) --- sys/netpfil/pf/pf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e19370cc7333..b0b0a02afaf4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7374,6 +7374,7 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, if (error == 0) { m_clrprotoflags(m0); md = m0; + pd->pf_mtag = pf_find_mtag(md); error = pf_dummynet_route(pd, s, r, ifp, sintosa(&dst), &md); if (md != NULL) From nobody Mon Apr 1 07:34:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7N7d2NRrz5Fqxl; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7N7d0QZgz4kGH; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCELliUr/OHnQbBUgtDozNb9GJ2IxZNck/o6hfiIBzc=; b=oGXh/V6B0ggqaPBg86z50khVuF78/goFopON/aCKua5QMmw9obWb7M/xw2vRwWcNs5TSpO DSom77vvTRuTvSvL5o00gRmmJCVNe9Hu9WU4TpGrO0+DMR9biyIdLapnuiFS7/xULngG+x wTdxzN/7RUKntvgdHmURSWfo6qSWf74xDhr/C83dJQ0LybKtyk4CFt4Ce5Ci9Fd37x1wrs FCrkG2IJ7kDoNZX4veaAJRrLRAz5bWQfBggsEq+TepT2EhCszRej2salbRta71Tzv7V8OG 7DNlha9imRKTGYcc5LqgQuhYkskAoUF7JBF1IPtqrJWUhvi+w2/hOadsZFZl/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711956877; a=rsa-sha256; cv=none; b=BAHjOxcSwDm4dTlj/FbnRhjYATiiPpup0xjKqyIx4T/p7bD92YrB16+krwSJ1TtzCggZIa yeQa4EBhtvJT9OKgJgSdc9mpfWg19UzkNxRcoP+VV8da9PRgZgpfwNX4yaseYDbTfzB2Il SCP+G45e/LqkKJeOcNXEeXQuSe5REqeYmlkNBoPqCzIB3Y2WsuowG65rJNiWi0gPdLikP1 OpY8bPyViXQ9BbpUVKyNKQl+pUW5rE9TXoXMO5yYEeMFiVeVfbR/9aNL5MdhgdACihIjL/ Nq3tpD6LQbkrKLwNhNCOPLVSskLBpSlDEqgvuH3GWm9rWMOOl0hxJSentV6mLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DCELliUr/OHnQbBUgtDozNb9GJ2IxZNck/o6hfiIBzc=; b=L8nM+lpqY99Oi1xHCs5bXevv96qvOaQ4MkD5SdhLspFSIyD2NI2wPHW+kyCDCSlR7n6OWK SprK4jFp0Ik9cfjrsK/75kcnBLWqApMCfbRHUABEDT6Lj2qf2rhQmjk9nxu7Az760CTUJp Uo+YWLVt1NmLMqm+JoSqWbK5anE7NOf0stPe/RRjy+mUIrbv41keL7lbURt3GJO5a5pwyC eujhaj6Bwfu/dOlTGzcPMihmwqyYQRA6RqQpgEAQ6NlcFvtkUuC/KQLQ64wODO4BWamnMz g2amD35Fp552MNNGU1eDN4NdzveDrBlnAbd2JQcpcxHSj9RgqdCaXz0UY0vq3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7N7d02zRz1CXD; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4317YaXt037756; Mon, 1 Apr 2024 07:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4317YaQd037753; Mon, 1 Apr 2024 07:34:36 GMT (envelope-from git) Date: Mon, 1 Apr 2024 07:34:36 GMT Message-Id: <202404010734.4317YaQd037753@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: e0a58ef24a3b - stable/13 - pfsync: cope with multiple pending plus messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: e0a58ef24a3baf5ed4cc09a798b9fe2d85408052 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e0a58ef24a3baf5ed4cc09a798b9fe2d85408052 commit e0a58ef24a3baf5ed4cc09a798b9fe2d85408052 Author: Kristof Provost AuthorDate: 2024-03-24 15:08:52 +0000 Commit: Kristof Provost CommitDate: 2024-04-01 07:33:36 +0000 pfsync: cope with multiple pending plus messages It's possible for pfsync to add a plus message when one is already queued. Append both, rather than overwriting the already pending one. MFC after: 1 week (cherry picked from commit caccf6d3c008d3c778986734c2705cdae849a877) --- sys/netpfil/pf/if_pfsync.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index a08a8334683a..d4d3c521a568 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -202,7 +202,7 @@ struct pfsync_bucket TAILQ_HEAD(, pfsync_upd_req_item) b_upd_req_list; TAILQ_HEAD(, pfsync_deferral) b_deferrals; u_int b_deferred; - void *b_plus; + uint8_t *b_plus; size_t b_pluslen; struct ifaltq b_snd; @@ -421,6 +421,7 @@ pfsync_clone_destroy(struct ifnet *ifp) free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; callout_drain(&b->b_tmo); } @@ -1562,6 +1563,7 @@ pfsync_drop(struct pfsync_softc *sc) b->b_len = PFSYNC_MINPKT; free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; } } @@ -1675,6 +1677,7 @@ pfsync_sendout(int schedswi, int c) free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; } subh = (struct pfsync_subheader *)(m->m_data + offset); @@ -2289,20 +2292,28 @@ pfsync_send_plus(void *plus, size_t pluslen) { struct pfsync_softc *sc = V_pfsyncif; struct pfsync_bucket *b = &sc->sc_buckets[0]; + uint8_t *newplus; PFSYNC_BUCKET_LOCK(b); - MPASS(b->b_plus == NULL); - if (b->b_len + pluslen > sc->sc_ifp->if_mtu) pfsync_sendout(1, b->b_id); - b->b_plus = malloc(pluslen, M_PFSYNC, M_NOWAIT); - if (b->b_plus == NULL) + newplus = malloc(pluslen + b->b_pluslen, M_PFSYNC, M_NOWAIT); + if (newplus == NULL) goto out; - memcpy(b->b_plus, plus, pluslen); - b->b_len += (b->b_pluslen = pluslen); + if (b->b_plus != NULL) { + memcpy(newplus, b->b_plus, b->b_pluslen); + free(b->b_plus, M_PFSYNC); + } else { + MPASS(b->b_pluslen == 0); + } + memcpy(newplus + b->b_pluslen, plus, pluslen); + + b->b_plus = newplus; + b->b_pluslen += pluslen; + b->b_len += pluslen; pfsync_sendout(1, b->b_id); From nobody Mon Apr 1 07:34:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7N7d6ZF0z5Fr0Y; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7N7d3W4vz4kPY; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0qnN7/yuOH52MwvQFhwI+E7e2FZPUFfeAlI+JHm5Idk=; b=stdtJGpYQNCr3gz1w2llC4x3YTkOl/UDyE6ZRnjJtkV8G3v83vWQ88Lej0Q0ABFSRFaRcB 8IyVP+buAO4QpqBECVvjVWmR5oGVmNfumewCFr47XlBT0smFtJpkhmkScGj9npJY7PQf2V 7AvlhrmwVKj4AqRwIsQnq47YwOjVKERFv9Q665rcaE9PWQShsds04VAhE7uzMwyLoQ/PAY 1cF8X2LtYACqNQ8nl1m3lA8ILaHabAxVBcjbtQWANYpH/tdN4APGbO7FhwplEUD8bPpZXE LGNJt18rEZD0N3TtBirW276aaX67teA2DNPgDsMmRDG+0++v/nyUswu8TsFabQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711956877; a=rsa-sha256; cv=none; b=gMi4bd31GfX5JoP2zFASPx0wSUA4/stuv3i+dKozVolIovuCQTtjyvvQk221s0GYtr4bki JQhUv3m+5NlyjyMefltExF3PF0dy10Wqv8EI1TnqNoPsUdqqufPl77qv1gmWH+fteHOLXD jLFQ2+w75X/Aux7q+/Qe4nmVfeevtIX3JEsqRWzT08k6CA/jfTooCL7+T9MlcRe7Y6pBLc KlZNOrkj2/Y0LhLTQYAfawcHrLSoqIVAtw/wcSSeXEnz4hUu8dtM74WMqKmFZIeFxgPBa9 gpq8s26tn4Lj3nmDL9JByH75V1HF9bYK1g2DNuHCrEmGXoaJEPwYTZiMXQTctA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0qnN7/yuOH52MwvQFhwI+E7e2FZPUFfeAlI+JHm5Idk=; b=sz6qnvwLg7A92c+tDFOFe3Wn7JuZ+wr3NPdUjVmxAejWQc/GtxT1x0DCa0xiOK9lp7BG2U ZWu1d+jpgoRTvMXeg+V6VkYvvYSYXIOX3vVhrUL9zsH3jAHPb77ykt19F+OOHRqkn8/CJK vXWV03MVdPMyoHRemTPWY4be8oeQg+5leP3VeAecjWC8KBfk63Og76lGjIL9vFV+KbDqHn aXZDc66+TMCJ6/Om/CUGYJ6QISVHb1/1JLyl2ritjkdrTyyi3KO2fWORDqnH8ewoYd+PvV fH8JJwCsalSn5ug934H6K7oYM1lSkvVsY3mm3sX3y40Chex4FkPCCqGHSwaCgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7N7d36kkz1Byn; Mon, 1 Apr 2024 07:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4317YbnD037804; Mon, 1 Apr 2024 07:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4317Ybm5037801; Mon, 1 Apr 2024 07:34:37 GMT (envelope-from git) Date: Mon, 1 Apr 2024 07:34:37 GMT Message-Id: <202404010734.4317Ybm5037801@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: f5c0005567b4 - stable/14 - pfsync: fix use of invalidated stack variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: f5c0005567b4f029297ffc5b5c7c2925b2608ba1 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5c0005567b4f029297ffc5b5c7c2925b2608ba1 commit f5c0005567b4f029297ffc5b5c7c2925b2608ba1 Author: Kristof Provost AuthorDate: 2024-03-24 08:46:31 +0000 Commit: Kristof Provost CommitDate: 2024-04-01 07:33:32 +0000 pfsync: fix use of invalidated stack variable Calls to pfsync_send_plus() pass pointers to stack variables. If pfsync_sendout() then fails it retains the pointer to these stack variables, accesing them later. Allocate a buffer and copy the data instead, so that we can retain the pointer safely. Reported by: CI KASAN, markj MFC after: 1 week (cherry picked from commit 81debbd60e5773e812e9227a2003ea88699580be) --- sys/netpfil/pf/if_pfsync.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 41eab7be515d..5df5824c93b8 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -474,6 +474,9 @@ pfsync_clone_destroy(struct ifnet *ifp) MPASS(TAILQ_EMPTY(&b->b_deferrals)); PFSYNC_BUCKET_UNLOCK(b); + free(b->b_plus, M_PFSYNC); + b->b_plus = NULL; + callout_drain(&b->b_tmo); } @@ -1766,6 +1769,7 @@ pfsync_drop(struct pfsync_softc *sc) } b->b_len = PFSYNC_MINPKT; + free(b->b_plus, M_PFSYNC); b->b_plus = NULL; } } @@ -1906,6 +1910,7 @@ pfsync_sendout(int schedswi, int c) bcopy(b->b_plus, m->m_data + offset, b->b_pluslen); offset += b->b_pluslen; + free(b->b_plus, M_PFSYNC); b->b_plus = NULL; } @@ -2563,13 +2568,21 @@ pfsync_send_plus(void *plus, size_t pluslen) PFSYNC_BUCKET_LOCK(b); + MPASS(b->b_plus == NULL); + if (b->b_len + pluslen > sc->sc_ifp->if_mtu) pfsync_sendout(1, b->b_id); - b->b_plus = plus; + b->b_plus = malloc(pluslen, M_PFSYNC, M_NOWAIT); + if (b->b_plus == NULL) + goto out; + + memcpy(b->b_plus, plus, pluslen); b->b_len += (b->b_pluslen = pluslen); pfsync_sendout(1, b->b_id); + +out: PFSYNC_BUCKET_UNLOCK(b); } From nobody Mon Apr 1 07:34:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7N7f5bW3z5Fqpd; Mon, 1 Apr 2024 07:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7N7f44fLz4kPf; Mon, 1 Apr 2024 07:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiiJ6KkCKWoyrNANwywbwhzpWXUwx6zyEW4YlL4zNBg=; b=fW+cCjABCWgu7afhUMRZiaCnMKqoisHVJBezz4mMYW77nO8i6kVfV9mK0UED6PuDHNe0gq eyDkls4BCBMDmpBBuaVNObGpw6jLw8bTpdU8bvirtoA6bmspeO/KpeV58KomRAwhbSc1b2 HctYYcSqC373HlPF3AVV3GysfJ3DSAk6PxY1OdNl8RsChh2tEtvukVxxo3bn8n6CaoE70I 5hMGTrlfSVexDyXsxw/T3hZWbMrMS/4b/AEyXYQNwG/GiC1eNgJ5Mx/+WUUNz2RItLyEI8 FjvyZPk3fUsLGjD33S9pRm2auum9WnX94agjyCzNSPb9G5Gc5kgQ77RZhnQZ5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711956878; a=rsa-sha256; cv=none; b=yp6hK2dHWTg+Oy0s1fUj5XFFMtMHQreTdepdOs5vfj51C6MLMz6Z3/VzpgeZRTPdqbkqc+ 4h39IP9+tjO95wyi0kNlUPNLYhcWsO6ZbulBbKl+TMwXKQU1/2o9zBbCMFNh4TLSwBxFZD osrsp4S7E6atEoLxRVheCQpVqV3NkRr8qv8Tc7Ocn68ihgomiRhpP7XC3BY++qO8Z6Ngio dbM9rZ/e50Zc0EXJ+A9HA6YxmTNIrGyQawIjCLNj7S+RajT6iNG1bcmrG9Y2GcOhBXAfA+ 1agYyz3DJCpS1ApfEYZHxLSo9qho65DdFR6MoIBjO7GOxxwcgTleCzmjjTmcwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711956878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiiJ6KkCKWoyrNANwywbwhzpWXUwx6zyEW4YlL4zNBg=; b=RUxWTcaVD6t7SouMP7rhz60Qxs/Cx6uriSG2LhwZQTTz7DFiwVJy4h7L/c4cZC9DjlU2RP yPVc5SWD2R+fk8SxQKTNqari/lePYTNqcHGVD24B+eWI9HS5yvrytuSRzSRS+v+aCYChd7 /IFyWKae7kF0RZCF0/dOpMnaXIaGdlGb3OJEQFBjNhyQcJoH71I4vWBa8h8jwDbTHc5hvr 83VCNzKrvLHgRdXREDHFToYby3H08rsAkaSedqBrWd1+Ej/oDvTy+hxPZxaOhDX5lcuKkz zNA+cugpt90LnTTls7ovp0IpTxT6NEV2z24uNdvYwkAX+w9OtK89ApjUg7+5wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7N7f3hxcz1C44; Mon, 1 Apr 2024 07:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4317Ycve037880; Mon, 1 Apr 2024 07:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4317YcMv037877; Mon, 1 Apr 2024 07:34:38 GMT (envelope-from git) Date: Mon, 1 Apr 2024 07:34:38 GMT Message-Id: <202404010734.4317YcMv037877@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: ab872ab0bf19 - stable/14 - pfsync: cope with multiple pending plus messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: ab872ab0bf195e872ed8d955aab3b2a537a230cd Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab872ab0bf195e872ed8d955aab3b2a537a230cd commit ab872ab0bf195e872ed8d955aab3b2a537a230cd Author: Kristof Provost AuthorDate: 2024-03-24 15:08:52 +0000 Commit: Kristof Provost CommitDate: 2024-04-01 07:33:32 +0000 pfsync: cope with multiple pending plus messages It's possible for pfsync to add a plus message when one is already queued. Append both, rather than overwriting the already pending one. MFC after: 1 week (cherry picked from commit caccf6d3c008d3c778986734c2705cdae849a877) --- sys/netpfil/pf/if_pfsync.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 5df5824c93b8..def06cd0c113 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -239,7 +239,7 @@ struct pfsync_bucket TAILQ_HEAD(, pfsync_upd_req_item) b_upd_req_list; TAILQ_HEAD(, pfsync_deferral) b_deferrals; u_int b_deferred; - void *b_plus; + uint8_t *b_plus; size_t b_pluslen; struct ifaltq b_snd; @@ -476,6 +476,7 @@ pfsync_clone_destroy(struct ifnet *ifp) free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; callout_drain(&b->b_tmo); } @@ -1771,6 +1772,7 @@ pfsync_drop(struct pfsync_softc *sc) b->b_len = PFSYNC_MINPKT; free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; } } @@ -1912,6 +1914,7 @@ pfsync_sendout(int schedswi, int c) free(b->b_plus, M_PFSYNC); b->b_plus = NULL; + b->b_pluslen = 0; } subh = (struct pfsync_subheader *)(m->m_data + offset); @@ -2565,20 +2568,28 @@ pfsync_send_plus(void *plus, size_t pluslen) { struct pfsync_softc *sc = V_pfsyncif; struct pfsync_bucket *b = &sc->sc_buckets[0]; + uint8_t *newplus; PFSYNC_BUCKET_LOCK(b); - MPASS(b->b_plus == NULL); - if (b->b_len + pluslen > sc->sc_ifp->if_mtu) pfsync_sendout(1, b->b_id); - b->b_plus = malloc(pluslen, M_PFSYNC, M_NOWAIT); - if (b->b_plus == NULL) + newplus = malloc(pluslen + b->b_pluslen, M_PFSYNC, M_NOWAIT); + if (newplus == NULL) goto out; - memcpy(b->b_plus, plus, pluslen); - b->b_len += (b->b_pluslen = pluslen); + if (b->b_plus != NULL) { + memcpy(newplus, b->b_plus, b->b_pluslen); + free(b->b_plus, M_PFSYNC); + } else { + MPASS(b->b_pluslen == 0); + } + memcpy(newplus + b->b_pluslen, plus, pluslen); + + b->b_plus = newplus; + b->b_pluslen += pluslen; + b->b_len += pluslen; pfsync_sendout(1, b->b_id); From nobody Mon Apr 1 19:18:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7gmK4SWyz5Gg1t; Mon, 1 Apr 2024 19:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7gmK3wSJz4s8p; Mon, 1 Apr 2024 19:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711999137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoW4YY9YDyPbmjjnwsqUZg9mCtkeIdjzSi4RhNI05Wk=; b=sQLyMJvXaEcec8CvMVf9bG3X1RCn+YpB3vg7VcfGX1npqv9z0qHVonjdycK1CzVoGtkqOT ND8TNV+fiODcyekPpNuMwneuHmQ+SKFkMEcgDykFT+CNPcTdXNPzrMTGkr8AfoBBFg09eM x8iHF8PNJ7hCgMJdu1Tl1kNY0rFmf8yHRfpCd3yJo8fnDra8gVj0eIXlACmlj3MK0EhdNX z2z2jsT6SyMYc7vv9hrI+IMKDlGGgMPqnZoLwsU1wORKvJv3MIUapF6/lsgamt7iBPxici Tqe6PocR2SK8kxx4i+3EdFD/B1+8crC1kDcI72AilP4EAemHB5tO2CWmiPE49g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711999137; a=rsa-sha256; cv=none; b=VSrIRvpTWqCTS+hEdQ9W6Hjh0uJll1+49Fdt8szy77CyhazlNjJSIeBrVezbx/5U/JdbKT VZdKGS2xuRkte7U9n7Eg6/yC+9VrvJzMafOZDGO9EN2jmykPCq8aUiEd2s0lUkVMRGB0gt +DkiTnVcmMC07rG6RGNvJYRY0wFkd5MzIlREXqgd5txMIS492Ou8EF01MHsn7oBjCjFflb A/AkHhwx58hl6ymK9ImGFoOPMZbgAJSZgdnohkoAiE6A2U9FS3AHJualsHzYVUCpm8CA2E jqxUBSVTgsITmw6On6hQ6z61MpCjkPm5DM+rvbVmWrEkzWwTt44MBnIrI/M+tA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711999137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoW4YY9YDyPbmjjnwsqUZg9mCtkeIdjzSi4RhNI05Wk=; b=HufT/R9ItwHE/1bJjIXaNyAGUNbnPPeGaPU+yfmpGmCzkAMYp/n6Tk5BCGVIIl+fdlP8/j y7wbih25GLPbTmd7EwUJc3xBSyMzeTNK6Xp7nJMr/vy7ABKbRAr2MgNUjBNgmjDmrfkDbx 12sab2n+1vDhusjO1fkHzAaGmUAHT5FZ8CKkAFcFl6UaEMZc+B6dRy90klp4rJEh6e0jIl yuJ9H0tpz2SQselaLms8C5NE0AlIqA8Jcv47Ajm4Sl4i/5SCrT10ueAuZpK9khXedF1W3f G0QSsOo9JDTjSnKf08rj1EL/hK1N3V2zEfi9GizfAXt8tlRThfUovt3iis93wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7gmK3NwPzHrm; Mon, 1 Apr 2024 19:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431JIvEN027656; Mon, 1 Apr 2024 19:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431JIvUO027653; Mon, 1 Apr 2024 19:18:57 GMT (envelope-from git) Date: Mon, 1 Apr 2024 19:18:57 GMT Message-Id: <202404011918.431JIvUO027653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: e54b9d17f82d - stable/14 - freebsd-update: mark "cron" as fetched as "fetch" itself List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e54b9d17f82d5cb5efd84826706205442e6352cd Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=e54b9d17f82d5cb5efd84826706205442e6352cd commit e54b9d17f82d5cb5efd84826706205442e6352cd Author: Michael Osipov AuthorDate: 2024-03-14 16:39:47 +0000 Commit: Michael Osipov CommitDate: 2024-04-01 19:18:15 +0000 freebsd-update: mark "cron" as fetched as "fetch" itself The change in 33bd05c3187d7b49c80cf1b0132b405c105d0833 was incomplete because it did not mark "cron" as ISFETCHED=1 although it performs the same operations as "install", but less output and does not perform a hard exit. Mark result as such and make "install" know that updates have been fetched. PR: 277699 Approved by: jrm (mentor), emaste, cperciva MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44356 --- usr.sbin/freebsd-update/freebsd-update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 551d40418240..9af6e8d711ed 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3457,6 +3457,7 @@ cmd_cron () { [ ${VERBOSELEVEL} = "debug" ]; then mail -s "`hostname` security updates" ${MAILTO} < ${TMPFILE} fi + ISFETCHED=1 rm ${TMPFILE} } From nobody Mon Apr 1 19:20:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7gnh1jvgz5GgPZ; Mon, 1 Apr 2024 19:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7gnh1BSxz4snL; Mon, 1 Apr 2024 19:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711999208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nd/m+NzGkZbPWGhyjDGTFTd19/mmo0P1ynp309fauEI=; b=R2oKoZkvYMoM8jtig5iBJlvqCcEEbpJGidNUWwOqrH+vr1Ov/l8w0LzZL+BYoI9C6Rrp0H xgrUBlAYd57iBBqWN+nhKHilYTabu7ezp8uR+dNnUwbu618Y8sot6cztva6FAAWlCwGOUl smRsnnYvogdq9ErRxgpbhnievrKI5EPK4dsfX23Xn02IIfhEX37wLICArw3wUgZvHe0Ib5 kBpA/eno10geEG3lmE3V6XVKPP4ptnrB0K/vOd4+NBxmLUwFXPk9FJ8OpCOOiNWpMOAJpw x4Vy2hG5XbVeUQsnJxPNixkxFEgtDVUD5hW49D/oYfqiF0jh7bK76mTMYROFLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711999208; a=rsa-sha256; cv=none; b=qiX2RW6hik+0m8uCJ2fIEGY5K5Gp7PAor+oJVbY7j85fZsNornfZJfg1T4mtdB2q7o6Dbe 4dEQVypBzOgqulaYxRBeg/0aWaRVLvTEOr5mLuD958/xiBRgXoXE16Vs0QCcuPAcuX/3Vb xrTIjPMIthfwglwdGOeT0VhQNbXb59yu1oRSckqFN5+17QjEvom3BNemf3zYxdk1PlYMrw UbQ0glIponKT8VuhorG4B4g37XJYMiXJSxN4Uc7bV+QfAqXevNcxOi7bZ4EyrmWj57Ihha Z50gm0A06oJJrVm7z+nZ6CzFC5HG62H+x7Rdv9Y3S2ebD5DrNv2irK7+0xhfDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711999208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nd/m+NzGkZbPWGhyjDGTFTd19/mmo0P1ynp309fauEI=; b=s00i0zL1PER7QbqCVD5azKba5w9AWgSLHrdFcA2oiMbgMB25BMDrGDFEB0wo/5fTlKWxfz RIq9bRCEAyBiQt/IyttBgWmetgzMZL1/fqVBOJvJ/KVLGM0qW8X60kRJy7g5ilW5W6c+5B u1eBL31N3YqXtbcn5wMrM+Amrw1rOdrC5PGC66rELgGo1dNCat4eT6Ree0rCpKdmGcRWcS zbwAOtYYjHuiZLXUL52Isc+0rSxBnSOplO+OE+hEWpnyWngeKc0XDjI6K8NOuDCRtcLL8x MdRrA157BnC3tljvTE+e/t16qumU4QjfReBos3KMqAu0v8N2nRq3AkqCoA/5cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7gnh0nwkzHjc; Mon, 1 Apr 2024 19:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431JK8Nm031201; Mon, 1 Apr 2024 19:20:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431JK8tQ031197; Mon, 1 Apr 2024 19:20:08 GMT (envelope-from git) Date: Mon, 1 Apr 2024 19:20:08 GMT Message-Id: <202404011920.431JK8tQ031197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: fc5208028a78 - stable/13 - freebsd-update: mark "cron" as fetched as "fetch" itself List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc5208028a78b014bdb1c77264c5b8c1823f9281 Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=fc5208028a78b014bdb1c77264c5b8c1823f9281 commit fc5208028a78b014bdb1c77264c5b8c1823f9281 Author: Michael Osipov AuthorDate: 2024-03-14 16:39:47 +0000 Commit: Michael Osipov CommitDate: 2024-04-01 19:19:50 +0000 freebsd-update: mark "cron" as fetched as "fetch" itself The change in 33bd05c3187d7b49c80cf1b0132b405c105d0833 was incomplete because it did not mark "cron" as ISFETCHED=1 although it performs the same operations as "install", but less output and does not perform a hard exit. Mark result as such and make "install" know that updates have been fetched. PR: 277699 Approved by: jrm (mentor), emaste, cperciva MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44356 --- usr.sbin/freebsd-update/freebsd-update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 551d40418240..9af6e8d711ed 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3457,6 +3457,7 @@ cmd_cron () { [ ${VERBOSELEVEL} = "debug" ]; then mail -s "`hostname` security updates" ${MAILTO} < ${TMPFILE} fi + ISFETCHED=1 rm ${TMPFILE} } From nobody Mon Apr 1 23:47:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nk75nqvz5FRVf; Mon, 1 Apr 2024 23:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nk75DX4z4QB6; Mon, 1 Apr 2024 23:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nx0+kTGqdXxg7KwbFAAOov37N62LmVx4ySTz+Mxql78=; b=Pz1MllZ6rAfzHZGhYtsEMGJu9XxC2k9gdEcuZpQPfVP6vGmuId487z4siLiF5RjW3SnQst pIZjuTTiTRGfy8CwJ5i2ZWDFfaMwVPcU3CeJNZWa0zDaUl1zAojDT+8F55Y2wgBn6B7fUu bCUGRbXUHJXOxxF2ZoJ11oQOg2JPLkIQGE3roTqEeosmrs8OENnZRvYIbLgey0SLfKTeJv M5KhSdV0ahlQTjy9YO5TpMt9uBDU/ujBLEKZeKM4Jak0GcOovVr6Ueoe8NIVpp7qF14Rb7 5nBNkMy+FDGzX3rn46AP/txLD8xZEWhjdPnvBLO0/n/fBEBIoF6JtlroSxgNIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015247; a=rsa-sha256; cv=none; b=angC23pd6iMVCcC13oESh2knPNiHFF2GETKYtuGTVX3ZFHXPbLW2KvYjtFT0gtnbfQYQ0P XuqhuNWSZ9m/yeq0zCjYxMuUST0GkegGboW0DFeC0nf+CUVe3/5/y2j0LZRCvl2V/N9/NC xdVOQmtKxrnJWDztC6ZgqR/skpCgXW9rbgDu19G8I8tKXaGmv4njztBvDgm/tnjyuMbPEa tX4mg8mqrsKLslGychDLYWZ9rSlpE/pR2ndMjLdszwxsCse9nHeLq6zGeKCBeg+bhXMXNx zH2MBNBqFnDyRxr7sH8M5QWKBsVIQBcjvIutjiY3eNOeNalDTPVi4msW+HKoMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nx0+kTGqdXxg7KwbFAAOov37N62LmVx4ySTz+Mxql78=; b=jdv6cQv+l8RsP2WhyG7peC8+3dbhmOUf4nhlMuH7wK91M9VE0TfBEf6f6mHby2HHQPuvh2 ksEWAHn3JbmA0LEW0EJDM1b6D9ClQSZGwLHwbo91GHygYCO8L16LpRfM+KZ2TFXpdpOx7n bffsdKoQdgZmgxUG3I1lKp/htueWnst/wzQqcGsG0AKGjsmGxGVHwfMBS+8QDZWsrx8d32 ehDOm+I9IgIX65mNmLK3m4QbAD+x8VfKj6BM1sqYY+O8bRqSQYEc8pBBW7W9SPtY4N1Hnw yWF1LjQqN0NpuDHr00eP1w0cmSvubeAWXQPRBxXgHK93Z/R8TlkHDN0NHOEqVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nk74jfXzR1w; Mon, 1 Apr 2024 23:47:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlRdH083897; Mon, 1 Apr 2024 23:47:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlRiY083894; Mon, 1 Apr 2024 23:47:27 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:27 GMT Message-Id: <202404012347.431NlRiY083894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: faf66c373ab7 - stable/14 - ath(4): always enable 11n List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: faf66c373ab7aef4bd2c9c90c0298a31c74da677 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=faf66c373ab7aef4bd2c9c90c0298a31c74da677 commit faf66c373ab7aef4bd2c9c90c0298a31c74da677 Author: Bjoern A. Zeeb AuthorDate: 2024-02-18 18:16:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 ath(4): always enable 11n Enabling 11n for ath(4) so far was handled by a kernel option, which was only enabled for certain kernel configurations. In order to allow loading ath(4) as a module with 11n support on all platforms, remove the kernel option and unconditionally enable 11n in ath(4). Reported by: pkubaj Reviewed by: adrian, imp (cherry picked from commit 89c1e54a71cc4e04d4c575ee6df956a12e163cde) --- sys/amd64/conf/GENERIC | 1 - sys/arm/conf/ARMADA38X | 1 - sys/conf/options | 1 - sys/dev/ath/if_athvar.h | 1 + sys/i386/conf/GENERIC | 1 - sys/powerpc/conf/GENERIC64 | 1 - sys/powerpc/conf/GENERIC64LE | 1 - 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index a88f5713de72..ab1c3856051b 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -291,7 +291,6 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros CardBus/PCI NICs device ath_hal # Atheros CardBus/PCI chip support options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath #device bwi # Broadcom BCM430x/BCM431x wireless NICs. #device bwn # Broadcom BCM43xx wireless NICs. diff --git a/sys/arm/conf/ARMADA38X b/sys/arm/conf/ARMADA38X index d0c7ddcef60b..bb7ef098f350 100644 --- a/sys/arm/conf/ARMADA38X +++ b/sys/arm/conf/ARMADA38X @@ -90,7 +90,6 @@ device wlan # 802.11 support device ath # Atheros CardBus/PCI NICs device ath_hal device ath_rate_sample -options ATH_ENABLE_11N # CESA device cesa diff --git a/sys/conf/options b/sys/conf/options index c4da2e595ea3..afeb4bd83c06 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -814,7 +814,6 @@ ATH_TXBUF opt_ath.h ATH_RXBUF opt_ath.h ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h -ATH_ENABLE_11N opt_ath.h ATH_ENABLE_DFS opt_ath.h ATH_EEPROM_FIRMWARE opt_ath.h ATH_ENABLE_RADIOTAP_VENDOR_EXT opt_ath.h diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index f706b360946a..96c4318d5987 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -59,6 +59,7 @@ /* * 802.11n requires more TX and RX buffers to do AMPDU. */ +#define ATH_ENABLE_11N /* 802.11n support for AR5416 and later */ #ifdef ATH_ENABLE_11N #define ATH_TXBUF 512 #define ATH_RXBUF 512 diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index c8e9cd439d74..1a57015d0dcc 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -250,7 +250,6 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros CardBus/PCI NICs device ath_hal # Atheros CardBus/PCI chip support options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath #device bwi # Broadcom BCM430x/BCM431x wireless NICs. #device bwn # Broadcom BCM43xx wireless NICs. diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index c413e37b44fb..1e91a4cc9455 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -234,7 +234,6 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros CardBus/PCI NICs device ath_hal # Atheros CardBus/PCI chip support options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath # FireWire support diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 83cf664bd5d7..d05308b9f0b9 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -230,7 +230,6 @@ device wlan_amrr # AMRR transmit rate control algorithm device ath # Atheros CardBus/PCI NICs device ath_hal # Atheros CardBus/PCI chip support options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath # FireWire support From nobody Mon Apr 1 23:47:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nk91jpGz5FRSH; Mon, 1 Apr 2024 23:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nk85tSqz4QCf; Mon, 1 Apr 2024 23:47:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODACNkdORah275F8Pl9m8KIKT5WcX29f5kE9A3ZGPYM=; b=x2xnQuCrbgog29Qb9XM+S/wciFgxt2dNRr0heDKzpPGMOOC358oilWsLEXA02MFSQHP1tF bNCpWd6IjBXCFzN9BmZHiD4oZrr8eGtYJ2Z6wSSs6CMd3WxCZq280SurRQpscSKF9Dy8Gm m/iaYTOXnWUrr9TEpQiGYD9Qh/ww07uI4MHHZsRP8sHhOG2+FyCsZVbx6ff4AE8CW3O46s 6ZeKeYo+BVavVDQh57NEwm2bGgy1Rif+YI/CcPZgWPzyCVILVj/u2c7zjwuMUDpzLOZ/ez 9dPmwk727ohqqypg6kWAn/PwyH/R2o/cX+24/dMpIqukiwsdAg2cZrC/IwnOcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015248; a=rsa-sha256; cv=none; b=BZACSUnSCL4CZ/5iZHLy0gmoDqfXOCuf1mT6ZFjSvP1RFwMtf8HUMiMLUgnTIl2KDxebhG DdxVnLYlHtWkmWpArg9r18tPmo0TitJKW8JivNZErDuQs1r5hhYOBD+VqiR3GN9l44XPuc 6DqBq/b1+NE7/Y/nZEHRTJef2jf5VnxZkRKu7cW22UOSrQbEGpwhIvrBTNN17huDo6QeCT GPneMHpYSXNQzTM3moSvRDNEZKBzEwZFMSqvd5IZ0dRSXrCDUv2XiqrfJ4TqXMWy7CrG5h w0S0fRosgS7PmUiuYnrvLQCug5HnNg5LRPJWjnZ+FTARCmCLjviikh9Zu5iWRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODACNkdORah275F8Pl9m8KIKT5WcX29f5kE9A3ZGPYM=; b=VALqJ7XJzRXwZ515ab78unWHAJrBcp7tihDAuVpqrcTNHGNrgtVVa9XL8OmawIzOISkbXy ZqjWvBQPHSExzIynFOoOgQ2WDIkeXBjQI8Ipf9/43H9exoTRPGp/nBeWLuJTa30ZiMrOTc R5zc8xCEnG6Z1m8nB7VEdlc3AMdWplII1f91xis1nksGXMXXXGpAspXvy5zUHpLUFBatOk P+CwjqLlld6t1w9NzvFk6WhTW91w6uIatwal5ToTQ9r4yKDdh0EYw7VvRq4N58OTov2SFD uJqO+uzmQJK8NxRuZXRKAudCDqFfUgC/BD6bUhRS2P3MbC/5CxfRx98NHxm+FQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nk85VbmzR5J; Mon, 1 Apr 2024 23:47:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlSFv083948; Mon, 1 Apr 2024 23:47:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlS2g083945; Mon, 1 Apr 2024 23:47:28 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:28 GMT Message-Id: <202404012347.431NlS2g083945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 21b6420f67cf - stable/14 - ath_hal/ar9300: allow JUPITER cards to read eeprom List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 21b6420f67cff32e69452a7e3822af37659eb4b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=21b6420f67cff32e69452a7e3822af37659eb4b8 commit 21b6420f67cff32e69452a7e3822af37659eb4b8 Author: Bjoern A. Zeeb AuthorDate: 2024-03-12 21:22:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 ath_hal/ar9300: allow JUPITER cards to read eeprom In ar9300_eeprom_read_word() also allow JUPITER cards read the eeprom instead of returning an error. While this will not help all the 9462, 9485, 9565 OEM cards to work, it will make debugging of the next steps a lot easier. While here fix a typo in the error message if we do not get CAL. PR: 255337 Tested by: John Nielsen (john jnielsen net) Reviewed by: adrian (cherry picked from commit f254aad33dfb5ce18b6b97b7d036b420310e9ed5) --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c index 0251222c50b4..073428c8fa71 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c @@ -225,7 +225,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar9300_eeprom_t *mptr, HAL_BOOL ar9300_eeprom_read_word(struct ath_hal *ah, u_int off, u_int16_t *data) { - if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah)) + if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_JUPITER(ah)) { (void) OS_REG_READ(ah, AR9300_EEPROM_OFFSET + (off << AR9300_EEPROM_S)); if (!ath_hal_wait(ah, @@ -4319,7 +4319,7 @@ ar9300_eeprom_restore_internal(struct ath_hal *ah, ar9300_eeprom_t *mptr, } #endif if (nptr < 0) { - ath_hal_printf(ah, "%s[%d] No vaid CAL, calling default template\n", + ath_hal_printf(ah, "%s[%d] No valid CAL, calling default template\n", __func__, __LINE__); nptr = ar9300_eeprom_restore_something(ah, mptr, mdata_size); } From nobody Mon Apr 1 23:47:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nkB05prz5FRP2; Mon, 1 Apr 2024 23:47:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nk96XsDz4Q7c; Mon, 1 Apr 2024 23:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZekT35PTutV3ZQUxiXQUlSAvF7/3fYHOT3BINSJYOwM=; b=ycNNDpom8s0vZY/kf/sRMEGfI4gXhPzZD/+SfjZo1bc9MlVpRNjglpTZ1Xp6vqwxKsFjEH Z6tj/NFMmeIKzWjoedZmqohcfxmQA+zzoOYYVOry6h4HtjHPoAbler4Fgg9oZpL3PqKJMb BKRaQ2dxwSjktrCBkFEDYC2MccOroCXjLEc0snC9+q+fGoGB7Bu8S7gegAdRwAFH88mgXX HTIDDLfyJ/hzoNcuoGy8EZzWjDaNX1FFxPfB3lzJTm5418JHHe6HuovpXyrm1foXEguWQ1 ZjqVxyMCPqPFEeTrWWvcXGjnTPq2PC9GtX9joMONU5XI04A6UZl5EISGsPhyLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015249; a=rsa-sha256; cv=none; b=bj8U+Wl/b6giq/X75EG0+nKmB2yBxnGuPS40YhVOC6xqwt5DkWUnaE0l/cEKhL7yKjQsmM zLMnXtC65w96AVUuJA+Y8MVjL7OeymWNsy0Na50eoOQMq4ystYR3PhLh15g5ooqF85XnFN YrROl86gqYaNutETFrWJIWUb5T1ZXFJT1kPBhLnSvtdeiPz4OnJfX/J39VY/txCKeM77m+ WZPDpkjSzEpfCGBq8n8tRhy4sZ8rebztsEOiqq5mReiWAlhokpPeApAR4d1rIl81mmd6j6 5zPQYyFJL+ZmrVXHBIvfj3Uj6EiIuBByCBV5LNYeN1D38rMvM1EQtbv9B2Flww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZekT35PTutV3ZQUxiXQUlSAvF7/3fYHOT3BINSJYOwM=; b=rtcDa1w8Jun2u9DiKNriIi2IKNpEImSKLETpk83sDwJ5UoRVrEIX9sy6cvrEx5KVRoc3l5 HxONbJYYH93rBDKHRUsbPloauuoecEjjCMNpadZJ7n331e3X6wRp3B3PB9chO+2hW25D5u salgF/y9gRoelEcXfbxJTfSZYa5/w7JOatsn791dzrkil3zD3bjmTmNxKGEG7+StGFbhN3 vl8Vcle7155PpC896I2cXSQLBeODMuminK8zmP6ovAKNmp0BSYUujg/ztrJE+9+NNdtMZz xwlATaAtWpClfEFCW6AGb9sa0SH2S2yIsvjeX0pCa71wfeBuQJyZgGM5W2fukQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nk968zTzQnD; Mon, 1 Apr 2024 23:47:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlTal084002; Mon, 1 Apr 2024 23:47:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlTBs083999; Mon, 1 Apr 2024 23:47:29 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:29 GMT Message-Id: <202404012347.431NlTBs083999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4bce8178af85 - stable/14 - iicbus/mux/pca954x: add support for PCA9546 I2C Switch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4bce8178af8544cf0cc2cfc742bbe50ad43af738 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4bce8178af8544cf0cc2cfc742bbe50ad43af738 commit 4bce8178af8544cf0cc2cfc742bbe50ad43af738 Author: Bjoern A. Zeeb AuthorDate: 2024-02-21 09:10:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 iicbus/mux/pca954x: add support for PCA9546 I2C Switch Add support for the 4 channel I2C switch from NXP by adding a new description struct and the list entries. Compared to x=[2345] which require code to support the INT, for this one no further changes are needed. Tested on: WHLE-LS1088A using a SPF+ Reviewed by: imp (cherry picked from commit c81df1c112621803abe6a43aa89238c830e86b72) --- sys/dev/iicbus/mux/pca954x.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/iicbus/mux/pca954x.c b/sys/dev/iicbus/mux/pca954x.c index aebd55d6c311..befa0db39172 100644 --- a/sys/dev/iicbus/mux/pca954x.c +++ b/sys/dev/iicbus/mux/pca954x.c @@ -3,7 +3,7 @@ * * Copyright (c) 2019 Ian Lepore * Copyright (c) 2020-2021 Andriy Gapon - * Copyright (c) 2022 Bjoern A. Zeeb + * Copyright (c) 2022-2024 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -69,6 +69,13 @@ static struct pca954x_descr pca9540_descr = { .enable = 0x04, }; +static struct pca954x_descr pca9546_descr = { + .partname = "pca9546", + .description = "PCA9546 I2C Switch", + .type = PCA954X_SW, + .numchannels = 4, +}; + static struct pca954x_descr pca9547_descr = { .partname = "pca9547", .description = "PCA9547 I2C Mux", @@ -87,6 +94,7 @@ static struct pca954x_descr pca9548_descr = { #ifdef FDT static struct ofw_compat_data compat_data[] = { { "nxp,pca9540", (uintptr_t)&pca9540_descr }, + { "nxp,pca9546", (uintptr_t)&pca9546_descr }, { "nxp,pca9547", (uintptr_t)&pca9547_descr }, { "nxp,pca9548", (uintptr_t)&pca9548_descr }, { NULL, 0 }, @@ -94,6 +102,7 @@ static struct ofw_compat_data compat_data[] = { #else static struct pca954x_descr *part_descrs[] = { &pca9540_descr, + &pca9546_descr, &pca9547_descr, &pca9548_descr, }; From nobody Mon Apr 1 23:47:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nkD0ZbVz5FRSL; Mon, 1 Apr 2024 23:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nkC0hwtz4Q3M; Mon, 1 Apr 2024 23:47:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0pLPaqIv5i4rSmcETzybOT0if6B91HEm4FkQdNwRKDA=; b=bz5Nq2FbYud7vFkNsQgsNduEZ4F7vjdr78q1rusoVQ2IkZnk9mSEAk8CiI9Dj0fESZ6M4A dVRrQajnlCl2hX8gTbhlvbdZNb45tL14CnvOL5Zrs+S+u359UqzQ2bwTQFceTxlhYbpACV vuejhzMBJuxa5OCIQQj/xNYi8C5LqrcKJ9s5Nh81Wtin+duGVF3IBBXV4Gz6kYcqP97Bbr cklqvXRkfvmYNgLDCEK06u2CetNsC2LWHKwEIOOLJPut0vVSG0NW73JXK4AUHrmcUXUTn1 1IGb7ZcreqYliwhMwTwt5I94E+t30KzQtFYvTIqxFP/9Pc9LGDkyG6SLpbV+zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015251; a=rsa-sha256; cv=none; b=uhgXsjSV0FwxRImdkwpz8uWQVBHobc3FWtW646eOHyz+i9XCgITxdhIe6MftCV3Mv2GFj8 /PNb+Huz1cGWRSjxZ26ggdM5p922GSI/26/Vx5lcbQ5ejDZ3m1GMb+IzR6jdWx5dyro4wD h7FD71B9Z2FlxisftYk56vuX3RJvBaYFsQfFDij2whrQjreqewnFnMTcFNOXtVgaeYE7Yu CM7a17ydICfCkaLPU7sKuCIyUGsun2SKEmGuvKld+ZnxB4ut5p+m3EXelEwXT1jis07gRg YK6PQ4rkv0hIWV8XhYmv6AWLNG1FWF//J2dpD2EFiE4Xsr5Vjgm191fxbw0Uww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0pLPaqIv5i4rSmcETzybOT0if6B91HEm4FkQdNwRKDA=; b=OAmdPzDb8QbBKuz1h7w/WbGOGO0uCip3GeiFr7Ai40biukfi/LgkOIpPeFVbNT/0LZHPuq mxi6bceXJqYBRIy9d/hGbJsyRbmzSLTWecPfhLKPkfrV7w7/S9wxf11ch8nP5+z0GDtmK9 oMzlr7kKPkvpaPgZtPZpHkJ/FFL4j0vtuy6cJ02w4d/w0L2OpVBhHVwohuX82jEwLBBXVE WCh3IVQIKEw12bIUAXmQFbArP1YZp+poaX/W8N+RkspAfYcoOwZeiJ6Gbg5iWx9/Vzi7Kk RJQBddKtW4iJqCWFFuLt7bEbX4rrtEiLVph26SdtxCnfQugVh3JfNvtF+CpSSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nkC06BWzQbk; Mon, 1 Apr 2024 23:47:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlUiG084053; Mon, 1 Apr 2024 23:47:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlUnk084050; Mon, 1 Apr 2024 23:47:30 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:30 GMT Message-Id: <202404012347.431NlUnk084050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: dd167e59079b - stable/14 - LinuxKPI: 802.11: implement a deferred RX path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd167e59079b65a53a45744055db6634f3c19a56 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dd167e59079b65a53a45744055db6634f3c19a56 commit dd167e59079b65a53a45744055db6634f3c19a56 Author: Bjoern A. Zeeb AuthorDate: 2024-02-12 16:03:13 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 LinuxKPI: 802.11: implement a deferred RX path Some calls, e.g., action frames cause us to call through all the way down to firmware from the RX path without any deferral in net80211. For LinuxKPI and iwlwifi this goes (with omissions) like this: lkpi_napi_task -> linuxkpi_ieee80211_rx -> ieee80211_input_mimo -> sta_input -> ht_recv_action_ba_addba_request -> lkpi_ic_ampdu_rx_start -> iwl_mvm_mac_ampdu_action -> iwl_trans_txq_send_hcmd. At that point we are waiting for an interrupt from the firmware but given the lkpi_napi_task has not finished (and may have more to dispatch based on budget and what was received) we will not see the new interrupt/fw response. With no answer from the firmware, the software timeout in the driver kills the command and the firmware and issues a complete restart. Implement the deferred RX path in LinuxKPI for the moment. At a later point we should carefully shift this into net80211. This fixes the hangs for (*ic_ampdu_rx_start)() calls with iwlwifi. PR: 276083 Reviewed by: cc (cherry picked from commit 759a996d610d9354aac5c48a6bdc9cedcba2f48b) --- sys/compat/linuxkpi/common/src/linux_80211.c | 134 ++++++++++++++++++++++++--- sys/compat/linuxkpi/common/src/linux_80211.h | 31 +++++++ 2 files changed, 154 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e365e0f574e4..57b3609b2290 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -145,6 +145,7 @@ const struct cfg80211_ops linuxkpi_mac80211cfgops = { static struct lkpi_sta *lkpi_find_lsta_by_ni(struct lkpi_vif *, struct ieee80211_node *); static void lkpi_80211_txq_task(void *, int); +static void lkpi_80211_lhw_rxq_task(void *, int); static void lkpi_ieee80211_free_skb_mbuf(void *); #ifdef LKPI_80211_WME static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); @@ -4272,6 +4273,12 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) TAILQ_INIT(&lhw->scheduled_txqs[ac]); } + /* Deferred RX path. */ + LKPI_80211_LHW_RXQ_LOCK_INIT(lhw); + TASK_INIT(&lhw->rxq_task, 0, lkpi_80211_lhw_rxq_task, lhw); + mbufq_init(&lhw->rxq, IFQ_MAXLEN); + lhw->rxq_stopped = false; + /* * XXX-BZ TODO make sure there is a "_null" function to all ops * not initialized. @@ -4297,11 +4304,42 @@ void linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) { struct lkpi_hw *lhw; + struct mbuf *m; lhw = HW_TO_LHW(hw); free(lhw->ic, M_LKPI80211); lhw->ic = NULL; + /* + * Drain the deferred RX path. + */ + LKPI_80211_LHW_RXQ_LOCK(lhw); + lhw->rxq_stopped = true; + LKPI_80211_LHW_RXQ_UNLOCK(lhw); + + /* Drain taskq, won't be restarted due to rxq_stopped being set. */ + while (taskqueue_cancel(taskqueue_thread, &lhw->rxq_task, NULL) != 0) + taskqueue_drain(taskqueue_thread, &lhw->rxq_task); + + /* Flush mbufq (make sure to release ni refs!). */ + m = mbufq_dequeue(&lhw->rxq); + while (m != NULL) { + struct m_tag *mtag; + + mtag = m_tag_locate(m, MTAG_ABI_LKPI80211, LKPI80211_TAG_RXNI, NULL); + if (mtag != NULL) { + struct lkpi_80211_tag_rxni *rxni; + + rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); + ieee80211_free_node(rxni->ni); + } + m_freem(m); + m = mbufq_dequeue(&lhw->rxq); + } + KASSERT(mbufq_empty(&lhw->rxq), ("%s: lhw %p has rxq len %d != 0\n", + __func__, lhw, mbufq_len(&lhw->rxq))); + LKPI_80211_LHW_RXQ_LOCK_DESTROY(lhw); + /* Cleanup more of lhw here or in wiphy_free()? */ LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw); @@ -4796,6 +4834,66 @@ linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *hw, return; } +static void +lkpi_80211_lhw_rxq_rx_one(struct lkpi_hw *lhw, struct mbuf *m) +{ + struct ieee80211_node *ni; + struct m_tag *mtag; + int ok; + + ni = NULL; + mtag = m_tag_locate(m, MTAG_ABI_LKPI80211, LKPI80211_TAG_RXNI, NULL); + if (mtag != NULL) { + struct lkpi_80211_tag_rxni *rxni; + + rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); + ni = rxni->ni; + } + + if (ni != NULL) { + ok = ieee80211_input_mimo(ni, m); + ieee80211_free_node(ni); /* Release the reference. */ + if (ok < 0) + m_freem(m); + } else { + ok = ieee80211_input_mimo_all(lhw->ic, m); + /* mbuf got consumed. */ + } + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_RX) + printf("TRACE %s: handled frame type %#0x\n", __func__, ok); +#endif +} + +static void +lkpi_80211_lhw_rxq_task(void *ctx, int pending) +{ + struct lkpi_hw *lhw; + struct mbufq mq; + struct mbuf *m; + + lhw = ctx; + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_RX) + printf("%s:%d lhw %p pending %d mbuf_qlen %d\n", + __func__, __LINE__, lhw, pending, mbufq_len(&lhw->rxq)); +#endif + + mbufq_init(&mq, IFQ_MAXLEN); + + LKPI_80211_LHW_RXQ_LOCK(lhw); + mbufq_concat(&mq, &lhw->rxq); + LKPI_80211_LHW_RXQ_UNLOCK(lhw); + + m = mbufq_dequeue(&mq); + while (m != NULL) { + lkpi_80211_lhw_rxq_rx_one(lhw, m); + m = mbufq_dequeue(&mq); + } +} + /* For %list see comment towards the end of the function. */ void linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, @@ -5019,20 +5117,34 @@ skip_device_ts: } #endif + /* + * Attach meta-information to the mbuf for the deferred RX path. + * Currently this is best-effort. Should we need to be hard, + * drop the frame and goto err; + */ if (ni != NULL) { - ok = ieee80211_input_mimo(ni, m); - ieee80211_free_node(ni); - if (ok < 0) - m_freem(m); - } else { - ok = ieee80211_input_mimo_all(ic, m); - /* mbuf got consumed. */ + struct m_tag *mtag; + struct lkpi_80211_tag_rxni *rxni; + + mtag = m_tag_alloc(MTAG_ABI_LKPI80211, LKPI80211_TAG_RXNI, + sizeof(*rxni), IEEE80211_M_NOWAIT); + if (mtag != NULL) { + rxni = (struct lkpi_80211_tag_rxni *)(mtag + 1); + rxni->ni = ni; /* We hold a reference. */ + m_tag_prepend(m, mtag); + } } -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("TRACE %s: handled frame type %#0x\n", __func__, ok); -#endif + LKPI_80211_LHW_RXQ_LOCK(lhw); + if (lhw->rxq_stopped) { + LKPI_80211_LHW_RXQ_UNLOCK(lhw); + m_freem(m); + goto err; + } + + mbufq_enqueue(&lhw->rxq, m); + taskqueue_enqueue(taskqueue_thread, &lhw->rxq_task); + LKPI_80211_LHW_RXQ_UNLOCK(lhw); IMPROVE(); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index d25614de56dc..b0156a5ade3f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -76,6 +76,18 @@ if (linuxkpi_debug_80211 & D80211_TRACE_MODE_HT) \ printf("%s:%d: XXX LKPI80211 IMPROVE_HT\n", __func__, __LINE__) +#define MTAG_ABI_LKPI80211 1707696513 /* LinuxKPI 802.11 KBI */ + +/* + * Deferred RX path. + * We need to pass *ni along (and possibly more in the future so + * we use a struct right from the start. + */ +#define LKPI80211_TAG_RXNI 0 /* deferred RX path */ +struct lkpi_80211_tag_rxni { + struct ieee80211_node *ni; /* MUST hold a reference to it. */ +}; + struct lkpi_radiotap_tx_hdr { struct ieee80211_radiotap_header wt_ihdr; uint8_t wt_flags; @@ -192,6 +204,11 @@ struct lkpi_hw { /* name it mac80211_sc? */ uint32_t txq_generation[IEEE80211_NUM_ACS]; TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; + /* Deferred RX path. */ + struct task rxq_task; + struct mbufq rxq; + struct mtx rxq_mtx; + /* Scan functions we overload to handle depending on scan mode. */ void (*ic_scan_curchan)(struct ieee80211_scan_state *, unsigned long); @@ -240,6 +257,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ bool update_mc; bool update_wme; + bool rxq_stopped; /* Must be last! */ struct ieee80211_hw hw __aligned(CACHE_LINE_SIZE); @@ -304,6 +322,19 @@ struct lkpi_wiphy { #define LKPI_80211_LHW_TXQ_UNLOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->txq_mtx, MA_NOTOWNED) +#define LKPI_80211_LHW_RXQ_LOCK_INIT(_lhw) \ + mtx_init(&(_lhw)->rxq_mtx, "lhw-rxq", NULL, MTX_DEF | MTX_RECURSE); +#define LKPI_80211_LHW_RXQ_LOCK_DESTROY(_lhw) \ + mtx_destroy(&(_lhw)->rxq_mtx); +#define LKPI_80211_LHW_RXQ_LOCK(_lhw) \ + mtx_lock(&(_lhw)->rxq_mtx) +#define LKPI_80211_LHW_RXQ_UNLOCK(_lhw) \ + mtx_unlock(&(_lhw)->rxq_mtx) +#define LKPI_80211_LHW_RXQ_LOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->rxq_mtx, MA_OWNED) +#define LKPI_80211_LHW_RXQ_UNLOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->rxq_mtx, MA_NOTOWNED) + #define LKPI_80211_LHW_LVIF_LOCK(_lhw) sx_xlock(&(_lhw)->lvif_sx) #define LKPI_80211_LHW_LVIF_UNLOCK(_lhw) sx_xunlock(&(_lhw)->lvif_sx) From nobody Mon Apr 1 23:47:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nkD3nFdz5FRCT; Mon, 1 Apr 2024 23:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nkD1Zfgz4QMN; Mon, 1 Apr 2024 23:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDf33JmlG2JZCuApfD0dyewA6RmuuWdKVjj4hrEOh+4=; b=IhYk55sgaR6D302kprgKLh6e4qoHvT2xYFQJ9Vst1mSuuZ/jQbdy2oOG5PnaWL0Rl1bpJ2 iNcT+x+wcYgqtgRuqoCLtM+GKvejTvvGBeTkDKAki7loRYOLony0J2UDKMtTt2sqdfKZHb vuqUIZ9rl3ZtQ8ZF+jVAjzTt7FSmPsywGYFF9SfM1t6QV+0Z66/I1xIRq+nXGLHjEliexI 0gCej+EcmHcgtm+A9xe2JsmSVhbyecDqvsHb+3O1w38yS7nxFwcUkz31mt9KfU+EaWDZDm UcBqIsn/yAVzsCZgDN1Pi1vHIGZpjVwOsuO8sthbs7YdxNI6N6eNIY+SjlN17w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015252; a=rsa-sha256; cv=none; b=dVE+HL3jM94j4DALly/JXAAaQxiOCOc3y1koxU2K9qUnfxfPolMRWY8M4Qplod46zCy7uD epaWW/CKp/XqiTQDmFxl28+abQNZCAzONtezg3PC+sKMD8mIJQleE1h6r6xeLzu7N7oWId wzFtY3NF15wp5hui4KAnU97ndr+7ejUxN+57Wn2iU2ZWZi0wbOeN/kqmVL4/3dq8bsJG3a tPAUeDJMABC7S21lKBHyIIsoS94rqPK0iz8e7Zh/dGAdkR/3TQcb4GYmQSo+6dBMiya7fe sQmVQYpozj4yMkLnEU+FyffBkCudGwwFOfxS+Ay1vP3EsYtf1LQtEsmzj+61JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yDf33JmlG2JZCuApfD0dyewA6RmuuWdKVjj4hrEOh+4=; b=BJYfCfMJO1zGuzkhD3kwaICVz5LmAw5ZZ6rEPRJowgFDCOKke8JGvuvRGvVlTb+uKyiRYw JFtk1a8KFrdNjb1nB/hB3Mu8zktTC+u2nNdLCqZbGWw8iRP8gpNiGWBV2cVlzfglR9q+Gu 7+ueG5kDZZaMI13MHaFwvE+wgv8FC/jbBwzd3hPpCsQWgOjewBH6c+dxwg6ON0PUE81iLD vX4O2XscFchyQrVK9UZmujIJ9gu9rQyulTogrtLIreriQxWDIN2uNjl4WA6Fw8N6dPTJIs F/ZuRvjG1oeIlTdsNWKLQpKrx0OJs3fv444vqIXO1BqgZuMCZfHJAiqHv3JU7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nkD18TczR6y; Mon, 1 Apr 2024 23:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlWLp084112; Mon, 1 Apr 2024 23:47:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlWdb084109; Mon, 1 Apr 2024 23:47:32 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:32 GMT Message-Id: <202404012347.431NlWdb084109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e74405a4d648 - stable/14 - LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e74405a4d6488194a8e6d83a6637a181864f221c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e74405a4d6488194a8e6d83a6637a181864f221c commit e74405a4d6488194a8e6d83a6637a181864f221c Author: Bjoern A. Zeeb AuthorDate: 2024-03-04 23:03:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM In case of LKPI_80211_HW_CRYPTO we convert from LinuxKPI cipher_suites to net80211 ic_cryptocaps fields. For WLAN_CIPHER_SUITE_CCMP we accidentally returned the bit number instead of the shifted value which leads to ieee80211_crypto_newkey() setting IEEE80211_KEY_SWCRYPT, which in turned lead to us trying to decode the frame again despite HW had already done it. This was found out of a discussion in D43634. Reviewed by: cc, adrian (cherry picked from commit 906521f8176b13533556d742db4ab28e847b85c0) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 57b3609b2290..d5a97009200f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -547,7 +547,7 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) case WLAN_CIPHER_SUITE_TKIP: return (IEEE80211_CRYPTO_TKIP); case WLAN_CIPHER_SUITE_CCMP: - return (IEEE80211_CIPHER_AES_CCM); + return (IEEE80211_CRYPTO_AES_CCM); case WLAN_CIPHER_SUITE_WEP104: return (IEEE80211_CRYPTO_WEP); case WLAN_CIPHER_SUITE_AES_CMAC: From nobody Mon Apr 1 23:47:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nkG5sQzz5FRQ6; Mon, 1 Apr 2024 23:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nkF2V1Fz4QH2; Mon, 1 Apr 2024 23:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDpYMNKya1M+gRZaAJmKVZd9O5Qt6kvTNEiWh9q4hjw=; b=Aw/HH74iTxOQ6sww2q4gPRHZoQg45DTui3gg8ALrYWAc/P2Gf0xxp+V/4nd7mhw8NfsHo+ o0CwwTFBdB653gISWsFKxkfXy5QfMhtKPMSmSSFfLi40Pqlc1MRImdKT9A1iDDs0lqVdpg HI7SgMxQwZSrWow16DuSB/CJwZwObHhB9mRL6jcIkRlRJJCXyw1Bp8Y3yOluSX8Z8/iYIw pb2Rh9Cscnv3BVH25IMUMctCbuYnMRY/dz8AKMPsoduUs/3drC/G11+JIfO6a64ZqFis4N j3SY91iHrMe+9mOiKj5OweFxvNAKljie1vR54EyPK++UxsJd7aRUF200DGvimw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015253; a=rsa-sha256; cv=none; b=skLeRcyaOr4lP+dtrNrH37EoklWt+3cplTaWtjQMz1aQx8YWUOaYfdudtkzge6y7iTlBOm 1WRFh+Mgm0z0nATIUwj5KuA12zFIB0lNE4wYDG1jY1zM9phsMNwF1P44fl4aCioEtunrdT VVR0mmncuDIj6bVeWxWPI1LfixUqIeutlE86ZnP6rkbFDWn5Z0PgIi4VTpuJS52vcMFTl1 Q/yIKCf8qjlO2QvkqzDJ4Vqd4Ua3SMacNOhHLIyVNjYsKdi5O6ZH+V0zVxfsFYob1uGu4K JBmVtqfXYg5pGBoaYYPzY64j/uS9tIZd4KBlV5Y6D6ENMBX8zyvASDVz/Hirow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EDpYMNKya1M+gRZaAJmKVZd9O5Qt6kvTNEiWh9q4hjw=; b=jhROE+N6dmt8Pj/p1pMohK2Sm5cuakXewxNplMHEy8nD0LD5g7Z8pesLGYThCUAEKkxiZd 6gW9v0UUacZlkE9Ot0GgHJGPoVkDrcY15sw2+2iumxuH2AUhpuQmdilANZGQvYy3H/a4Od s44qEcZdNRyi9P7F47ALdrt5boAIQODUf48PZ7VulcRvZPmMjxhCVSi9NB+MYpafDq9s9u Z9+tRXLI2zYyszNkycuOS3/VZXm56n/VW7LSC7lJKHwWTeAR5LjqoBfWrG981TmbXBv8kf LPdp/FzC3JmslTRSMc67TD970oKFDKCr9PxTfn2TAQGE5S82z3/v8Cp9o0gaRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nkF21KTzQSv; Mon, 1 Apr 2024 23:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlX6Z084175; Mon, 1 Apr 2024 23:47:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlX9x084172; Mon, 1 Apr 2024 23:47:33 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:33 GMT Message-Id: <202404012347.431NlX9x084172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d1aff3556656 - stable/14 - vf_i2c: split up and add ACPI attachments in addition to FDT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d1aff3556656bf85a2a0f07963264ad5d2ddc704 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1aff3556656bf85a2a0f07963264ad5d2ddc704 commit d1aff3556656bf85a2a0f07963264ad5d2ddc704 Author: Pierre-Luc Drouin AuthorDate: 2024-03-22 22:12:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:10 +0000 vf_i2c: split up and add ACPI attachments in addition to FDT Move the code from the arm specific to the iicbus controller directory. Split up between general logic and bus attachment code. Add support for ACPI attachment in addition to FDT. Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) Based on: D24917 by Val Packett (initial early version) (cherry picked from commit 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c) --- sys/arm/freescale/vybrid/files.vybrid | 3 +- sys/conf/files.arm64 | 4 +- .../iicbus/controller}/vybrid/vf_i2c.c | 240 +++++++++++---------- sys/dev/iicbus/controller/vybrid/vf_i2c.h | 75 +++++++ sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c | 101 +++++++++ sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c | 122 +++++++++++ sys/modules/Makefile | 2 + sys/modules/vf_i2c/Makefile | 14 ++ 8 files changed, 440 insertions(+), 121 deletions(-) diff --git a/sys/arm/freescale/vybrid/files.vybrid b/sys/arm/freescale/vybrid/files.vybrid index b39cbbfd83cf..dff5892e9931 100644 --- a/sys/arm/freescale/vybrid/files.vybrid +++ b/sys/arm/freescale/vybrid/files.vybrid @@ -9,7 +9,8 @@ arm/freescale/vybrid/vf_edma.c standard arm/freescale/vybrid/vf_dmamux.c standard arm/freescale/vybrid/vf_port.c standard arm/freescale/vybrid/vf_adc.c standard -arm/freescale/vybrid/vf_i2c.c optional iicbus +dev/iicbus/controller/vybrid/vf_i2c.c optional iicbus +dev/iicbus/controller/vybrid/vf_i2c_fdt.c optional iicbus fdt arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 15ae804bfb0f..218571d0e23a 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -628,7 +628,9 @@ tegra210_xusb.fw optional tegra210_xusb_fw \ clean "tegra210_xusb.fw" # NXP -arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus soc_nxp_ls +dev/iicbus/controller/vybrid/vf_i2c.c optional vf_i2c iicbus soc_nxp_ls +dev/iicbus/controller/vybrid/vf_i2c_acpi.c optional vf_i2c iicbus acpi soc_nxp_ls +dev/iicbus/controller/vybrid/vf_i2c_fdt.c optional vf_i2c iicbus fdt soc_nxp_ls arm64/qoriq/qoriq_dw_pci.c optional pci fdt soc_nxp_ls arm64/qoriq/qoriq_gpio_pic.c optional gpio fdt soc_nxp_ls arm64/qoriq/qoriq_therm.c optional pci fdt soc_nxp_ls diff --git a/sys/arm/freescale/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c similarity index 75% rename from sys/arm/freescale/vybrid/vf_i2c.c rename to sys/dev/iicbus/controller/vybrid/vf_i2c.c index 0bda13ef31d2..7a6ec3948e13 100644 --- a/sys/arm/freescale/vybrid/vf_i2c.c +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2014 Ruslan Bukin - * All rights reserved. + * Copyright (c) 2024 Pierre-Luc Drouin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,13 +29,14 @@ /* * Vybrid Family Inter-Integrated Circuit (I2C) * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * + * The current implementation is based on the original driver by Ruslan Bukin, + * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val + * Packett. */ -/* - * This driver is based on the I2C driver for i.MX - */ - -#include +#include +#include #include #include #include @@ -51,17 +52,11 @@ #include "iicbus_if.h" -#include -#include -#include - -#include - #include #include #include -#include +#include #define I2C_IBAD 0x0 /* I2C Bus Address Register */ #define I2C_IBFD 0x1 /* I2C Bus Frequency Divider Register */ @@ -86,42 +81,44 @@ #define IBIC_BIIE (1 << 7) /* Bus Idle Interrupt Enable bit. */ #define I2C_IBDBG 0x6 /* I2C Bus Debug Register */ +#define DIV_REG_UNSET 0xFF + +#define READ1(_sc, _reg) bus_space_read_1(_sc->bst, _sc->bsh, _reg) +#define WRITE1(_sc, _reg, _val) bus_space_write_1(_sc->bst,\ + _sc->bsh, _reg, _val) + #ifdef DEBUG #define vf_i2c_dbg(_sc, fmt, args...) \ device_printf((_sc)->dev, fmt, ##args) +#ifdef DEBUG2 +#undef WRITE1 +#define WRITE1(_sc, _reg, _val) ({\ + vf_i2c_dbg(_sc, "WRITE1 REG 0x%02X VAL 0x%02X\n",_reg,_val);\ + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val);\ + }) +#undef READ1 +#define READ1(_sc, _reg) ({\ + uint32_t ret=bus_space_read_1(_sc->bst, _sc->bsh, _reg);\ + vf_i2c_dbg(_sc, "READ1 REG 0x%02X RETURNS 0x%02X\n",_reg,ret);\ + ret;\ + }) +#endif #else #define vf_i2c_dbg(_sc, fmt, args...) #endif -#define HW_UNKNOWN 0x00 -#define HW_MVF600 0x01 -#define HW_VF610 0x02 - static int i2c_repeated_start(device_t, u_char, int); static int i2c_start(device_t, u_char, int); static int i2c_stop(device_t); static int i2c_reset(device_t, u_char, u_char, u_char *); static int i2c_read(device_t, char *, int, int *, int, int); static int i2c_write(device_t, const char *, int, int *, int); -static phandle_t i2c_get_node(device_t, device_t); struct i2c_div_type { uint32_t reg_val; uint32_t div; }; -struct i2c_softc { - struct resource *res[2]; - bus_space_tag_t bst; - bus_space_handle_t bsh; - clk_t clock; - uint32_t freq; - device_t dev; - device_t iicbus; - struct mtx mutex; - uintptr_t hwtype; -}; - static struct resource_spec i2c_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -144,49 +141,15 @@ static struct i2c_div_type vf610_div_table[] = { { 0x3F, 3840 }, { 0x7B, 4096 }, { 0x7D, 5120 }, { 0x7E, 6144 }, }; -static const struct ofw_compat_data i2c_compat_data[] = { - {"fsl,mvf600-i2c", HW_MVF600}, - {"fsl,vf610-i2c", HW_VF610}, - {NULL, HW_UNKNOWN} -}; - -static int -i2c_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_search_compatible(dev, i2c_compat_data)->ocd_data) - return (ENXIO); - - device_set_desc(dev, "Vybrid Family Inter-Integrated Circuit (I2C)"); - return (BUS_PROBE_DEFAULT); -} - -static int -i2c_attach(device_t dev) +int +vf_i2c_attach_common(device_t dev) { - struct i2c_softc *sc; - phandle_t node; + struct vf_i2c_softc *sc; int error; sc = device_get_softc(dev); - sc->dev = dev; - sc->hwtype = ofw_bus_search_compatible(dev, i2c_compat_data)->ocd_data; - node = ofw_bus_get_node(dev); - error = clk_get_by_ofw_index(dev, node, 0, &sc->clock); - if (error != 0) { - sc->freq = 0; - device_printf(dev, "Parent clock not found.\n"); - } else { - if (OF_hasprop(node, "clock-frequency")) - OF_getencprop(node, "clock-frequency", &sc->freq, - sizeof(sc->freq)); - else - sc->freq = 100000; - } + vf_i2c_dbg(sc, "i2c attach common\n"); mtx_init(&sc->mutex, device_get_nameunit(dev), "I2C", MTX_DEF); @@ -201,8 +164,25 @@ i2c_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); + mtx_lock(&sc->mutex); + WRITE1(sc, I2C_IBIC, IBIC_BIIE); + if (sc->freq == 0) { + uint8_t div_reg; + + div_reg = READ1(sc, I2C_IBFD); + + if (div_reg != 0x00) { + sc->freq = UINT32_MAX; + device_printf(dev, "Using existing bus frequency divider register value (0x%02X).\n", div_reg); + } else { + device_printf(dev, "Bus frequency divider value appears unset, defaulting to low I2C bus speed.\n"); + } + } + + mtx_unlock(&sc->mutex); + sc->iicbus = device_add_child(dev, "iicbus", -1); if (sc->iicbus == NULL) { device_printf(dev, "could not add iicbus child"); @@ -219,10 +199,18 @@ i2c_attach(device_t dev) static int i2c_detach(device_t dev) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; int error = 0; sc = device_get_softc(dev); + vf_i2c_dbg(sc, "i2c detach\n"); + + mtx_lock(&sc->mutex); + + if (sc->freq == 0) { + vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n"); + WRITE1(sc, I2C_IBFD, 0x00); + } error = bus_generic_detach(dev); if (error != 0) { @@ -238,6 +226,8 @@ i2c_detach(device_t dev) bus_release_resources(dev, i2c_spec, sc->res); + mtx_unlock(&sc->mutex); + mtx_destroy(&sc->mutex); return (0); @@ -245,7 +235,7 @@ i2c_detach(device_t dev) /* Wait for transfer interrupt flag */ static int -wait_for_iif(struct i2c_softc *sc) +wait_for_iif(struct vf_i2c_softc *sc) { int retry; @@ -263,7 +253,7 @@ wait_for_iif(struct i2c_softc *sc) /* Wait for free bus */ static int -wait_for_nibb(struct i2c_softc *sc) +wait_for_nibb(struct vf_i2c_softc *sc) { int retry; @@ -279,7 +269,7 @@ wait_for_nibb(struct i2c_softc *sc) /* Wait for transfer complete+interrupt flag */ static int -wait_for_icf(struct i2c_softc *sc) +wait_for_icf(struct vf_i2c_softc *sc) { int retry; @@ -298,8 +288,9 @@ wait_for_icf(struct i2c_softc *sc) } /* Get ACK bit from last write */ static bool -tx_acked(struct i2c_softc *sc) +tx_acked(struct vf_i2c_softc *sc) { + vf_i2c_dbg(sc, "i2c get ACK bit from last write\n"); return (READ1(sc, I2C_IBSR) & IBSR_RXAK) ? false : true; @@ -308,7 +299,7 @@ tx_acked(struct i2c_softc *sc) static int i2c_repeated_start(device_t dev, u_char slave, int timeout) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; int error; int reg; @@ -356,7 +347,7 @@ i2c_repeated_start(device_t dev, u_char slave, int timeout) static int i2c_start(device_t dev, u_char slave, int timeout) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; int error; int reg; @@ -406,7 +397,7 @@ i2c_start(device_t dev, u_char slave, int timeout) static int i2c_stop(device_t dev) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; sc = device_get_softc(dev); @@ -429,45 +420,53 @@ i2c_stop(device_t dev) return (IIC_NOERR); } -static uint32_t +static uint8_t i2c_get_div_val(device_t dev) { - struct i2c_softc *sc; - uint64_t clk_freq; - int error, i; + struct vf_i2c_softc *sc; + uint8_t div_reg = DIV_REG_UNSET; sc = device_get_softc(dev); + if (sc->freq == UINT32_MAX) + return div_reg; +#ifndef FDT + div_reg = vf610_div_table[nitems(vf610_div_table) - 1].reg_val; +#else if (sc->hwtype == HW_MVF600) - return 20; - - if (sc->freq == 0) - return vf610_div_table[nitems(vf610_div_table) - 1].reg_val; - - error = clk_get_freq(sc->clock, &clk_freq); - if (error != 0) { - device_printf(dev, "Could not get parent clock frequency. " - "Using default divider.\n"); - return vf610_div_table[nitems(vf610_div_table) - 1].reg_val; + div_reg = MVF600_DIV_REG; + else if (sc->freq == 0) + div_reg = vf610_div_table[nitems(vf610_div_table) - 1].reg_val; + else { + uint64_t clk_freq; + int error, i; + + error = clk_get_freq(sc->clock, &clk_freq); + if (error != 0) { + device_printf(dev, "Could not get parent clock frequency. " + "Using default divider.\n"); + div_reg = vf610_div_table[nitems(vf610_div_table) - 1].reg_val; + } else { + + for (i = 0; i < nitems(vf610_div_table) - 1; i++) + if ((clk_freq / vf610_div_table[i].div) <= sc->freq) + break; + div_reg = vf610_div_table[i].reg_val; + } } - - for (i = 0; i < nitems(vf610_div_table) - 1; i++) - if ((clk_freq / vf610_div_table[i].div) <= sc->freq) - break; - - return vf610_div_table[i].reg_val; +#endif + vf_i2c_dbg(sc, "Writing 0x%02X to clock divider register\n", div_reg); + return div_reg; } static int i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) { - struct i2c_softc *sc; - uint32_t div; + struct vf_i2c_softc *sc; + uint8_t div_reg; sc = device_get_softc(dev); - div = i2c_get_div_val(dev); - vf_i2c_dbg(sc, "Div val: %02x\n", div); - + div_reg = i2c_get_div_val(dev); vf_i2c_dbg(sc, "i2c reset\n"); switch (speed) { @@ -484,7 +483,9 @@ i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) DELAY(1000); - WRITE1(sc, I2C_IBFD, div); + if(div_reg != DIV_REG_UNSET) + WRITE1(sc, I2C_IBFD, div_reg); + WRITE1(sc, I2C_IBCR, 0x0); /* Enable i2c */ DELAY(1000); @@ -497,7 +498,7 @@ i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) static int i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; int error; sc = device_get_softc(dev); @@ -549,7 +550,7 @@ i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) static int i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) { - struct i2c_softc *sc; + struct vf_i2c_softc *sc; int error; sc = device_get_softc(dev); @@ -580,20 +581,20 @@ i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) return (IIC_NOERR); } -static phandle_t -i2c_get_node(device_t bus, device_t dev) -{ - - return ofw_bus_get_node(bus); -} - static device_method_t i2c_methods[] = { - DEVMETHOD(device_probe, i2c_probe), - DEVMETHOD(device_attach, i2c_attach), + /* Device interface */ DEVMETHOD(device_detach, i2c_detach), - DEVMETHOD(ofw_bus_get_node, i2c_get_node), + /* Device interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + /* iicbus interface */ DEVMETHOD(iicbus_callback, iicbus_null_callback), DEVMETHOD(iicbus_repeated_start, i2c_repeated_start), DEVMETHOD(iicbus_start, i2c_start), @@ -602,10 +603,11 @@ static device_method_t i2c_methods[] = { DEVMETHOD(iicbus_read, i2c_read), DEVMETHOD(iicbus_write, i2c_write), DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), - { 0, 0 } + DEVMETHOD_END }; -static DEFINE_CLASS_0(i2c, i2c_driver, i2c_methods, sizeof(struct i2c_softc)); -DRIVER_MODULE(vybrid_i2c, simplebus, i2c_driver, 0, 0); -DRIVER_MODULE(iicbus, i2c, iicbus_driver, 0, 0); -DRIVER_MODULE(ofw_iicbus, i2c, ofw_iicbus_driver, 0, 0); +driver_t vf_i2c_driver = { + "i2c", + i2c_methods, + sizeof(struct vf_i2c_softc), +}; diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.h b/sys/dev/iicbus/controller/vybrid/vf_i2c.h new file mode 100644 index 000000000000..8be6e2d86324 --- /dev/null +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.h @@ -0,0 +1,75 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2024 Pierre-Luc Drouin + * + * 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. + */ + +/* + * Vybrid Family Inter-Integrated Circuit (I2C) + * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * + * The current implementation is based on the original driver by Ruslan Bukin, + * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val + * Packett. + */ + +#ifndef __VF_I2C_H__ +#define __VF_I2C_H__ + +#include "opt_acpi.h" +#include "opt_platform.h" + +#ifdef FDT +#include +#endif + +#define VF_I2C_DEVSTR "Vybrid Family Inter-Integrated Circuit (I2C)" + +#define HW_MVF600 0x01 +#define HW_VF610 0x02 + +#define MVF600_DIV_REG 0x14 + +#define VF_I2C_DEFAULT_BUS_SPEED 100000 + +struct vf_i2c_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + uint32_t freq; + device_t dev; + device_t iicbus; + struct mtx mutex; + uintptr_t hwtype; +#ifdef FDT + clk_t clock; +#endif +}; + +extern driver_t vf_i2c_driver; + +device_attach_t vf_i2c_attach_common; + +#endif /* !__VF_I2C_H__ */ diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c b/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c new file mode 100644 index 000000000000..03f5c99a45c6 --- /dev/null +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c @@ -0,0 +1,101 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Pierre-Luc Drouin + * + * 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. + */ + +/* + * Vybrid Family Inter-Integrated Circuit (I2C) + * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * + * The current implementation is based on the original driver by Ruslan Bukin, + * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val + * Packett. + */ + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +static char *vf_i2c_ids[] = { + "NXP0001", + NULL +}; + +static int +vf_i2c_acpi_probe(device_t dev) +{ + int rv; + + if (acpi_disabled("vf_i2c")) + return (ENXIO); + + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, vf_i2c_ids, NULL); + if (rv > 0) + return (rv); + + device_set_desc(dev, VF_I2C_DEVSTR); + return (BUS_PROBE_DEFAULT); +} + +static int +vf_i2c_acpi_attach(device_t dev) +{ + struct vf_i2c_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->hwtype = HW_VF610; + sc->freq = 0; + + return (vf_i2c_attach_common(dev)); +} + +static device_method_t vf_i2c_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vf_i2c_acpi_probe), + DEVMETHOD(device_attach, vf_i2c_acpi_attach), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(vf_i2c_acpi, vf_i2c_acpi_driver, vf_i2c_acpi_methods, + sizeof(struct vf_i2c_softc), vf_i2c_driver); + +DRIVER_MODULE(vf_i2c_acpi, acpi, vf_i2c_acpi_driver, 0, 0); +DRIVER_MODULE(iicbus, vf_i2c_acpi, iicbus_driver, 0, 0); +DRIVER_MODULE(acpi_iicbus, vf_i2c_acpi, acpi_iicbus_driver, 0, 0); diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c b/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c new file mode 100644 index 000000000000..935f389ab516 --- /dev/null +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c @@ -0,0 +1,122 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2014 Ruslan Bukin + * Copyright (c) 2024 Pierre-Luc Drouin + * + * 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. + */ + +/* + * Vybrid Family Inter-Integrated Circuit (I2C) + * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * + * The current implementation is based on the original driver by Ruslan Bukin, + * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val + * Packett. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +static const struct ofw_compat_data vf_i2c_compat_data[] = { + {"fsl,mvf600-i2c", HW_MVF600}, + {"fsl,vf610-i2c", HW_VF610}, + {NULL, 0} +}; + +static int +vf_i2c_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, vf_i2c_compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, VF_I2C_DEVSTR); + return (BUS_PROBE_DEFAULT); +} + +static int +vf_i2c_fdt_attach(device_t dev) +{ + struct vf_i2c_softc *sc; + phandle_t node; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->hwtype = ofw_bus_search_compatible(dev, vf_i2c_compat_data)->ocd_data; + node = ofw_bus_get_node(dev); + + error = clk_get_by_ofw_index(dev, node, 0, &sc->clock); + if (error != 0) { + sc->freq = 0; + device_printf(dev, "Parent clock not found.\n"); + } else { + if (OF_hasprop(node, "clock-frequency")) + OF_getencprop(node, "clock-frequency", &sc->freq, + sizeof(sc->freq)); + else + sc->freq = VF_I2C_DEFAULT_BUS_SPEED; + } + return (vf_i2c_attach_common(dev)); +} + +static phandle_t +vf_i2c_get_node(device_t bus, device_t dev) +{ + return (ofw_bus_get_node(bus)); +} + +static device_method_t vf_i2c_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, vf_i2c_fdt_probe), + DEVMETHOD(device_attach, vf_i2c_fdt_attach), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, vf_i2c_get_node), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(vf_i2c_fdt, vf_i2c_fdt_driver, vf_i2c_fdt_methods, + sizeof(struct vf_i2c_softc), vf_i2c_driver); + +DRIVER_MODULE(vf_i2c_fdt, simplebus, vf_i2c_fdt_driver, 0, 0); +DRIVER_MODULE(iicbus, vf_i2c_fdt, iicbus_driver, 0, 0); +DRIVER_MODULE(ofw_iicbus, vf_i2c_fdt, ofw_iicbus_driver, 0, 0); + diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 4dedd440017f..b6327ec224af 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -396,6 +396,7 @@ SUBDIR= \ unionfs \ usb \ ${_vesa} \ + ${_vf_i2c} \ virtio \ vge \ ${_viawd} \ @@ -686,6 +687,7 @@ _dpaa2= dpaa2 _sff= sff _em= em _hyperv= hyperv +_vf_i2c= vf_i2c .if !empty(OPT_FDT) _allwinner= allwinner diff --git a/sys/modules/vf_i2c/Makefile b/sys/modules/vf_i2c/Makefile new file mode 100644 index 000000000000..53c9f9948ac8 --- /dev/null +++ b/sys/modules/vf_i2c/Makefile @@ -0,0 +1,14 @@ +.PATH: ${SRCTOP}/sys/dev/iicbus/controller/vybrid + +KMOD= vf_i2c +SRCS= vf_i2c.c vf_i2c.h +SRCS+= device_if.h bus_if.h iicbus_if.h +SRCS+= opt_acpi.h opt_platform.h + +SRCS.DEV_ACPI= vf_i2c_acpi.c acpi_if.h + +.if !empty(OPT_FDT) +SRCS+= vf_i2c_fdt.c ofw_bus_if.h clknode_if.h +.endif + +.include From nobody Mon Apr 1 23:47:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nkG6JT9z5FRHZ; Mon, 1 Apr 2024 23:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nkG41Xcz4QHF; Mon, 1 Apr 2024 23:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWu2nrLRSEzYrvl0Svc8IIYYlAv9WtE/4lDjCgOlw9Y=; b=kgt4XpyjmoJ21pmFfsecAOUSTtGUKB7iHPjAfY/ENNlW4pZPd5bjYg4Q8T+uApzZTzhk6N 64L4L3DZeE6rNvosaCaWfxxI3CEWWTNFuex9F5fNP9Ouke8ZPwzzSw5FeaOJwK73/RLIr1 m6gzaFrZI5APsRF9YadPNjFbpV1fIEoEmSiAnT4KWp1pMDcxzbFwmS3tFHbdF62Q1HUKxj +wcsCX2gVA6HMH9mEVL6TWExzpEzrvpj67qAUBpuW1/VK5IBYQFmuGQCv7e2p9IPFkpfnm 6/3Pk5ELoMYsPvvKqcHcJma6IOuS5Di7d+z4A4o/9NOyD2OABviDQtsDbYBAVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015254; a=rsa-sha256; cv=none; b=n/Z/lzyBIFww8WPpkdduM8vraTxRcVEKirW4a3rYT7w77UyclnZ/RPiAlc65P6UELQx9qJ RTH86kwwKYG1GRVJ0whhQ9W4JCmqftJn0CJI/+LlVr347FVSpX4Mr6igJU732WM7N2ei+3 RGpsHGDY9CM094uMEmBywFlL8nY98qpt81We9xabWH1rrWvgcrCBtJ6iEDk8UEduWVRzSC u0AMnMK/pbTmFSYJDSlhDu9Zew33A3zGRdia6bHdcFW6EBiKcSzNEvte7Oorb4275402fk HE16GK72Q8ROnQUCRI0SrBwd9L387c0nIZWZvveL0NFK30+SHByT1BBsYBfqsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWu2nrLRSEzYrvl0Svc8IIYYlAv9WtE/4lDjCgOlw9Y=; b=hCSzlt1dn1pI7LRVcvtGVnB3Jv/CpzmxUnwvPe0mLcRFXKnmfGrK9ZNOZOCBpBpjiZwT8l AHHIU6HKGsu3RULiEu56HCuUxyRWg/X9wX9LrIVxLfa3X5Tun2Vu+IRTo+XvDuT+/99qXl qrPAZv3xjjtzpi/JrESPehyBkmhmENKOyndX9Ir7sWLc4KDf9RKaPYNN13hoBivuHohjng 086MH3yxxR4kTNra1henu7Fp6U6Y8erNFL/Xtat0K7QObmLLGe1rKyxj2u+0ygmVGATPBj xPHzY51bzt8k2K52MfuTvtMTb0dAeHv/avW2zUgCAnCbNXJCWWFxTdzmA6iCkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nkG39C6zR70; Mon, 1 Apr 2024 23:47:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NlYa9084220; Mon, 1 Apr 2024 23:47:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NlYhq084217; Mon, 1 Apr 2024 23:47:34 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:47:34 GMT Message-Id: <202404012347.431NlYhq084217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4197e21ed39c - stable/14 - vf_i2c: update I2C controller logic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4197e21ed39c28d261a9cb08e6cb6fc351902a3a Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4197e21ed39c28d261a9cb08e6cb6fc351902a3a commit 4197e21ed39c28d261a9cb08e6cb6fc351902a3a Author: Pierre-Luc Drouin AuthorDate: 2024-03-22 22:13:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:46:11 +0000 vf_i2c: update I2C controller logic Update the I2C controller logic to be more consistent with the newer version of the controller reference manual. This makes it work better on modern LS/LX platforms and avoids unnecessary delays. Also fixes a lock leak. Tested by: bz (LS1088a FDT), Pierre-Luc Drouin (Honeycomb, ACPI) (cherry picked from commit 44847114bd4c61ed3dfcc879fa0d7deb452e12d3) --- sys/dev/iicbus/controller/vybrid/vf_i2c.c | 148 ++++++++++--------------- sys/dev/iicbus/controller/vybrid/vf_i2c.h | 3 +- sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c | 3 +- sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c | 3 +- 4 files changed, 65 insertions(+), 92 deletions(-) diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c index 7a6ec3948e13..d3c3664af78c 100644 --- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c @@ -28,7 +28,8 @@ /* * Vybrid Family Inter-Integrated Circuit (I2C) - * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Originally based on Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Currently based on Chapter 21, LX2160A Reference Manual, Rev. 1, 10/2021 * * The current implementation is based on the original driver by Ruslan Bukin, * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val @@ -184,6 +185,7 @@ vf_i2c_attach_common(device_t dev) mtx_unlock(&sc->mutex); sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { device_printf(dev, "could not add iicbus child"); mtx_destroy(&sc->mutex); @@ -233,24 +235,6 @@ i2c_detach(device_t dev) return (0); } -/* Wait for transfer interrupt flag */ -static int -wait_for_iif(struct vf_i2c_softc *sc) -{ - int retry; - - retry = 1000; - while (retry --) { - if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { - WRITE1(sc, I2C_IBSR, IBSR_IBIF); - return (IIC_NOERR); - } - DELAY(10); - } - - return (IIC_ETIMEOUT); -} - /* Wait for free bus */ static int wait_for_nibb(struct vf_i2c_softc *sc) @@ -272,14 +256,24 @@ static int wait_for_icf(struct vf_i2c_softc *sc) { int retry; + uint8_t ibsr; + + vf_i2c_dbg(sc, "i2c wait for transfer complete + interrupt flag\n"); retry = 1000; while (retry --) { - if (READ1(sc, I2C_IBSR) & IBSR_TCF) { - if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { - WRITE1(sc, I2C_IBSR, IBSR_IBIF); - return (IIC_NOERR); + ibsr = READ1(sc, I2C_IBSR); + + if (ibsr & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); + + if (ibsr & IBSR_IBAL) { + WRITE1(sc, I2C_IBSR, IBSR_IBAL); + return (IIC_EBUSBSY); } + + if (ibsr & IBSR_TCF) + return (IIC_NOERR); } DELAY(10); } @@ -309,30 +303,24 @@ i2c_repeated_start(device_t dev, u_char slave, int timeout) mtx_lock(&sc->mutex); - WRITE1(sc, I2C_IBAD, slave); - if ((READ1(sc, I2C_IBSR) & IBSR_IBB) == 0) { + vf_i2c_dbg(sc, "cant i2c repeat start: bus is no longer busy\n"); mtx_unlock(&sc->mutex); return (IIC_EBUSERR); } - /* Set repeated start condition */ - DELAY(10); - reg = READ1(sc, I2C_IBCR); reg |= (IBCR_RSTA | IBCR_IBIE); WRITE1(sc, I2C_IBCR, reg); - DELAY(10); - /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); - error = wait_for_iif(sc); + error = wait_for_icf(sc); if (!tx_acked(sc)) { - vf_i2c_dbg(sc, - "cant i2c start: missing ACK after slave addres\n"); + mtx_unlock(&sc->mutex); + vf_i2c_dbg(sc, "cant i2c repeat start: missing ACK after slave address\n"); return (IIC_ENOACK); } @@ -357,27 +345,32 @@ i2c_start(device_t dev, u_char slave, int timeout) mtx_lock(&sc->mutex); - WRITE1(sc, I2C_IBAD, slave); + error = wait_for_nibb(sc); - if (READ1(sc, I2C_IBSR) & IBSR_IBB) { + /* Reset controller if bus is still busy. */ + if (error == IIC_ETIMEOUT) { + WRITE1(sc, I2C_IBCR, IBCR_MDIS); + DELAY(1000); + WRITE1(sc, I2C_IBCR, IBCR_NOACK); + error = wait_for_nibb(sc); + } + + if (error != 0) { mtx_unlock(&sc->mutex); - vf_i2c_dbg(sc, "cant i2c start: IIC_EBUSBSY\n"); - return (IIC_EBUSERR); + vf_i2c_dbg(sc, "cant i2c start: %i\n", error); + return (error); } /* Set start condition */ - reg = (IBCR_MSSL | IBCR_NOACK | IBCR_IBIE); + reg = (IBCR_MSSL | IBCR_NOACK | IBCR_IBIE | IBCR_TXRX); WRITE1(sc, I2C_IBCR, reg); - DELAY(100); - - reg |= (IBCR_TXRX); - WRITE1(sc, I2C_IBCR, reg); + WRITE1(sc, I2C_IBSR, IBSR_IBIF); /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); - error = wait_for_iif(sc); + error = wait_for_icf(sc); if (error != 0) { mtx_unlock(&sc->mutex); vf_i2c_dbg(sc, "cant i2c start: iif error\n"); @@ -386,8 +379,7 @@ i2c_start(device_t dev, u_char slave, int timeout) mtx_unlock(&sc->mutex); if (!tx_acked(sc)) { - vf_i2c_dbg(sc, - "cant i2c start: missing QACK after slave addres\n"); + vf_i2c_dbg(sc, "cant i2c start: missing ACK after slave address\n"); return (IIC_ENOACK); } @@ -405,16 +397,9 @@ i2c_stop(device_t dev) mtx_lock(&sc->mutex); - WRITE1(sc, I2C_IBCR, IBCR_NOACK | IBCR_IBIE); - - DELAY(100); + if ((READ1(sc, I2C_IBCR) & IBCR_MSSL) != 0) + WRITE1(sc, I2C_IBCR, IBCR_NOACK | IBCR_IBIE); - /* Reset controller if bus still busy after STOP */ - if (wait_for_nibb(sc) == IIC_ETIMEOUT) { - WRITE1(sc, I2C_IBCR, IBCR_MDIS); - DELAY(1000); - WRITE1(sc, I2C_IBCR, IBCR_NOACK); - } mtx_unlock(&sc->mutex); return (IIC_NOERR); @@ -469,27 +454,14 @@ i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) div_reg = i2c_get_div_val(dev); vf_i2c_dbg(sc, "i2c reset\n"); - switch (speed) { - case IIC_FAST: - case IIC_SLOW: - case IIC_UNKNOWN: - case IIC_FASTEST: - default: - break; - } - mtx_lock(&sc->mutex); WRITE1(sc, I2C_IBCR, IBCR_MDIS); - DELAY(1000); - if(div_reg != DIV_REG_UNSET) WRITE1(sc, I2C_IBFD, div_reg); WRITE1(sc, I2C_IBCR, 0x0); /* Enable i2c */ - DELAY(1000); - mtx_unlock(&sc->mutex); return (IIC_NOERR); @@ -511,36 +483,34 @@ i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) if (len) { if (len == 1) - WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | \ - IBCR_NOACK); + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | IBCR_NOACK); else WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL); /* dummy read */ READ1(sc, I2C_IBDR); - DELAY(1000); - } - while (*read < len) { - error = wait_for_icf(sc); - if (error != 0) { - mtx_unlock(&sc->mutex); - return (error); - } + while (*read < len) { + error = wait_for_icf(sc); + if (error != 0) { + mtx_unlock(&sc->mutex); + return (error); + } - if ((*read == len - 2) && last) { - /* NO ACK on last byte */ - WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | \ - IBCR_NOACK); - } + if (last) { + if (*read == len - 2) { + /* NO ACK on last byte */ + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | IBCR_NOACK); - if ((*read == len - 1) && last) { - /* Transfer done, remove master bit */ - WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_NOACK); - } + } else if (*read == len - 1) { + /* Transfer done, remove master bit */ + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_NOACK); + } + } - *buf++ = READ1(sc, I2C_IBDR); - (*read)++; + *buf++ = READ1(sc, I2C_IBDR); + (*read)++; + } } mtx_unlock(&sc->mutex); @@ -563,7 +533,7 @@ i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) while (*sent < len) { WRITE1(sc, I2C_IBDR, *buf++); - error = wait_for_iif(sc); + error = wait_for_icf(sc); if (error != 0) { mtx_unlock(&sc->mutex); return (error); diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.h b/sys/dev/iicbus/controller/vybrid/vf_i2c.h index 8be6e2d86324..7eb9025893ed 100644 --- a/sys/dev/iicbus/controller/vybrid/vf_i2c.h +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.h @@ -28,7 +28,8 @@ /* * Vybrid Family Inter-Integrated Circuit (I2C) - * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Originally based on Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Currently based on Chapter 21, LX2160A Reference Manual, Rev. 1, 10/2021 * * The current implementation is based on the original driver by Ruslan Bukin, * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c b/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c index 03f5c99a45c6..0b18926ee2df 100644 --- a/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c_acpi.c @@ -27,7 +27,8 @@ /* * Vybrid Family Inter-Integrated Circuit (I2C) - * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Originally based on Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Currently based on Chapter 21, LX2160A Reference Manual, Rev. 1, 10/2021 * * The current implementation is based on the original driver by Ruslan Bukin, * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c b/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c index 935f389ab516..def5ce109caf 100644 --- a/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c +++ b/sys/dev/iicbus/controller/vybrid/vf_i2c_fdt.c @@ -28,7 +28,8 @@ /* * Vybrid Family Inter-Integrated Circuit (I2C) - * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Originally based on Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + * Currently based on Chapter 21, LX2160A Reference Manual, Rev. 1, 10/2021 * * The current implementation is based on the original driver by Ruslan Bukin, * later modified by Dawid Górecki, and split into FDT and ACPI drivers by Val From nobody Mon Apr 1 23:49:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nmt3HJMz5FRHn; Mon, 1 Apr 2024 23:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nmt2kfnz4S51; Mon, 1 Apr 2024 23:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C02FeL7WufYWy3SsH9TasBvK3/Zxsr6x1SVh19gZx8I=; b=rHxEA1Grffdy18yThNt0Nr+00FaAmeu6yqjqIlZ12rCT01XxM3O7+i6JHEX0vZWWHqzFtY bn4sti6cjgMxTxx4TZ5eMSPWVrWZR3ChRlBNMi/62SneuSkwyi7+n568VQqYMIvf+wQT0k XPuWN6dSPiGVFm/Ec1Arygo8xaU1t13/VrdUVu5Lq/+lPVmTdQbQjrvAxfD1phOOyXNIA+ OPS1dtSl2LdmfP4Mx8frCtbc5tMRokSk6B/dof+22XDiXgFjl1mij7BXNEfD31Qw68QoMz dNQg7g4z4fMRZFGKYiSFxz2BcQ/VuRGym3NY3z5Yk6nnNyB0oSSyPVxJlS5aAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015390; a=rsa-sha256; cv=none; b=C4dbKvg35fpMO2ZqVV1SXFQmEU2QtNSVVjKoEXzyjhOf4fmk2w8rQ47Spmm+QtlIeKTN0J Gg0Mwz2b+qKSrgeq/LQJ9T9xkyyCTti3QnmjDZSgUjZzWfnNXPGX2qHQUisxdY4Mc2cS6n M7PAWLnfZ5AYzYWkJEgD42wXDVA2e7gegaV/C216pBriUSZa2lbgr2+mdWfXHyePsjmtJM h0ehQas19sc7OnJI+hxM7lC/GeTIISemKtB1xzCNIdb5xV7ZHmBTOCMevnEuWWtcJPx6AG S4Md2aLToueKGHSx3mwU18D6+37REUojVktJZ0p99iFDrrPIeqb1OXkc72HinQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C02FeL7WufYWy3SsH9TasBvK3/Zxsr6x1SVh19gZx8I=; b=ewOWsFXczcIwLz9Px9knxQncN9TV9anlkvdYwRkif3fybsnbcM9Hote51y5uf5FYQawBVt Zub4L2pAoUJLQZ7fzzXvKfxLDI70nBJj6w80vKSSr/9kt7KZ+kh2P6sz1wtfLXlyR58Hek cSZScoJ/EAiCkO/M+1dDHPBM2Z+kULPxIyDMrhX/4VE/5CYIiQ57nJ4UQgjI2x6b8KsYBT L/NB+AoxT2P0kDPgGczKJQiLlayEiJ/8F19wtJMWmXDCXnxNLKYyeGGFSA6hoNc+M/3ZfM UC1YaBrFNaYfXP2XhXFrSUQp+LM/RHZh8avSXg08pF5uNlfAzXza48iQL0ksXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nmt2KRDzR1x; Mon, 1 Apr 2024 23:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431NnoWw084674; Mon, 1 Apr 2024 23:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NnomJ084671; Mon, 1 Apr 2024 23:49:50 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:49:50 GMT Message-Id: <202404012349.431NnomJ084671@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: 87c576a25a1f - stable/14 - release: rework distributions list List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 87c576a25a1f79730843b20a843b69e3f21f77f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87c576a25a1f79730843b20a843b69e3f21f77f6 commit 87c576a25a1f79730843b20a843b69e3f21f77f6 Author: Ed Maste AuthorDate: 2024-01-22 14:49:02 +0000 Commit: Ed Maste CommitDate: 2024-04-01 23:49:25 +0000 release: rework distributions list Components like base.txz and ports.txz are called distributions in the installer, and with the introduction of pkgbase we will start dealing with normal pkg packages in the installer. Rename EXTRA_PACKAGES to DISTRIBUTIONS, and move base.txz and kernel.txz to that list. This introduces no functional change but is a small cleanup in advance of some pkgbase experimentation. Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43544 (cherry picked from commit 2e9b8c8c1e3938335e17e63049887f8e8c6e11bc) --- release/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/Makefile b/release/Makefile index 92d0106384a6..2cf6efe2e231 100644 --- a/release/Makefile +++ b/release/Makefile @@ -75,12 +75,12 @@ VOLUME_LABEL= FreeBSD_Install NOPORTS= true .endif -EXTRA_PACKAGES= +DISTRIBUTIONS= base.txz kernel.txz .if !defined(NOPORTS) -EXTRA_PACKAGES+= ports.txz +DISTRIBUTIONS+= ports.txz .endif .if !defined(NOSRC) -EXTRA_PACKAGES+= src.txz +DISTRIBUTIONS+= src.txz .endif RELEASE_TARGETS= ftp @@ -287,7 +287,7 @@ mini-memstick: mini-memstick.img mini-memstick.img: bootonly cd bootonly && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET} -packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} +packagesystem: ${DISTRIBUTIONS} sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} From nobody Mon Apr 1 23:50:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7nnx3RBmz5FRps; Mon, 1 Apr 2024 23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7nnx1b1Lz4SDM; Mon, 1 Apr 2024 23: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=1712015445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMVkEgjTc+Du/NYOJfPZSIY8dsNHeOVVNDP2JH6pY+U=; b=cmpfTmZCGkEYdYPrZMmVhGYyluBIgqneia7v73DK0Pil20tVMdvQ42u9fE4XH6YFBGC/Z9 eYIIK8aebGuAHi9IjEpGNn+SWXfqmSnVwq32tHKQ/n5+2bJlh3aEPfrZsCYwRevaEinHB2 UqKeJkkUDPsL2WGUDDdWcmhqkbFI7CndWMCK6N3YhAZk9CEWtegSseDMcxWp0gUJ7HyRcm UwUYPOZnx+XnuR3vCVwoyW9m1eUjjpHU6uEgirFjC/jcwlfqYylRbWYDvh+Kxxa81JKsbK p/WxorQjQVPoftCuFjXQvtTLT2QQQ9iO6BZxfMjHCs0xgG2xLNYuCSDW2N/O8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712015445; a=rsa-sha256; cv=none; b=s/EOTeGcEZ2IuxQZ8vww+VhXTcjdJXtY5FFUQ44AtbMT3RrcObJpgNzcwcCXwDoHyaRxKj WuyND5UrydcdZXItxV6y8P9rdyqajGFRBUfKRs1QavRvlL96Vx16+jUzGKq6ge1gqomkj0 1f3qSBpPmlNJJQMgtD48wrYFCzEJMJELbacnTw3qSOGV5dmGm/mF26AuWsUS1X0ytzPF9k YKUn7xNgmUBWW/tX5l+twpgIJ740kFz9sf9v2rNFGj0691ldB2xFgDoVO9cw7zuEMImfpP Y61R+Mi5BGZPk8hYwolW1dME9lbq8NEILsVxK0xphkGgAmjIZBaxsn6FV3ggPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712015445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMVkEgjTc+Du/NYOJfPZSIY8dsNHeOVVNDP2JH6pY+U=; b=abFR6gjHg1oPFwiRV2ItKmToSuhOUXWKR/VdKaJzYAn6x04WLD07T2vz7i7pZGvxSGAQv0 DvaYLdW0Ac+IRYK3kRYUS3d2AJQB4Sv7RDWn6Una8/FXW+K+uVN/h5z6emV4MmeiKE1S+v Qlrfh7tzHFz9S4kM99Qx2pA8xL63Hh0Ff34X/ewqmjrsSl7cTYHG3SK/vabkRNKpaklFWW 36Rkc7qva/4bXGdi2wDyYhiVbDhA1Ae2ICyqIScBrAJLoEayropYwd0Pw5LgpfNJEkZmKh 05kM+rhumXtvxsI5eFqOyYByVVxtu9qYG9JGQici6dgFwLKvA5r5SmgNb0lcwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7nnx1C2VzQbv; Mon, 1 Apr 2024 23:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 431Noj5u094412; Mon, 1 Apr 2024 23:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 431NojCl094409; Mon, 1 Apr 2024 23:50:45 GMT (envelope-from git) Date: Mon, 1 Apr 2024 23:50:45 GMT Message-Id: <202404012350.431NojCl094409@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: 7249e0d28c23 - stable/14 - crunch: remove fdisk from examples List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 7249e0d28c2327318a5869d41f506edaddc94adb Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7249e0d28c2327318a5869d41f506edaddc94adb commit 7249e0d28c2327318a5869d41f506edaddc94adb Author: Ed Maste AuthorDate: 2024-01-23 18:28:07 +0000 Commit: Ed Maste CommitDate: 2024-04-01 23:49:26 +0000 crunch: remove fdisk from examples It has been deprecated for a long time; gpart should be used instead. The man page was updated in 2015 to declare it obsolete (b8c19fd719945). (cherry picked from commit 1f41c1c1a3a9883ed4b239ed3ec2f4cf183ce1e8) --- usr.sbin/crunch/examples/filesystem.conf | 2 +- usr.sbin/crunch/examples/fixit.conf | 2 +- usr.sbin/crunch/examples/really-big.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/crunch/examples/filesystem.conf b/usr.sbin/crunch/examples/filesystem.conf index 5be30f528cce..c9a6cf0ce018 100644 --- a/usr.sbin/crunch/examples/filesystem.conf +++ b/usr.sbin/crunch/examples/filesystem.conf @@ -12,7 +12,7 @@ ln sh - ln sh -sh # /sbin -progs disklabel fdisk init mount newfs reboot umount +progs disklabel init mount newfs reboot umount ln reboot halt ln reboot fastboot ln reboot fasthalt diff --git a/usr.sbin/crunch/examples/fixit.conf b/usr.sbin/crunch/examples/fixit.conf index 5596d58c45f1..7c6539cf8aa5 100644 --- a/usr.sbin/crunch/examples/fixit.conf +++ b/usr.sbin/crunch/examples/fixit.conf @@ -21,7 +21,7 @@ ln sh -sh # init invokes the shell this way # /sbin stuff -progs chown clri disklabel dump dmesg fdisk fsck ifconfig init +progs chown clri disklabel dump dmesg fsck ifconfig init progs mknod mount newfs ping reboot restore swapon umount ln dump rdump ln restore rrestore diff --git a/usr.sbin/crunch/examples/really-big.conf b/usr.sbin/crunch/examples/really-big.conf index e6624a1ad836..12c08b73936f 100644 --- a/usr.sbin/crunch/examples/really-big.conf +++ b/usr.sbin/crunch/examples/really-big.conf @@ -22,7 +22,7 @@ ln sh -sh srcdirs /usr/src/sbin -progs bim clri disklabel dmesg dump dumpfs fdisk fsck halt +progs bim clri disklabel dmesg dump dumpfs fsck halt progs ifconfig init mknod modload modunload mount mount_isofs progs mount_lofs mount_msdosfs mountd progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore From nobody Tue Apr 2 02:19:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V7s5Q6yhdz5FlDh; Tue, 2 Apr 2024 02:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V7s5Q6RLHz4h4s; Tue, 2 Apr 2024 02:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712024362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ABJEsE5d135f3pUgE7eyE5hHUKNQjvrRngQFyHM6JbA=; b=Qpyqemb17rXy+bUBp+I05nkQW6vhIrOmmEanCZjX+q4LNPtaLXiz8XjR9eBX8HFU0vTurP lFYB1rDvSbU4tOH4MW6zqeX2zQWQaor9iub1SxYrYNeDD0sdjp6J/3nekqRVd6rjjWHdAa I328InWNtUiKm58D4yCoZITkpDsLcuIVmBNJ3FjdLprqtbc4DZ88s61Qsf4w4EC7X4N2oJ dPiwPNwVtPkCtzfd9qP4xXYPq0VGrel4vFPIkXNcD3UOZRQIfef2+nW960Ttk1e5FSo9re 8eISCA4sE7dtpAIs0LbR2TVDJ1CHdF+idcYDn5+EdfS9cAYDS92/JVIp1hU3Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712024362; a=rsa-sha256; cv=none; b=Dge3aV3Ghrwn1MCqXBMyMfXEFX7dXYsP4T63TprOqqjy8WasVU146o+uHFumBGYeF66Em3 YBZnDyYMxwkbhwazl/3tSOq54WEpQXD5uFU7GwroueXoJMIKzHcejkOjWNu9JZjXc5rCtf xaeYHO3PCpLyf4P9brX7lxkrpNNf/nhE7v0hbAaualplGDw9OabZEY+NgR/Of/BrOl5kVp nc5zGm1rwb5/7pKJJfTb38F0A7fTIIzbqDattMQOBUvao7joRmyY8F485WAlcREGq94bwY rJ3uGBaMUD2nheySxQjip97wATaQ2d7yg9CSMrQdXxtvE0Cr/ck3A6YkMHMJUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712024362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ABJEsE5d135f3pUgE7eyE5hHUKNQjvrRngQFyHM6JbA=; b=ROwnM04la8ONLJGFiSKDFaFNbFY1Jy/vvAHmjp+zFflIFpudUxqi9QLRxfFY9cu3vS7Ns3 OQ26U+ZsK4m026aaAF5ro+uxgx43hH6p1C0X/vMqXhnnso7VNyGucNMg5kuVheXGJ4HPw0 Na+UjGwoziUFtHZmKkBmTUj21MqeRKHmBhgRS5abtTwHpaw9dzTYeV2qimZhAcZWL1JW7Z bpnswR3yPw4BE3bNu2GibpmdKqsDvn9rMlSg1Lh2pWBSQt33+BdoxQXP24LQqMCyZZd/Lv fCA8+oSxJGyaz9Tomvmhs8G2hVUZFW/V0NwsRkVHnxjXyHwYBgsWoE2cvBnUOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V7s5Q5wJqzX3r; Tue, 2 Apr 2024 02:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4322JM28037518; Tue, 2 Apr 2024 02:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4322JMXH037515; Tue, 2 Apr 2024 02:19:22 GMT (envelope-from git) Date: Tue, 2 Apr 2024 02:19:22 GMT Message-Id: <202404020219.4322JMXH037515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Justin Hibbits Subject: git: 44aac9115f75 - stable/14 - powerpc: Bump maximum number of FDT reserved mem entries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 44aac9115f75fc98c955758c202e0025ae4a0876 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=44aac9115f75fc98c955758c202e0025ae4a0876 commit 44aac9115f75fc98c955758c202e0025ae4a0876 Author: Shawn Anastasio AuthorDate: 2024-02-27 19:40:50 +0000 Commit: Justin Hibbits CommitDate: 2024-04-02 02:09:57 +0000 powerpc: Bump maximum number of FDT reserved mem entries Newer firmware on POWER systems, including v2.10 of the Talos II and Blackbird firmware can end up reserving more than 32 memory regions in the device tree, which exceeded an assumption made by ofw_machdep.c's excise_fdt_reserved(). Bump the maximum number of FDT reservations to the next power of 2 in order to fix booting on newer firmware. PR: 277097 Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D44015 (cherry picked from commit b52dceb838116391996909ff50b49f950ee01f48) --- sys/powerpc/ofw/ofw_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c index f850efa6c713..6d7b0b01fc84 100644 --- a/sys/powerpc/ofw/ofw_machdep.c +++ b/sys/powerpc/ofw/ofw_machdep.c @@ -426,7 +426,7 @@ excise_msi_region(struct mem_region *avail, int asz) static int excise_fdt_reserved(struct mem_region *avail, int asz) { - struct mem_region fdtmap[32]; + struct mem_region fdtmap[64]; ssize_t fdtmapsize; phandle_t chosen; int j, fdtentries; From nobody Tue Apr 2 08:59:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V81zJ6l7vz5G4ZH; Tue, 2 Apr 2024 08:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V81zJ6DMRz4VM6; Tue, 2 Apr 2024 08:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712048380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Jbx2XDpo8Xv1ES0eAcnTwD08eazOi9U6yoG3mS67Ek=; b=qroNVbTrznkkYMHawao/o4tF5dcxpFlO5YRxA65DWlS5bXZLWiRemvZtA9IzZnX7jhThhS or8RS3bVK4byu8BcUY7c1G7HuDzA5hVe4YFI7A7JW5OeiEBPD7QtOa6qB0HAa7UMOfc0rR Kcfd9xWfdX6LudKjh9+Lo2Pg0lrL/xlD/ks6hUiPHxmhuMLpARVPzsEYwu4AjWZZGQlfbp PNle2sr+kc4xXgh2S5+5nbo7NtAaLMDJR/XUP5f88oo/a8L93gKZCXzaggb9zVcUffzCHQ VUkExhU1sBiuOks7YrjARbvBJxeuXab7lIEnZeLg+MPuMnoboTRteJJcQwY90A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712048380; a=rsa-sha256; cv=none; b=xxKhv/cFY/s6b3D9YJQs8XwLI95oQWt2UCgPuW5sXGwgo2LKFJne8HEqNpnp58TJrOHW1y v2JnRbVwuMQb1hjzXT4nbYlLhJCZcjwlkHJV4lok7Hkt+jiVTUYnLZc5mAJt/Ok+VLA/OX Q1bQvkOFXNAlYLMYzz3eM6WqDC+IyObFMgXTcd5f7Yc9Jr4vPuQ+ye1XnsMu0gY9z0ALKg EBuPtnSkKbmgDYEtvohRYhsy9M2sENlfJPCrmghMx5cGdlw6DWn/wav0r4bQIN8zFlYFet gbXMAhsF5KuddzXy/lj5DgcVlTPfKfiTmWE2Rvw4Z6O6OV1TCg83Mlz3P8ggIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712048380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Jbx2XDpo8Xv1ES0eAcnTwD08eazOi9U6yoG3mS67Ek=; b=Qck/5KuRobR2iwGlKqMrEuMicwwMXUQ7/VoljLeOmsTsPPTwpV53xqMuqw1zNk3l4V1NSc Q9ZZLLY3eEDcUclcJbpcU7M4mQWPNpFGR1FtLVYZL893pc4mHN8R64dJ4kxH8sWonYqmWW yuKCU3feXkpUg6MU6n1sG6ClqNUvQsUxTJKCKWdhOenqgA4ORSMog/vLbvMYf5Fz3XJUxp 1lZ0XMpYtRh5W2GtNRTmaJvYaogCmHnNaHqNfN8pTI9zeAkYh/CBtBHwC5LqILl74jzcMO 6Jaqz+6Cph8ePN33RNh/h9e/zzDzuRIvBA1yEKOROf6wGmDjzyj5Wx/KLu+UHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V81zJ5qX4zjZ3; Tue, 2 Apr 2024 08:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4328xexX014597; Tue, 2 Apr 2024 08:59:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4328xett014594; Tue, 2 Apr 2024 08:59:40 GMT (envelope-from git) Date: Tue, 2 Apr 2024 08:59:40 GMT Message-Id: <202404020859.4328xett014594@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: b40ed1134d67 - stable/14 - x86: test the right CPUID bit when checking for XSAVEOPT support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: b40ed1134d6763ef8a24f6fe2f0f219dba5d3f6e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b40ed1134d6763ef8a24f6fe2f0f219dba5d3f6e commit b40ed1134d6763ef8a24f6fe2f0f219dba5d3f6e Author: Konstantin Belousov AuthorDate: 2024-03-25 10:34:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 08:58:20 +0000 x86: test the right CPUID bit when checking for XSAVEOPT support (cherry picked from commit 960d151eaa1ecde109accc30ca0c3306551d8e58) --- sys/amd64/amd64/fpu.c | 5 ++++- sys/i386/i386/npx.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 3432e62bf7f8..63fcf7b0a361 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -236,9 +236,12 @@ fpurestore_fxrstor(void *addr) DEFINE_IFUNC(, void, fpusave, (void *)) { + u_int cp[4]; + if (!use_xsave) return (fpusave_fxsave); - if ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0) { + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { return ((cpu_stdext_feature & CPUID_STDEXT_NFPUSG) != 0 ? fpusave_xsaveopt64 : fpusave_xsaveopt3264); } diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index 26def3f433f1..9cbb1340e9d1 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -317,9 +317,13 @@ fpusave_fnsave(union savefpu *addr) DEFINE_IFUNC(, void, fpusave, (union savefpu *)) { - if (use_xsave) - return ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0 ? + u_int cp[4]; + + if (use_xsave) { + cpuid_count(0xd, 0x1, cp); + return ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0 ? fpusave_xsaveopt : fpusave_xsave); + } if (cpu_fxsr) return (fpusave_fxsave); return (fpusave_fnsave); From nobody Tue Apr 2 08:59:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V81zL0brdz5G4d2; Tue, 2 Apr 2024 08:59:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V81zL08L1z4VCw; Tue, 2 Apr 2024 08:59:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712048382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HaKcjFk7EqM7Ky0WjbKCyJKHcgn6J8in7P4ls6/QGXw=; b=Yv+zxZ57DuLo6rc7VltPP7Rx4Cv6ow9h0tAx2b6rQzlZMsk+J2HLRueuvBABWCpG40RBsB Ubp+jBlgNTOjIquV2JA9BZwpi+b0pPtmjrfieMiHz/qoywSM15pGpaFKPkt8OIRtMGH8SN VuxmkDXRhDkYTZaVHjppOMWvmfvpv05cupwoqdFyzuEMqLedLisiYt01FO/TxEj8WRZGQg zUMcIdoMTEYgt+ctctyPACQ0Qh0Kei05s0WIu8wCJ5RaULaIlvdXWR3PoICgniXPFWNxGO zClSGU+tpN/Vw/zp2dQtdazuK2DP1e/Wrw/f+e1/KqqmDKavVI782KgiQb29Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712048382; a=rsa-sha256; cv=none; b=Uq+IvhNwGL2ub/0ARDf6Sm8+DFEO9esVBP9+QK5zYiqrapxYhf9DrmTRQNTjP+ypJXatMX k2V6hfJmqWfkxPKrHB7hr/14PjxYRHkhzUN1CTwH0wxzgHTo2ZI9BWgeOxxtk1fY7ZTVSp pCNqZv+KQ253zvhoONS15e7sRL7E8fI92K9GWSmHJMMGz8NtYC9Y73+mVsXbeFBKc49DTw 7VRYGyX6ypCCVwV28rILdxa1mkVjgsBYMZoQVYdHb3yxgLv2Bm6WC2GJSoQYCmDvgVjrzC WCB8DK+PHpm1Mwhqzjbs5m9nBvsHOSBhsGqtfiu/7Re/WxK2CoxIcr4L5GtqOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712048382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HaKcjFk7EqM7Ky0WjbKCyJKHcgn6J8in7P4ls6/QGXw=; b=fCr36WunRDdNlBTa9k//6LWxEnfR9uPxWMY+ZYv/p5iPDmuy2TZuoDmK/xW0eukdXMX/vp A5myY03GKMXdUOs6BrxK601pVQdjScwJ06Ajx5Hq+Kq6OaenpmOy8i+vgO8aJMag/QBh1p NVaiZrAVtBNqnU0on373dBmgzjF7IkwlvCk/SvEvHCuR2rD8dK3orTgbhpibGjegE4Abcy /AuKaSdsPGeJtfHEAmoKHDQgqKleKxBNTeIOduF3/cvvEWiLJ6ZIuFgDnHd1cYI2vRRkEx rocANruFJ4AaADXP2O9fpaIiMFNFEnHjoSbT1J0dNZWQDTZqNRRDt3IC7rCMaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V81zK6tTGzj2S; Tue, 2 Apr 2024 08:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4328xfq6014651; Tue, 2 Apr 2024 08:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4328xflP014648; Tue, 2 Apr 2024 08:59:41 GMT (envelope-from git) Date: Tue, 2 Apr 2024 08:59:41 GMT Message-Id: <202404020859.4328xflP014648@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: 38c74c46b220 - stable/14 - amd64: initialize td_frame stack area for init(8) main thread List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 38c74c46b220d8f74335026c4dcca0ab368789d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=38c74c46b220d8f74335026c4dcca0ab368789d2 commit 38c74c46b220d8f74335026c4dcca0ab368789d2 Author: Konstantin Belousov AuthorDate: 2024-03-25 12:10:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 08:58:20 +0000 amd64: initialize td_frame stack area for init(8) main thread (cherry picked from commit e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b) --- sys/kern/init_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index a8df9f84a29a..8d650c7ea084 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -787,6 +787,7 @@ start_init(void *dummy) */ KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); + memset(td->td_frame, 0, sizeof(*td->td_frame)); oldvmspace = p->p_vmspace; error = kern_execve(td, &args, NULL, oldvmspace); KASSERT(error != 0, From nobody Tue Apr 2 08:59:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V81zM3f4Tz5G4ky; Tue, 2 Apr 2024 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V81zM19hRz4VGX; Tue, 2 Apr 2024 08: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=1712048383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MsP/zc8gCusSNUacYUbyJWrPZBBH4MA+sIr2OdzA5iA=; b=LpBeyGFwkp/ZXMuotneD0EqJ6XoN7nSZk9lmfRTyvpxZ+py01m+eiBto7QqtwsUxHVAfU6 /LHG2FpgLXCj5RbhJzmft/r5TV8nMGsOKAKiYLxK5yZVa0n6FusDPK2V3j4jYR28tqbang oVQoHgQJR18XIQ0K86ZUbTaBBb3JTVZxY/jjwQMvkD4qaj0/+PVydI1WoOeyWY+9VXbPHs XLYa5p5v5WpbkAeKmhqaWic6PFd2FljGi6/Llrsk5JMWAdNrjkTjR/7xyG2Ultd3/m7U9t 6wWrc8AuHMvs7PsjMAAZF+obzPhebXkd3m+xazp4R5f1dI6a3KX1NkWg9+ElZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712048383; a=rsa-sha256; cv=none; b=cwrICnsMtdVV6vhrKuZqQqrWTj7xxILc8XDMxt7Bdt9N8fhSbCR0Aj6vgvJ1i/1cGQN3Aq OlZdkwAKTjFVsFca+64pHg6csG/Xk10d8V0GYCXY6feIA6pAhMzS4z5CWQRRYyPvQptPpT hLaG1xIh8H4nrgg1W/Jr3ZzzYBky1/rxjI2kqyhVBcUL9Ev5omvYlMPcdlJ4OmyDOgIl1M sS1inHm+8xPY3pb01r2qiCy+CEYVtH62Ad5R2i8Hbu61QQlRBu/Yacf1/2rvQqzk12pn/N L0XZCOOudIpRQdWbce2w12XyOtDoY9QpT/x8oxv40bO15KosdTI2DTvZEnyGkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712048383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MsP/zc8gCusSNUacYUbyJWrPZBBH4MA+sIr2OdzA5iA=; b=jU6sEtscrlH6c14s2FIVVLbwFUfBT/HjanxiHcKcSC7f8cijVlKs/Jmi5EcQ2uA56cpDmH 1x2NLnSl90O6LYhbK0w+7qz2wrNvUjbb8p46Q/l6E9ahK+mxRzPSYARPfzK41tNZMheF9X W16KpzK8hxCfjhq+FB1omsxvyCzqrKHkohMZ5NHDzPaeiiWAEhVQnYeWsLG6uZU2V0Wb12 k+jXJedyxO4xqxTZjVBUPuXc4Mrj8L3580GKZ+u4rayPqIHdHWN6l9NtpO8oJyanBemxfh 5MDemXJfTXMKcYQHAowAOUygN+9vpXMzfixAX/HZx4H34G3os2dvjluh8wxNsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V81zM0nTTzj2T; Tue, 2 Apr 2024 08:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4328xhIN014714; Tue, 2 Apr 2024 08:59:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4328xhKQ014710; Tue, 2 Apr 2024 08:59:43 GMT (envelope-from git) Date: Tue, 2 Apr 2024 08:59:43 GMT Message-Id: <202404020859.4328xhKQ014710@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: 38fdb37047ea - stable/14 - x86: handle MXCSR from XSAVEOPT when x87 state was optimized List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 38fdb37047ead625b97b82e8f6532ed7bc404ee3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=38fdb37047ead625b97b82e8f6532ed7bc404ee3 commit 38fdb37047ead625b97b82e8f6532ed7bc404ee3 Author: Konstantin Belousov AuthorDate: 2024-03-27 11:01:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 08:58:20 +0000 x86: handle MXCSR from XSAVEOPT when x87 state was optimized PR: 275322 (cherry picked from commit 1c091d11261a3c8cc3728b92760e65242c0f5949) --- sys/amd64/amd64/fpu.c | 21 +++++++++++++++++++++ sys/i386/i386/npx.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 63fcf7b0a361..8a0666fc0614 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -853,7 +853,10 @@ fpugetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; + struct savefpu *s; + uint32_t mxcsr, mxcsr_mask; int max_ext_n, i, owned; + bool do_mxcsr; pcb = td->td_pcb; critical_enter(); @@ -884,10 +887,28 @@ fpugetregs(struct thread *td) bit = 1ULL << i; if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; + do_mxcsr = false; + if (i == 0 && (*xstate_bv & (XFEATURE_ENABLED_SSE | + XFEATURE_ENABLED_AVX)) != 0) { + /* + * x87 area was not saved by XSAVEOPT, + * but one of XMM or AVX was. Then we need + * to preserve MXCSR from being overwritten + * with the default value. + */ + s = (struct savefpu *)sa; + mxcsr = s->sv_env.en_mxcsr; + mxcsr_mask = s->sv_env.en_mxcsr_mask; + do_mxcsr = true; + } bcopy((char *)fpu_initialstate + xsave_area_desc[i].offset, sa + xsave_area_desc[i].offset, xsave_area_desc[i].size); + if (do_mxcsr) { + s->sv_env.en_mxcsr = mxcsr; + s->sv_env.en_mxcsr_mask = mxcsr_mask; + } *xstate_bv |= bit; } } diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index 9cbb1340e9d1..122452598f29 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -977,8 +977,11 @@ npxgetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; + union savefpu *s; + uint32_t mxcsr, mxcsr_mask; int max_ext_n, i; int owned; + bool do_mxcsr; if (!hw_float) return (_MC_FPOWNED_NONE); @@ -1021,10 +1024,28 @@ npxgetregs(struct thread *td) bit = 1ULL << i; if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; + do_mxcsr = false; + if (i == 0 && (*xstate_bv & (XFEATURE_ENABLED_SSE | + XFEATURE_ENABLED_AVX)) != 0) { + /* + * x87 area was not saved by XSAVEOPT, + * but one of XMM or AVX was. Then we need + * to preserve MXCSR from being overwritten + * with the default value. + */ + s = (union savefpu *)sa; + mxcsr = s->sv_xmm.sv_env.en_mxcsr; + mxcsr_mask = s->sv_xmm.sv_env.en_mxcsr_mask; + do_mxcsr = true; + } bcopy((char *)npx_initialstate + xsave_area_desc[i].offset, sa + xsave_area_desc[i].offset, xsave_area_desc[i].size); + if (do_mxcsr) { + s->sv_xmm.sv_env.en_mxcsr = mxcsr; + s->sv_xmm.sv_env.en_mxcsr_mask = mxcsr_mask; + } *xstate_bv |= bit; } } From nobody Tue Apr 2 09:53:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V839v5M5mz5G9hg; Tue, 2 Apr 2024 09:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V839v4sMqz4bsC; Tue, 2 Apr 2024 09:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712051635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VheO/VpcUe6z6l0e4/3tPkX6FCVZJkW41rxI9Rpy+Rg=; b=ASkxQW2O8XFhzoUa9d0KqR9ipbDCa+2JEeqgYTmHHM4Si2SU2nlz7ZS4qXP+Zh9GmBarQH H1Uq530jEACCYLZVNz0+ImKa2EPBMdSr0D1Cof/xexAba2djYg2ddIvkBdoDvd6iKU4TKM Xa5CDQJ8+JDprjmjqATZ+I6qu/P+VQDTE45eqH2KSWFryJwOOlUizZFmZ0TjCon1ZF/j3w MKundY2FCiDcVXM4LFCJ4yGvisGUeQISGHgkWzMssvTJ4mMiyRc6JJGznGppifBDa1FDVR cqezOuZvKlGAS0WRCiR/A8pMl8z4f+NO/kaMsUclSyMekrpjR+nGa4KS6NafQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712051635; a=rsa-sha256; cv=none; b=S6o6SAeHRdwM32Dez4a6HFhGTRG6qvgpA/yF/u1lC1uZsPYltvaUz/pJ7pkxaJuui4f5At LAQs087k/aFFMBgfOm8oa8lui8sli+AUoUWplI3ufVVi+Pb8PPf5sh1AGEqna6Ih8Gibux 9I/ndk/uWdbDTzPjtY1I5jJOOotYy4LIQ9gESGyPXNeRWm0gvGpjQg3ZZr2Tc5Urpz+UZi 7aCsNxdx3R/uct8P0lxvG6DBgfvv5KxZXb+RCf/jdF0bh6t2LTpPJpRmn9WbgKdRzHtTeA o17hy9abt+nwGFggYtEh880KLZ10w8zjfdFmJfhSKq0+RZwXf+MTQrZqSiL6fA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712051635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VheO/VpcUe6z6l0e4/3tPkX6FCVZJkW41rxI9Rpy+Rg=; b=TiAB328w+jDmWxvpQdg9x3xuqa0425ncLols2LIcmsY5moSsBMfOjYO0Y/D8z54Z3XfLqM wgUuwbQbyktezxtsIlZ4Fsc+8yYdRIPKuecfjXx6J54dkmzHKa8tqW9+FSXN8hifE9hmrP E7ZMP2ctIcg1JEYe2fxFeVSEGDcXp3U9QOT2lfRJJ/WMKumgq/8O6I2a3V/yyl1u/OuPXq msmVJYFnoH5bBxzUCDj8AOE9EGC7lWWZeE3jTqoJgtuHGnUEmaVREOWXSZyByhgIi+tYAf Kknfa6Yq5ftSfPIL0geLMAAw4RXfoYc94a4FVUQMd6bMuLxy7DBeg+YgiQMCeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V839v4TQSzlQ5; Tue, 2 Apr 2024 09:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4329rtKc015551; Tue, 2 Apr 2024 09:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4329rtAh015548; Tue, 2 Apr 2024 09:53:55 GMT (envelope-from git) Date: Tue, 2 Apr 2024 09:53:55 GMT Message-Id: <202404020953.4329rtAh015548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 465e5f1b8b80 - stable/13 - ath_hal/ar9300: allow JUPITER cards to read eeprom List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 465e5f1b8b80bac313e83b4e62d7c532ffb320d6 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=465e5f1b8b80bac313e83b4e62d7c532ffb320d6 commit 465e5f1b8b80bac313e83b4e62d7c532ffb320d6 Author: Bjoern A. Zeeb AuthorDate: 2024-03-12 21:22:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-01 23:52:40 +0000 ath_hal/ar9300: allow JUPITER cards to read eeprom In ar9300_eeprom_read_word() also allow JUPITER cards read the eeprom instead of returning an error. While this will not help all the 9462, 9485, 9565 OEM cards to work, it will make debugging of the next steps a lot easier. While here fix a typo in the error message if we do not get CAL. PR: 255337 Tested by: John Nielsen (john jnielsen net) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D44328 (cherry picked from commit f254aad33dfb5ce18b6b97b7d036b420310e9ed5) --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c index 0251222c50b4..073428c8fa71 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c @@ -225,7 +225,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar9300_eeprom_t *mptr, HAL_BOOL ar9300_eeprom_read_word(struct ath_hal *ah, u_int off, u_int16_t *data) { - if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah)) + if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_JUPITER(ah)) { (void) OS_REG_READ(ah, AR9300_EEPROM_OFFSET + (off << AR9300_EEPROM_S)); if (!ath_hal_wait(ah, @@ -4319,7 +4319,7 @@ ar9300_eeprom_restore_internal(struct ath_hal *ah, ar9300_eeprom_t *mptr, } #endif if (nptr < 0) { - ath_hal_printf(ah, "%s[%d] No vaid CAL, calling default template\n", + ath_hal_printf(ah, "%s[%d] No valid CAL, calling default template\n", __func__, __LINE__); nptr = ar9300_eeprom_restore_something(ah, mptr, mdata_size); } From nobody Tue Apr 2 13:54:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V88WS6tbzz5GfcD; Tue, 2 Apr 2024 13:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V88WS5QzZz46RV; Tue, 2 Apr 2024 13:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MtwtM7VCy5C0PVpvbTZcF4K9w0UOxdEp3YNQQTaKHR8=; b=tvh2inJorn4MUf7SK6AXQGTA0duJFbP6OjPdzJYH/rNdfnTF5alii+ZaF4YEfOYZA1RZkP rvKGeNMn/7NOY0f5usgjnpE41Htp2d4DObZysMkJSgAV5fFvTyr6qEfw97qAoKwAH8JKy5 NuF6dZPcho8ToRoRzo9IbIbhhbvS4mn5DSO4TqTNTykrY+4UdV4BonCchxqxedwykb/scG BTsKpAB0zerxGHPaF58//fM7QbiYc69p5/HzWs/rp8OyylkSne34k1w8DSbYNhmrAMB8k4 0GPr8kWnZNBWvY4ZH/oh6t0FhgwYb9dXZ+wcsW365FUsHguX/Frb3aS3+K5qUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712066068; a=rsa-sha256; cv=none; b=a3ZLNvkBRnM3kgTiyTeCai4OzL7i7RWFoWgaI2PoMldMI9Z3swBVuTD3PzayFIlGnTBd19 UhNDTNiSE9CclZb6SEC0K4nIlDCX6bLmO4/XKvjic42dsOJOaNw78jjuhf+jEvjIoAX5cN yUq6qviKTHSYlsWRJOVUTZhAFZvBUpauCyxw0ekTjULlzwuHvZRM9dn9ttZkj0dkEnUiwL QtVTUb7t6e26KecH+8uEmR0m5MaeZ2VEwKIlyQoABp5LQvqd6OPrHTZ6+oR4bfgTwl5dKJ Dm5DJTheLTcUCoFRVZEE3jgX3W1vuTz+8qDKsJRZEeaXvv/WEnTqL1949t2Dew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MtwtM7VCy5C0PVpvbTZcF4K9w0UOxdEp3YNQQTaKHR8=; b=j3ipSDi2YJRK/hkyqx+55OCN65RxI8d2GMmmNfPLZYfiAR2NU9OESbs7zcMt8vwy4ZS14A PxA4KJHPevQNwm1h/DuR1tZuN2dOwtNDVXB3Peu5WgT6s3vCo9+aTao/JTgo24K1ad10Yp 9LxfRM/n5EdMqH5M7GUtf/v3VY1yLJl+Mdw1rGkwpoXu4MhuQaRCSoMpseKZzmePMVdp6o duPPEYppW3EUTAtQ7uvUvm31VD9AMGS1EVhlZqElJMvqlY3LNmQXVs0eSKKjTwJLXB6KJA AHQvU/csROPNAKK++eB7sWpjNQQwPZMJUiykuqNmjfVKaWY9OPFlIdqeKN1khQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V88WS52STzsQj; Tue, 2 Apr 2024 13:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432DsSjg021455; Tue, 2 Apr 2024 13:54:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432DsSKd021452; Tue, 2 Apr 2024 13:54:28 GMT (envelope-from git) Date: Tue, 2 Apr 2024 13:54:28 GMT Message-Id: <202404021354.432DsSKd021452@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: 8db49fc84c53 - stable/14 - msgs: Use C99 bool instead of defining our own List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 8db49fc84c53dab69265fd9c1201a5fec336f343 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8db49fc84c53dab69265fd9c1201a5fec336f343 commit 8db49fc84c53dab69265fd9c1201a5fec336f343 Author: Collin Funk AuthorDate: 2024-02-06 12:40:05 +0000 Commit: Ed Maste CommitDate: 2024-04-02 13:53:51 +0000 msgs: Use C99 bool instead of defining our own Use stdbool.h definitions instead of defining non-standard ones. Signed-off-by: Collin Funk Pull-request: https://github.com/freebsd/freebsd-src/pull/1105 (cherry picked from commit 912b52a62c72ca9c96a396148a6b30ff9c0917e7) --- usr.bin/msgs/msgs.c | 97 ++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index e4b3b09efc81..980625bb3fd4 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -87,11 +87,10 @@ static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #include #include #include +#include #include "pathnames.h" #define CMODE 0644 /* bounds file creation mode */ -#define NO 0 -#define YES 1 #define SUPERUSER 0 /* superuser uid */ #define DAEMON 1 /* daemon uid */ #define NLINES 24 /* default number of lines/crt screen */ @@ -103,8 +102,6 @@ static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #define MORE "More? [ynq]" #define NOMORE "(No more) [q] ?" -typedef char bool; - static FILE *msgsrc; static FILE *newmsg; static const char *sep = "-"; @@ -122,11 +119,11 @@ static bool totty; static bool seenfrom; static bool seensubj; static bool blankline; -static bool printing = NO; -static bool mailing = NO; -static bool quitit = NO; -static bool sending = NO; -static bool intrpflg = NO; +static bool printing = false; +static bool mailing = false; +static bool quitit = false; +static bool sending = false; +static bool intrpflg = false; static uid_t uid; static int msg; static int prevmsg; @@ -137,14 +134,14 @@ static time_t t; static time_t keep; /* option initialization */ -static bool hdrs = NO; -static bool qopt = NO; -static bool hush = NO; -static bool send_msg = NO; -static bool locomode = NO; -static bool use_pager = NO; -static bool clean = NO; -static bool lastcmd = NO; +static bool hdrs = false; +static bool qopt = false; +static bool hush = false; +static bool send_msg = false; +static bool locomode = false; +static bool use_pager = false; +static bool clean = false; +static bool lastcmd = false; static jmp_buf tstpbuf; static void ask(const char *); @@ -200,35 +197,35 @@ main(int argc, char *argv[]) if (uid != SUPERUSER && uid != DAEMON) errx(1, "only the super-user can use the c flag"); - clean = YES; + clean = true; break; case 'f': /* silently */ - hush = YES; + hush = true; break; case 'h': /* headers only */ - hdrs = YES; + hdrs = true; break; case 'l': /* local msgs only */ - locomode = YES; + locomode = true; break; case 'o': /* option to save last message */ - lastcmd = YES; + lastcmd = true; break; case 'p': /* pipe thru 'more' during long msgs */ - use_pager = YES; + use_pager = true; break; case 'q': /* query only */ - qopt = YES; + qopt = true; break; case 's': /* sending TO msgs */ - send_msg = YES; + send_msg = true; break; default: @@ -246,13 +243,13 @@ main(int argc, char *argv[]) /* * Test access rights to the bounds file * This can be a little tricky. if(send_msg), then - * we will create it. We assume that if(send_msg), + * we will create it. We assume that if(send_msg), * then you have write permission there. * Else, it better be there, or we bail. */ - if (send_msg != YES) { + if (!send_msg) { if (stat(fname, &buf) < 0) { - if (hush != YES) { + if (!hush) { err(errno, "%s", fname); } else { exit(1); @@ -273,7 +270,7 @@ main(int argc, char *argv[]) if (clean || bounds == NULL) { /* relocate message bounds */ struct dirent *dp; struct stat stbuf; - bool seenany = NO; + bool seenany = false; DIR *dirp; dirp = opendir(_PATH_MSGS); @@ -314,7 +311,7 @@ main(int argc, char *argv[]) lastmsg = i; if (i < firstmsg) firstmsg = i; - seenany = YES; + seenany = true; } closedir(dirp); @@ -354,7 +351,7 @@ main(int argc, char *argv[]) fprintf(bounds, "%d %d\n", firstmsg, nextmsg); fclose(bounds); - sending = YES; + sending = true; if (ruptible) signal(SIGINT, onintr); @@ -368,10 +365,10 @@ main(int argc, char *argv[]) fflush(stdout); fprintf(newmsg, "From %s %sSubject: %s\n", ptr, ctime(&t), inbuf); - blankline = seensubj = YES; + blankline = seensubj = true; } else - blankline = seensubj = NO; + blankline = seensubj = false; for (;;) { fgets(inbuf, sizeof inbuf, stdin); if (feof(stdin) || ferror(stdin)) @@ -407,20 +404,20 @@ main(int argc, char *argv[]) snprintf(fname, sizeof(fname), "%s/%s", cp, MSGSRC); msgsrc = fopen(fname, "r"); if (msgsrc) { - newrc = NO; + newrc = false; fscanf(msgsrc, "%d\n", &nextmsg); fclose(msgsrc); if (nextmsg > lastmsg+1) { printf("Warning: bounds have been reset (%d, %d)\n", firstmsg, lastmsg); truncate(fname, (off_t)0); - newrc = YES; + newrc = true; } else if (!rcfirst) rcfirst = nextmsg - rcback; } else - newrc = YES; + newrc = true; msgsrc = fopen(fname, "r+"); if (msgsrc == NULL) msgsrc = fopen(fname, "w"); @@ -457,9 +454,9 @@ main(int argc, char *argv[]) #endif Lpp -= 6; /* for headers, etc. */ - already = NO; + already = false; prevmsg = firstmsg; - printing = YES; + printing = true; if (ruptible) signal(SIGINT, onintr); @@ -493,7 +490,7 @@ main(int argc, char *argv[]) if (totty) signal(SIGTSTP, onsusp); (void) setjmp(tstpbuf); - already = YES; + already = true; nlines = 2; if (seenfrom) { printf("Message %d:\nFrom %s %s", msg, from, date); @@ -548,7 +545,7 @@ cmnd: case 'q': /* FALLTHROUGH */ case 'Q': - quitit = YES; + quitit = true; printf("--Postponed--\n"); exit(0); /* NOTREACHED */ @@ -695,7 +692,7 @@ onintr(int unused __unused) sep = "Interrupt"; if (newmsg) fseeko(newmsg, (off_t)0, SEEK_END); - intrpflg = YES; + intrpflg = true; } } @@ -746,7 +743,7 @@ ask(const char *prompt) printf("%s ", prompt); fflush(stdout); - intrpflg = NO; + intrpflg = false; (void) fgets(inbuf, sizeof inbuf, stdin); if ((n = strlen(inbuf)) > 0 && inbuf[n - 1] == '\n') inbuf[n - 1] = '\0'; @@ -792,14 +789,14 @@ ask(const char *prompt) if (fd != -1) { snprintf(cmdbuf, sizeof(cmdbuf), _PATH_MAIL, fname); - mailing = YES; + mailing = true; } } if (fd == -1 || (cpto = fdopen(fd, "a")) == NULL) { if (fd != -1) close(fd); warn("%s", fname); - mailing = NO; + mailing = false; fseeko(newmsg, oldpos, SEEK_SET); ask(prompt); fclose(cpfrom); @@ -817,7 +814,7 @@ ask(const char *prompt) else { system(cmdbuf); unlink(fname); - mailing = NO; + mailing = false; } ask(prompt); } @@ -829,8 +826,8 @@ gfrsub(FILE *infile) off_t frompos; int count; - seensubj = seenfrom = NO; - local = YES; + seensubj = seenfrom = false; + local = true; subj[0] = from[0] = date[0] = '\0'; /* @@ -841,7 +838,7 @@ gfrsub(FILE *infile) /* * expected form starts with From */ - seenfrom = YES; + seenfrom = true; frompos = ftello(infile); ptr = from; in = nxtfld(inbuf); @@ -850,7 +847,7 @@ gfrsub(FILE *infile) while (*in && *in > ' ' && count-- > 0) { if (*in == ':' || *in == '@' || *in == '!') - local = NO; + local = false; *ptr++ = *in++; } } @@ -885,7 +882,7 @@ gfrsub(FILE *infile) * extract Subject line */ if (!seensubj && strncmp(inbuf, "Subj", 4)==0) { - seensubj = YES; + seensubj = true; frompos = ftello(infile); strlcpy(subj, nxtfld(inbuf), sizeof subj); } From nobody Tue Apr 2 13:56:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V88Yz4Mwxz5GfZg; Tue, 2 Apr 2024 13:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V88Yz3ZTLz46Zm; Tue, 2 Apr 2024 13:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EqUqrwU+PKtiinXZQl+kDfqtNwNW4Ssm+kOOf9m5gMI=; b=ZNhUe82sUhR+iZJo0DwiMx9MFS4Q9uL/GQX2mgdZK89NfaKWCSG4nB4pcGiAjqBFXcExvH 414pkr2OXLV5lLzeYOiiAXlQlJEQyt5v8b/m8o5AE7s+BEVpDk684Nwu/y1HexYRXKaYsQ 3aBpM7n3iHeSOFL7yldSWX576qyCwmQrEBdF21nvSkVQa8s8RLwa0Ase8lTmR9Z6QMqMEE EojV+ljIltAMwEm5Zdv+KW2dV8AA4KnfFew10weA4vbuJiqhYdqZGxmDeNJ8qORZP0hvTp FcUp+p0dKMoMVy2gz/BP6PdD3Yio4A4d/iZvNGi3UYSzyDfhuJ3AbQsPea+iWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712066199; a=rsa-sha256; cv=none; b=Rv20TEgokdggAUee4xaUpZa3s1aphik0BY9bq9LMMXhgmYasocc5M3EHALjnUCuYvIHkcJ 3h6Do/jdIIFgkQXJ20niLTFkPbOrOOJLmW3vOc1UggzjGwWxmT8y5Fowv7q6ahtsGQhvt5 LBRTV5q1BRyNzLvzsJn4q1reYqp5W5hgbURSH2HWweqem7UvC5fjIPcUQDKlwUJcxPLA+A lKHtbIMgSWgAEsMCKmj1pE6VsJseQ6IsXVrkx9G8O3KWckm50dr4AtnkNh1ZV5qBDZro+G nfhRvqO8p8JebemQhH3TNl9X2xTraQCgRxeqJTzZZkBY2TqwioGULytoIJVmqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EqUqrwU+PKtiinXZQl+kDfqtNwNW4Ssm+kOOf9m5gMI=; b=kGEA1/zM3ZSd4k0rzpxkE+uYJ41LQHI6+sg3MNMkb3Vv8/eKOnWe4Wo4YK0TqoaoHQdoHz 1++hEgH51H4BNJfKjbWzJnPvkwZzZi2Xyhg5U1JRdAE2ruid9zJBbIuiKkqNnoV5C8L2Aw R1KjDZaFn59HICR3xhtlO5GbMmMBGlWmbJAPriKxzK4y3C8gAwRhoRZ2+Tr6ZkSlAA2BVy tsg+KubbJteM9augf48dqDR70lgPHPTkIJE3zQh/DA5Gx5iUmZGPFKHazWuuoZDzLJ97my ve9VR8uK0XN9EFAR/foeCdLtymzZOQ7+g785WYYsxCJ/Bd6Q/7CESL2LI5jduA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V88Yz37n7zsQk; Tue, 2 Apr 2024 13:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432Duddu021983; Tue, 2 Apr 2024 13:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432DudpH021980; Tue, 2 Apr 2024 13:56:39 GMT (envelope-from git) Date: Tue, 2 Apr 2024 13:56:39 GMT Message-Id: <202404021356.432DudpH021980@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: 9f9289901c86 - stable/14 - bsdlabel: add BUGS section documenting 8 partition limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 9f9289901c86e88c7eb357ecfe3334369356b1b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9f9289901c86e88c7eb357ecfe3334369356b1b0 commit 9f9289901c86e88c7eb357ecfe3334369356b1b0 Author: Ed Maste AuthorDate: 2024-03-25 22:25:05 +0000 Commit: Ed Maste CommitDate: 2024-04-02 13:56:28 +0000 bsdlabel: add BUGS section documenting 8 partition limit PR: 276517 (cherry picked from commit 7dc5c6c4120ee6d5a028a1e01cdc1bfbe9499634) --- sbin/bsdlabel/bsdlabel.8 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index 9228bba78d4b..a1ff2a78f1f0 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -504,3 +504,8 @@ The .Nm disklabel utility appeared in .Bx 4.3 Tahoe . +.Sh BUGS +.\" PR276517 +The disklabel scheme supports up to 20 partitions, but +.Nm +supports only 8 partitions. From nobody Tue Apr 2 13:57:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V88Zt4KTXz5GfRs; Tue, 2 Apr 2024 13:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V88Zt36tsz46wP; Tue, 2 Apr 2024 13:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RsIKzI1ZeDVM8NbvJP0wfnhJxaRTvWWa6CHJC2lOOc=; b=Xbk4xUyjCGAEGHzHqM8I9Hz8moE5/aw7CEywpTa33GjqJWXgg17XbA6bPkEm12kxKWaTTU LnvizguqJz+0DyYalYWBg8xJNRNZpolmwqqkWL5HCBxQno7FhLtrZGlCeZCeREX74DLabM nOlD7hVxgQk4LuWFPWPjduBrhLTzjNUizd1xKREeDEnL1epP50DmHYSWCdsbUUYduXtI0z BBjytxYlT5KeYjIQQPhxJ7I1yd5hi2NPsJwtQLU5gNofTa4IxTQDxl2R813t7Ex5tK5d+9 1K8mIWnN0qj6Dj948g2cEJwQwJBgWdDu7OeFDaHCrEdspKukfytnh93crS/siw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712066246; a=rsa-sha256; cv=none; b=gcg/6YKVJtnlmgj/dCwDb2M07L+qaN70j6zTBJPw0XS+a1Q9lNGoAgLx2z7r6jJlJ29dfO oTt+vNnB4JyQGLNLDlOYlD1LwvfsXkt+WqhUHmx7zteF1RaqCQRm+Aczrs6/+b1Q/cL2Tp G1qGXhiYOaquiuMHAbB0TRT5NSu2MdljVdNOsi3UWlil4jS8OssuMQxiVX4bVjOEzRiD4x Zu5G45BOm4a5kQWnAAQQaVN+GkhKd5sdSCaBxlplKZClxKvU139uQDgi9FfyZ1MM7BzyKs awQLWvXx91JtNQRxR8M3pBQeQOl5l04wfqoExZW2iEgMt45fAPCaP7xEkGgfbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+RsIKzI1ZeDVM8NbvJP0wfnhJxaRTvWWa6CHJC2lOOc=; b=REzyBLG5gzvsAKB6E7Ru1kkh0ZQpjfKr5kYOZ+23r1tq0xJg/ct/zbMQt5K9x69uMaIaDQ d5OjWnMZJbddMESf82Xszt3MSBzO+fxGQ+Hhi93cudTzig6LF4ZG3uXdMlKTlg68tzTLyy TL3eSzBofV0LSbZJpwmdpV3/5YiCNm7BmXo2JM/C8+5Q8wMVTwzmnLMP4GNL3ZPJ8IRuCw gF7uCmUpIGSvDdTWE7UfzyU8vgjq+5cPfltpsrrcWswRVmYjtPyHoQ1J71LeXvR7CjaQeR v9inIIYDKsTDIGp/nZpZr1xIEXx8Y/t/s8a1AOAB/31sRuS3RyoV9TJ4L46GJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V88Zt2kn7zsQl; Tue, 2 Apr 2024 13:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432DvQET022219; Tue, 2 Apr 2024 13:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432DvQik022216; Tue, 2 Apr 2024 13:57:26 GMT (envelope-from git) Date: Tue, 2 Apr 2024 13:57:26 GMT Message-Id: <202404021357.432DvQik022216@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: 1f97fc87f1a6 - stable/14 - Cirrus-CI: Add manual Clang 18 jobs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 1f97fc87f1a66e0154bd14032ad5a79b020248ae Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1f97fc87f1a66e0154bd14032ad5a79b020248ae commit 1f97fc87f1a66e0154bd14032ad5a79b020248ae Author: Ed Maste AuthorDate: 2024-03-01 13:21:54 +0000 Commit: Ed Maste CommitDate: 2024-04-02 13:56:28 +0000 Cirrus-CI: Add manual Clang 18 jobs Work is in progress to import Clang/LLVM 18 as the base system compiler. llvm18-lite is not yet in the quarterly package set but but will be available in the not too distant future, and is available for src forks that switch to latest packages. Add manual llvm18 jobs now so that they can be used for testing. Sponsored by: The FreeBSD Foundation (cherry picked from commit 24235654f104d8613bbae1c44cd8f7c39b5fe8fe) --- .cirrus.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index d84614321145..90d031a919f2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,6 +29,14 @@ task: TARGET_ARCH: amd64 TOOLCHAIN: llvm17 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite + - name: amd64-llvm18 World and kernel build and boot smoke test + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: amd64 + TARGET_ARCH: amd64 + TOOLCHAIN: llvm18 + TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: arm64-llvm16 World and kernel build and boot smoke test only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual @@ -45,6 +53,14 @@ task: TARGET_ARCH: aarch64 TOOLCHAIN: llvm17 TOOLCHAIN_PKG: ${TOOLCHAIN} + - name: arm64-llvm18 World and kernel build and boot smoke test + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual + env: + TARGET: arm64 + TARGET_ARCH: aarch64 + TOOLCHAIN: llvm18 + TOOLCHAIN_PKG: ${TOOLCHAIN} - name: amd64-gcc12 World and kernel build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual From nobody Tue Apr 2 13:58:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V88cV5blrz5GfjX; Tue, 2 Apr 2024 13:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V88cV50kpz47Rc; Tue, 2 Apr 2024 13:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHIVTjQ2vomXqpurCdcNUU9jM1EiEYL7ZliZbFXnJao=; b=pDjE5CRKYvJ/GCoK6vPchTmXfNgxayplD1Qb1/Duhyn4QgBIAiwvEm4hhQtgTadLh4of9F 3Ih3WAWEegtRHLJplZEKypdvMf6mzF8pZ6xpmFhZ5tBfF/z6QRAd02feKI9KLBz/PShFtI tKrnsdN3oZmU0lOUWRu1ocw0F+eYNV1GeACx1p+Uoj8AkJQnEKWIA/lsqxQYcyQbyip1Xi O8im4n8Hi5GbIlaIWDRjikNxtGZfOBRdMkI6SLuVjDydhZApZPnC/2ExUGwAke7W+TjLG8 7kzBCEn/RgPoXUNShef3zwylxzj+Tc20UEl2tEC5iiuqUou12yOm2FR7bC4G/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712066330; a=rsa-sha256; cv=none; b=qPo4q+PDdteVeZ9M+tjf8qghnNk3wkgbVQdEmyZ19gK8JW8MoIKekkLgL+DSIOfYqALkC3 qJlhUEi50Qiwg1r7MOoozf4I+RPvHRVbdSly+4uguLyA5be3YcuMoGqEAWjnMtCZ58XcI2 z+ydHV4/8oSFl1VueFtRiCKRyhsaJkQlSyG0C3zC8TSbsEZxo5EFgemHkcSmJbGDUPiEI0 RiKSX6WP7/w+vVHBT/L7kx1uwPkFt8NRLicgwj0YI/Nh5lXEiEBbs48mBnInQ3dQCEURVb DClVG0pi0U3qAWKlEXHbbGT9PpNr5escLF0+rSidu/rs2Y2TgD56+yrWA2bl4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712066330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHIVTjQ2vomXqpurCdcNUU9jM1EiEYL7ZliZbFXnJao=; b=OikfiYUmEtT/ho4wyRjuo2S32T74e+kN/C+Pi7TK57+kcpgQ2YsH06ktyPTnQAi3LBTxDC uiYuP+y3VJVDNeY1VTT1RZkR0XlJzxu71W53+fT25pD6LAQ9QJuDXw8OM0y22gFM7SCD8G pvYz8/CdQ9rUe0wHma4uf3fDzpW5XSlzoh3LURX+F5PEdoJ0ttjykE4rLdj0V5Yw5hS5rH +ROtWUUD/JUzePFptQmcQo13oKzXm/OBrrXgGDNXfolxr7bciiSu1s5ZcZMOklcAi8DGZq DPgymttoxOAxfKvo8KGVQw2GyscJb8XL9k+rNjxb+VBUGhHic12lE1pl4gSYGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V88cV4YXGzrjC; Tue, 2 Apr 2024 13:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432Dwod9022515; Tue, 2 Apr 2024 13:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432DwoWS022512; Tue, 2 Apr 2024 13:58:50 GMT (envelope-from git) Date: Tue, 2 Apr 2024 13:58:50 GMT Message-Id: <202404021358.432DwoWS022512@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: 51b2556ee60a - stable/13 - bsdlabel: add BUGS section documenting 8 partition limit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 51b2556ee60a503f89064152a897722a2daaa199 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=51b2556ee60a503f89064152a897722a2daaa199 commit 51b2556ee60a503f89064152a897722a2daaa199 Author: Ed Maste AuthorDate: 2024-03-25 22:25:05 +0000 Commit: Ed Maste CommitDate: 2024-04-02 13:58:37 +0000 bsdlabel: add BUGS section documenting 8 partition limit PR: 276517 (cherry picked from commit 7dc5c6c4120ee6d5a028a1e01cdc1bfbe9499634) (cherry picked from commit 9f9289901c86e88c7eb357ecfe3334369356b1b0) --- sbin/bsdlabel/bsdlabel.8 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/bsdlabel/bsdlabel.8 b/sbin/bsdlabel/bsdlabel.8 index 9228bba78d4b..a1ff2a78f1f0 100644 --- a/sbin/bsdlabel/bsdlabel.8 +++ b/sbin/bsdlabel/bsdlabel.8 @@ -504,3 +504,8 @@ The .Nm disklabel utility appeared in .Bx 4.3 Tahoe . +.Sh BUGS +.\" PR276517 +The disklabel scheme supports up to 20 partitions, but +.Nm +supports only 8 partitions. From nobody Tue Apr 2 15:18:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8BN74MBrz5GpYf; Tue, 2 Apr 2024 15:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8BN73jTMz4KYm; Tue, 2 Apr 2024 15:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivro18lXASLYjoOW3EbERQ0ktkhw6U3Y2Q5qWU5cyZI=; b=kCrmV9FxXp9u30R/6+zXCoRZQ+RW/WkC2/zLEeKHsSiatHfbHkwYqVnj+pbVHX/p+HOY3R MimbUZ4zD+J36ZwCkfjZ0dXStb9emzgtTbt33Ng/Mm2RlpsmNBbEPaQkgt6vfJAd6UJ0oT Ht9akeuNQcNqugmr9twQ6XQ4XoofNzNF+U4+YKFX8tC2a/l3NaWYMZ/shVl3CfG2TdmuD+ THGhq8rRSaFd69BZ+rbT0WyHNEr/hRNm3ySkQHiBajQCiPdx81wMvU/PUne6BSpxmzZtRf tR3NnB3OzveXNqPcoItmk/CdLECkM726vMH3tk7eyZy1eqOyL7NHB2u5ui+kpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712071095; a=rsa-sha256; cv=none; b=LtyywJLGRXE+AOeYaObyIwUj4RnRO0z6eJAJjun/FsR/D6K+632t+7Xc2ItkYrxPBe+kaT IVx+Z1ka8dkIGonb9QO0RhLBwuRQofSwVEr9pc4URpL4u9w2QKBmFwSUjFbrk3uIX2naSW EeiLy8unBuCuKiNeVkZfOtXjyGs1PzVWXNL/ho2MBGzExMeqwzLchRlv2vaAdOsLe5y8H0 2m3tu/xIEEVWtsmgH/rsWlH9pD/pNXD8ucEnUHE/CnFz4UCifQq4zZBTPnlDzQZ8kHfcXd JVS3EtpiXI2JptHQ0XqbirZ368d5n166hQGAL7ZwkVQQeNiAM8+19FXXPvZ9SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivro18lXASLYjoOW3EbERQ0ktkhw6U3Y2Q5qWU5cyZI=; b=okRemvomIpoh6rd5vnE+l8HXFeLsXg2n+NmpNVPYE2HQUbVQ2/O+QDBP8PgzSPhIOGr0Eq ypQdf6rmJ7KwoXMx9AkmIQq+Gk4KtQdq+DM1Q68EiIEhJhCF0gOLS+6bfZWK4M4b1ApATj x70Pf1lpGRJMLBcNFQV4NtnJhsPtxvxgB9UYGcxKTBjgvQweS07RLtU1tX5LbKsfDFnSkf 1FAb8sG2Iv7JgroyhfHEtFCe7nF0dIQz/Uj6mx/M8lC3ut/sM1ZvZRhFkzpvb059CGFFJj UaMfJ6kjwJLQt8TYf+Z9OwmoJqIRlmK7ObSbPz73s2eHow/5QKqetCm+ivyJ0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8BN73KY7zv28; Tue, 2 Apr 2024 15:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432FIFvR057677; Tue, 2 Apr 2024 15:18:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432FIFDL057674; Tue, 2 Apr 2024 15:18:15 GMT (envelope-from git) Date: Tue, 2 Apr 2024 15:18:15 GMT Message-Id: <202404021518.432FIFDL057674@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: d4676f565d9a - stable/13 - x86: test the right CPUID bit when checking for XSAVEOPT support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: d4676f565d9ad0ec76acb50a930d26dc27dd8ce7 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4676f565d9ad0ec76acb50a930d26dc27dd8ce7 commit d4676f565d9ad0ec76acb50a930d26dc27dd8ce7 Author: Konstantin Belousov AuthorDate: 2024-03-25 10:34:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 15:18:00 +0000 x86: test the right CPUID bit when checking for XSAVEOPT support (cherry picked from commit 960d151eaa1ecde109accc30ca0c3306551d8e58) --- sys/amd64/amd64/fpu.c | 5 ++++- sys/i386/i386/npx.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 073c56e4902d..18330cb58d3c 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -260,9 +260,12 @@ fpurestore_fxrstor(void *addr) DEFINE_IFUNC(, void, fpusave, (void *)) { + u_int cp[4]; + if (!use_xsave) return (fpusave_fxsave); - if ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0) { + cpuid_count(0xd, 0x1, cp); + if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { return ((cpu_stdext_feature & CPUID_STDEXT_NFPUSG) != 0 ? fpusave_xsaveopt64 : fpusave_xsaveopt3264); } diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index 628fab71499f..e7e8fc01fa6b 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -341,9 +341,13 @@ fpusave_fnsave(union savefpu *addr) DEFINE_IFUNC(, void, fpusave, (union savefpu *)) { - if (use_xsave) - return ((cpu_stdext_feature & CPUID_EXTSTATE_XSAVEOPT) != 0 ? + u_int cp[4]; + + if (use_xsave) { + cpuid_count(0xd, 0x1, cp); + return ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0 ? fpusave_xsaveopt : fpusave_xsave); + } if (cpu_fxsr) return (fpusave_fxsave); return (fpusave_fnsave); From nobody Tue Apr 2 15:18:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8BN86kBMz5Gpsf; Tue, 2 Apr 2024 15:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8BN84D46z4KYn; Tue, 2 Apr 2024 15:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/OLpLW2qrzX3mQh0qSGuy/UuEZBINmnWlVw+uyWUIs=; b=dNMLyP9fUpVlnZ6sg4X/x2NHjnA8WiofcV128u4qzlRxN3++pVghIyX6BSI3lD3M/OODce 1UpVRWU/nFAzJdV2cdP9a+ZZI50oZ6/yDh/jeETrNJQaB/3PhiXmlKh89g7v1aWsGgr1m1 gM0tjUhuc/cpGqHXlF7ycXXwwskSntp+wAnegOTJPF21XRHVF87RxtYxx5TY+1xF0gjnUa yt6VNeKDgpXo7LUHITm4PUpG+uWO8phSMqigZLG84LEO7iDmWpkImE2rp12d/LllKZSIN1 ihN04XOK8+WeBRfJN5cWx0aYEYl18BMEmcr8BRGLxUL4oz3+EP4+IB9XnMDv9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712071096; a=rsa-sha256; cv=none; b=iieXHQX4S8IGzqH0bR7g3nqU9GANB8wTQ9Ca1MT/N5hWMOQBi+YzrbrYsfPyPHWug4t9Y9 dUhUeLkDXi1ubtkuGNu1dIZo5bxKgW4tampJXGxncSyLcntyonra5HYpeJTqfxQyg74fEb 2Jf0+tnsMujwQ02H9PkXJAAv19tR/g3nUMHiqN+hY0+DBIHL+B1o1XpAIg+fq98MebFBZY cfwgsvMZQ9kxvKWX645QhuoHdHOYxwtXUPNuVcmzq7STTMLB2TcRVqCw3inCmXowiMo7fU b1BR2eh6MDnw1vX5n2mFF+1uGY2Q2hfFFApR68LubQQxCLg7uD3ff1Wrno2p/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/OLpLW2qrzX3mQh0qSGuy/UuEZBINmnWlVw+uyWUIs=; b=dT8Y9Tot45LREttAsV5Wwys1iY9nGnJCs6a+WkpX3HF9CDjaD223oddMvEDBQG7U5YhP03 untwNHR16/0gIcuTue3I1wT4uY/VAR+N0VHnNK+zz8nkMaRAF23rppb6jGbibk/NFrsviS TLBKHWiutA1i7yOr0yYA/yyvAPewou0cxgyx1ODWYlzbvyO3Wv0s3jGsQy2HXUsb/wBFhR kXPVbfL8bPjJ/a2DvoR7hvWuXtAsbvYYoS2/x3EHV7r2YDi1cdxsmeBH2Cl2Fz8jGmohlF 4P7Xmdog83Io0cKS3S4Q44ZPS5T6i/CttRc6qy1j2ytipAj6/9+AO9Dfp8B+Vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8BN83pF0zttx; Tue, 2 Apr 2024 15:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432FIGgh057736; Tue, 2 Apr 2024 15:18:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432FIGD8057733; Tue, 2 Apr 2024 15:18:16 GMT (envelope-from git) Date: Tue, 2 Apr 2024 15:18:16 GMT Message-Id: <202404021518.432FIGD8057733@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: c787fedf1262 - stable/13 - amd64: initialize td_frame stack area for init(8) main thread List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: c787fedf1262c253faac09b95184e409b26c2f1e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c787fedf1262c253faac09b95184e409b26c2f1e commit c787fedf1262c253faac09b95184e409b26c2f1e Author: Konstantin Belousov AuthorDate: 2024-03-25 12:10:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 15:18:00 +0000 amd64: initialize td_frame stack area for init(8) main thread (cherry picked from commit e0c92dd2b7e62e4f8281c9ad1d31465bb32f9e3b) --- sys/kern/init_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 73d78ad16df3..1a8269b8b367 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -783,6 +783,7 @@ start_init(void *dummy) */ KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); + memset(td->td_frame, 0, sizeof(*td->td_frame)); oldvmspace = p->p_vmspace; error = kern_execve(td, &args, NULL, oldvmspace); KASSERT(error != 0, From nobody Tue Apr 2 15:18:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8BNB1RKnz5GpYh; Tue, 2 Apr 2024 15:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8BN95X9Tz4KhN; Tue, 2 Apr 2024 15:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wTbXvDUZl4jstp5J67XiJGTlmaI9H1Y0c4NR4q+rZL0=; b=AWOHkupnOYuTmwio+DuNRnMou5daxkeB3f48XGYBFqzpoG6NuQefu+K+wDMeb/mPDDpC6r mx9k9zqWHrfg3xozNg3RQ5O2nXbI6F5ROoE3Pgc6RcPJHdUXLe5HIFgSSUK001unS6NRPK terpmwWg2KfCmH2zL7ddlq97Wrp3OD77Dn1MwzmmedC2PRN8u6/sa9dtoz27hBe9lp06Ng X9DL91F84sev3LtmJRzJhA1P8kjTxL6vKPwNd+huINgU4Y5ut3uLGMKTu0JbK4E3k4wstp 5XzUfhe/tmrmOdmwDt5ksHmeKtw6oGSpDbq6lQaCoyDmnXldXlOKk/t9//kjUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712071097; a=rsa-sha256; cv=none; b=RoB8k/CIoChB/UBvKdJQc1bpmKlXudJ/iotwefCU+nAxcF1qIP3k782JfJ98lF5BtD3xp8 GoC8vEfalN12sDgV1OnEtRV2zfk8EKk7ZlFy8Byf1x5dzSVZR24WJU2a/Xp763+pVaPvrc r8iTCU99AXbDOQFwR/lJQ2rez4Y1qIJX2a/NSSfjUHk4CkIEDVI3rrwnKHVHKEwLTQaRpi EiciXRuQBRpelMLyfDNuJJVGgKMhJRGlj39ocT677wrMMRJQ+SbNyKE+qWMuKOv0C8cr9w bbHQFeJBy+FxPAUGIz7VTXv48CnaQNe0TGHJfyCiiLeyjwdW2ZTrwsUgieqekw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712071097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wTbXvDUZl4jstp5J67XiJGTlmaI9H1Y0c4NR4q+rZL0=; b=IAkboDKj2Qb4BghZCCYFFzBFElpC2yumKUwTAIybaddGFh1Ldgdbwm4P3WI7LdOEJ+Eno8 1BQTSa7YBERZ8nWtq+jlrFzqhqw1ROUgAixJQtElEZxSuRztDucvf0f9r2xTSZbcw8/UbM bNAIjQ2dptBKr+rUvdsb69gwW6Lho8X+VVABUMJeZjr/l1O9MnsNrtWedVkCPqbup6pBLD iZQQNZpfBA8xU8l1G40JgAEpyqbVdzgu1JORLe11P6NIcX19838lUbFKP72ZpnCJFV5Vr5 mokCNP94aAnWjK7h5270J5BzySkYcmynKGBu17Wj6c0oNtNJV+oHgEeC1E3Ong== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8BN958FWzvN8; Tue, 2 Apr 2024 15:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432FIHJU057793; Tue, 2 Apr 2024 15:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432FIH1U057790; Tue, 2 Apr 2024 15:18:17 GMT (envelope-from git) Date: Tue, 2 Apr 2024 15:18:17 GMT Message-Id: <202404021518.432FIH1U057790@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: b79fb02b32d9 - stable/13 - x86: handle MXCSR from XSAVEOPT when x87 state was optimized List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: b79fb02b32d930b1940ad7a21cb17896c848d432 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b79fb02b32d930b1940ad7a21cb17896c848d432 commit b79fb02b32d930b1940ad7a21cb17896c848d432 Author: Konstantin Belousov AuthorDate: 2024-03-27 11:01:44 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-02 15:18:00 +0000 x86: handle MXCSR from XSAVEOPT when x87 state was optimized PR: 275322 (cherry picked from commit 1c091d11261a3c8cc3728b92760e65242c0f5949) --- sys/amd64/amd64/fpu.c | 21 +++++++++++++++++++++ sys/i386/i386/npx.c | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 18330cb58d3c..3f06033ae89a 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -875,7 +875,10 @@ fpugetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; + struct savefpu *s; + uint32_t mxcsr, mxcsr_mask; int max_ext_n, i, owned; + bool do_mxcsr; pcb = td->td_pcb; critical_enter(); @@ -906,10 +909,28 @@ fpugetregs(struct thread *td) bit = 1ULL << i; if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; + do_mxcsr = false; + if (i == 0 && (*xstate_bv & (XFEATURE_ENABLED_SSE | + XFEATURE_ENABLED_AVX)) != 0) { + /* + * x87 area was not saved by XSAVEOPT, + * but one of XMM or AVX was. Then we need + * to preserve MXCSR from being overwritten + * with the default value. + */ + s = (struct savefpu *)sa; + mxcsr = s->sv_env.en_mxcsr; + mxcsr_mask = s->sv_env.en_mxcsr_mask; + do_mxcsr = true; + } bcopy((char *)fpu_initialstate + xsave_area_desc[i].offset, sa + xsave_area_desc[i].offset, xsave_area_desc[i].size); + if (do_mxcsr) { + s->sv_env.en_mxcsr = mxcsr; + s->sv_env.en_mxcsr_mask = mxcsr_mask; + } *xstate_bv |= bit; } } diff --git a/sys/i386/i386/npx.c b/sys/i386/i386/npx.c index e7e8fc01fa6b..09abf7c17438 100644 --- a/sys/i386/i386/npx.c +++ b/sys/i386/i386/npx.c @@ -1001,8 +1001,11 @@ npxgetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; + union savefpu *s; + uint32_t mxcsr, mxcsr_mask; int max_ext_n, i; int owned; + bool do_mxcsr; if (!hw_float) return (_MC_FPOWNED_NONE); @@ -1045,10 +1048,28 @@ npxgetregs(struct thread *td) bit = 1ULL << i; if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; + do_mxcsr = false; + if (i == 0 && (*xstate_bv & (XFEATURE_ENABLED_SSE | + XFEATURE_ENABLED_AVX)) != 0) { + /* + * x87 area was not saved by XSAVEOPT, + * but one of XMM or AVX was. Then we need + * to preserve MXCSR from being overwritten + * with the default value. + */ + s = (union savefpu *)sa; + mxcsr = s->sv_xmm.sv_env.en_mxcsr; + mxcsr_mask = s->sv_xmm.sv_env.en_mxcsr_mask; + do_mxcsr = true; + } bcopy((char *)npx_initialstate + xsave_area_desc[i].offset, sa + xsave_area_desc[i].offset, xsave_area_desc[i].size); + if (do_mxcsr) { + s->sv_xmm.sv_env.en_mxcsr = mxcsr; + s->sv_xmm.sv_env.en_mxcsr_mask = mxcsr_mask; + } *xstate_bv |= bit; } } From nobody Tue Apr 2 20:44:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8KcG3gn1z5FjnZ; Tue, 2 Apr 2024 20:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8KcG2w3lz5457; Tue, 2 Apr 2024 20:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712090654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8kG0+900V4HWM47iUAvo/laMZubWiQR1L0kJYHIyZ4=; b=e2P6VW1IrkTrmTbCRY/6nOAPCwLy9pKkR9swnG2cQ0OQCtWUz/F3UPQ2Pg/Xe+ueFSsxW4 8U2hakvvmi5i83VSW3gmYQb6TA2Of7ZOZXzjTRG4x9Qnpgu2vANeU836qdjYPduhgBZ8CB GcRmSW9eBPviU2CUEVIYjjilIWqroX+mCvbxl2I3DPtKSQ8w2vCsK/HJoJvA/Th5NmujpD tE/VBAzJ/vCSY+57biDwciM2zITrfbwPmnS6beNDsIUmFmLIeeED1cOocOzgv8aTg9MBsG XNGCiuZvqBo/m/EX7Qj6e71iQsbYkp+JjhKFQgsJdBF91lPUhOEjYO5Sy9J+Fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712090654; a=rsa-sha256; cv=none; b=tHbO2yjqmv4iJ4Kq6CCllknM0MQ373svCVAiQ/gFJCUBpHY5XNjWtrsL0ndj1Dr7PpOWGI zPvanhbu7XO8dCtJlEW+zSBzCOHYaBDSH8Ea/6LHIO437shxyLmaW1hI4CF5uOjqQqkIlb 861FR/lMoDxoK44HJqyufry1kS4a6bLmF2dgsv5so/afeGTv2wu7NPNEXWrEgCUUzUAG6P +cJ6BiPqbrf7lwTYim6iJ3FLRyYhct/QmZhKW19+HLZ8HCC5aXbWBOxkC+Ws6SOiJpG0ZQ Y5ynEiEnFnjPp0purJy93/uQkJwl7xnSKIv3YN9MvDjB5Aw5FgQTVtCXIvCIGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712090654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h8kG0+900V4HWM47iUAvo/laMZubWiQR1L0kJYHIyZ4=; b=LthXLtrm/OxFgb+7XjdhlJ1Z5j/WTEcVCTgZL/YWaoWnb0yNz/Gpo8x9EYqQCMu5rrmqQy p4KiovulzmOrtROnjT7JOWvZfvjpYWoQ63v8vUr3USXrGtB212Nhn2Qa6LqMl1zddS24nD 1nakoXg5S17cNhbPHubVnBe95VpqLMPd8c2zzB1f+NVuZJ6wU0dZW5A1jr4gmmktzDN+S8 zJ9l66RG5l/h0jLU8dhfOmsRPGAmlkIHyi95R4ssmna3GBdMtN94XEBBNGradqvm7YxbwD PjciTIZez/t4TbbnOYSdekK2ZqeOIZCfvu2uUKY8pG3FaTdPiuXjJuhB8v5PgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8KcG2SLvz13w7; Tue, 2 Apr 2024 20:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432KiERP015337; Tue, 2 Apr 2024 20:44:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432KiEHH015334; Tue, 2 Apr 2024 20:44:14 GMT (envelope-from git) Date: Tue, 2 Apr 2024 20:44:14 GMT Message-Id: <202404022044.432KiEHH015334@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: 794473e3101c - stable/14 - release.sh: Don't install git if already present List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 794473e3101c5e7764be7eea13429a1daac7b3e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=794473e3101c5e7764be7eea13429a1daac7b3e7 commit 794473e3101c5e7764be7eea13429a1daac7b3e7 Author: Colin Percival AuthorDate: 2024-03-29 07:10:50 +0000 Commit: Colin Percival CommitDate: 2024-04-02 20:44:03 +0000 release.sh: Don't install git if already present Prior to this commit, we install git from ports if there is a ports tree available and git is not installed, and we install git from pkg otherwise -- including the case where git is already installed. Rework the logic to not (re)install git at all if it is already installed. MFC after: 3 days (cherry picked from commit 6baddb6b117664f51e2b1d2427fced946913a08f) --- release/release.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release/release.sh b/release/release.sh index 75278a12daa6..c9d0203debd4 100755 --- a/release/release.sh +++ b/release/release.sh @@ -252,11 +252,11 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi - if [ -z "${NOGIT}" ]; then - # Install git from ports or packages if the ports tree is - # available and VCSCMD is unset. - _gitcmd="$(which git)" - if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + _gitcmd="$(which git)" + if [ -z "${NOGIT}" -a -z "${_gitcmd}" ]; then + # Install git from ports if the ports tree is available; + # otherwise install the pkg. + if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) From nobody Tue Apr 2 20:44:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8Kd25YFWz5Fk4s; Tue, 2 Apr 2024 20:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8Kd24xwzz54Nf; Tue, 2 Apr 2024 20:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712090694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qZVM726yTkuNRF5MvtCM68LT50JlFicniZAx1JbkQMo=; b=YQmAZGdguOU4DT+u8osapSdA/G2zsCasyz7zwj2imEgmCIvd2jeW5ovxyPeYPihGGSGAMo O+aLTezM7Gzpea/AjYGp6O65Ps9OUb8fHCKP+itwAI72SI1Gi6lpAFHHL0xb7yUaQU3Pmc 63w7rW/KigrD3I8fkNPH7O/3Hd9Am0qHVjUclPNSrOaGdAbg0/lIOQknDpnXoM8wGgG6ur YukRZ6BYTxDDd6NA4uKS3XeQj7w87tu2Ce44AprH60d+jEkXzyO7KB+jLB/QUObx4u7VEH q7cATycN+Ae/84g8OYlXIOp/wScEN0wh8jPMKukGlOOlPbF6bc80qlSx+qa/5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712090694; a=rsa-sha256; cv=none; b=SeBiCSVGM7whlZcxDkGRHdKS0kudQl2cQJyEh5aOCmDCn3xq0XRel76Nv0JJw72IZjjUE2 g9nWZ6Yl8AGOw/TVdowzHP3nEY/RK9lDGyUllm9Czn1PBUd5MnnG3ktBCes3AWxBNsbLqy 2N3RLzHsVpd5ZHeQvay7wEl068z0xQqmtF6t6VHfA2O2790O4hLRquoGL3IzXsmqdq5S5x FWIaiL4Kej1YeXzy4QKm7+SPMDfDL/lab+Ts8X5zGwNNp0uwQQbTNgDud0/palBu6FIkBo n0jHDbKBZ+BrpYaw5Uo0E+NHHhNMap20Y0Eg77VlGaHHD3wrB5BekUtA0Eo0MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712090694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qZVM726yTkuNRF5MvtCM68LT50JlFicniZAx1JbkQMo=; b=EOsyTjkrIXJaOLKE8S7qzQ8BwXSssQS39sx4b0GwN8ELiz0EcAScaWXj0GcaC5HAiJwQ8Q cxuyccNtxuqkJe8nsbWHFqzKcAY57oTicqcNyAz/ZDarYkBda9++Mw2Mlq0UdzyMJDx05w ZGlddRl9dGPjbgx9XLtFTtq5Waz43nFPYgklgxOKsDDLGrsM5VDbgO15WnMjUafSDGU9um NePSTt1O0Mcxc/4/HLPEmAEYtOb0BA8oKGiYnYAGgVRhvhYDYSOWKisboeox57Urtx/7kY bbS00jiDgbJ4rH1m5DYcpZGdR8HoymF7CFctFtAjjLIk3QBOX3KvN13FvbUR7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8Kd24TYfz14Ng; Tue, 2 Apr 2024 20:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 432Kissq015609; Tue, 2 Apr 2024 20:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 432KisTv015606; Tue, 2 Apr 2024 20:44:54 GMT (envelope-from git) Date: Tue, 2 Apr 2024 20:44:54 GMT Message-Id: <202404022044.432KisTv015606@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: 853241218da2 - stable/13 - release.sh: Don't install git if already present List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 853241218da2d2eed02e76683b77842451fcdf0f Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=853241218da2d2eed02e76683b77842451fcdf0f commit 853241218da2d2eed02e76683b77842451fcdf0f Author: Colin Percival AuthorDate: 2024-03-29 07:10:50 +0000 Commit: Colin Percival CommitDate: 2024-04-02 20:44:46 +0000 release.sh: Don't install git if already present Prior to this commit, we install git from ports if there is a ports tree available and git is not installed, and we install git from pkg otherwise -- including the case where git is already installed. Rework the logic to not (re)install git at all if it is already installed. MFC after: 3 days (cherry picked from commit 6baddb6b117664f51e2b1d2427fced946913a08f) --- release/release.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release/release.sh b/release/release.sh index 75278a12daa6..c9d0203debd4 100755 --- a/release/release.sh +++ b/release/release.sh @@ -252,11 +252,11 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi - if [ -z "${NOGIT}" ]; then - # Install git from ports or packages if the ports tree is - # available and VCSCMD is unset. - _gitcmd="$(which git)" - if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + _gitcmd="$(which git)" + if [ -z "${NOGIT}" -a -z "${_gitcmd}" ]; then + # Install git from ports if the ports tree is available; + # otherwise install the pkg. + if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) From nobody Wed Apr 3 00:28:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8QbV1Gy4z5G4t9; Wed, 3 Apr 2024 00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8QbV0Sc9z4DqC; Wed, 3 Apr 2024 00: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=1712104134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ALiQ75RXu0fy9NYzYi17Yz/gSqdAOVzsxV9gjh9bQ1o=; b=fvJmT8orn8zihe4VKEPx6G+KpYgI00unP8Ghg8VtPePrGXBXuiM+zCkVbJXae4Tht8+Rwy sqLycqXznUMVWeju40GBKBp696lFuhi0AGnaLxOPFkEYLmJcYreNiJlzy4ztBRh9tyFdtO vum220GsDYS2rqoB7DYyVodG4REumDZvnHs1TeupLsJe9AZvJQnHdqQNvyw6b1y5o8+tkv AJTeRIS5xmZNcqSim/kiwNg+a870geLVsUCkoEQZqwKiAA0FkWX61z9c+Hz/DuVwD7LzW1 mKASHqTzg3XUod7eA6oIfF6jkRXsu55D3wh/0tMamaPD57GRzxW7ImFHHSfCBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712104134; a=rsa-sha256; cv=none; b=qvlSqxIEhyubryxq8Jb5nN65uREYLhiMAZLUAuE+PCmQF5rtBb/zCIU87bJwY49KidTDaq cY2GHCFBoZv8ztZOsQvS4qVMpI3/Y8domIAWrjX04gzWPnnq4Bt+YAqI2q42GnYzjh+MKF S7XdcyZDqbqn3CBPFzicMcEvbhBljv7mR0Cs/BPiSvl5IBd1HPPXryO+TDE6atvJRm4BWZ 0w2rkYAJFRxP5GAQR9YaePfSXsGsPS6AB3ItXIabKfOizQs2AnxslHVspoAo+fpKBT2tEW jHDbT/7fupclmKVrBsmSlSNNk59plBxh7bqTsf8+SPoZccIRhVRD6N1cfgV+7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ALiQ75RXu0fy9NYzYi17Yz/gSqdAOVzsxV9gjh9bQ1o=; b=FvLxVRm5cAdvpWLoQASwzQYGqUsx13jONybSEx6h7QHN5+JWfcB2GeYAs7vlxZ+ZP6BjL3 P/A8yCDzZKh8cTEel8eHbcgX7VMz056jgASqDBOzQbee5qNp45Eq0gyrX6F3gzegpFIKBv heTZudm5LwKzbzYYDhBPCYI6uPQe2ZuFbF/iCJC2bCeuwvUcO2Rn/tLQjMILrDNj2EufLW vr0nsPITb4w8m8sfFdI0dlxX766xHEgzuPSKeiYZX7zsnq0PrQHsZY1TBF940FdPrcxYdn brj0koeNvO+iUYYPz61S2vv3MZj3JC9fb9yU1Cew97UGZym0MipcPqzSWesa5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8QbV03yQz19Jr; Wed, 3 Apr 2024 00:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4330SrdS088377; Wed, 3 Apr 2024 00:28:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4330SrlR088374; Wed, 3 Apr 2024 00:28:53 GMT (envelope-from git) Date: Wed, 3 Apr 2024 00:28:53 GMT Message-Id: <202404030028.4330SrlR088374@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: beb5140a9d8f - stable/14 - hostapd: Work around lack of MLME support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: beb5140a9d8f349866ef4ba8ada9d98faed2c770 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=beb5140a9d8f349866ef4ba8ada9d98faed2c770 commit beb5140a9d8f349866ef4ba8ada9d98faed2c770 Author: Cy Schubert AuthorDate: 2024-02-27 03:34:09 +0000 Commit: Cy Schubert CommitDate: 2024-04-03 00:28:45 +0000 hostapd: Work around lack of MLME support hostap MLME uses Linux data structures and definitions not available in FreeBSD. The ability for hostapd to select the frequency (channel) depends Linux MLME, though strictly it's not required. Work around the Linux MLME requirement to configure device frequency. The detailed description is: hostapd will only set the channel (frequency) when Linux MLME is configured. Enabling NEED_AP_MLME will result in numerous build errors due do Linux data structures and definitions not available under FreeBSD. The code to set the frequency from the selected channel is only within the NEED_AP_MLME code path because without MLME, hostapd_get_hw_features() is an inline that always returns -1 whereas with MLME hostapd_get_hw_features() will obtain hardware features from the kernel. Until such time we simply set the frequency as configured. PR: 276375 (cherry picked from commit 84ed86380aeb566ffd8b957ba99c36ad345413ef) --- contrib/wpa/src/ap/hostapd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/wpa/src/ap/hostapd.c b/contrib/wpa/src/ap/hostapd.c index 4b88641a2dde..a5cabc01f163 100644 --- a/contrib/wpa/src/ap/hostapd.c +++ b/contrib/wpa/src/ap/hostapd.c @@ -1698,6 +1698,20 @@ static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; +#ifdef __FreeBSD + /* XXX hostapd_get_hw_features() is an inline that always returns -1 + * because MLME will not build under FreeBSD due to its use of + * Linux definitions. Normally FreeBSD would uncondionally execute the + * "Not all drivers support..." block. Instead we #ifdef out the entire + * block of code instead of maintaining the fallacy that + * hostapd_get_hw_features() returns anything meaninful. + * + * Ideally WANT_AP_MLME should be taught about FreeBSD data structures + * and defintions. Instead we do this to enable channel selection in + * hostapd.conf. + */ + iface->freq = iface->conf->channel; +#else if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ @@ -1744,6 +1758,7 @@ static int setup_interface2(struct hostapd_iface *iface) if (iface->conf->ieee80211h) wpa_printf(MSG_DEBUG, "DFS support is enabled"); } +#endif return hostapd_setup_interface_complete(iface, 0); fail: From nobody Wed Apr 3 00:29:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8Qc40n68z5G526; Wed, 3 Apr 2024 00:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8Qc404k7z4F32; Wed, 3 Apr 2024 00:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kv8+k+UWZnXPnFuxqCNjSfbBQp/5jc+KYsAdHMRZVVs=; b=bwnzQolmRve8ikLtz4uW28J1bOa43KFqqelPUJcydotCvcpSVsd0zecR891l6VYewODgsk cSNVtsD/sKJ8++pUJZXPs8TZKZP2yScyaRiMYikHfbxTI6NzB5Xcnl5XKjLQ59nEHBfkWG EE2ixANkj2AK0vZdEpqwvPNrbkmGFpogkB0YSc/vVH3J36vxIZW6vE8HIaaajO4ojyD9wa yN/OfUxCvRNFamdEbVXge2u8Tasz5+YsSaBuGa2Jx5Y9PaRptW29v06yyh+xuoEuaFnWE0 r8Vy34rBcld59Taw8RPwHGB0gtCX2QgiJWaM6O8Z58YQLOhGpSGTaEsqOxZR/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712104164; a=rsa-sha256; cv=none; b=dCoYHcasE7LAjSmkNXnOuwh0qAIIbpcgWzvl7ZUtuxoNpyUpMBsEPfoIjtSciM4eKnwlM7 qs9eaNWko7qaqaMVNihkghZRDOl3HHf/HcIWErskpgg1YJCFeePIxjH5CoDFAIMzyrbWBh W9QQXFGPGRvxcV5uZT6dkvoFdPLdvF8QEHeIfxzRYZ7fBqWpjvX3OYwi/dahiJAcwS+WoL jTzcxz6rkaeGnmHK6fJTn+CuziGV2LYiSXso9XOMZlvRJQhTOSCJGaF6uXFDJFmGuPas2Q hvjJX8J4EBMlnJY9OBL0yEYh6OfoLHixmqc6Kvhn0IboMIvdU7JiLxw/TKB10Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kv8+k+UWZnXPnFuxqCNjSfbBQp/5jc+KYsAdHMRZVVs=; b=X33ARYKq+pNGv4COFBu2Z6dFuSNkfWupTODKlbMFYzxF4Hj6qP3bKxciE5/E1h/EJphjaJ tEGthuROq1IVCvI0i4jTY4OcyJNu5N4XJQT5ro49dfFvOQCLiQMNfMM5BjtkqQoD0Xt+fH 81yCoJtU3rm/rFu21O8FCb+MDN1CodVoktE4RJiOdQlcgPon89COE8/aOTWI0MugMew6et zZhT0aTJazHjUGz6LEJgAtZ/F/sjGZFaG9JaW6EKZgKyYzx/CqvBIBC3esDSYP1JdbCbUY VkqVyK/P8LpIQAPx2eQY0WzbRXFUhv05FZhAJfjAaldb+iODRpIviZtGuzPkBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8Qc36ntKz19qK; Wed, 3 Apr 2024 00:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4330TNQD088588; Wed, 3 Apr 2024 00:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4330TNM6088585; Wed, 3 Apr 2024 00:29:23 GMT (envelope-from git) Date: Wed, 3 Apr 2024 00:29:23 GMT Message-Id: <202404030029.4330TNM6088585@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: 0fb7c4a38c85 - stable/13 - hostapd: Work around lack of MLME support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 0fb7c4a38c8527156b1d1eedd072787602a13c69 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0fb7c4a38c8527156b1d1eedd072787602a13c69 commit 0fb7c4a38c8527156b1d1eedd072787602a13c69 Author: Cy Schubert AuthorDate: 2024-02-27 03:34:09 +0000 Commit: Cy Schubert CommitDate: 2024-04-03 00:29:13 +0000 hostapd: Work around lack of MLME support hostap MLME uses Linux data structures and definitions not available in FreeBSD. The ability for hostapd to select the frequency (channel) depends Linux MLME, though strictly it's not required. Work around the Linux MLME requirement to configure device frequency. The detailed description is: hostapd will only set the channel (frequency) when Linux MLME is configured. Enabling NEED_AP_MLME will result in numerous build errors due do Linux data structures and definitions not available under FreeBSD. The code to set the frequency from the selected channel is only within the NEED_AP_MLME code path because without MLME, hostapd_get_hw_features() is an inline that always returns -1 whereas with MLME hostapd_get_hw_features() will obtain hardware features from the kernel. Until such time we simply set the frequency as configured. PR: 276375 (cherry picked from commit 84ed86380aeb566ffd8b957ba99c36ad345413ef) --- contrib/wpa/src/ap/hostapd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/wpa/src/ap/hostapd.c b/contrib/wpa/src/ap/hostapd.c index 4b88641a2dde..a5cabc01f163 100644 --- a/contrib/wpa/src/ap/hostapd.c +++ b/contrib/wpa/src/ap/hostapd.c @@ -1698,6 +1698,20 @@ static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; +#ifdef __FreeBSD + /* XXX hostapd_get_hw_features() is an inline that always returns -1 + * because MLME will not build under FreeBSD due to its use of + * Linux definitions. Normally FreeBSD would uncondionally execute the + * "Not all drivers support..." block. Instead we #ifdef out the entire + * block of code instead of maintaining the fallacy that + * hostapd_get_hw_features() returns anything meaninful. + * + * Ideally WANT_AP_MLME should be taught about FreeBSD data structures + * and defintions. Instead we do this to enable channel selection in + * hostapd.conf. + */ + iface->freq = iface->conf->channel; +#else if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ @@ -1744,6 +1758,7 @@ static int setup_interface2(struct hostapd_iface *iface) if (iface->conf->ieee80211h) wpa_printf(MSG_DEBUG, "DFS support is enabled"); } +#endif return hostapd_setup_interface_complete(iface, 0); fail: From nobody Wed Apr 3 06:25:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8ZVv1bdxz5G6yZ; Wed, 3 Apr 2024 06:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8ZVv0hqbz4hkQ; Wed, 3 Apr 2024 06:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712125527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oGZJ81AjUV4p+kAzy2pm+yoVoqeAAiDxN/3qcriwjAo=; b=DfPk7ptaciiyx9WgrL68ok2MKCyX19WgvyWgYq8ME+kIIPa9F3Gmb8ggdrf7E5us+1Mi2i orwKkm8WrREcI3O800RQHvwM2yrqWm05MOlAm8S05OuAH5PV5zEzlXPMqrQkyBjOuE0K+L Ks1/W9HNSrBsi8RO14cGwYexRujTcqTqmCb3aUVOfVE2AmiLrokFrdJ6tE4A43Q2f3brRm c38Cn7uyjXKmewTHxik9LQAsYGGuGRjHVF23yySL4wgzyew8vGBRTD+MU2VsYBuXVrlAfd Pcap6uK2atnfEUE9NguUdmPLFri7ZYMHISDUQU5NS+5kGkd5beazX7QClMx6FQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712125527; a=rsa-sha256; cv=none; b=GONl+ON4YG2RSLs7UYgooKVTnz6PNOq8/bRcqr9up/KvmrVRih6w0U7ulqk9nZNYTK1Grz 9Y7fkeY9evRxnUTpkwCmw5MyQlM5Y9TnCABqwUMctwOVU4++DgYUB42ZEgJ0774tf1OvsM h7Wf59VX0HkUW6MqTtSMtMLgFrWZTLEh+ywC0Dc8xOF2mVzUZuSW5ML8k/Xsj+yBixUUOz lGJjJ8U+VdpGVRNXYcS1HlDDgVNX+xP8skDfLMJhkIyDiWYQk31vcpEhTj2DcCU60cil8S xIa/ClRUVqRSjDew1IN3LxnQbM8vrjJPbZEtJQta8VuQ6Cc3ruAKUxD/b6o1Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712125527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oGZJ81AjUV4p+kAzy2pm+yoVoqeAAiDxN/3qcriwjAo=; b=V+7brZ03V0Ys2Cqsq1ceA2noKSeQfdyj6gXywVeK7cWNtDrZWoFHHxJYysj/dUzPrk8G5w pPsX/GzTwmgQXMrWFRm4I/QSN6tCRgJ3PFA4urj4CsFXBsOI6Bejt4DWMOCBICQcV967Ox FW5acB0q+ltxoSxzgT4JVP30Nj0QzpxkjtZFD6y/6aPwsSPJlWA/ixBrqPUVumdZ5o82gu rQcdxwOQ8hXGnZ/yLw9ZH/1DH7fReSZj2GBKJNMZ4Fz9P/tFrBnh+67PJfeZt9Jlh6/R3i m5HhUgCDT9AyXQeyUrTqPy4Q5sTJ9KJCpFUHSCUCsHMcbv5Uj9zNaOMhW3srLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8ZVv0BcpzLsg; Wed, 3 Apr 2024 06:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4336PQKe096579; Wed, 3 Apr 2024 06:25:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4336PQ9u096576; Wed, 3 Apr 2024 06:25:26 GMT (envelope-from git) Date: Wed, 3 Apr 2024 06:25:26 GMT Message-Id: <202404030625.4336PQ9u096576@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: 41d9d301fbd0 - stable/14 - kern linker: Make linker_file_add_dependency() void List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 41d9d301fbd091eee159d8e6d70b60ff7d67c349 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=41d9d301fbd091eee159d8e6d70b60ff7d67c349 commit 41d9d301fbd091eee159d8e6d70b60ff7d67c349 Author: Zhenlei Huang AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-03 06:15:15 +0000 kern linker: Make linker_file_add_dependency() void The only possible return value has been zero since cee9542d51f0. No functional change intended. Reviewed by: dfr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44507 (cherry picked from commit 1c7307cf6763a295ea9896be9f197d40511c77ed) --- sys/kern/kern_linker.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 6ac2e694a4cf..2b220295f78e 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -144,7 +144,7 @@ struct modlist { typedef struct modlist *modlist_t; static modlisthead_t found_modules; -static int linker_file_add_dependency(linker_file_t file, +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep); static caddr_t linker_file_lookup_symbol_internal(linker_file_t file, const char* name, int deps); @@ -779,7 +779,7 @@ linker_ctf_get(linker_file_t file, linker_ctf_t *lc) return (LINKER_CTF_GET(file, lc)); } -static int +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep) { linker_file_t *newdeps; @@ -792,7 +792,6 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep) KLD_DPF(FILE, ("linker_file_add_dependency:" " adding %s as dependency for %s\n", dep->filename, file->filename)); - return (0); } /* @@ -1721,10 +1720,7 @@ restart: TAILQ_FOREACH_SAFE(lf, &depended_files, loaded, nlf) { if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, - linker_kernel_file); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, linker_kernel_file); } error = linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL); @@ -1746,10 +1742,7 @@ restart: if (lf == mod->container) continue; mod->container->refs++; - error = linker_file_add_dependency(lf, - mod->container); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, mod->container); } } /* @@ -2212,11 +2205,8 @@ linker_load_module(const char *kldname, const char *modname, error = ENOENT; break; } - if (parent) { - error = linker_file_add_dependency(parent, lfdep); - if (error) - break; - } + if (parent) + linker_file_add_dependency(parent, lfdep); if (lfpp) *lfpp = lfdep; } while (0); @@ -2245,9 +2235,7 @@ linker_load_dependencies(linker_file_t lf) sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, linker_kernel_file); - if (error) - return (error); + linker_file_add_dependency(lf, linker_kernel_file); } if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL) != 0) @@ -2288,9 +2276,7 @@ linker_load_dependencies(linker_file_t lf) if (mod) { /* woohoo, it's loaded already */ lfdep = mod->container; lfdep->refs++; - error = linker_file_add_dependency(lf, lfdep); - if (error) - break; + linker_file_add_dependency(lf, lfdep); continue; } error = linker_load_module(NULL, modname, lf, verinfo, NULL); From nobody Wed Apr 3 06:39:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8Zph0nxsz5G8HM; Wed, 3 Apr 2024 06:39:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8Zph05J7z4jvh; Wed, 3 Apr 2024 06: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=1712126348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL4EEI0iC7/vpk4bVnlN9CasVFKAMP/2ciC2JSKQA3g=; b=eZRD/jH5YLjaMKvgvBjR9dz/vprhIR6BD9TtMDeiYX3a1haCQQsushzyyPsm35ngb/w4N5 gHHu5PSXAlr3jSYlCz2uq9Wmzy2BwiBRmHasMimjd5Xp3Ow2bfK2Y7Py+7kV2RG+jsJG9O HScmadc557CVf0atRUUVdtd+rxySflXBy3djk7KgUQMzKlgiH+T4wDaLtAOlX/2zSrl76S +10mJ2lrVMF1IEIJqIKJt72GxDkju/pktH+V4tDvEwvTLwjO74Ox0qG0qiG/V1oMf+5hUW DSiHO5wHPuWRKelN2NvCiX93z9x1l+/7QPxeN8tkkEdVFEFxPyGE2K3oIflKTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712126348; a=rsa-sha256; cv=none; b=E0q8g/tMdofWZK0qToCAmSbIFt30lWNxQiU+/msDAuFrOhI9ONC+mtfAsZTTmyiMl5av+B hEclb4wHaAdVSToSQfajj6deCbjfWpkAGYFrhuUjuEULn0v+BuTF5tBY0s/7lNzjAAb7Oe UvWjX0q1bxYVudWSZ+M+dU6Jlkz2JyuBwAee8WecrgSZk1I8U+VvC2DjsFMy7YAk4WuuDP DERwKBvRtgRyfln7/94tOkZcDLemY5uCYYluv4AgYLr4/xUMGS63FrxGm1yhb6dDHnzbWN aZb0z4I2WgE5dl1xSoFRYgtrjYrA6B2zcwJOQlQd2WNrhKYr5WR+X2rASWaLEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712126348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL4EEI0iC7/vpk4bVnlN9CasVFKAMP/2ciC2JSKQA3g=; b=FVPrUy15hORcn2fCPyWS+RQS/TCozIoG+wM5GZU7cHv/YzW4S6/Zogvr8tbls+fIfI/r7m cp4zNaV5dYgQL9kT8ZKP3/v5e7spGH/Erh+8NNfEZ+OpLyv+PBAHClUq1q017cHJtBb2gZ wLm7ilchb3UkpscVzLlpCJzb3f+C15JbDco1JIIWn14WV382ndSX7dJd3LjRfUFf+YTSLg /4u1j09GXmc/pk2pUr1tYbymQzl0FfN1PqVUEEI5FlGVTDIxZz5hDmZIGUSiS/9lxAgEV1 lm8FWhYQuhumaWHsPKLUBJ4LmMP4+Mr9KiHAzO4wnItAyo+e1DmZV9ngmFxkWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8Zpg6hq1zMX5; Wed, 3 Apr 2024 06:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4336d7fm013779; Wed, 3 Apr 2024 06:39:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4336d7Xu013776; Wed, 3 Apr 2024 06:39:07 GMT (envelope-from git) Date: Wed, 3 Apr 2024 06:39:07 GMT Message-Id: <202404030639.4336d7Xu013776@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: 223077d0a847 - stable/13 - kern linker: Make linker_file_add_dependency() void List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 223077d0a847509a14102719e04f2ae0666461f8 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=223077d0a847509a14102719e04f2ae0666461f8 commit 223077d0a847509a14102719e04f2ae0666461f8 Author: Zhenlei Huang AuthorDate: 2024-03-27 04:02:32 +0000 Commit: Zhenlei Huang CommitDate: 2024-04-03 06:26:57 +0000 kern linker: Make linker_file_add_dependency() void The only possible return value has been zero since cee9542d51f0. No functional change intended. Reviewed by: dfr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44507 (cherry picked from commit 1c7307cf6763a295ea9896be9f197d40511c77ed) (cherry picked from commit 41d9d301fbd091eee159d8e6d70b60ff7d67c349) --- sys/kern/kern_linker.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 87354e47d002..bc2f477997e0 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -143,7 +143,7 @@ struct modlist { typedef struct modlist *modlist_t; static modlisthead_t found_modules; -static int linker_file_add_dependency(linker_file_t file, +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep); static caddr_t linker_file_lookup_symbol_internal(linker_file_t file, const char* name, int deps); @@ -764,7 +764,7 @@ linker_ctf_get(linker_file_t file, linker_ctf_t *lc) return (LINKER_CTF_GET(file, lc)); } -static int +static void linker_file_add_dependency(linker_file_t file, linker_file_t dep) { linker_file_t *newdeps; @@ -777,7 +777,6 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep) KLD_DPF(FILE, ("linker_file_add_dependency:" " adding %s as dependency for %s\n", dep->filename, file->filename)); - return (0); } /* @@ -1706,10 +1705,7 @@ restart: TAILQ_FOREACH_SAFE(lf, &depended_files, loaded, nlf) { if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, - linker_kernel_file); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, linker_kernel_file); } error = linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL); @@ -1731,10 +1727,7 @@ restart: if (lf == mod->container) continue; mod->container->refs++; - error = linker_file_add_dependency(lf, - mod->container); - if (error) - panic("cannot add dependency"); + linker_file_add_dependency(lf, mod->container); } } /* @@ -2197,11 +2190,8 @@ linker_load_module(const char *kldname, const char *modname, error = ENOENT; break; } - if (parent) { - error = linker_file_add_dependency(parent, lfdep); - if (error) - break; - } + if (parent) + linker_file_add_dependency(parent, lfdep); if (lfpp) *lfpp = lfdep; } while (0); @@ -2230,9 +2220,7 @@ linker_load_dependencies(linker_file_t lf) sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { linker_kernel_file->refs++; - error = linker_file_add_dependency(lf, linker_kernel_file); - if (error) - return (error); + linker_file_add_dependency(lf, linker_kernel_file); } if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL) != 0) @@ -2273,9 +2261,7 @@ linker_load_dependencies(linker_file_t lf) if (mod) { /* woohoo, it's loaded already */ lfdep = mod->container; lfdep->refs++; - error = linker_file_add_dependency(lf, lfdep); - if (error) - break; + linker_file_add_dependency(lf, lfdep); continue; } error = linker_load_module(NULL, modname, lf, verinfo, NULL); From nobody Wed Apr 3 13:07:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8lQS5bKjz5Gmhb; Wed, 3 Apr 2024 13:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8lQS52ysz4RfG; Wed, 3 Apr 2024 13:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712149632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xaF3Dnpnc2/toOQgacquvzKIuMxSKFhqrYd0LVpeu2o=; b=UnuRO4KS61pTGYQeBzPMfehq9otQqhlmzdGfLdeUih43aWu7f6VQ8YI+v+2784BFlFavzT JwH8RIZtre5ziA/Rkgpsyqf7AgGUCJgIa46qDOhrpz0sQy6R2fIUlNwZH7Ae9DBKBrbHn4 XT+5Y8tZeMQTLBIkUJxt6Gq1kSazy8XJBjMs7THHOKETVt00mm8RQaCFQ0oWlKMgAjrtGt oJ/oPMy3ZFla2Ckhj1OOmtwLv1pjeKCVQW77P3WaAVCS2aAoveiXe82Ih+tEcbNuWrYMl/ TY2lDPiFua9Jj2A/BkrargE9Q/DUl/P2ijJiumhl51AJKvUdtX862G2I9xjo7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712149632; a=rsa-sha256; cv=none; b=jlQzfHPbAaOwsFeb8fvP8x39EEdgABQZc9DwMIdVGzCkj1ppVX3qhxPmzIsi1pLwwoHK/P bh4MnB5zTSFDWWw/145Vh8LzCkNY/oef4zjFET7sjtDQFi2YSst89C3tlKMLVQAN2JKznK IN0HEeDnmZCMzIBUU89OIQOUngqolfX+gLoHf1UpU3zn/nIZt76uF589VozFCwXYCbGd0l 7ghbhec1YJoTaP9FX7zlIZF70pG2ruwBaCNesGy5sx9skL9Q+6ojzLe+plo5Ga5/tsy9PU jGPP4zspB4alg9j0NQuPalOAR2wBDMeA8o5KE4Trwxtl1TWuxTxamXxpMIka7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712149632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xaF3Dnpnc2/toOQgacquvzKIuMxSKFhqrYd0LVpeu2o=; b=sLFNiDqU9n/dXzaXKwxV13EaNoSNuJDmJ0w8j3zMWKrZnM75jYz0rsYcXMfKMeoTG0juYm 6FjMb9bZc14OkxrclDCNdg0TWgFrUboHj6UniXQ6IFCEiIVfglaHR1BUEESk0WZ2E/ImUj OB4Hulf/cF7rr9WhIVhercAhH/r2Dv/rmALvKgCsROrelF2mmjqFkofUEv+qyAxfBf+8hZ RF1azzF1rxgdgZO+DxXRZMye3JfXmPuCn0tb2CsugQSHEf7kRcL12SCJEjdejp6z+fW2TP vDre36bCfQ+ekJeGTd3buTABC0BZeFp6iWbTCYXkc1nIMrxnWvjGbYsmBpF2ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8lQS4ZtyzZYj; Wed, 3 Apr 2024 13:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 433D7C8U074511; Wed, 3 Apr 2024 13:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433D7CTx074508; Wed, 3 Apr 2024 13:07:12 GMT (envelope-from git) Date: Wed, 3 Apr 2024 13:07:12 GMT Message-Id: <202404031307.433D7CTx074508@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: bade279b8106 - stable/14 - tar: make error reporting more robust and use correct errno List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: bade279b8106e9d4166ef2430b4bdbcf17be9953 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bade279b8106e9d4166ef2430b4bdbcf17be9953 commit bade279b8106e9d4166ef2430b4bdbcf17be9953 Author: Ed Maste AuthorDate: 2024-03-31 14:37:38 +0000 Commit: Ed Maste CommitDate: 2024-04-03 13:06:41 +0000 tar: make error reporting more robust and use correct errno Apply upstream pull request 2101. (cherry picked from commit d68c68693e110353f70b5c04f8de416cf5766eca) --- contrib/libarchive/tar/read.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/libarchive/tar/read.c b/contrib/libarchive/tar/read.c index 2a907518d7cb..94616f279e65 100644 --- a/contrib/libarchive/tar/read.c +++ b/contrib/libarchive/tar/read.c @@ -372,8 +372,9 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) if (r != ARCHIVE_OK) { if (!bsdtar->verbose) safe_fprintf(stderr, "%s", archive_entry_pathname(entry)); - fprintf(stderr, ": %s: ", archive_error_string(a)); - fprintf(stderr, "%s", strerror(errno)); + safe_fprintf(stderr, ": %s: %s", + archive_error_string(a), + strerror(archive_errno(a))); if (!bsdtar->verbose) fprintf(stderr, "\n"); bsdtar->return_value = 1; From nobody Wed Apr 3 13:08:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8lRN6w2qz5Gn2X; Wed, 3 Apr 2024 13:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8lRN65Dbz4Rv6; Wed, 3 Apr 2024 13:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712149680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/ufA8CmswqAaiGftMJ3DkQEZVSl99IPny9RnphIM5Y=; b=s8WZdbws7dvGJ5mhE7BIJFKcwowJkPw28huc2cXZCqNq6lx5H6AdW3E2CXOVqTxbomq0R9 wf43qO9LBsYkVM/9l0rzVLZlhxozY0w7mYbNzLdCQBCLCjOjmLF/SeQAFyoLaxYwSkUQN1 xC5tWjtrdyl9n+OezqW4Eq8ssdnewUlPIRRJppD0FyV94RpBqAL7Qf9MQidpC1CY7AluUk oMKMyBuYHsz8iDJsU7ygA1WPupkOaNc60pkw+lG3Brac9pRmc+Ejln/XqTw6lXp11PzFFq UFz0OqR3RPb3wbrQsFAzltffuSILk/moaf6K3Vl1zEQbO1v0bOTghZlDYo36Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712149680; a=rsa-sha256; cv=none; b=uGICrfS9ES1z3XVQd8bSyND/r76WWALlX/7LG+xDy8iMhPSbpCLqug8olvcePZjw/O2Vbc Bm/EynLLAyUXdptNnjyguaVz82nk23U5ukO1LXkj3yUyTMRsJ6oxvO1+5GiebxCd9QHteY OXjX/psYEkqdLe2Wzty6PfrR8yDLxWVOwZJs8q83jIv0oYp7TlyhZMJtuO9XjF+DWQHB6x Jt6pY+gq9smsUK+osNB+OM/dllJIqlG5guxeLAB0+QsrF5icXfQgE8UzmYXJkvwTxy3TkS QdjnLNRG6OVDlh73sehFrx2xkmGNvjyDnXLspymQkIz2qSUHgz6Ndhflig5V0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712149680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/ufA8CmswqAaiGftMJ3DkQEZVSl99IPny9RnphIM5Y=; b=JuZHCUP7oQFfXLPtqX8kyQLauWEr6Peblk4P+/kOFoMKzEDuIMQCXTP/B7K+lLCf6oRlBl DB3nIGsdZdjvfAplPzYFwjMcgVmPG1zb2NqzRHr7ucCfJ+aLHuTsbu4s/d91v3nQSK1AFp 0iI3z3YyW8+DKADSgwIN2/HAPEmPQO4Ebu7SZ+eRwyu76TB6lbIxGmMZIb64K5FHg2jKZ+ x+PgxD2VfiBr5aSm0dyzEIxvFTIheUBHuwicBNrkqCYb8RiIj3ePhQoIrbTajk8MYB0TUb mk6wqZ7PnW72b9l09C9MKZUYHeC8CJC8mGh1uOOFnh7z8tKaVDlp9VLlkylczQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8lRN5hS8zYwp; Wed, 3 Apr 2024 13:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 433D80Df074739; Wed, 3 Apr 2024 13:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433D807e074736; Wed, 3 Apr 2024 13:08:00 GMT (envelope-from git) Date: Wed, 3 Apr 2024 13:08:00 GMT Message-Id: <202404031308.433D807e074736@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: 26c9cc10b220 - stable/14 - boot0: remove reference to fdisk List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 26c9cc10b2208bc8fcbc4f6c80210250febe6abb Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=26c9cc10b2208bc8fcbc4f6c80210250febe6abb commit 26c9cc10b2208bc8fcbc4f6c80210250febe6abb Author: Ed Maste AuthorDate: 2024-01-24 15:13:08 +0000 Commit: Ed Maste CommitDate: 2024-04-03 13:06:41 +0000 boot0: remove reference to fdisk fdisk is obsolete and there is no need to mention a specific tool used to update the partition table. Just refer to it as the MBR partition table. Sponsored by: The FreeBSD Foundation (cherry picked from commit 3bd637afbd68baaff3ae4b3d41bdbd39b1fbb63c) --- stand/i386/boot0/boot0.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/i386/boot0/boot0.S b/stand/i386/boot0/boot0.S index d92f8dcb05f1..2b7e56c89167 100644 --- a/stand/i386/boot0/boot0.S +++ b/stand/i386/boot0/boot0.S @@ -672,7 +672,7 @@ ticks: .word TICKS # Delay .org PRT_OFF /* - * Here is the 64 byte partition table that fdisk would fiddle with. + * Here is the 64 byte MBR partition table. */ partbl: .fill 0x40,0x1,0x0 # Partition table .word MAGIC # Magic number From nobody Wed Apr 3 19:12:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8vWh2Z6Rz5FfZX; Wed, 3 Apr 2024 19:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8vWh25gSz4Hg6; Wed, 3 Apr 2024 19:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712171536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOQ/du9RuRYKdTF3i3/+r5ZG2NoLYKiNliC3gaC1Kcc=; b=iN1mI5GfaS4xyCdQafpGHW9jwFKFcsTkyDlgLwN6J4mid4u/zpTC1e1zMfHYxBeruXE006 TgKdF19urQszNO+kz3g8rMYQ9IPAmcg+caBhxSxYil6QS/+r6cVNTGldkNZaiRABqK4t6F EUUdZfcSP8LBOBq0uFrGBr33cGhAAW/2W0SaYen+fmtUu0pAgTFOD+IZwfML03q+PhmV8S dSpyQpRVoKX1K6UPbEsk6ggwzh30UjJjm9S1A6aTTjdgqghJhW6dSmwNRHrwZjn1QxK8aK IoTCtBL7Ytc/ZtxsF6mZsNlHrgvWTuLwh0aFtg8ppafKj1tdaOwL+MbFwHHpUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712171536; a=rsa-sha256; cv=none; b=aUksbEJXdkDemjRL4LxAWqei3JTO8w3I1phrEfrR+Dci2kGKJLQ6R39BEiAZuSkVVa/OWm ZHmqaOxbddPgL4m8CqtaCwqZrmAwzhxhAUi8EpJzTR56iyCkQivfKjxdBeJx7T2u6kmDZS aSZ7Y1R0NsivHGPJ1yEaPgMtJlLw/ySjs5BT3ZwinSvtXvRKA3myodaqWNWxaqm1gHCbi2 QoJ5cNw6jksjIH3OwC87tC1zg5vteTMCeFtzWxO3T8aqgIogp6xs8PKUosZ2yEvbdik8oF qQEq9RCuQlZPUGD05ybaqQkCP40MF0GXy3DubuhDGX85OqGt8ZzRsZRkC2KYyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712171536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eOQ/du9RuRYKdTF3i3/+r5ZG2NoLYKiNliC3gaC1Kcc=; b=XItNOsbfbaxTrkQPVvS0YRUxshDzuokZPypG5WBaephyiKbWA+Y1Kokug3Sfem2zgeaBvE tneE6F31Ov9M6wPqD30KBJ9bY7Eym16p4hT55gyI4V+OIoPPAVUemfmJOQaMOHDodFKtdH 4+YUSOJzi5FbJdbSwFAO8IuCK1p3Gr8M+Pep7QUDZ3GeModDvMgCapxdGR2NFY8zb5yg+9 QPa/ldJPBNRNe7NzJyyR+TfCPCkcjks1kJ3smDgXSwm/lQ6QBcntXyEpIzDLJlFGk9NDJv GkHq5XtcnQ941GzVFD10uSAykvJ+gVATEzGRRGOSYIrb2W+mzmanaaMGhXkXjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8vWh1j1NzlWj; Wed, 3 Apr 2024 19:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 433JCGWf000697; Wed, 3 Apr 2024 19:12:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433JCG18000694; Wed, 3 Apr 2024 19:12:16 GMT (envelope-from git) Date: Wed, 3 Apr 2024 19:12:16 GMT Message-Id: <202404031912.433JCG18000694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 72c3d91294c4 - stable/14 - libfetch: parse scheme://domain:/ correctly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72c3d91294c4d9c46c8185f90cba522f539d1051 Auto-Submitted: auto-generated The branch stable/14 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=72c3d91294c4d9c46c8185f90cba522f539d1051 commit 72c3d91294c4d9c46c8185f90cba522f539d1051 Author: Ka Ho Ng AuthorDate: 2024-03-25 20:10:42 +0000 Commit: Ka Ho Ng CommitDate: 2024-04-03 19:11:58 +0000 libfetch: parse scheme://domain:/ correctly This improves URL-parsing compability with cURL, and unbreaks parsing of similar kinds of URLs after commit 8d9de5b10a24. Sponsored by: Juniper Networks, Inc. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44493 (cherry picked from commit fb860ed0c52c2c1e7792ef86718620a439663c7f) --- lib/libfetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 135ee8dad151..8cb3536a46c5 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -427,7 +427,7 @@ fetchParseURL(const char *URL) goto ouch; } } - if (n < 1 || n > IPPORT_MAX) + if (p != q && (n < 1 || n > IPPORT_MAX)) goto ouch; u->port = n; p = q; From nobody Wed Apr 3 19:12:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8vXD1qzRz5Ff53; Wed, 3 Apr 2024 19:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8vXD1Fzhz4J1P; Wed, 3 Apr 2024 19:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712171564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rDf9gUHjNxyQdUcI/NCe1SVVtGGAA4cQIDdClvSOfM0=; b=wtZ1wJdr/Hkx/EVvQ1yfuPwiMtApbfl85Vtfv0N0/PqrnDAAvnEMwkQlNCqiFsi682lyg5 mY3qay7em7tF0enHukq3FRgkXF9EMMO8YqLtN2yLFldu9QmO6BpjiYMIfuQpUnZ8DOW/Dc nBBVSqEDkx7gZZPR9vGBuJxVZG42CesKiFIqfFf1vfVFnfugGx33DlSOi6IuURumiyi8/Y 9emKKaJgl+7sYZAOpEGrJZHm6ixuWFTTt4ffjOASm1qTDwhpuf9A0DOnDXQNFhUGt3nowE K1cwiROvhf1T0PTHQsuefYtJD5CYjmnecC/baXnKrDHO9qjKBSzYM61SCBPbdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712171564; a=rsa-sha256; cv=none; b=paqed/uq9Erb/qezONza+SSNwid+JDse9xdpAYTMC1gLMJSxr4FJafVIzuh9bEv5RzTRBk sg5nHRqUg9+uPuTnPLCUJYbH7DyI417xqa1lDjdQBIrUIL3MIe7YEBJqIELBMNVxm9aLat t6Sz2cE9H2z1/NOagtIUWrsGX2HJVzRtE6p8vae8rHLo+NFlDilrviD/NevZ2HY+w2RqkI v1D3YcJqzNRMXgK5M58pqVCSo4SDZtB32JNxzyACOXo9+Mf2nNyYENriz3uzFe6BzS96Iu 9Dt4GPHBaUlNWZx+8eoPP3qd8aP+rggkO/yVh2oWf3QzaUDl40sSvliFhW+Pfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712171564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rDf9gUHjNxyQdUcI/NCe1SVVtGGAA4cQIDdClvSOfM0=; b=sbJgyQ/QuA7eLzrV9O2Ims+0J7TvMe93rJ+WWrh45bUdxSyfce9U2V6yC2kw0sMezIPTis 7vqEN1DZEw+zIcLxz0TfZIGsPvlOE6eyDo2txwFnprzkRtYfKxFMwP2xBp2UnGq2uXpI4Q wEptRWB6f+CJEqdOaVTBHcLC1IriGasHneGAifKeYVi0M+L8XxFDU16guGXOd8mHKqCIcy Lv1RNgwwYdaaZvLgVrF3IOZOlPxUXzXzdj/MbHwm60n2xa66qWkN8BWGU+h0iIHyZesyqh DXorUjpzgeYhZS6tcpMWRXuHiwiJVkKD6J1F4YICunyjjMLn/GfhJbc/VcUI5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8vXD0sb1zlWm; Wed, 3 Apr 2024 19:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 433JCiPw001924; Wed, 3 Apr 2024 19:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433JCiJh001921; Wed, 3 Apr 2024 19:12:44 GMT (envelope-from git) Date: Wed, 3 Apr 2024 19:12:44 GMT Message-Id: <202404031912.433JCiJh001921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: c89889b9c342 - stable/13 - libfetch: parse scheme://domain:/ correctly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c89889b9c342e764e39b351d5024a4ba3429fb15 Auto-Submitted: auto-generated The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=c89889b9c342e764e39b351d5024a4ba3429fb15 commit c89889b9c342e764e39b351d5024a4ba3429fb15 Author: Ka Ho Ng AuthorDate: 2024-03-25 20:10:42 +0000 Commit: Ka Ho Ng CommitDate: 2024-04-03 19:12:38 +0000 libfetch: parse scheme://domain:/ correctly This improves URL-parsing compability with cURL, and unbreaks parsing of similar kinds of URLs after commit 8d9de5b10a24. Sponsored by: Juniper Networks, Inc. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44493 (cherry picked from commit fb860ed0c52c2c1e7792ef86718620a439663c7f) --- lib/libfetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 135ee8dad151..8cb3536a46c5 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -427,7 +427,7 @@ fetchParseURL(const char *URL) goto ouch; } } - if (n < 1 || n > IPPORT_MAX) + if (p != q && (n < 1 || n > IPPORT_MAX)) goto ouch; u->port = n; p = q; From nobody Thu Apr 4 02:45:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V95Z65FShz5GSWf; Thu, 4 Apr 2024 02:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V95Z62gN2z449j; Thu, 4 Apr 2024 02:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jR/FpkZI27xvJVKIzec93pJyudphaJiydS5oNI1AW5o=; b=nmwV9AAHTqEC4O5OTeztMkt7YNCmllJ6h03DElI7Kz74HVPCXsoemhYLaDXMnh2Fc8zYeI 3qMe1TKUg6uYqE6aTd5FKg4GjQcotPoyQ8TZUCU9Ka46ExtYynebV6VDO/Ofw0x5m/5Hao E7y293/fuIAdAz9DV5sSNk6lBrfkzujt6F4v5gy756YlKNCn6qzjvSL9BJ3j4EXy4WuHRt FgoAUm2zd4bgtwUYaAJ97X1rtY2kqpI6kzGy44ziNhd3YK1aDnBjIIlhj4MaVyzMHpDOoE ojhTd+pTRA8vCk6af4xKyXU5Z9ybio1K3AZbmxMJC76aJImHCbTViCKore6y5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712198702; a=rsa-sha256; cv=none; b=Ble6xjwoSxLltAxCfkvfIZew7s91BGmj5D6jpSEtgFu27sMRg9bMLqzu74tXl0sWPE9Z+S D3aZqoSyhjvBfWqkb6N9YBpB6IFTa6DS/BzQsKMSKyCmNT1IUvTsgBYnBrvRxvFyrTO8OA ZeOvWaOyjFGOroVY9cU+ilPf9joMl1Ri0DRoFDcpm4JvKPCzZxPBVs4YJ20L3amfFtip4Y FHQtBfGN0VHfq443ZKKHNn/r1S8w9PPtuVe4stKa4gQ/SwJ2Tbtb1R/VrJjh+ICuM6qZi2 GwDpVPergwDHH0dJ9b31Y5c6g8YJ+WvQP42D+Sj1IXy4KfXm4AGbFZcqwTkk2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jR/FpkZI27xvJVKIzec93pJyudphaJiydS5oNI1AW5o=; b=I9QyIXTR7tve+BNEylcaJ0UtZPvjJDg3Odug0+s2gLQodpuUVoNJ2NRogp5E7sIexyJYGd qS50NfUIFZMatuNyMXi6i5fBkTr05TQa1q58HZclYpXGIU+cYnK/6cayuukClHTF4bxH13 fHvripChiRYuQBk8buSE/mkphNUpYVxIwwU8u8vLT9ZIZFkIY+K27ai2cyD5CrCoUw3imT AJrrcOCV2uIN06mfTbq1WhPiolG+Y8/tYx7m24bVsFPLzJ+pDVpRZsMtHgrtXzFnxXl1UK +XwXUx2+vifgAvABp9NhRnFGKYvrWLRAApVJC7h6iXsLSe7UPFwYiDJzzrVnxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V95Z62GjZzybN; Thu, 4 Apr 2024 02:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4342j2mS060667; Thu, 4 Apr 2024 02:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4342j2WY060665; Thu, 4 Apr 2024 02:45:02 GMT (envelope-from git) Date: Thu, 4 Apr 2024 02:45:02 GMT Message-Id: <202404040245.4342j2WY060665@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: df9c60beea7c - stable/14 - thread_single(9): decline external requests for traced or debugger-stopped procs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: df9c60beea7c5d6d21c3e9e892f4e97a4bb7b4d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=df9c60beea7c5d6d21c3e9e892f4e97a4bb7b4d8 commit df9c60beea7c5d6d21c3e9e892f4e97a4bb7b4d8 Author: Konstantin Belousov AuthorDate: 2024-03-27 12:29:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-04 02:44:38 +0000 thread_single(9): decline external requests for traced or debugger-stopped procs (cherry picked from commit 9241ebc796c11cf133c550f188f324bd2c12d89a) --- sys/kern/kern_thread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index d8ba94925fec..1586d6c664fe 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1249,6 +1249,9 @@ thread_single(struct proc *p, int mode) return (1); msleep(&p->p_flag, &p->p_mtx, PCATCH, "thrsgl", 0); } + if ((p->p_flag & (P_STOPPED_SIG | P_TRACED)) != 0 || + (p->p_flag2 & P2_WEXIT) != 0) + return (1); } else if ((p->p_flag & P_HADTHREADS) == 0) return (0); if (p->p_singlethread != NULL && p->p_singlethread != td) From nobody Thu Apr 4 02:45:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V95ZT0twtz5GSFy; Thu, 4 Apr 2024 02:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V95ZT04P7z44bZ; Thu, 4 Apr 2024 02:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9x9ZgISR81RgerLCLG7ZsR/fXMYZ5KDQZCcTI/odsiU=; b=bdJPjtIIyjqkR78b8LBEXH399U1bk9XlsuoC52HeexC32HQOYMD8R7meLfQXFFT3+CaQKF M/Uf3I8dV0e0lKN4K6UwHWjOfi6z40j43wp6o29L1sUSY9Q/m7x0LWh8zITPxM16reSkJM eCSON0fndBpKP3OdyJ7rJvZsQTSKVcTxeMN0lDE+8ensaqvsfY9tCkGRmthbt08E2APfWd OVaV93yV++pxI8+DiZsj9s3/Ag5ubpcE8YULEUQcYzimNAah4qa60D9TvY3r/lSOQe9EDF nxrkSqH6cJbZZLzRlflJL4PWBNPBh1KHoUsyQgrS9Z+QCfW2UT/WiF8nUdQd1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712198721; a=rsa-sha256; cv=none; b=XwYMEyMO4CsjW2zfciuA5zYS3XvHs9ZWuLFyOZNI8JgtX5QEDHGrLVszrrN1b+WjC/bNr9 L8sLlcsRAGHEK8puK+gugi6S3OpNRM4zaoRv49h515PlPQxL7udsDBYha2IkW07Edl+kZ1 ZwIix9UJmeBGzf+P/Psn7GA0haM/KGgRULqFpcuZhibpVKiMcaC0WGdMkJ7UgLw+xbi8Ib fcY2SdwiZNkP4e7MrBDE05Vl2kBL+Ko2Bg54fgnMvq9PUxHfSy9sMC3+XnNerzhqT365/3 cdsQcrpaCc4ze7gHfylDmE6hqGDfXTPMp8BJT8MAdPzutVjO/156rwJIt00/GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712198721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9x9ZgISR81RgerLCLG7ZsR/fXMYZ5KDQZCcTI/odsiU=; b=YxOfQSh2pARN1Px0t4XDTKEkOkZFqjo087ysqoGO2Mvb6OIG072JM394vAguzwwjUr1k/W tum9+qPTeP3qXiVYsKSjR0rnnK26m+G9fIcNlOLiRQJnxCXqGxtlf3VBSGDkpok44CnHM3 P39usmsd8brooMpnGeY1bcmAWGl7dxc99PGJgxeKBEu/hayLvZOAg3ilyt4dVxGFtq8D/O LG9Mu3anv0W7reR4ebMuLiTK7dXmxsdu5G2DHmfGWHOAvji3QTqQf4CnA0YELr++e88vvd efdBFn051ofzEFUSz+p+N5BQ8fg5rBy8Qj+4GyWD54R44SLNjw76/wgF9z57/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V95ZS6n31zybP; Thu, 4 Apr 2024 02:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4342jKeg060843; Thu, 4 Apr 2024 02:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4342jKNH060840; Thu, 4 Apr 2024 02:45:20 GMT (envelope-from git) Date: Thu, 4 Apr 2024 02:45:20 GMT Message-Id: <202404040245.4342jKNH060840@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: bfafc6a86ddb - stable/13 - thread_single(9): decline external requests for traced or debugger-stopped procs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff commit bfafc6a86ddb4d278ceacab3d83b3e19b0cb33ff Author: Konstantin Belousov AuthorDate: 2024-03-27 12:29:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-04 02:43:56 +0000 thread_single(9): decline external requests for traced or debugger-stopped procs (cherry picked from commit 9241ebc796c11cf133c550f188f324bd2c12d89a) --- sys/kern/kern_thread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 14015ef5fdc2..75a10a0810f0 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1205,6 +1205,9 @@ thread_single(struct proc *p, int mode) return (1); msleep(&p->p_flag, &p->p_mtx, PCATCH, "thrsgl", 0); } + if ((p->p_flag & (P_STOPPED_SIG | P_TRACED)) != 0 || + (p->p_flag2 & P2_WEXIT) != 0) + return (1); } else if ((p->p_flag & P_HADTHREADS) == 0) return (0); if (p->p_singlethread != NULL && p->p_singlethread != td) From nobody Thu Apr 4 11:38:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KPz49lyz5GrPj; Thu, 4 Apr 2024 11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KPz3MGxz5776; Thu, 4 Apr 2024 11: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=1712230727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Bloqm3Uj41KAYjyWY/to5WP7tKkDTV4DhGq1gswuXU=; b=mzQFAgdC/Lx81pcYT2xD2HbJFwus55KVwyiAalcXg1dUQ4ClRhFt0ofJySlJ8crIWv0Ytw r+6YtyffiQkV7sA4UfqVF7yFYAmaCjTW424qTRxwo/O+7MUbJpNPScuD0w/xwlm6kZukv/ 1i/dH2UdpQZnrMRdk9wzcSbbraT8VoxxVWNCl/+mInxmGcxGSMmgCDaZn7nISnrKtBanR5 whPWGho4midCH+lOkADK6FPKtHKSMey7nSzwTm+Ren7lXdDkYoeIRREuIegjrdcWXMrBNb i6eiMw8gEAwyHo99KHbu/ysS2BKz67R420FPbTuKgq6VmgX8/Y+3Ewl/1osC4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230727; a=rsa-sha256; cv=none; b=nx/lmY0UVCRj+xZKvUQhJ0nThXAgZgN9oaWKpgROuBhsaL7X+6YQU4lCHzHCYBsskgpC++ E6YickJ8SaPWCXoyT3BXUMuBuXMVXmwSHf+np+JkP6qTEIBA/g/2nrnfNutw/IxsJCmXap FsP38ZDCLWe+AvLT/1+DFCI4oJB04aFaTH+QhTI3SCJHtooenioS55qPVVKHE36m33URj5 kEdzY2soHAM949FRv7jfKpwk5rI9PauKNEH17ChZX4SqESND0NaOtj6i7XJhEkZkZTuthB 22KO5nnUy1hkUdIt/6WRS+UtgSCf66Ojm1jIiogMZsh4t8Ur416qFtnAjJkB+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Bloqm3Uj41KAYjyWY/to5WP7tKkDTV4DhGq1gswuXU=; b=FBpQhqUNMKGhItOqnLxVC3Lg9Yz/X10iVzbsHMXlG+CN6yddjp+/hpUKLK/cQfCrvJokio S/oEaMR2Y09nH3W2icpLsbKmCkXymjcoXTPVsRaJbP9iw3VWA117ZzaAEH/El3ZzhyX7pa vfQ/cpSOHJQ1gI8rxRLfimod/s7CEEwBxONCIvezC+hFSw3ntwux9Cs/A7CgI9SiGTzb4w kadT8kguN8wtXMe3+Yp3B6E5kLFtmMj0p5P+BPGfW5WC0RhgHpWgX2xKP6xlvueiVBrITu I0pDy4+oW+Ootu8DCb1oq1LKto79pT/ygPY+4IwHwoCXyegn77aXW0Gi+xhw/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KPz2yG2zFVY; Thu, 4 Apr 2024 11:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434BclEu059652; Thu, 4 Apr 2024 11:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434BclUj059649; Thu, 4 Apr 2024 11:38:47 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:38:47 GMT Message-Id: <202404041138.434BclUj059649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fdde01c5b449 - stable/14 - libc: Improve description of mktime() / timegm(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: fdde01c5b44904e34ff3b003f446644de865fa21 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fdde01c5b44904e34ff3b003f446644de865fa21 commit fdde01c5b44904e34ff3b003f446644de865fa21 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:41:41 +0000 libc: Improve description of mktime() / timegm(). * Mention that mktime() and timegm() set errno on failure. * Correctly determining whether mktime() / timegm() succeeded with arbitrary input (where -1 can be a valid result) is non-trivial. Document the recommended procedure. PR: 277863 MFC after: 1 week Reviewed by: pauamma_gundo.com, gbe Differential Revision: https://reviews.freebsd.org/D44503 (cherry picked from commit 7534109d13a6cdb22e78d9d4c0a0cd5efd323c45) --- lib/libc/stdtime/ctime.3 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3 index 25a7c6a7656e..7216ada23826 100644 --- a/lib/libc/stdtime/ctime.3 +++ b/lib/libc/stdtime/ctime.3 @@ -29,7 +29,7 @@ .\" .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" -.Dd April 20, 2023 +.Dd March 26, 2024 .Dt CTIME 3 .Os .Sh NAME @@ -243,7 +243,21 @@ The .Fn mktime function returns the specified calendar time; if the calendar time cannot be -represented, it returns \-1; +represented, it returns \-1 and sets +.Xr errno 3 +to an appropriate value. +.Pp +Note that \-1 is a valid result (representing one second before +midnight UTC on the evening of 31 December 1969), so this cannot be +relied upon to indicate success or failure; instead, +.Fa tm_wday +and / or +.Fa tm_yday +should be set to an out-of-bounds value (e.g. \-1) prior to calling +.Fn mktime +or +.Fn timegm +and checked after the call. .Pp The .Fn difftime From nobody Thu Apr 4 11:38:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQ04rjlz5GrPn; Thu, 4 Apr 2024 11:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQ04LBvz56t1; Thu, 4 Apr 2024 11:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGTVbb/kseuXy+/4alRsSzpvCuqv/K5Sxiz3oRzETPY=; b=E7HXOdW8in6i6AzLcTy/mDUWiV3QFfjvv6k3F/yM3IDqcBl+5/i1o2zHw3F7a/aHB8Yfzi eGUjvzdNlxT5svPA+9BumQ+Ls2nAjmxqOwQvzYZs1wmjh3kbdgJG4jyDNyR3JHrD5jit29 SYAevbCnwr1lS4c7O5k/cPcEa7LkZGPu6rSoj1AnpwJtzPc2TQqvUCzhGnfwBE5K4wSRvJ RJvxfQRtNry+Jn7GjVFw7UGwq/1AJzyaCqzRXMWz+8uYNgJOWUW3q7SmIN3xCUXQ/zc0zT I3C+EbeCna3wLpba2suuth23yfydXm3M6zr2pYJQ62EBu+wCj6uzKJBNe6ntag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230728; a=rsa-sha256; cv=none; b=DAUFZxe2KjSbdwXaTTzmyrB73tZEt4OWKNK5ZgAuaoZMxpIag1BAS43RiE5HOPGqP1DnSr hRhCO28BSO45vSyEweuCZZ69CKnVGiiOSssdbIHN9Qsktbp4kEUxHItObRCxDI+YUsUipc xQaqciGf8wL/REH4JqexfetiqpWUyOekbFNZAqHVdyeKxE9LAYAljek4mh6bH/0nfLk9NE m4oBQZiWKh39ZG9CsWFAomU2Rsz43bZXEi7apiBIUY28yc1Z4fjlLFFHqW6//3/6jjXtp2 7Aqd8MYeFk1DIcXnfxnlnQD2o5o/Rhi3rdeT0nT0wLorpwEuheYeXxyjnCudyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGTVbb/kseuXy+/4alRsSzpvCuqv/K5Sxiz3oRzETPY=; b=EmoHBHcP+qDXLIakLafMV8lq+S6VilqEuQf9f0amt4/m9SWn3b8wt+ijJ8SR86yp8nrA7F +kxZYhRLAtKXSLGp1XKPDDSAd3ccQz07DxFuoc4RSNrm6A+/rnoluVaP1aqg04STsZxNAj mrQq3kk8Sb1Vrr85lpfCbdaQyTcxBrRggufCcQV+kVoZHA2D3HRIddpwXTG18cxo64JFcg 08TY1/Q9d1oh2PoB6GUlTvJ3ptET+qq8djokwS0d1zA0sXU6gw5dB/WZdyMjCWrilsNXfT 7rfwxz99bsunq7qe8ROVzRoJKDP7l3sfwtrfCZSk9Rc1LYvQWWGwBz7MaoSzzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQ03xyDzFLb; Thu, 4 Apr 2024 11:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434BcmTf059703; Thu, 4 Apr 2024 11:38:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434BcmuD059700; Thu, 4 Apr 2024 11:38:48 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:38:48 GMT Message-Id: <202404041138.434BcmuD059700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ae2888dd0e25 - stable/14 - touch: Allow setting the timestamp to -1. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ae2888dd0e25e0334c89164454480d9c2ff9bd23 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2888dd0e25e0334c89164454480d9c2ff9bd23 commit ae2888dd0e25e0334c89164454480d9c2ff9bd23 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:43:12 +0000 touch: Allow setting the timestamp to -1. Note that VFS internally interprets a timestamp of -1 as “do not set”, so this has no effect, but at least touch won't incorrectly reject the given date / time (1969-12-31 23:59:59 UTC) as invalid. While here, fix some style issues. MFC after: 1 week Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44504 (cherry picked from commit aa69e0f212630bd6d4ec1c3c54e117be16653e8a) touch: Add unit tests. MFC after: 1 week Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D44505 (cherry picked from commit 74a4aa9b1517d92bfa85b0b1cd7d4c1262bb1ef9) --- etc/mtree/BSD.tests.dist | 2 + usr.bin/touch/Makefile | 4 + usr.bin/touch/tests/Makefile | 4 + usr.bin/touch/tests/touch_test.sh | 157 ++++++++++++++++++++++++++++++++++++++ usr.bin/touch/touch.c | 21 +++-- 5 files changed, 181 insertions(+), 7 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 8a3b097c4162..a3c5cae09567 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1133,6 +1133,8 @@ .. tftp .. + touch + .. tr .. truncate diff --git a/usr.bin/touch/Makefile b/usr.bin/touch/Makefile index 5c153b3357a4..f4b74a033c36 100644 --- a/usr.bin/touch/Makefile +++ b/usr.bin/touch/Makefile @@ -1,5 +1,9 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= touch +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests .include diff --git a/usr.bin/touch/tests/Makefile b/usr.bin/touch/tests/Makefile new file mode 100644 index 000000000000..543b682b96a0 --- /dev/null +++ b/usr.bin/touch/tests/Makefile @@ -0,0 +1,4 @@ +PACKAGE= tests +ATF_TESTS_SH= touch_test + +.include diff --git a/usr.bin/touch/tests/touch_test.sh b/usr.bin/touch/tests/touch_test.sh new file mode 100644 index 000000000000..da39abef622e --- /dev/null +++ b/usr.bin/touch/tests/touch_test.sh @@ -0,0 +1,157 @@ +# +# Copyright (c) 2024 Dag-Erling Smørgrav +# +# SPDX-License-Identifier: BSD-2-Clause +# + +export TZ=UTC + +atf_check_mtime() +{ + local mtime=$1 filename=$2 + atf_check -o inline:"$((mtime))\n" stat -f%m "$filename" +} + +atf_test_case touch_none +touch_none_head() +{ + atf_set descr "No arguments" +} +touch_none_body() +{ + atf_check -s exit:1 -e match:"^usage" touch +} + +atf_test_case touch_one +touch_one_head() +{ + atf_set descr "One argument" +} +touch_one_body() +{ + atf_check touch foo + atf_check test -f foo +} + +atf_test_case touch_multiple +touch_multiple_head() +{ + atf_set descr "Multiple arguments" +} +touch_multiple_body() +{ + atf_check touch foo bar baz + atf_check test -f foo -a -f bar -a -f baz +} + +atf_test_case touch_absolute +touch_absolute_head() +{ + atf_set descr "Absolute date / time" +} +touch_absolute_body() +{ + atf_check touch -t 7001010101 foo + atf_check_mtime 3660 foo + atf_check rm foo + + atf_check touch -t 7001010101.01 foo + atf_check_mtime 3661 foo + atf_check rm foo + + atf_check touch -t 196912312359 foo + atf_check_mtime -60 foo + atf_check rm foo + + atf_check touch -t 196912312359.58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check touch -t 196912312359.59 foo + atf_expect_fail "VFS interprets -1 as “do not set”" + atf_check_mtime -1 foo + atf_check rm foo + + atf_check touch -d1969-12-31T23:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check touch -d1969-12-31\ 23:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check env TZ=CET touch -d1970-01-01T00:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check env TZ=CET touch -d1970-01-01T00:59:58Z foo + atf_check_mtime 3598 foo + atf_check rm foo + + atf_check touch -d1969-12-31T23:59:59Z foo + atf_expect_fail "VFS interprets -1 as “do not set”" + atf_check_mtime -1 foo + atf_check rm foo +} + +atf_test_case touch_relative +touch_relative_head() +{ + atf_set descr "Relative date / time" +} +touch_relative_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -A -36 foo + atf_check_mtime 1711283660 foo + atf_check touch -A -0100 foo + atf_check_mtime 1711283600 foo + atf_check touch -A -010000 foo + atf_check_mtime 1711280000 foo + atf_check touch -A 010136 foo + atf_check_mtime 1711283696 foo +} + +atf_test_case touch_copy +touch_copy_head() +{ + atf_set descr "Copy time from another file" +} +touch_copy_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -t 7001010000 bar + atf_check_mtime 0 bar + atf_check touch -r foo bar + atf_check_mtime 1711283696 bar +} + +atf_test_case touch_nocreate +touch_nocreate_head() +{ + atf_set descr "Do not create file" +} +touch_nocreate_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -c -t 7001010000 foo bar + atf_check_mtime 0 foo + atf_check -s exit:1 test -f bar + atf_check touch -c bar + atf_check -s exit:1 test -f bar +} + +atf_init_test_cases() +{ + atf_add_test_case touch_none + atf_add_test_case touch_one + atf_add_test_case touch_multiple + atf_add_test_case touch_absolute + atf_add_test_case touch_relative + atf_add_test_case touch_copy + atf_add_test_case touch_nocreate + # TODO: add test cases for -a, -h, -m +} diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index 91abcfd447ea..ed5b2125ec36 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -243,7 +243,7 @@ stime_arg1(const char *arg, struct timespec *tvp) } yearset = 0; - switch(strlen(arg)) { + switch (strlen(arg)) { case 12: /* CCYYMMDDhhmm */ t->tm_year = ATOI2(arg); t->tm_year *= 100; @@ -274,15 +274,17 @@ stime_arg1(const char *arg, struct timespec *tvp) } t->tm_isdst = -1; /* Figure out DST. */ + t->tm_yday = -1; tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); - if (tvp[0].tv_sec == -1) + if (t->tm_yday == -1) goto terr; tvp[0].tv_nsec = tvp[1].tv_nsec = 0; return; terr: - errx(1, "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); + errx(1, "out of range or illegal time specification: " + "[[CC]YY]MMDDhhmm[.SS]"); } static void @@ -307,10 +309,11 @@ stime_arg2(const char *arg, int year, struct timespec *tvp) } t->tm_isdst = -1; /* Figure out DST. */ + t->tm_yday = -1; tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); - if (tvp[0].tv_sec == -1) - errx(1, - "out of range or illegal time specification: MMDDhhmm[yy]"); + if (t->tm_yday == -1) + errx(1, "out of range or illegal time specification: " + "MMDDhhmm[yy]"); tvp[0].tv_nsec = tvp[1].tv_nsec = 0; } @@ -350,13 +353,17 @@ stime_darg(const char *arg, struct timespec *tvp) if (*p != '\0') goto bad; + t.tm_yday = -1; tvp[0].tv_sec = isutc ? timegm(&t) : mktime(&t); + if (t.tm_yday == -1) + goto bad; tvp[1] = tvp[0]; return; bad: - errx(1, "out of range or illegal time specification: YYYY-MM-DDThh:mm:SS[.frac][tz]"); + errx(1, "out of range or illegal time specification: " + "YYYY-MM-DDThh:mm:SS[.frac][tz]"); } /* Calculate a time offset in seconds, given an arg of the format [-]HHMMSS. */ From nobody Thu Apr 4 11:38:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQ20Rhcz5GrMM; Thu, 4 Apr 2024 11:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQ15N2Fz57NM; Thu, 4 Apr 2024 11:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0zAKuBGftuhTwjUnGGyn90vMFXO/QHbfWetjfGvcKa8=; b=cBQbfSVncGCZua76lLUljty5HkVHglg7c05OfhgzqKXmoE6SPMRzPeQ6aX6XR650gYi2XU phQB/tNV7rYqwN1UswJAU0stoWhB6D5Wyfyg4Ybv85ut0opxlhu4ZHkWIVdgtn3b61rOIL tEbfjVTk4D16qqEGIwb3n87n1+kO9jypTyodUjzeBArGDNmAS8zRziqAJKPvQ9Ye/UGDCT I30qN8vUBuhu0JAnRKQjz/FhX4ZLusA0d9LvdiiqO5lrWnYsc58u1T31nFj3egV0Veau3S NFHo595UNxG80vSHBDn8TkTWPuw/fcJ9shJDvLQhyscpY4NWm1YpBjK+ErtYMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230729; a=rsa-sha256; cv=none; b=mFe7clffAJb9pyoKNk/csciY8aROXJTHHlTUxonzD5/5oHu96gWG8IW60O1fLP5t/bAI7K 1OSbZgRqye/rtFnxvF0KQexBkDDG6H7iIVfhWtajGqXS7BQkxdIc4inHwaZNk2evijMhfI hAxroVyzkCx04q0XeZL6QkpuwZ/HOEH91ch49KSIcp1zBH0fM6S27KxeLpDkCBCQ6qtAsA WObT+CHE9VpVDuQzudVF8y20bTKmx+TXgy03B1VSz1WdDUT35rDKU2p/gjhCCtbN78qBbY Wtr+G8EPHmmKtDcih/UVLNDPa6Nadm7FvPhHAXZCk8K25U2sJrBOMjl1hyhpKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0zAKuBGftuhTwjUnGGyn90vMFXO/QHbfWetjfGvcKa8=; b=NBigf3h2sgZ/fEc30WsItC8kN6XQlaxt/8+klVWOKa5K8lvxvvaMjxoC4YU6xwAWjZc/VW 5WKzQDB9vlBp/d3uu/Swjr4tu7AEZZtq7dX7ajjrYxP04QaVPhfj3k4fWGmBNJijHapVCB h7Pj3lR0soQKJ3FAGv5TjjbgkNC8gVngLxFFFyfUyk1Dd73Ggk5IcyulAf8CLfSvZI/O8h phje11TKC9gzm1PKaQTVbvvWv8KJQOu5tP7j3lHSlml33S3W93D1ij/LOVOKyzScsgqlBd dVQkgWtY4YzGEpOt3QXoO5TkICMQ1QLvHv3T0R2nqerCJuGg3/y2vYWLayBY3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQ14z3lzFVZ; Thu, 4 Apr 2024 11:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434BcnCZ059748; Thu, 4 Apr 2024 11:38:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434BcnVn059745; Thu, 4 Apr 2024 11:38:49 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:38:49 GMT Message-Id: <202404041138.434BcnVn059745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d738ce7cf6a3 - stable/14 - ln: Use stdbool, style nits. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d738ce7cf6a35faa071d3945ae75a7438a7b28e6 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d738ce7cf6a35faa071d3945ae75a7438a7b28e6 commit d738ce7cf6a35faa071d3945ae75a7438a7b28e6 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:43:14 +0000 ln: Use stdbool, style nits. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D44511 (cherry picked from commit 437d53daf71a357aae960881ef037564736f7441) ln: Clean up and simplify tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44512 (cherry picked from commit e0afcbc85690b6464706ead57103baa0493fdfb2) ln: Add a test case for ln -sfF. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, asomers Differential Revision: https://reviews.freebsd.org/D44513 (cherry picked from commit 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9) --- bin/ln/ln.c | 76 ++++++++++++++++++++++--------------------- bin/ln/tests/ln_test.sh | 85 +++++++++++++++++++++---------------------------- 2 files changed, 76 insertions(+), 85 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 546bfba1c7c3..a0e19d702dea 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -49,24 +49,25 @@ static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94"; #include #include #include +#include #include #include #include #include -static int fflag; /* Unlink existing files. */ -static int Fflag; /* Remove empty directories also. */ -static int hflag; /* Check new name for symlink first. */ -static int iflag; /* Interactive mode. */ -static int Pflag; /* Create hard links to symlinks. */ -static int sflag; /* Symbolic, not hard, link. */ -static int vflag; /* Verbose output. */ -static int wflag; /* Warn if symlink target does not +static bool fflag; /* Unlink existing files. */ +static bool Fflag; /* Remove empty directories also. */ +static bool hflag; /* Check new name for symlink first. */ +static bool iflag; /* Interactive mode. */ +static bool Pflag; /* Create hard links to symlinks. */ +static bool sflag; /* Symbolic, not hard, link. */ +static bool vflag; /* Verbose output. */ +static bool wflag; /* Warn if symlink target does not * exist, and -f is not enabled. */ static char linkch; -static int linkit(const char *, const char *, int); -static void usage(void); +static int linkit(const char *, const char *, bool); +static void usage(void) __dead2; int main(int argc, char *argv[]) @@ -91,41 +92,41 @@ main(int argc, char *argv[]) argv += optind; if (argc != 2) usage(); - exit(linkit(argv[0], argv[1], 0)); + exit(linkit(argv[0], argv[1], false)); } while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1) switch (ch) { case 'F': - Fflag = 1; + Fflag = true; break; case 'L': - Pflag = 0; + Pflag = false; break; case 'P': - Pflag = 1; + Pflag = true; break; case 'f': - fflag = 1; - iflag = 0; - wflag = 0; + fflag = true; + iflag = false; + wflag = false; break; case 'h': case 'n': - hflag = 1; + hflag = true; break; case 'i': - iflag = 1; - fflag = 0; + iflag = true; + fflag = false; break; case 's': - sflag = 1; + sflag = true; break; case 'v': - vflag = 1; + vflag = true; break; case 'w': - wflag = 1; + wflag = true; break; case '?': default: @@ -136,21 +137,21 @@ main(int argc, char *argv[]) argc -= optind; linkch = sflag ? '-' : '='; - if (sflag == 0) - Fflag = 0; - if (Fflag == 1 && iflag == 0) { - fflag = 1; - wflag = 0; /* Implied when fflag != 0 */ + if (!sflag) + Fflag = false; + if (Fflag && !iflag) { + fflag = true; + wflag = false; /* Implied when fflag is true */ } - switch(argc) { + switch (argc) { case 0: usage(); /* NOTREACHED */ case 1: /* ln source */ - exit(linkit(argv[0], ".", 1)); + exit(linkit(argv[0], ".", true)); case 2: /* ln source target */ - exit(linkit(argv[0], argv[1], 0)); + exit(linkit(argv[0], argv[1], false)); default: ; } @@ -169,7 +170,7 @@ main(int argc, char *argv[]) if (!S_ISDIR(sb.st_mode)) usage(); for (exitval = 0; *argv != targetdir; ++argv) - exitval |= linkit(*argv, targetdir, 1); + exitval |= linkit(*argv, targetdir, true); exit(exitval); } @@ -220,14 +221,15 @@ samedirent(const char *path1, const char *path2) } static int -linkit(const char *source, const char *target, int isdir) +linkit(const char *source, const char *target, bool isdir) { - struct stat sb; - const char *p; - int ch, exists, first; char path[PATH_MAX]; char wbuf[PATH_MAX]; char bbuf[PATH_MAX]; + struct stat sb; + const char *p; + int ch, first; + bool exists; if (!sflag) { /* If source doesn't exist, quit now. */ @@ -290,7 +292,7 @@ linkit(const char *source, const char *target, int isdir) /* * If the file exists, first check it is not the same directory entry. */ - exists = !lstat(target, &sb); + exists = lstat(target, &sb) == 0; if (exists) { if (!sflag && samedirent(source, target)) { warnx("%s and %s are the same directory entry", diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 75fda4ce2dd7..8e5dcf81e61f 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -1,4 +1,6 @@ # +# SPDX-License-Identifier: BSD-2-Clause +# # Copyright 2017 Shivansh Rai # All rights reserved. # @@ -23,13 +25,15 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# -set_umask() +atf_check_same_file() { - if ! umask 022; then - atf_fail "setting umask failed" - fi + atf_check_equal "$(stat -f %d,%i "$1")" "$(stat -f %d,%i "$2")" +} + +atf_check_symlink_to() +{ + atf_check -o inline:"$1\n" readlink "$2" } atf_test_case L_flag @@ -39,18 +43,13 @@ L_flag_head() "symbolic link, '-L' option creates a hard" \ "link to the target of the symbolic link" } - L_flag_body() { - set_umask atf_check touch A atf_check ln -s A B atf_check ln -L B C - stat_A=$(stat -f %i A) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_A" "$stat_C" - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_same_file A C + atf_check_symlink_to A B } atf_test_case P_flag @@ -60,16 +59,12 @@ P_flag_head() "symbolic link, '-P' option creates a hard " \ "link to the symbolic link itself" } - P_flag_body() { - set_umask atf_check touch A atf_check ln -s A B atf_check ln -P B C - stat_B=$(stat -f %i B) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_B" "$stat_C" + atf_check_same_file B C } atf_test_case f_flag @@ -78,15 +73,11 @@ f_flag_head() atf_set "descr" "Verify that if the target file already exists, " \ "'-f' option unlinks it so that link may occur" } - f_flag_body() { - set_umask atf_check touch A B atf_check ln -f A B - stat_A=$(stat -f %i A) - stat_B=$(stat -f %i B) - atf_check_equal "$stat_A" "$stat_B" + atf_check_same_file A B } atf_test_case target_exists_hard @@ -95,10 +86,8 @@ target_exists_hard_head() atf_set "descr" "Verify whether creating a hard link fails if the " \ "target file already exists" } - target_exists_hard_body() { - set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln A B @@ -110,10 +99,8 @@ target_exists_symbolic_head() atf_set "descr" "Verify whether creating a symbolic link fails if " \ "the target file already exists" } - target_exists_symbolic_body() { - set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln -s A B @@ -124,13 +111,12 @@ shf_flag_dir_head() { atf_set "descr" "Verify that if the target directory is a symbolic " \ "link, '-shf' option prevents following the link" } - shf_flag_dir_body() { atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -shf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check test -L C atf_check -o inline:'B\n' readlink C } @@ -139,14 +125,12 @@ snf_flag_dir_head() { atf_set "descr" "Verify that if the target directory is a symbolic " \ "link, '-snf' option prevents following the link" } - snf_flag_dir_body() { atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -snf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C - atf_check -o inline:'B\n' readlink C + atf_check_symlink_to B C } atf_test_case sF_flag @@ -156,13 +140,11 @@ sF_flag_head() "and is a directory, then '-sF' option removes " \ "it so that the link may occur" } - sF_flag_body() { atf_check mkdir A B atf_check ln -sF A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case sf_flag @@ -172,14 +154,27 @@ sf_flag_head() "'-sf' option unlinks it and creates a symbolic link " \ "to the source file" } - sf_flag_body() { - set_umask atf_check touch A B atf_check ln -sf A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B +} + +atf_test_case sfF_flag +sfF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a symlink, then '-sfF' option removes " \ + "it so that the link may occur" +} +sfF_flag_body() +{ + atf_check mkdir A B C + atf_check ln -sF A C + atf_check_symlink_to A C + atf_check ln -sfF B C + atf_check_symlink_to B C } atf_test_case s_flag @@ -187,14 +182,11 @@ s_flag_head() { atf_set "descr" "Verify that '-s' option creates a symbolic link" } - s_flag_body() { - set_umask atf_check touch A atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case s_flag_broken @@ -203,12 +195,10 @@ s_flag_broken_head() atf_set "descr" "Verify that if the source file does not exists, '-s' " \ "option creates a broken symbolic link to the source file" } - s_flag_broken_body() { atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case sw_flag @@ -217,13 +207,11 @@ sw_flag_head() atf_set "descr" "Verify that '-sw' option produces a warning if the " \ "source of a symbolic link does not currently exist" } - sw_flag_body() { atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ ln -sw A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_init_test_cases() @@ -237,6 +225,7 @@ atf_init_test_cases() atf_add_test_case snf_flag_dir atf_add_test_case sF_flag atf_add_test_case sf_flag + atf_add_test_case sfF_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken atf_add_test_case sw_flag From nobody Thu Apr 4 11:38:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQ30lxXz5GrPp; Thu, 4 Apr 2024 11:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQ26PMrz57Qq; Thu, 4 Apr 2024 11:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fet3Kz+vnUYmNqMkapqaGJnDj+T9NYmPT6o13NBbt/M=; b=snwUuHkZn3HbjSTPjj449YyZzwOeUmHflBYFrX7dofDo2GEXHNUD2sUHOxU38if6x31p6B nggQxCQyOWp6A642jC6TMtMUPdOhb8qwDD1GHoMeTnvnsVkcfPEpP32sWvxYiFOBlJBV30 PqZMKaqMzk0fRb/Ita4p+LGeTEvZV+BaI7Aze1tnclWCx29xB5oSSkaiNKBYD29aEdx0uV FbLzzBLWRFggxhvBdAUPS14AyoTvaEPeBb5vBoBb4Rp8DZe/FkstPzrp6jb2VOWx2g2bgO yNTjTsrnm9xpAQfe2JwK7z64Z+DrWDy/mPz+Zgjzn0SjpNf/W2Nk8Lg4WOHJ1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230730; a=rsa-sha256; cv=none; b=sAaI8BnOdCyN5SQRUTP4LYGPLKbgREGbOwmnn46R8ygUPX0QGicOUS1CQsy+qJYAjAyi7R ePSudHyngOvfXgZz9jjuzomTilkgAzBoPmjc72MGK+Wr0FuekeHwl+RvPTlKeK7WOImnn2 p3xxM2Gvw6XT+/G0UrvERoA5+tf3LqsGSmMmS7M4jkSQIyC1uk35VQ5uovF5Te6yZEAhLq 41HL82sLY43xdw7jNzNPJinq3BYhMKxqxOyAAjDEwicBVCgVmPAHSljjkYNrcHGgGXu5rJ tzC8YXfNLGllnULkxR6Hyqgm5Kwag/8C7h9eiN3FEuD4pJEmDUZPh4ZUIVO4FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fet3Kz+vnUYmNqMkapqaGJnDj+T9NYmPT6o13NBbt/M=; b=ok3KKvdXsu6rD+IlwbVfbe62Tk8ch6sJAkngzkcmVWkIKCSFkW5DmKEsB1HVdIQyFkhTHT ZfiYvC2+N56Wu0qxh8jYzC0Pyo1qyAtLacTVoIrPKsgkgSQbqbt/tyjpVhmJdy2xIWSWJp DMBEEiWuAA5R81K53auj+BlvdEhRpEM6uWO8tR5fS5gn5L+eSq0OUERRWVydCNR2ykYrtN I2JqL2JP87JWbr+wVu5cUQZN5/I48YpXqRVS0tGi9b4+EDa0wM/UPsq5d9tA0rZFZWlBb0 Um4fqGekDZGXHM49FXaR0spz4C6q6N2U7egQsNhF5RCQB83AmCEiRmxOrMK+Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQ2604JzFJL; Thu, 4 Apr 2024 11:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434BcoL8059795; Thu, 4 Apr 2024 11:38:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434BcorS059791; Thu, 4 Apr 2024 11:38:50 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:38:50 GMT Message-Id: <202404041138.434BcorS059791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 80f2602e48eb - stable/14 - install: Prefer strsnvis() to strsvis(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 80f2602e48ebafcc5b82909724f970d2103185c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=80f2602e48ebafcc5b82909724f970d2103185c4 commit 80f2602e48ebafcc5b82909724f970d2103185c4 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:43:15 +0000 install: Prefer strsnvis() to strsvis(). MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44514 (cherry picked from commit 2cab4be46b0eeb64b8ade010bc16245151af5ccd) --- usr.bin/xinstall/xinstall.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 1ab9cac76f2f..3764c5ef92fa 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1542,15 +1542,18 @@ metadata_log(const char *path, const char *type, struct timespec *ts, static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; const char *p; char *buf; - size_t destlen; + size_t buflen, destlen; struct flock metalog_lock; if (!metafp) return; - /* Buffer for strsvis(3). */ - buf = (char *)malloc(4 * strlen(path) + 1); - if (buf == NULL) { - warnx("%s", strerror(ENOMEM)); + /* Buffer for strsnvis(3), used for both path and slink. */ + buflen = strlen(path); + if (slink && strlen(slink) > buflen) + buflen = strlen(slink); + buflen = 4 * buflen + 1; + if ((buf = malloc(buflen)) == NULL) { + warn(NULL); return; } @@ -1575,7 +1578,7 @@ metadata_log(const char *path, const char *type, struct timespec *ts, } while (*p && *p == '/') p++; - strsvis(buf, p, VIS_OCTAL, extra); + strsnvis(buf, buflen, p, VIS_OCTAL, extra); p = buf; /* Print details. */ fprintf(metafp, ".%s%s type=%s", *p ? "/" : "", p, type); @@ -1585,14 +1588,14 @@ metadata_log(const char *path, const char *type, struct timespec *ts, fprintf(metafp, " gname=%s", group); fprintf(metafp, " mode=%#o", mode); if (slink) { - strsvis(buf, slink, VIS_CSTYLE, extra); /* encode link */ + strsnvis(buf, buflen, slink, VIS_CSTYLE, extra); fprintf(metafp, " link=%s", buf); } if (*type == 'f') /* type=file */ fprintf(metafp, " size=%lld", (long long)size); if (ts != NULL && dopreserve) fprintf(metafp, " time=%lld.%09ld", - (long long)ts[1].tv_sec, ts[1].tv_nsec); + (long long)ts[1].tv_sec, ts[1].tv_nsec); if (digestresult && digest) fprintf(metafp, " %s=%s", digest, digestresult); if (fflags) From nobody Thu Apr 4 11:38:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQ40dTLz5Gr8q; Thu, 4 Apr 2024 11:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQ36rSRz578m; Thu, 4 Apr 2024 11:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sFH5lARvL/uY67KOaBAlwgLluoGrytxBvD6WRPrI8g4=; b=pLv6Z47SBIoa7gIRwSCNSJB8nI5jjTFxd5I/eFtaYyry8xU55WYowtHxcmad9P4x+v3Opl V7jEaY0IFF+SOYgoLvr5BWLhweEXzbTuap3XHoeurqDgrxqG5/GUFKqnJmfaaJ8ZquD/vc ba58QrjTuzqdBoqaGbjpsA4vK6JT2p4FHfRDjP8rXuHEPfnAizQxf5VanpIdHvh1YpNzC6 wI2VO+vkiqpHD9PdW9pLuE6Kh/uKLvEU6j3j57p8uoR6+cBIv3bex2kdZUgnDCmrwWF9o2 hnt4pRAtC707MF+YtrpOrnn19vtxYhkuwaMhMsdo6dJQecgOl+h5EYxpih9VeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230732; a=rsa-sha256; cv=none; b=firu4EIU26EPh0loh75q8oLDXyA2e1o1StJ/0TP/TWtRBBWEkqYXv3w8or0OtgnsVFCwmo /jc/TVvjDQpr3yFnIT8niiEgbE27uPFTKaqiZMezDBHoUvjmmmOO2ww/kkkm/Jt1XanXHm oW9N5UfiP0VF4NIa+DhNomqb44CoWOnO8kvOtBP6pR/dpdXWqFMA442cwlJkuT7Dp+7nu+ vR6tij0hUKODv9s9mnutKbmBWdV8n8lPUKNNU7qjwoKcs8lQgJ5sHln0K/rW9EgSEcVUA8 oADcan1vN33uOKMKNN6ub/Ycj4oXkyOTS7qDELkKrHprx13sw3IlhwMx1bVNHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sFH5lARvL/uY67KOaBAlwgLluoGrytxBvD6WRPrI8g4=; b=o972RAUxv3QSNoRXrQKOOU908aKcJmxaWnpQ8OOHZ7TGGYHuXMHs+H18b3mM3opcbrCUcC AGBG6aB2j375+U6divofd13S1H3kXY9U7H+dVA983Ym5UwK8KY6raCvEu+fp47uqdXvatG wdZfr0CKOY3TBOSaWb94Mg3ketInhbXIb5N5u3wEg4AW74c58UCX7wydx5Ij03bq0dLOMF CejjjaxR4QXBXIBXT3sMVOcCyTlfS/LMzbh7tENvAO9vSzLzUa/fJuVVRaqz1+tgknX/y2 J/eUf3gIZji0RKI56ms8BLAD6HuYFgEjayef5QsgDlWQDVrScLIkF5gvXAGdbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQ36T2HzFVb; Thu, 4 Apr 2024 11:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434BcpJx059850; Thu, 4 Apr 2024 11:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434BcpBf059847; Thu, 4 Apr 2024 11:38:51 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:38:51 GMT Message-Id: <202404041138.434BcpBf059847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ddee3ee4e071 - stable/14 - usr.bin: Make lorder conditional on MK_TOOLCHAIN. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ddee3ee4e071d5c9e27dfe53487d7b8a6d1cead2 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ddee3ee4e071d5c9e27dfe53487d7b8a6d1cead2 commit ddee3ee4e071d5c9e27dfe53487d7b8a6d1cead2 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-01 13:18:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:53:25 +0000 usr.bin: Make lorder conditional on MK_TOOLCHAIN. MFC after: 1 week Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D44558 (cherry picked from commit 125c4560bc70971b950d035cfcd2255b89984011) --- tools/build/mk/OptionalObsoleteFiles.inc | 6 ++++++ usr.bin/Makefile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 3a46b9537f71..506f3877883e 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -8356,6 +8356,12 @@ OLD_FILES+=usr/share/man/man3/elftc_set_timestamps.3.gz OLD_FILES+=usr/share/man/man3/elftc_timestamp.3.gz OLD_FILES+=usr/share/man/man3/elftc_string_table_create.3.gz OLD_FILES+=usr/share/man/man3/elftc_version.3.gz +# usr.bin/lorder +OLD_FILES+=usr/bin/lorder +OLD_FILES+=usr/tests/usr.bin/lorder/Kyuafile +OLD_FILES+=usr/tests/usr.bin/lorder/lorder_test +OLD_DIRS+=usr/tests/usr.bin/lorder +# usr.bin/yacc OLD_FILES+=usr/tests/usr.bin/yacc/Kyuafile OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 4e48c18d5e81..aa62155703a7 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -84,7 +84,6 @@ SUBDIR= alias \ logins \ logname \ look \ - lorder \ lsvfs \ lzmainfo \ m4 \ @@ -269,6 +268,7 @@ SUBDIR.${MK_TOOLCHAIN}+= file2c SUBDIR.${MK_TOOLCHAIN}+= gprof SUBDIR.${MK_TOOLCHAIN}+= indent SUBDIR.${MK_TOOLCHAIN}+= lex +SUBDIR.${MK_TOOLCHAIN}+= lorder SUBDIR.${MK_TOOLCHAIN}+= mkstr SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef From nobody Thu Apr 4 11:39:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQF6QfKz5GrS2; Thu, 4 Apr 2024 11:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQF2jyDz57hQ; Thu, 4 Apr 2024 11:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwZkWQsmhghCLlTN2+a/cBWCbciE/i/+V0aKCaDr70w=; b=cGotmhW9eORCaxkNI3n6rYr4f+siw1IapxDvDzkK7gqYXrzkEHCFHCAxOCQDagYq3lSu03 uNK5sV70Q4HyRvcRZH+4ArCq2fDMkXryoWPkurgGpDbRlYur56XkNjrvWnU7WgrV02J9Es MXyfbp7WV2+r5ixHkJVAtL5ncOKYmqgr9wJtNiiWyqjJyQrzZq716TG3kEJcZBcH4OQw7W 6t97rY/PRBzPRz5wwOhP5Q/T0aKCJErPNYtJWzI4SwsRo57IYVkwfZ8JjLkS+0jjtmHGB+ fGWBK83pAZAV5qXZBbZdaZzLn0FMyPayomr3dMcUNlbshhtIvldJjVmoDYD5kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230741; a=rsa-sha256; cv=none; b=M7NxNd0qATyIzgqK9YQj1pEALh7z1gFboeUZDWhnpLzlCF3b1loqArrHKpmzZToKZbqC77 QX7RJNUaNZWP8gLntdOrIuvXR5VmI9ENUH8vf7/6LEFOVH6ioVKKyQKxUau9O6dnNByeZx 0pMYeA8OCM9febA7HkM0m/0A6EYr+DypYFfKylMp13oNT2UdfnDXBH5cSKjc7DIk+69SS6 q1C7dnBlkkDYRSgCr9Y+DK3OssaDceVL0d4Zsu7+sOlAuHkg0nlYonY7wNXeI/xvzhYxrj q69LASDYXVG7N5FWtrD3vH4SniWpE4cKm5L1roSPiUsV8SzrqnHPbZKReoxaKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwZkWQsmhghCLlTN2+a/cBWCbciE/i/+V0aKCaDr70w=; b=hEWF6dtt9LDDIwdKzIdjkW3Fo/Ay1GsK7DVVBaGTjhaJmPTZxmw5qn1KkmDWwFqqLoipeC g66daMtcuk9gAZHFry5n6TuA0b/wFseEAJZ97r7k72cpGZ3nM/QISkAQnfFNXZVp3EzRTw BTYafFCru+TI8hKj5bO9dmzE9zaz8aBdsJmA5gKJ2DlUp4Y/DLoOpVvTenU55XBTbm482a Uvz5CV0DdoDcgHi5C5woxjosgq278YtXV+06aCkmy2C6Wyb0JMwczoRgGUvkoZmApjrJce woz8na64JOTHfQGBfdlu9hFM8/ivaJWw08nZSafoD5gtUwfFtNcCkT6P31pyCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQF2GyCzFJM; Thu, 4 Apr 2024 11:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd1Hv060048; Thu, 4 Apr 2024 11:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd1nd060045; Thu, 4 Apr 2024 11:39:01 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:01 GMT Message-Id: <202404041139.434Bd1nd060045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 16349f296b23 - stable/13 - Update tzcode to 2024a. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 16349f296b239a8eeb2c91cd2b756aba6b25b4b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=16349f296b239a8eeb2c91cd2b756aba6b25b4b1 commit 16349f296b239a8eeb2c91cd2b756aba6b25b4b1 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-13 20:20:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:47:10 +0000 Update tzcode to 2024a. MFC after: 3 weeks Sponsored by: Klara, Inc. (cherry picked from commit 46c599340f187db577b9212ab18022f3c7380c68) --- contrib/tzcode/Makefile | 261 +++++++---- contrib/tzcode/NEWS | 193 +++++++- contrib/tzcode/README | 19 +- contrib/tzcode/date.1 | 14 +- contrib/tzcode/localtime.c | 128 +++--- contrib/tzcode/newctime.3 | 16 +- contrib/tzcode/newstrftime.3 | 152 ++++++- contrib/tzcode/newtzset.3 | 206 +++++---- contrib/tzcode/private.h | 44 +- contrib/tzcode/strftime.c | 7 +- contrib/tzcode/theory.html | 37 +- contrib/tzcode/tz-art.html | 419 ++++++++---------- contrib/tzcode/tz-link.html | 118 +++-- contrib/tzcode/tzdir.h | 6 + contrib/tzcode/tzfile.5 | 32 +- contrib/tzcode/tzfile.h | 14 +- contrib/tzcode/tzselect.8 | 2 +- contrib/tzcode/tzselect.ksh | 1006 +++++++++++++++++++++++------------------- contrib/tzcode/version | 2 +- contrib/tzcode/zdump.c | 2 +- contrib/tzcode/zic.8 | 35 +- contrib/tzcode/zic.c | 239 +++++----- lib/libc/gen/sysconf.c | 2 +- lib/libc/stdtime/strftime.c | 2 +- 24 files changed, 1767 insertions(+), 1189 deletions(-) diff --git a/contrib/tzcode/Makefile b/contrib/tzcode/Makefile index 0e56af89e2a4..d48354c72df4 100644 --- a/contrib/tzcode/Makefile +++ b/contrib/tzcode/Makefile @@ -1,7 +1,25 @@ # Make and install tzdb code and data. - # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: +# On older platforms you may need to scrounge for a POSIX-conforming 'make'. +# For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or +# /usr/xpg4/bin/make, not /usr/ccs/bin/make. + +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh +# make CC='gcc -std=gnu11' "$@" +# +# This example script is appropriate for a pre-2017 GNU/Linux system +# where a non-default setting is needed to support this package's use of C99. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. # Package name for the code distribution. PACKAGE= tzcode @@ -35,7 +53,7 @@ DATAFORM= main LOCALTIME= Factory -# The POSIXRULES macro controls interpretation of POSIX-like TZ +# The POSIXRULES macro controls interpretation of POSIX-2017.1-like TZ # settings like TZ='EET-2EEST' that lack DST transition rules. # If POSIXRULES is '-', no template is installed; this is the default. # Any other value for POSIXRULES is obsolete and should not be relied on, as: @@ -191,8 +209,9 @@ UTF8_LOCALE= en_US.utf8 # On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= -# Add the following to the end of the "CFLAGS=" line as needed to override -# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". # -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime # formats that generate only the last two digits of year numbers # -DEPOCH_LOCAL if the 'time' function returns local time not UT @@ -234,11 +253,16 @@ 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 -# -DPORT_TO_C89 if tzcode should also run on C89 platforms+ +# -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'. +# Even with -DPORT_TO_C89, the code needs at least one C99 +# 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 # -DSUPPORT_C89 if the tzcode library should support C89 callers+ +# However, this might trigger latent bugs in C99-or-later callers. # -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has # security implications and is not recommended for general use # -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; @@ -250,7 +274,7 @@ LDLIBS= # -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; # the default is system-supplied, typically "/usr/lib/locale" # -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified -# DST transitions for POSIX-style TZ strings lacking them, +# DST transitions for POSIX.1-2017-style TZ strings lacking them, # in the usual case where POSIXRULES is '-'. If not specified, # TZDEFRULESTRING defaults to US rules for future DST transitions. # This mishandles some past timestamps, as US DST rules have changed. @@ -270,11 +294,15 @@ LDLIBS= # -DZIC_MAX_ABBR_LEN_WO_WARN=3 # (or some other number) to set the maximum time zone abbreviation length # that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' # $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking # # * Options marked "*" can be omitted if your compiler is C23 compatible. # * Options marked "+" are obsolescent and are planned to be removed -# once the code assumes C99 or later. +# once the code assumes C99 or later, say in the year 2029. # # Select instrumentation via "make GCC_INSTRUMENT='whatever'". GCC_INSTRUMENT = \ @@ -312,9 +340,10 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. # Similarly, if your system has a "zone abbreviation" field, define # -DTM_ZONE=tm_zone -# and define NO_TM_ZONE to suppress any guessing. Although these two fields -# not required by POSIX, a future version of POSIX is planned to require them -# and they are widely available on GNU/Linux and BSD systems. +# and define NO_TM_ZONE to suppress any guessing. +# Although these two fields are not required by POSIX.1-2017, +# POSIX 202x/D4 requires them and they are widely available +# on GNU/Linux and BSD systems. # # The next batch of options control support for external variables # exported by tzcode. In practice these variables are less useful @@ -324,7 +353,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # -DHAVE_TZNAME=0 # do not support "tzname" # # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library # # -DHAVE_TZNAME=2 # support and define "tzname" -# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # to the "CFLAGS=" line. "tzname" is required by POSIX.1-1988 and later. # # If not defined, the code attempts to guess HAVE_TZNAME from other macros. # # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause # # crashes when combined with some platforms' standard libraries, @@ -334,8 +363,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # -DUSG_COMPAT=0 # do not support # # -DUSG_COMPAT=1 # support, and variables are defined by system library # # -DUSG_COMPAT=2 # support and define variables -# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by -# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix +# # Systems Group code and are required by POSIX.1-2008 and later (with XSI). # # If not defined, the code attempts to guess USG_COMPAT from other macros. # # # # To support the external variable "altzone", add @@ -353,10 +382,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. -# "offtime_r" is to "offtime" what "gmtime_r" is to "gmtime". -# "timelocal" is equivalent to "mktime". +# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. +# "timelocal" is nearly equivalent to "mktime". # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. +# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. # "posix2time" and "time2posix" are described in an included manual page. # X3J11's work does not describe any of these functions. # These functions may well disappear in future releases of the time @@ -379,7 +409,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put # out by the National Institute of Standards and Technology -# which claims to test C and Posix conformance. If you want to pass PCTS, add +# which claims to test C and POSIX conformance. If you want to pass PCTS, add # -DPCTS # to the end of the "CFLAGS=" line. # @@ -389,19 +419,33 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # 53 as a week number (rather than 52 or 53) for January days before # January's first Monday when a "%V" format is used and January 1 # falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. -CFLAGS= +#CFLAGS= -O 1 -# Linker flags. Default to $(LFLAGS) for backwards compatibility -# to release 2012h and earlier. -LDFLAGS= $(LFLAGS) +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. +# The commented-out values are the defaults specified by POSIX.1-202x/D4. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in # submake command lines. The default is no leap seconds. LEAPSECONDS= +# Where to fetch leap-seconds.list from. +leaplist_URI = \ + https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list +# The file is generated by the IERS Earth Orientation Centre, in Paris. +leaplist_TZ = Europe/Paris + # The zic command and its arguments. zic= ./zic @@ -419,22 +463,23 @@ ZFLAGS= ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) -# The name of a Posix-compliant 'awk' on your system. +# The name of a POSIX-compliant 'awk' on your system. # mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. # Also, it is better (though not essential) if 'awk' supports UTF-8, # and unfortunately mawk and busybox awk do not support UTF-8. # Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. AWK= awk -# The full path name of a Posix-compliant shell, preferably one that supports +# The full path name of a POSIX-compliant shell, preferably one that supports # the Korn shell's 'select' statement as an extension. # These days, Bash is the most popular. # It should be OK to set this to /bin/sh, on platforms where /bin/sh -# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash # is typically nicer if it works. KSHELL= /bin/bash -# Name of curl , used for HTML validation. +# Name of curl , used for HTML validation +# and to fetch leap-seconds.list from upstream. CURL= curl # Name of GNU Privacy Guard , used to sign distributions. @@ -504,17 +549,16 @@ GZIPFLAGS= -9n DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ || echo ' -F^TZ=') -############################################################################### - -#MAKE= make +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : -cc= cc -CC= $(cc) -DTZDIR='"$(TZDIR)"' +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh -AR= ar +# End of macros that one plausibly might want to tailor. +############################################################################### -# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. -RANLIB= : TZCOBJS= zic.o TZDOBJS= zdump.o localtime.o asctime.o strftime.o @@ -544,7 +588,7 @@ YDATA= $(PRIMARY_YDATA) etcetera NDATA= factory TDATA_TO_CHECK= $(YDATA) $(NDATA) backward TDATA= $(YDATA) $(NDATA) $(BACKWARD) -ZONETABLES= zone1970.tab zone.tab +ZONETABLES= zone.tab zone1970.tab zonenow.tab TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) LEAP_DEPS= leapseconds.awk leap-seconds.list TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ @@ -552,7 +596,7 @@ TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ leapseconds $(ZONETABLES) -AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ +AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) TZS_YEAR= 2050 @@ -573,7 +617,7 @@ VERSION_DEPS= \ calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ africa antarctica asctime.c asia australasia \ backward backzone \ - checklinks.awk checktab.awk \ + checklinks.awk checknow.awk checktab.awk \ date.1 date.c difftime.c \ etcetera europe factory iso3166.tab \ leap-seconds.list leapseconds.awk localtime.c \ @@ -583,12 +627,7 @@ VERSION_DEPS= \ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ workman.sh zdump.8 zdump.c zic.8 zic.c \ ziguard.awk zishrink.awk \ - zone.tab zone1970.tab - -# And for the benefit of csh users on systems that assume the user -# shell should be used to handle commands in Makefiles. . . - -SHELL= /bin/sh + zone.tab zone1970.tab zonenow.tab all: tzselect zic zdump libtz.a $(TABDATA) \ vanguard.zi main.zi rearguard.zi @@ -658,6 +697,16 @@ tzdata.zi: $(DATAFORM).zi version zishrink.awk $(DATAFORM).zi >$@.out mv $@.out $@ +tzdir.h: + printf '%s\n' >$@.out \ + '#ifndef TZDEFAULT' \ + '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ + '#endif' \ + '#ifndef TZDIR' \ + '# define TZDIR "$(TZDIR)" /* TZif directory */' \ + '#endif' + mv $@.out $@ + version.h: version VERSION=`cat version` && printf '%s\n' \ 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ @@ -677,6 +726,28 @@ leapseconds: $(LEAP_DEPS) -f leapseconds.awk leap-seconds.list >$@.out mv $@.out $@ +# Awk script to extract a Git-style author from leap-seconds.list comments. +EXTRACT_AUTHOR = \ + author_line { sub(/^.[[:space:]]*/, ""); \ + sub(/:[[:space:]]*/, " <"); \ + printf "%s>\n", $$0; \ + success = 1; \ + exit \ + } \ + /Questions or comments to:/ { author_line = 1 } \ + END { exit !success } + +# Fetch leap-seconds.list from upstream. +fetch-leap-seconds.list: + $(CURL) -OR $(leaplist_URI) + +# Fetch leap-seconds.list from upstream and commit it to the local repository. +commit-leap-seconds.list: fetch-leap-seconds.list + author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ + date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ + git commit --author="$$author" --date="$$date" -m'make $@' \ + leap-seconds.list + # Arguments to pass to submakes of install_data. # They can be overridden by later submake arguments. INSTALLARGS = \ @@ -764,7 +835,7 @@ force_tzs: $(TZS_NEW) libtz.a: $(LIBOBJS) rm -f $@ - $(AR) -rc $@ $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) $(RANLIB) $@ date: $(DATEOBJS) @@ -772,26 +843,32 @@ date: $(DATEOBJS) tzselect: tzselect.ksh version VERSION=`cat version` && sed \ - -e 's|#!/bin/bash|#!$(KSHELL)|g' \ - -e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \ - -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ - -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ - -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ - -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ - <$@.ksh >$@.out + -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ + -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ + -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ + -e s\''\(REPORT_BUGS_TO\)=.*'\''\1=\'\''$(BUGEMAIL)\'\'\' \ + -e s\''\(TZDIR\)=[^}]*'\''\1=\'\''$(TZDIR)\'\'\' \ + -e s\''\(TZVERSION\)=.*'\''\1=\'"'$$VERSION\\''" \ + <$@.ksh >$@.out chmod +x $@.out mv $@.out $@ check: check_back check_mild check_mild: check_character_set check_white_space check_links \ - check_name_lengths check_slashed_abbrs check_sorted \ + check_name_lengths check_now \ + check_slashed_abbrs check_sorted \ check_tables check_web check_ziguard check_zishrink check_tzs +# True if UTF8_LOCALE does not work; +# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). +UTF8_LOCALE_MISSING = \ + { test ! '$(UTF8_LOCALE)' \ + || ! printf 'A\304\200B\n' \ + | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ + || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } + check_character_set: $(ENCHILADA) - test ! '$(UTF8_LOCALE)' || \ - ! printf 'A\304\200B\n' | \ - LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ - LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + $(UTF8_LOCALE_MISSING) || { \ sharp='#' && \ ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ $(MISC) $(SOURCES) $(WEB_PAGES) \ @@ -806,12 +883,12 @@ check_character_set: $(ENCHILADA) touch $@ check_white_space: $(ENCHILADA) + $(UTF8_LOCALE_MISSING) || { \ patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ - ! grep -En "$$pat" \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - ! grep -n '[$s]$$' \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - touch $@ + ! grep -En "$$pat|[$s]\$$" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ + } + touch $@ PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} @@ -852,7 +929,29 @@ check_links: checklinks.awk tzdata.zi -f checklinks.awk tzdata.zi touch $@ -check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) +# Check timestamps from now through 28 years from now, to make sure +# that zonenow.tab contains all sequences of planned timestamps, +# without any duplicate sequences. In theory this might require +# 2800 years but that would take a long time to check. +CHECK_NOW_TIMESTAMP = `./date +%s` +CHECK_NOW_FUTURE_YEARS = 28 +CHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) '*' 366 '*' 24 '*' 60 '*' 60 +check_now: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab + rm -fr $@.dir + mkdir $@.dir + ./zic -d $@.dir tzdata.zi + now=$(CHECK_NOW_TIMESTAMP) && \ + future=`expr $(CHECK_NOW_FUTURE_SECS) + $$now` && \ + ./zdump -i -t $$now,$$future \ + $$(find $$PWD/$@.dir/????*/ -type f) \ + >$@.dir/zdump.tab + $(AWK) \ + -v zdump_table=$@.dir/zdump.tab \ + -f checknow.awk zonenow.tab + rm -fr $@.dir + touch $@ + +check_tables: checktab.awk $(YDATA) backward zone.tab zone1970.tab for tab in $(ZONETABLES); do \ test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ @@ -912,10 +1011,10 @@ check_zishrink_posix check_zishrink_right: \ touch $@ clean_misc: - rm -fr check_*.dir + rm -fr check_*.dir typecheck_*.dir rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ check_* core typecheck_* \ - date tzselect version.h zdump zic libtz.a + date tzdir.h tzselect version.h zdump zic libtz.a clean: clean_misc rm -fr *.dir tzdb-*/ rm -f *.zi $(TZS_NEW) @@ -953,12 +1052,18 @@ $(MANTXTS): workman.sh # plus N if GNU ls and touch are available. SET_TIMESTAMP_N = sh -c '\ n=$$0 dest=$$1; shift; \ - touch -cmr `ls -t "$$@" | sed 1q` "$$dest" && \ + <"$$dest" && \ if test $$n != 0 && \ - lsout=`ls -n --time-style="+%s" "$$dest" 2>/dev/null`; then \ + lsout=`ls -nt --time-style="+%s" "$$@" 2>/dev/null`; then \ set x $$lsout && \ - touch -cmd @`expr $$7 + $$n` "$$dest"; \ - else :; fi' + timestamp=`expr $$7 + $$n` && \ + echo "+ touch -md @$$timestamp $$dest" && \ + touch -md @$$timestamp "$$dest"; \ + else \ + newest=`ls -t "$$@" | sed 1q` && \ + echo "+ touch -mr $$newest $$dest" && \ + touch -mr "$$newest" "$$dest"; \ + fi' # If DEST depends on A B C ... in this Makefile, callers should use # $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any # downstream 'make' that considers equal timestamps to be out of date. @@ -983,8 +1088,12 @@ set-timestamps.out: $(EIGHT_YARDS) rm -f test.out && \ for file in $$files; do \ if git diff --quiet $$file; then \ - time=`git log -1 --format='tformat:%ct' $$file` && \ - touch -cmd @$$time $$file; \ + time=`TZ=UTC0 git log -1 \ + --format='tformat:%cd' \ + --date='format:%Y-%m-%dT%H:%M:%SZ' \ + $$file` && \ + echo "+ touch -md $$time $$file" && \ + touch -md $$time $$file; \ else \ echo >&2 "$$file: warning: does not match repository"; \ fi || exit; \ @@ -1009,7 +1118,8 @@ check_public: $(VERSION_DEPS) rm -fr public.dir mkdir public.dir ln $(VERSION_DEPS) public.dir - cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + cd public.dir \ + && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' TZDIR='$(TZDIR)' ALL for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ public.dir/vanguard.zi public.dir/main.zi \ public.dir/rearguard.zi; \ @@ -1140,7 +1250,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out sed '1s/$$/-rearguard/' $@.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. $(CREATE_EMPTY) $@.dir/pacificnew - touch -cmr version $@.dir/version + touch -mr version $@.dir/version LC_ALL=C && export LC_ALL && \ (cd $@.dir && \ tar $(TARFLAGS) -cf - \ @@ -1164,7 +1274,7 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out `test $(DATAFORM) = vanguard || echo pacificnew` (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ >$@.dir/etcetera - touch -cmr tzdata.zi $@.dir/etcetera + touch -mr tzdata.zi $@.dir/etcetera sed -n \ -e '/^# *version *\(.*\)/h' \ -e '/^# *ddeps */H' \ @@ -1175,7 +1285,7 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out -e 's/ /-/g' \ -e 'p' \ $@.dir/version - touch -cmr version $@.dir/version + touch -mr version $@.dir/version links= && \ for file in $(TZDATA_DIST); do \ test -f $@.dir/$$file || links="$$links $$file"; \ @@ -1227,15 +1337,16 @@ zonenames: tzdata.zi asctime.o: private.h tzfile.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.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 version.h +zic.o: private.h tzfile.h tzdir.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives .PHONY: check_web check_zishrink -.PHONY: clean clean_misc dummy.zd force_tzs +.PHONY: clean clean_misc commit-leap-seconds.list dummy.zd +.PHONY: fetch-leap-seconds.list force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_right public .PHONY: rearguard_signatures rearguard_signatures_version diff --git a/contrib/tzcode/NEWS b/contrib/tzcode/NEWS index b54538aa4a82..d407342a50e6 100644 --- a/contrib/tzcode/NEWS +++ b/contrib/tzcode/NEWS @@ -1,5 +1,177 @@ News for the tz database +Release 2024a - 2024-02-01 09:28:56 -0800 + + Briefly: + Kazakhstan unifies on UTC+5 beginning 2024-03-01. + Palestine springs forward a week later after Ramadan. + zic no longer pretends to support indefinite-past DST. + localtime no longer mishandles Ciudad Juárez in 2422. + + Changes to future timestamps + + Kazakhstan unifies on UTC+5. This affects Asia/Almaty and + Asia/Qostanay which together represent the eastern portion of the + country that will transition from UTC+6 on 2024-03-01 at 00:00 to + join the western portion. (Thanks to Zhanbolat Raimbekov.) + + Palestine springs forward a week later than previously predicted + in 2024 and 2025. (Thanks to Heba Hamad.) Change spring-forward + predictions to the second Saturday after Ramadan, not the first; + this also affects other predictions starting in 2039. + + Changes to past timestamps + + Asia/Ho_Chi_Minh's 1955-07-01 transition occurred at 01:00 + not 00:00. (Thanks to Đoàn Trần Công Danh.) + + From 1947 through 1949, Toronto's transitions occurred at 02:00 + not 00:00. (Thanks to Chris Walton.) + + In 1911 Miquelon adopted standard time on June 15, not May 15. + + Changes to code + + The FROM and TO columns of Rule lines can no longer be "minimum" + or an abbreviation of "minimum", because TZif files do not support + DST rules that extend into the indefinite past - although these + rules were supported when TZif files had only 32-bit data, this + stopped working when 64-bit TZif files were introduced in 1995. + This should not be a problem for realistic data, since DST was + first used in the 20th century. As a transition aid, FROM columns + like "minimum" are now diagnosed and then treated as if they were + the year 1900; this should suffice for TZif files on old systems + with only 32-bit time_t, and it is more compatible with bugs in + 2023c-and-earlier localtime.c. (Problem reported by Yoshito + Umaoka.) + + localtime and related functions no longer mishandle some + timestamps that occur about 400 years after a switch to a time + zone with a DST schedule. In 2023d data this problem was visible + for some timestamps in November 2422, November 2822, etc. in + America/Ciudad_Juarez. (Problem reported by Gilmore Davidson.) + + strftime %s now uses tm_gmtoff if available. (Problem and draft + patch reported by Dag-Erling Smørgrav.) + + Changes to build procedure + + The leap-seconds.list file is now copied from the IERS instead of + from its downstream counterpart at NIST, as the IERS version is + now in the public domain too and tends to be more up-to-date. + (Thanks to Martin Burnicki for liaisoning with the IERS.) + + Changes to documentation + + The strftime man page documents which struct tm members affect + which conversion specs, and that tzset is called. (Problems + reported by Robert Elz and Steve Summit.) + + +Release 2023d - 2023-12-21 20:02:24 -0800 + + Briefly: + Ittoqqortoormiit, Greenland changes time zones on 2024-03-31. + Vostok, Antarctica changed time zones on 2023-12-18. + Casey, Antarctica changed time zones five times since 2020. + Code and data fixes for Palestine timestamps starting in 2072. + A new data file zonenow.tab for timestamps starting now. + + Changes to future timestamps + + Ittoqqortoormiit, Greenland (America/Scoresbysund) joins most of + the rest of Greenland's timekeeping practice on 2024-03-31, by + 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. + + Fix predictions for DST transitions in Palestine in 2072-2075, + correcting a typo introduced in 2023a. + + Changes to past and future timestamps + + Vostok, Antarctica changed to +05 on 2023-12-18. It had been at + +07 (not +06) for years. (Thanks to Zakhary V. Akulov.) + + Change data for Casey, Antarctica to agree with timeanddate.com, + by adding five time zone changes since 2020. Casey is now at +08 + instead of +11. + + Changes to past tm_isdst flags + + Much of Greenland, represented by America/Nuuk, changed its + standard time from -03 to -02 on 2023-03-25, not on 2023-10-28. + This does not affect UTC offsets, only the tm_isdst flag. + (Thanks to Thomas M. Steenholdt.) + + New data file + + A new data file zonenow.tab helps configure applications that use + timestamps dated from now on. This simplifies configuration, + since users choose from a smaller Zone set. The file's format is + experimental and subject to change. + + Changes to code + + localtime.c no longer mishandles TZif files that contain a single + transition into a DST regime. Previously, it incorrectly assumed + DST was in effect before the transition too. (Thanks to Alois + Treindl for debugging help.) + + localtime.c's timeoff no longer collides with OpenBSD 7.4. + + The C code now uses _Generic only if __STDC_VERSION__ says the + compiler is C11 or later. + + tzselect now optionally reads zonenow.tab, to simplify when + configuring only for timestamps dated from now on. + + tzselect no longer creates temporary files. + + tzselect no longer mishandles the following: + + Spaces and most other special characters in BUGEMAIL, PACKAGE, + TZDIR, and VERSION. + + TZ strings when using mawk 1.4.3, which mishandles regular + expressions of the form /X{2,}/. + + ISO 6709 coordinates when using an awk that lacks the GNU + extension of newlines in -v option-arguments. + + Non UTF-8 locales when using an iconv command that lacks the GNU + //TRANSLIT extension. + + zic no longer mishandles data for Palestine after the year 2075. + Previously, it incorrectly omitted post-2075 transitions that are + predicted for just before and just after Ramadan. (Thanks to Ken + Murchison for debugging help.) + + zic now works again on Linux 2.6.16 and 2.6.17 (2006). + (Problem reported by Rune Torgersen.) + + Changes to build procedure + + The Makefile is now more compatible with POSIX: + * It no longer defines AR, CC, CFLAGS, LDFLAGS, and SHELL. + * It no longer uses its own 'cc' in place of CC. + * It now uses ARFLAGS, with default specified by POSIX. + * It does not use LFLAGS incompatibly with POSIX. + * It uses the special .POSIX target. + * It quotes special characters more carefully. + * It no longer mishandles builds in an ISO 8859 locale. + Due to the CC changes, TZDIR is now #defined in a file tzfile.h + built by 'make', not in a $(CC) -D option. Also, TZDEFAULT is + now treated like TZDIR as they have similar roles. + + Changes to commentary + + Limitations and hazards of the optional support for obsolescent + C89 platforms are documented better, along with a tentative + schedule for removing this support. + + Release 2023c - 2023-03-28 12:42:14 -0700 Changes to past and future timestamps @@ -76,11 +248,14 @@ Release 2023a - 2023-03-22 12:39:33 -0700 platform dependent and abbreviations were silently truncated to 16 bytes even when the limit was greater than 16. - The code by default is now designed for C99 or later. To build in - a C89 environment, compile with -DPORT_TO_C89. To support C89 - callers of the tzcode library, compile with -DSUPPORT_C89. The - two new macros are transitional aids planned to be removed in a - future version, when C99 or later will be required. + The code by default is now designed for C99 or later. To build on + a mostly-C89 platform, compile with -DPORT_TO_C89; this should + work on C89 platforms that also support C99 'long long' and + perhaps a few other extensions to C89. To support C89 callers of + tzcode's library, compile with -DSUPPORT_C89; however, this could + trigger latent bugs in C99-or-later callers. The two new macros + are transitional aids planned to be removed in a future version + (say, in 2029), when C99 or later will be required. The code now builds again on pre-C99 platforms, if you compile with -DPORT_TO_C89. This fixes a bug introduced in 2022f. @@ -723,6 +898,8 @@ Release 2021b - 2021-09-24 16:23:00 -0700 them, set the EXPIRES_LINE Makefile variable. If a TZif file uses this new feature it is marked with a new TZif version number 4, a format intended to be documented in a successor to RFC 8536. + The old-format "#expires" comments are now treated solely as + comments and have no effect on the TZif files. zic -L LEAPFILE -r @LO no longer generates an invalid TZif file that omits leap second information for the range LO..B when LO @@ -4302,7 +4479,7 @@ Release 2012j - 2012-11-12 18:34:49 -0800 now uses tz@iana.org rather than the old elsie address. zic -v now complains about abbreviations that are less than 3 - or more than 6 characters, as per Posix. Formerly, it checked + or more than 6 characters, as per POSIX. Formerly, it checked for abbreviations that were more than 3. 'make public' no longer puts its temporary directory under /tmp, @@ -4467,8 +4644,8 @@ Release data2011m - 2011-10-24 21:42:16 +0700 In particular, the typos in comments in the data (2011-11-17 should have been 2011-10-17 as Alan Barrett noted, and spelling of Tiraspol that Tim Parenti noted) have been fixed, and the change for Ukraine has been - made in all 4 Ukrainian zones, rather than just Kiev (again, thanks to - Tim Parenti, and also Denys Gavrysh) + made in all 4 Ukrainian zones, rather than just Europe/Kiev + (again, thanks to Tim Parenti, and also Denys Gavrysh). In addition, I added Europe/Tiraspol to zone.tab. diff --git a/contrib/tzcode/README b/contrib/tzcode/README index 145aacd495b7..edabd2e0690f 100644 --- a/contrib/tzcode/README +++ b/contrib/tzcode/README @@ -11,14 +11,17 @@ changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. See or the -file tz-link.html for how to acquire the code and data. Once acquired, -read the comments in the file 'Makefile' and make any changes needed -to make things right for your system, especially if you are using some -platform other than GNU/Linux. Then run the following commands, -substituting your desired installation directory for "$HOME/tzdir": - - make TOPDIR=$HOME/tzdir install - $HOME/tzdir/usr/bin/zdump -v America/Los_Angeles +file tz-link.html for how to acquire the code and data. + +Once acquired, read the leading comments in the file "Makefile" +and make any changes needed to make things right for your system, +especially when using a platform other than current GNU/Linux. + +Then run the following commands, substituting your desired +installation directory for "$HOME/tzdir": + + make TOPDIR="$HOME/tzdir" install + "$HOME/tzdir/usr/bin/zdump" -v America/Los_Angeles See the file tz-how-to.html for examples of how to read the data files. diff --git a/contrib/tzcode/date.1 b/contrib/tzcode/date.1 index e8107212364d..01907bc76e2c 100644 --- a/contrib/tzcode/date.1 +++ b/contrib/tzcode/date.1 @@ -154,15 +154,11 @@ hexadecimal (leading 0x), preceded by an optional sign. .br /usr/lib/locale/\f2L\fP/LC_TIME description of time locale \f2L\fP .br -/usr/share/zoneinfo timezone information directory +/usr/share/zoneinfo timezone directory .br -/usr/share/zoneinfo/posixrules default DST rules (obsolete, - and can cause bugs if present) +/usr/share/zoneinfo/posixrules default DST rules (obsolete) .br /usr/share/zoneinfo/GMT for UTC leap seconds -.sp -If -.B /usr/share/zoneinfo/GMT -is absent, -UTC leap seconds are loaded from -.BR /usr/share/zoneinfo/posixrules . +.PP +If /usr/share/zoneinfo/GMT is absent, +UTC leap seconds are loaded from /usr/share/zoneinfo/GMT0 if present. diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 8bf4fcb17d2d..25a65385256b 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -7,7 +7,7 @@ /* ** Leap second handling from Bradley White. -** POSIX-style TZ environment variable handling from Guy Harris. +** POSIX.1-1988 style TZ environment variable handling from Guy Harris. */ /*LINTLIBRARY*/ @@ -27,6 +27,7 @@ #include "private.h" #include "un-namespace.h" +#include "tzdir.h" #include "tzfile.h" #include "libc_private.h" @@ -124,12 +125,17 @@ static char const UNSPEC[] = "-00"; for ttunspecified to work without crashing. */ enum { CHARS_EXTRA = max(sizeof UNSPEC, 2) - 1 }; -/* Limit to time zone abbreviation length in POSIX-style TZ strings. +/* Limit to time zone abbreviation length in POSIX.1-2017-style TZ strings. This is distinct from TZ_MAX_CHARS, which limits TZif file contents. */ #ifndef TZNAME_MAXIMUM # define TZNAME_MAXIMUM 255 #endif +/* A representation of the contents of a TZif file. Ideally this + would have no size limits; the following sizes should suffice for + practical use. This struct should not be too large, as instances + are put on the stack and stacks are relatively small on some platforms. + See tzfile.h for more about the sizes. */ struct state { int leapcnt; int timecnt; @@ -172,8 +178,7 @@ static int_fast32_t leapcorr(struct state const *, time_t); static bool normalize_overflow32(int_fast32_t *, int *, int); static struct tm *timesub(time_t const *, int_fast32_t, struct state const *, struct tm *); -static bool typesequiv(struct state const *, int, int); -static bool tzparse(char const *, struct state *, struct state *); +static bool tzparse(char const *, struct state *, struct state const *); #ifdef ALL_STATE static struct state * lclptr; @@ -438,7 +443,8 @@ union input_buffer { /* The first part of the buffer, interpreted as a header. */ struct tzhead tzhead; - /* The entire buffer. */ + /* The entire buffer. Ideally this would have no size limits; + the following should suffice for practical use. */ char buf[2 * sizeof(struct tzhead) + 2 * sizeof(struct state) + 4 * TZ_MAX_TIMES]; }; @@ -457,7 +463,12 @@ union local_storage { struct state st; } u; - /* The file name to be opened. */ + /* The name of the file to be opened. Ideally this would have no + size limits, to support arbitrarily long Zone names. + Limiting Zone names to 1024 bytes should suffice for practical use. + However, there is no need for this to be smaller than struct + file_analysis as that struct is allocated anyway, as the other + union member. */ char fullname[max(sizeof(struct file_analysis), sizeof tzdirslash + 1024)]; }; @@ -737,14 +748,18 @@ tzloadbody(char const *name, struct state *sp, bool doextend, == sp->types[sp->timecnt - 2])) sp->timecnt--; - for (i = 0; - i < ts->timecnt && sp->timecnt < TZ_MAX_TIMES; - i++) { + sp->goahead = ts->goahead; + + for (i = 0; i < ts->timecnt; i++) { time_t t = ts->ats[i]; if (increment_overflow_time(&t, leapcorr(sp, t)) || (0 < sp->timecnt && t <= sp->ats[sp->timecnt - 1])) continue; + if (TZ_MAX_TIMES <= sp->timecnt) { + sp->goahead = false; + break; + } sp->ats[sp->timecnt] = t; sp->types[sp->timecnt] = (sp->typecnt + ts->types[i]); @@ -757,28 +772,6 @@ tzloadbody(char const *name, struct state *sp, bool doextend, } if (sp->typecnt == 0) return EINVAL; - if (sp->timecnt > 1) { - if (sp->ats[0] <= TIME_T_MAX - SECSPERREPEAT) { - time_t repeatat = sp->ats[0] + SECSPERREPEAT; - int repeattype = sp->types[0]; - for (i = 1; i < sp->timecnt; ++i) - if (sp->ats[i] == repeatat - && typesequiv(sp, sp->types[i], repeattype)) { - sp->goback = true; - break; - } - } - if (TIME_T_MIN + SECSPERREPEAT <= sp->ats[sp->timecnt - 1]) { - time_t repeatat = sp->ats[sp->timecnt - 1] - SECSPERREPEAT; - int repeattype = sp->types[sp->timecnt - 1]; - for (i = sp->timecnt - 2; i >= 0; --i) - if (sp->ats[i] == repeatat *** 3862 LINES SKIPPED *** From nobody Thu Apr 4 11:39:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQH0GLkz5GrMV; Thu, 4 Apr 2024 11:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQG5B8lz57nS; Thu, 4 Apr 2024 11:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAnWawo4pN539OYekuSWw3dRQdQ1QGukKyv8VzF7jvM=; b=sv9kJtqs05D/KN6PXacduZ1NOWUY+KPMiAHq7pyT4Roz3nHXRrLIJXi/M21EDeB/rifhPh QbyMfhSKraN+4LLeoUrf+8Rwxe6Y17CqinerUApPrlbl+v9ycy162S3CDhuButS68bIiR+ MzctlN7xwWVZgK26ordzlDyHJZc1iAJIEx7toQGVt1k38jzSO2ZMNi/hb1ZCggXjsdU7QI m5x+59LXzRn85Oe+/nmquRI8CSnZPTsPxD5E22u+uKJ/8R8rElJ8bVVkAGZarVqnv0U+cC wplREX3HXzEF94y0cpseH3IIMoPZLxg1aO2OTs1vsDUNZSZ66GNaTCpbd2+ZHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230742; a=rsa-sha256; cv=none; b=u1WD2aDXB5re/UCmA5CBYbPwhKIDuTgVaZs1e89YHwLaIM1G/ojQTI36CM+3dgKCAxFu1o CYTOSsCqqk57PSMX4rhBc5cCBuD2heoGk/mEZ7PnV5gJ7UUgknZZ8MTaaqY3rwD4Oa8ftB mARN/DIf/CdKLlYL3ehDytICMmlmGGap0SbIQqPb/F09qA74Ew2yU/PpBosL/8XafyL0Q/ Awj4qXzkAWa0zhZ9VbQQrlbaA6vzp1LFKWx6EQwPImLjVN3qnd8Gldbbl4eehVcVa/g67h td4cWqel57HFuVq4GpiQR1Q/CecOARFYRyIr/xVZJ6ZuUwjOPFHY7U/uC93Zyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAnWawo4pN539OYekuSWw3dRQdQ1QGukKyv8VzF7jvM=; b=Lr4emeaHGXjVxNwPbYpoBpjg7sTZ0J28ZWJEdn3gMOAXP1GVwnZ8w67uTNidB92GqRFvHG a3llkfpOav3on48S149r3Wqy2bzfnjRtbJVsuluafrlZEmwZX5Nx/5rgZBIoNPwbMRBYav 9hceVBhUUGxphDQPCEo9IE1gMZTi4DPUH8BeneeM0PxTIU1N2yunaFQpPgzmuSJhK9DliO VOWbgvTyS8QSuJOcCg0z8jnveI1AU+0OPCviiCrkuhWo3HcgJCRtsZW7yKtvYxCZu5uSIZ a8Dq7VI/s+4FRMFQQ5bTut0wig1skUpqdhoy+i4gwi+uQZccmqaleEoKJ1V2Hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQG3KzqzFk1; Thu, 4 Apr 2024 11:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd2FZ060099; Thu, 4 Apr 2024 11:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd2Gw060096; Thu, 4 Apr 2024 11:39:02 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:02 GMT Message-Id: <202404041139.434Bd2Gw060096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 662dc74155ad - stable/13 - tzcode: Clean up the ctime(3) manual page. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 662dc74155ada993513a08190032710cf224e47f Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=662dc74155ada993513a08190032710cf224e47f commit 662dc74155ada993513a08190032710cf224e47f Author: Dag-Erling Smørgrav AuthorDate: 2023-04-26 09:46:41 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:51:02 +0000 tzcode: Clean up the ctime(3) manual page. MFC after: 3 weeks Sponsored by: Klara, Inc. Reviewed by: pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D39714 (cherry picked from commit 6f3c2f41b18b9a7a8feb3c50254a21db2d9908fd) libc: Improve description of mktime() / timegm(). * Mention that mktime() and timegm() set errno on failure. * Correctly determining whether mktime() / timegm() succeeded with arbitrary input (where -1 can be a valid result) is non-trivial. Document the recommended procedure. PR: 277863 MFC after: 1 week Reviewed by: pauamma_gundo.com, gbe Differential Revision: https://reviews.freebsd.org/D44503 (cherry picked from commit 7534109d13a6cdb22e78d9d4c0a0cd5efd323c45) --- lib/libc/stdtime/ctime.3 | 207 ++++++++++++++++++++++++----------------------- 1 file changed, 104 insertions(+), 103 deletions(-) diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3 index 0f649e4d99ab..579b14ada552 100644 --- a/lib/libc/stdtime/ctime.3 +++ b/lib/libc/stdtime/ctime.3 @@ -29,7 +29,7 @@ .\" .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" -.Dd September 16, 2022 +.Dd March 26, 2024 .Dt CTIME 3 .Os .Sh NAME @@ -51,81 +51,78 @@ .In time.h .Vt extern char *tzname[2] ; .Ft char * +.Fn asctime "const struct tm *tm" +.Ft char * +.Fn asctime_r "const struct tm *tm" "char *buf" +.Ft char * .Fn ctime "const time_t *clock" +.Ft char * +.Fn ctime_r "const time_t *clock" "char *buf" .Ft double .Fn difftime "time_t time1" "time_t time0" -.Ft char * -.Fn asctime "const struct tm *tm" +.Ft struct tm * +.Fn gmtime "const time_t *clock" +.Ft struct tm * +.Fn gmtime_r "const time_t *clock" "struct tm *result" .Ft struct tm * .Fn localtime "const time_t *clock" .Ft struct tm * -.Fn gmtime "const time_t *clock" +.Fn localtime_r "const time_t *clock" "struct tm *result" .Ft time_t .Fn mktime "struct tm *tm" .Ft time_t .Fn timegm "struct tm *tm" -.Ft char * -.Fn ctime_r "const time_t *clock" "char *buf" -.Ft struct tm * -.Fn localtime_r "const time_t *clock" "struct tm *result" -.Ft struct tm * -.Fn gmtime_r "const time_t *clock" "struct tm *result" -.Ft char * -.Fn asctime_r "const struct tm *tm" "char *buf" .Sh DESCRIPTION -The functions +The .Fn ctime , -.Fn gmtime +.Fn gmtime , and .Fn localtime -all take as an argument a time value representing the time in seconds since -the Epoch (00:00:00 -.Tn UTC , -January 1, 1970; see +functions all take as argument a pointer to a time value representing +the time in seconds since the Epoch (00:00:00 UTC on January 1, 1970; +see .Xr time 3 ) . .Pp -The function +The .Fn localtime -converts the time value pointed at by +function converts the time value pointed to by .Fa clock , and returns a pointer to a -.Dq Fa struct tm +.Vt struct tm (described below) which contains the broken-out time information for the value after adjusting for the current -time zone (and any other factors such as Daylight Saving Time). +time zone (see +.Xr tzset 3 ) . When the specified time translates to a year that will not fit in an -.Dv int , +.Vt int , .Fn localtime -returns NULL. -Time zone adjustments are performed as specified by the -.Ev TZ -environment variable (see -.Xr tzset 3 ) . -The function +returns +.Dv NULL . +The .Fn localtime -uses +function uses .Xr tzset 3 to initialize time conversion information if .Xr tzset 3 has not already been called by the process. .Pp -After filling in the tm structure, +After filling in the +.Vt struct tm , .Fn localtime sets the -.Fa tm_isdst Ns 'th +.Va tm_isdst Ns 'th element of -.Fa tzname -to a pointer to an -.Tn ASCII -string that is the time zone abbreviation to be +.Va tzname +to a pointer to an ASCII string that is the time zone abbreviation to be used with .Fn localtime Ns 's return value. .Pp -The function +The .Fn gmtime -similarly converts the time value, but without any time zone adjustment, -and returns a pointer to a tm structure (described below). +function similarly converts the time value, but without any time zone +adjustment, and returns a pointer to a +.Vt struct tm . .Pp The .Fn ctime @@ -140,65 +137,58 @@ Thu Nov 24 18:22:48 1986\en\e0 All the fields have constant width. .Pp The +.Fn asctime +function converts the broken down time in the +.Vt struct tm +pointed to by +.Fa tm +to the form shown in the example above. +.Pp +The .Fn ctime_r -function -provides the same functionality as +and +.Fn asctime_r +functions +provide the same functionality as .Fn ctime +and +.Fn asctime except the caller must provide the output buffer -.Fa buf -to store the result, which must be at least 26 characters long. +.Fa buf , +which must be at least 26 characters long, to store the result in. The .Fn localtime_r and .Fn gmtime_r -functions -provide the same functionality as +functions provide the same functionality as .Fn localtime and .Fn gmtime respectively, except the caller must provide the output buffer .Fa result . .Pp -The -.Fn asctime -function -converts the broken down time in the structure -.Fa tm -pointed at by -.Fa *tm -to the form -shown in the example above. -.Pp -The -.Fn asctime_r -function -provides the same functionality as -.Fn asctime -except the caller provide the output buffer -.Fa buf -to store the result, which must be at least 26 characters long. -.Pp The functions .Fn mktime and .Fn timegm -convert the broken-down time in the structure -pointed to by tm into a time value with the same encoding as that of the -values returned by the +convert the broken-down time in the +.Vt struct tm +pointed to by +.Fa tm +into a time value with the same encoding as that of the values +returned by the .Xr time 3 -function (that is, seconds from the Epoch, -.Tn UTC ) . +function (that is, seconds from the Epoch, UTC). The .Fn mktime -function -interprets the input structure according to the current timezone setting -(see -.Xr tzset 3 ) . -The +function interprets the input structure according to the current +timezone setting (see +.Xr tzset 3 ) +while the .Fn timegm -function -interprets the input structure as representing Universal Coordinated Time -.Pq Tn UTC . +function interprets the input structure as representing Universal +Coordinated Time +.Pq UTC . .Pp The original values of the .Fa tm_wday @@ -227,7 +217,7 @@ A negative value for .Fa tm_isdst causes the .Fn mktime -function to attempt to divine whether summer time is in effect for the +function to attempt to guess whether summer time is in effect for the specified time. The .Fa tm_isdst @@ -253,21 +243,37 @@ The .Fn mktime function returns the specified calendar time; if the calendar time cannot be -represented, it returns \-1; +represented, it returns \-1 and sets +.Xr errno 3 +to an appropriate value. +.Pp +Note that \-1 is a valid result (representing one second before +midnight UTC on the evening of 31 December 1969), so this cannot be +relied upon to indicate success or failure; instead, +.Fa tm_wday +and / or +.Fa tm_yday +should be set to an out-of-bounds value (e.g. \-1) prior to calling +.Fn mktime +or +.Fn timegm +and checked after the call. .Pp The .Fn difftime -function -returns the difference between two calendar times, -.Pf ( Fa time1 -- -.Fa time0 ) , -expressed in seconds. +function returns the difference in seconds between two time values, +.Fa time1 +\- +.Fa time0 . .Pp -External declarations as well as the tm structure definition are in the +External declarations as well as the definition of +.Vt struct tm +are in the .In time.h -include file. -The tm structure includes at least the following fields: +header. +The +.Vt tm +structure includes at least the following fields: .Bd -literal -offset indent int tm_sec; /* seconds (0 - 60) */ int tm_min; /* minutes (0 - 59) */ @@ -283,16 +289,14 @@ long tm_gmtoff; /* offset from UTC in seconds */ .Ed .Pp The -field .Fa tm_isdst -is non-zero if summer time is in effect. +field is non-zero if summer time is in effect. .Pp -The field +The .Fa tm_gmtoff -is the offset (in seconds) of the time represented from -.Tn UTC , -with positive -values indicating east of the Prime Meridian. +field is the offset in seconds of the time represented from UTC, +with positive values indicating a time zone ahead of UTC (east of the +Prime Meridian). .Sh SEE ALSO .Xr date 1 , .Xr clock_gettime 2 , @@ -358,13 +362,13 @@ and .Fn timelocal in SunOS 4.0. .Pp -The functions +The .Fn asctime_r , .Fn ctime_r , -.Fn gmtime_r , +.Fn gmtime_r and .Fn localtime_r -have been available since +functions have been available since .Fx 8.0 . .Sh BUGS Except for @@ -379,13 +383,10 @@ Subsequent calls to these function will modify the same object. .Pp The C Standard provides no mechanism for a program to modify its current -local timezone setting, and the -.Tn POSIX Ns No \&-standard +local timezone setting, and the POSIX-standard method is not reentrant. (However, thread-safe implementations are provided -in the -.Tn POSIX -threaded environment.) +in the POSIX threaded environment.) .Pp The .Va tm_zone From nobody Thu Apr 4 11:39:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQH5l3rz5GrPv; Thu, 4 Apr 2024 11:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQH4Q5Hz57fQ; Thu, 4 Apr 2024 11:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h94R2vbjHe94FGRNpC+k58QmAq1nA6m5BODVgc7FwyE=; b=I0QN2VOCbYiq3wQznmrNCJGf6Hq3qBpKHOB2kbBewwny5ORqvHUDNrPdMimWFvSwys2dq7 Im8cV65/6MxInjn7HPd37SXEHkj4F1M/iKpXY8Oa1lidH+IAxfKsGJjJz936spW86nMdot jSjmDOgeJzZUy5Ao05qw7iWYC7qxyyJOZqsBtKhec7BROkyktJfOls0N84eoTK5q2dI43x /EIZBAKpuomE8MzwtzAoe/OvuDFqftInUpoA3U8PBudVOrtlbkQ855vXPdppyqMwQEq5Q/ AWeyD3GeqiROdB2qHCRZyyHTfo7rGNPwzKkcoGA2iwyoBwau4ggOCCVFE4kDYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230743; a=rsa-sha256; cv=none; b=HXCx0gMPGFdOpZ4SxV5ICcz4+k9PpHraDA54+qYRMPCT9WtEGKENVCcaM0VCjQWzVncZ5S w0uM749ilUF/tPTaCuDtkp5XqT57UyY0GyJMPVS7I+cL8ei4dE6skADQAAEiB03xXsMUhh 8XJkrqwykIRYKCZSOmwl6B21MMLt69R09FUNz9UM1xGHqZZFOHnXwTNjf/MTqKK8cmVOyw 6Q6M1h+1LGOkQAi304JXurjTrnVCAN21jDzCFiMdbYMDaSP4k/34C/ckE14luAodWfAxqx SO43wciFSi8TVwEWmGCCgSzFN+nTahEdwmZaWDg/UtI5OusoF9NUWWe8M8yEPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h94R2vbjHe94FGRNpC+k58QmAq1nA6m5BODVgc7FwyE=; b=QAybFmtDXeYHFHloPLJaexCWeM+ckrQqFAyRrQDGidQk8LzEzOFiKH2m3tujMRyn5/2Fl1 SaG2KRvO4xWrdVHVrj993SZHQF4e9zVrHL8/3kcyTVyoRQ2TMR01On/r5uahy4x7V0VWrc W9Hp0ds+XENoNp17MLKQLAGABqbaTBk+18t1Cg9RmU2qANCw3efKJoFNLfkN3jQA8+zLf1 5M3KqspPF/K9YwYcJMuzwBMwup+a+N0Tj01mCiFwMupCH8X+plWHYb4NUSP+MJxO8IeAUD tONdgy+hm1E0ibXCOPMNUoTkKPVZebeP+sCK9SpLHcGnKvs38r1E8aZZNjSE3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQH3fvwzF6D; Thu, 4 Apr 2024 11:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd3Fl060157; Thu, 4 Apr 2024 11:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd3c9060154; Thu, 4 Apr 2024 11:39:03 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:03 GMT Message-Id: <202404041139.434Bd3c9060154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fc7287456321 - stable/13 - touch: Allow setting the timestamp to -1. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: fc7287456321b5d27ab8766bf2b2a63502650e2f Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fc7287456321b5d27ab8766bf2b2a63502650e2f commit fc7287456321b5d27ab8766bf2b2a63502650e2f Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:51:04 +0000 touch: Allow setting the timestamp to -1. Note that VFS internally interprets a timestamp of -1 as “do not set”, so this has no effect, but at least touch won't incorrectly reject the given date / time (1969-12-31 23:59:59 UTC) as invalid. While here, fix some style issues. MFC after: 1 week Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44504 (cherry picked from commit aa69e0f212630bd6d4ec1c3c54e117be16653e8a) touch: Add unit tests. MFC after: 1 week Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D44505 (cherry picked from commit 74a4aa9b1517d92bfa85b0b1cd7d4c1262bb1ef9) --- etc/mtree/BSD.tests.dist | 7 ++ usr.bin/touch/Makefile | 4 + usr.bin/touch/tests/Makefile | 4 + usr.bin/touch/tests/touch_test.sh | 157 ++++++++++++++++++++++++++++++++++++++ usr.bin/touch/touch.c | 21 +++-- 5 files changed, 186 insertions(+), 7 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 16e19c967773..7c9b2464724c 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1103,6 +1103,13 @@ .. tar .. +<<<<<<< HEAD +======= + tftp + .. + touch + .. +>>>>>>> 74a4aa9b1517 (touch: Add unit tests.) tr .. truncate diff --git a/usr.bin/touch/Makefile b/usr.bin/touch/Makefile index 5c153b3357a4..f4b74a033c36 100644 --- a/usr.bin/touch/Makefile +++ b/usr.bin/touch/Makefile @@ -1,5 +1,9 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= touch +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests .include diff --git a/usr.bin/touch/tests/Makefile b/usr.bin/touch/tests/Makefile new file mode 100644 index 000000000000..543b682b96a0 --- /dev/null +++ b/usr.bin/touch/tests/Makefile @@ -0,0 +1,4 @@ +PACKAGE= tests +ATF_TESTS_SH= touch_test + +.include diff --git a/usr.bin/touch/tests/touch_test.sh b/usr.bin/touch/tests/touch_test.sh new file mode 100644 index 000000000000..da39abef622e --- /dev/null +++ b/usr.bin/touch/tests/touch_test.sh @@ -0,0 +1,157 @@ +# +# Copyright (c) 2024 Dag-Erling Smørgrav +# +# SPDX-License-Identifier: BSD-2-Clause +# + +export TZ=UTC + +atf_check_mtime() +{ + local mtime=$1 filename=$2 + atf_check -o inline:"$((mtime))\n" stat -f%m "$filename" +} + +atf_test_case touch_none +touch_none_head() +{ + atf_set descr "No arguments" +} +touch_none_body() +{ + atf_check -s exit:1 -e match:"^usage" touch +} + +atf_test_case touch_one +touch_one_head() +{ + atf_set descr "One argument" +} +touch_one_body() +{ + atf_check touch foo + atf_check test -f foo +} + +atf_test_case touch_multiple +touch_multiple_head() +{ + atf_set descr "Multiple arguments" +} +touch_multiple_body() +{ + atf_check touch foo bar baz + atf_check test -f foo -a -f bar -a -f baz +} + +atf_test_case touch_absolute +touch_absolute_head() +{ + atf_set descr "Absolute date / time" +} +touch_absolute_body() +{ + atf_check touch -t 7001010101 foo + atf_check_mtime 3660 foo + atf_check rm foo + + atf_check touch -t 7001010101.01 foo + atf_check_mtime 3661 foo + atf_check rm foo + + atf_check touch -t 196912312359 foo + atf_check_mtime -60 foo + atf_check rm foo + + atf_check touch -t 196912312359.58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check touch -t 196912312359.59 foo + atf_expect_fail "VFS interprets -1 as “do not set”" + atf_check_mtime -1 foo + atf_check rm foo + + atf_check touch -d1969-12-31T23:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check touch -d1969-12-31\ 23:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check env TZ=CET touch -d1970-01-01T00:59:58 foo + atf_check_mtime -2 foo + atf_check rm foo + + atf_check env TZ=CET touch -d1970-01-01T00:59:58Z foo + atf_check_mtime 3598 foo + atf_check rm foo + + atf_check touch -d1969-12-31T23:59:59Z foo + atf_expect_fail "VFS interprets -1 as “do not set”" + atf_check_mtime -1 foo + atf_check rm foo +} + +atf_test_case touch_relative +touch_relative_head() +{ + atf_set descr "Relative date / time" +} +touch_relative_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -A -36 foo + atf_check_mtime 1711283660 foo + atf_check touch -A -0100 foo + atf_check_mtime 1711283600 foo + atf_check touch -A -010000 foo + atf_check_mtime 1711280000 foo + atf_check touch -A 010136 foo + atf_check_mtime 1711283696 foo +} + +atf_test_case touch_copy +touch_copy_head() +{ + atf_set descr "Copy time from another file" +} +touch_copy_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -t 7001010000 bar + atf_check_mtime 0 bar + atf_check touch -r foo bar + atf_check_mtime 1711283696 bar +} + +atf_test_case touch_nocreate +touch_nocreate_head() +{ + atf_set descr "Do not create file" +} +touch_nocreate_body() +{ + atf_check touch -t 202403241234.56 foo + atf_check_mtime 1711283696 foo + atf_check touch -c -t 7001010000 foo bar + atf_check_mtime 0 foo + atf_check -s exit:1 test -f bar + atf_check touch -c bar + atf_check -s exit:1 test -f bar +} + +atf_init_test_cases() +{ + atf_add_test_case touch_none + atf_add_test_case touch_one + atf_add_test_case touch_multiple + atf_add_test_case touch_absolute + atf_add_test_case touch_relative + atf_add_test_case touch_copy + atf_add_test_case touch_nocreate + # TODO: add test cases for -a, -h, -m +} diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index 91abcfd447ea..ed5b2125ec36 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -243,7 +243,7 @@ stime_arg1(const char *arg, struct timespec *tvp) } yearset = 0; - switch(strlen(arg)) { + switch (strlen(arg)) { case 12: /* CCYYMMDDhhmm */ t->tm_year = ATOI2(arg); t->tm_year *= 100; @@ -274,15 +274,17 @@ stime_arg1(const char *arg, struct timespec *tvp) } t->tm_isdst = -1; /* Figure out DST. */ + t->tm_yday = -1; tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); - if (tvp[0].tv_sec == -1) + if (t->tm_yday == -1) goto terr; tvp[0].tv_nsec = tvp[1].tv_nsec = 0; return; terr: - errx(1, "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); + errx(1, "out of range or illegal time specification: " + "[[CC]YY]MMDDhhmm[.SS]"); } static void @@ -307,10 +309,11 @@ stime_arg2(const char *arg, int year, struct timespec *tvp) } t->tm_isdst = -1; /* Figure out DST. */ + t->tm_yday = -1; tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); - if (tvp[0].tv_sec == -1) - errx(1, - "out of range or illegal time specification: MMDDhhmm[yy]"); + if (t->tm_yday == -1) + errx(1, "out of range or illegal time specification: " + "MMDDhhmm[yy]"); tvp[0].tv_nsec = tvp[1].tv_nsec = 0; } @@ -350,13 +353,17 @@ stime_darg(const char *arg, struct timespec *tvp) if (*p != '\0') goto bad; + t.tm_yday = -1; tvp[0].tv_sec = isutc ? timegm(&t) : mktime(&t); + if (t.tm_yday == -1) + goto bad; tvp[1] = tvp[0]; return; bad: - errx(1, "out of range or illegal time specification: YYYY-MM-DDThh:mm:SS[.frac][tz]"); + errx(1, "out of range or illegal time specification: " + "YYYY-MM-DDThh:mm:SS[.frac][tz]"); } /* Calculate a time offset in seconds, given an arg of the format [-]HHMMSS. */ From nobody Thu Apr 4 11:39:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQK1rj8z5GrK4; Thu, 4 Apr 2024 11:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQJ53WWz57tc; Thu, 4 Apr 2024 11:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBubm65Nh0Ze5S8Fay33xLDfF6oALWVHV3XXRXnnZ3s=; b=QqZrHbeU1qEukrC6UOslhI6B1zIOsS1DxM0QM33jGxPQRz4t9bEKVN/AKgF/qtXII6eaSo J9wNjetRrM7QA388tgsKkdRmGcc5Q/nFmY7aQR/UEDAGUVnJYUHsp2hdpWL8bQTS3T1qUO Xwl4vf5bbhTqN7yhwdFcUDzW/iUOx7UgR2e6C7THajSFQdFD5l67SESYgWKQ6h6WciAyOD WyuffV7aBt+XtVsrlgo4p/FkAQ1pjSdvo1XM5saW079mgAD4CRR3KDXm9Hl4znb2AL/DNk rmlrX0vtG06a3IKPcxlhFS+sO5VHogbHPV6oXpe6q86MGwixfpcZoHrUMDaIiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230744; a=rsa-sha256; cv=none; b=RU/OeIG+2EhoyZVl3eO94dJdXLkkYR2qSKFztGlBXgoQu8KFDNJn5PdNTpuKWNKaqCoq/E 30yM0bFMQ58K1q2eIa2D6yvatbtFlDFoIzk28O8OxgK+7s6IBFpQ8X32QDTs2AFAMJtFi1 TekkjW9somh/zqVoXl/kyQ8YVEjwV9EqaGy/QzYdV9yo+K1Tk7MU2PCtfRgEFh9m+LSfhI 3k32P/6e1oyJxz3ILT/k+i+4iA6iIu4gRdkMrKVSLHxFK3A3bnB8zaPj7cRs5R3FPuhT4q heio9mqJGIedPq676UJwPJF8x4EQBxhTSxpEw+7snjltMzw0so7tPW0uEOn2WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GBubm65Nh0Ze5S8Fay33xLDfF6oALWVHV3XXRXnnZ3s=; b=LSe3Wh2eNIsZxrqXcUrHUjdDN053ZPHZChVoeqii92hwQImeo31OoPFHMg/R/W9e/tYqGQ rk9+d2i6gNp523tTbAYT/oJBvYeo2Yu1Dz7UB9NWm5GYbRmuAVBIKiMgAs/vQRSl0VMpcd mLtgzITdWf7U8DYqRNkcj8xlcOwKEg70zZEbORGciG0p3t2KxJ+ZezI/aJsADgq/ejAjsN US2qhd28iNsSChEInHMt89pY/MXdhomYX+da7yiunjxzdELSPiYzeyhFcPgtmNP7UwZJyR mbHGJaEwPDldiv9Ramrv7DgLLe9z7ruyO/TRrWJ9P+8Ln3didjVsxC3K5xu3gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQJ4gFmzDvB; Thu, 4 Apr 2024 11:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd442060202; Thu, 4 Apr 2024 11:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd44O060199; Thu, 4 Apr 2024 11:39:04 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:04 GMT Message-Id: <202404041139.434Bd44O060199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: f862c31a4159 - stable/13 - ln: Use stdbool, style nits. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f862c31a41599206b4bda19a10fc5d5b6256e715 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f862c31a41599206b4bda19a10fc5d5b6256e715 commit f862c31a41599206b4bda19a10fc5d5b6256e715 Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:51:05 +0000 ln: Use stdbool, style nits. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D44511 (cherry picked from commit 437d53daf71a357aae960881ef037564736f7441) ln: Clean up and simplify tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44512 (cherry picked from commit e0afcbc85690b6464706ead57103baa0493fdfb2) ln: Add a test case for ln -sfF. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, asomers Differential Revision: https://reviews.freebsd.org/D44513 (cherry picked from commit 2ae8d34666a6dea4c1c77a1905c7b8cebd6a21f9) --- bin/ln/ln.c | 76 ++++++++++++++++++++++--------------------- bin/ln/tests/ln_test.sh | 85 +++++++++++++++++++++---------------------------- 2 files changed, 76 insertions(+), 85 deletions(-) diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 546bfba1c7c3..a0e19d702dea 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -49,24 +49,25 @@ static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94"; #include #include #include +#include #include #include #include #include -static int fflag; /* Unlink existing files. */ -static int Fflag; /* Remove empty directories also. */ -static int hflag; /* Check new name for symlink first. */ -static int iflag; /* Interactive mode. */ -static int Pflag; /* Create hard links to symlinks. */ -static int sflag; /* Symbolic, not hard, link. */ -static int vflag; /* Verbose output. */ -static int wflag; /* Warn if symlink target does not +static bool fflag; /* Unlink existing files. */ +static bool Fflag; /* Remove empty directories also. */ +static bool hflag; /* Check new name for symlink first. */ +static bool iflag; /* Interactive mode. */ +static bool Pflag; /* Create hard links to symlinks. */ +static bool sflag; /* Symbolic, not hard, link. */ +static bool vflag; /* Verbose output. */ +static bool wflag; /* Warn if symlink target does not * exist, and -f is not enabled. */ static char linkch; -static int linkit(const char *, const char *, int); -static void usage(void); +static int linkit(const char *, const char *, bool); +static void usage(void) __dead2; int main(int argc, char *argv[]) @@ -91,41 +92,41 @@ main(int argc, char *argv[]) argv += optind; if (argc != 2) usage(); - exit(linkit(argv[0], argv[1], 0)); + exit(linkit(argv[0], argv[1], false)); } while ((ch = getopt(argc, argv, "FLPfhinsvw")) != -1) switch (ch) { case 'F': - Fflag = 1; + Fflag = true; break; case 'L': - Pflag = 0; + Pflag = false; break; case 'P': - Pflag = 1; + Pflag = true; break; case 'f': - fflag = 1; - iflag = 0; - wflag = 0; + fflag = true; + iflag = false; + wflag = false; break; case 'h': case 'n': - hflag = 1; + hflag = true; break; case 'i': - iflag = 1; - fflag = 0; + iflag = true; + fflag = false; break; case 's': - sflag = 1; + sflag = true; break; case 'v': - vflag = 1; + vflag = true; break; case 'w': - wflag = 1; + wflag = true; break; case '?': default: @@ -136,21 +137,21 @@ main(int argc, char *argv[]) argc -= optind; linkch = sflag ? '-' : '='; - if (sflag == 0) - Fflag = 0; - if (Fflag == 1 && iflag == 0) { - fflag = 1; - wflag = 0; /* Implied when fflag != 0 */ + if (!sflag) + Fflag = false; + if (Fflag && !iflag) { + fflag = true; + wflag = false; /* Implied when fflag is true */ } - switch(argc) { + switch (argc) { case 0: usage(); /* NOTREACHED */ case 1: /* ln source */ - exit(linkit(argv[0], ".", 1)); + exit(linkit(argv[0], ".", true)); case 2: /* ln source target */ - exit(linkit(argv[0], argv[1], 0)); + exit(linkit(argv[0], argv[1], false)); default: ; } @@ -169,7 +170,7 @@ main(int argc, char *argv[]) if (!S_ISDIR(sb.st_mode)) usage(); for (exitval = 0; *argv != targetdir; ++argv) - exitval |= linkit(*argv, targetdir, 1); + exitval |= linkit(*argv, targetdir, true); exit(exitval); } @@ -220,14 +221,15 @@ samedirent(const char *path1, const char *path2) } static int -linkit(const char *source, const char *target, int isdir) +linkit(const char *source, const char *target, bool isdir) { - struct stat sb; - const char *p; - int ch, exists, first; char path[PATH_MAX]; char wbuf[PATH_MAX]; char bbuf[PATH_MAX]; + struct stat sb; + const char *p; + int ch, first; + bool exists; if (!sflag) { /* If source doesn't exist, quit now. */ @@ -290,7 +292,7 @@ linkit(const char *source, const char *target, int isdir) /* * If the file exists, first check it is not the same directory entry. */ - exists = !lstat(target, &sb); + exists = lstat(target, &sb) == 0; if (exists) { if (!sflag && samedirent(source, target)) { warnx("%s and %s are the same directory entry", diff --git a/bin/ln/tests/ln_test.sh b/bin/ln/tests/ln_test.sh index 75fda4ce2dd7..8e5dcf81e61f 100644 --- a/bin/ln/tests/ln_test.sh +++ b/bin/ln/tests/ln_test.sh @@ -1,4 +1,6 @@ # +# SPDX-License-Identifier: BSD-2-Clause +# # Copyright 2017 Shivansh Rai # All rights reserved. # @@ -23,13 +25,15 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# -set_umask() +atf_check_same_file() { - if ! umask 022; then - atf_fail "setting umask failed" - fi + atf_check_equal "$(stat -f %d,%i "$1")" "$(stat -f %d,%i "$2")" +} + +atf_check_symlink_to() +{ + atf_check -o inline:"$1\n" readlink "$2" } atf_test_case L_flag @@ -39,18 +43,13 @@ L_flag_head() "symbolic link, '-L' option creates a hard" \ "link to the target of the symbolic link" } - L_flag_body() { - set_umask atf_check touch A atf_check ln -s A B atf_check ln -L B C - stat_A=$(stat -f %i A) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_A" "$stat_C" - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_same_file A C + atf_check_symlink_to A B } atf_test_case P_flag @@ -60,16 +59,12 @@ P_flag_head() "symbolic link, '-P' option creates a hard " \ "link to the symbolic link itself" } - P_flag_body() { - set_umask atf_check touch A atf_check ln -s A B atf_check ln -P B C - stat_B=$(stat -f %i B) - stat_C=$(stat -f %i C) - atf_check_equal "$stat_B" "$stat_C" + atf_check_same_file B C } atf_test_case f_flag @@ -78,15 +73,11 @@ f_flag_head() atf_set "descr" "Verify that if the target file already exists, " \ "'-f' option unlinks it so that link may occur" } - f_flag_body() { - set_umask atf_check touch A B atf_check ln -f A B - stat_A=$(stat -f %i A) - stat_B=$(stat -f %i B) - atf_check_equal "$stat_A" "$stat_B" + atf_check_same_file A B } atf_test_case target_exists_hard @@ -95,10 +86,8 @@ target_exists_hard_head() atf_set "descr" "Verify whether creating a hard link fails if the " \ "target file already exists" } - target_exists_hard_body() { - set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln A B @@ -110,10 +99,8 @@ target_exists_symbolic_head() atf_set "descr" "Verify whether creating a symbolic link fails if " \ "the target file already exists" } - target_exists_symbolic_body() { - set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln -s A B @@ -124,13 +111,12 @@ shf_flag_dir_head() { atf_set "descr" "Verify that if the target directory is a symbolic " \ "link, '-shf' option prevents following the link" } - shf_flag_dir_body() { atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -shf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C + atf_check test -L C atf_check -o inline:'B\n' readlink C } @@ -139,14 +125,12 @@ snf_flag_dir_head() { atf_set "descr" "Verify that if the target directory is a symbolic " \ "link, '-snf' option prevents following the link" } - snf_flag_dir_body() { atf_check mkdir -m 0777 A B atf_check ln -s A C atf_check ln -snf B C - atf_check -o inline:'Symbolic Link\n' stat -f %SHT C - atf_check -o inline:'B\n' readlink C + atf_check_symlink_to B C } atf_test_case sF_flag @@ -156,13 +140,11 @@ sF_flag_head() "and is a directory, then '-sF' option removes " \ "it so that the link may occur" } - sF_flag_body() { atf_check mkdir A B atf_check ln -sF A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case sf_flag @@ -172,14 +154,27 @@ sf_flag_head() "'-sf' option unlinks it and creates a symbolic link " \ "to the source file" } - sf_flag_body() { - set_umask atf_check touch A B atf_check ln -sf A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B +} + +atf_test_case sfF_flag +sfF_flag_head() +{ + atf_set "descr" "Verify that if the target file already exists " \ + "and is a symlink, then '-sfF' option removes " \ + "it so that the link may occur" +} +sfF_flag_body() +{ + atf_check mkdir A B C + atf_check ln -sF A C + atf_check_symlink_to A C + atf_check ln -sfF B C + atf_check_symlink_to B C } atf_test_case s_flag @@ -187,14 +182,11 @@ s_flag_head() { atf_set "descr" "Verify that '-s' option creates a symbolic link" } - s_flag_body() { - set_umask atf_check touch A atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case s_flag_broken @@ -203,12 +195,10 @@ s_flag_broken_head() atf_set "descr" "Verify that if the source file does not exists, '-s' " \ "option creates a broken symbolic link to the source file" } - s_flag_broken_body() { atf_check ln -s A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_test_case sw_flag @@ -217,13 +207,11 @@ sw_flag_head() atf_set "descr" "Verify that '-sw' option produces a warning if the " \ "source of a symbolic link does not currently exist" } - sw_flag_body() { atf_check -s exit:0 -e inline:'ln: warning: A: No such file or directory\n' \ ln -sw A B - atf_check -o inline:'Symbolic Link\n' stat -f %SHT B - atf_check -o inline:'A\n' readlink B + atf_check_symlink_to A B } atf_init_test_cases() @@ -237,6 +225,7 @@ atf_init_test_cases() atf_add_test_case snf_flag_dir atf_add_test_case sF_flag atf_add_test_case sf_flag + atf_add_test_case sfF_flag atf_add_test_case s_flag atf_add_test_case s_flag_broken atf_add_test_case sw_flag From nobody Thu Apr 4 11:39:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQL0jSlz5GrMZ; Thu, 4 Apr 2024 11:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQK6dHjz57lj; Thu, 4 Apr 2024 11:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18+mQ2llkB9U3sbXDOmMFyUyTatKEvGiAidOgz4eLe4=; b=oJz+S54ViWEx4pUX85MS2pktMbd5MgkIoZxUznkFlwI2XnIOAa4N3Xdn8WTsqFWkSmVNbC e0rdxj7KkDAooApn4AGaRrneV0Azpe/WDk1ag/lLYI9sG77t1OmP411a/ZL9U8+SlvZjMs 28NKkRumhwjChdAp5uIpz0KigxXMRI7tuzldHoidmr6x/8bVBJ9iFLVI4y+e9IZcw/Rd4f 0cq+85k7sKT+QUQIXyoDCcwDwfq8HMuo4vLTT9C7wiVqr2CwaZV0vUAdt+KVv1kljBWdf1 yJ9a8ynyBwjoY/VrRpzWfc+CQloZoag1Dg8QY0D23WOg7Wili/TnMKsuT3/a/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230745; a=rsa-sha256; cv=none; b=vSMgdMB7de6NMq1BMKcVzZmbUeTOFXeYE2wDC2lePSN+Swo3YcdhAyz58/YxYbSmweL0oy ODcnZfvp6CuD8K27l6qMo0e0DXR2EErE71KcapIV825WBEHCuLbICGAEgGPeh3pYHWRhZU EwP1gdtCqejXOzh5R45sH0TVOJc+1YcmYvnLuZZudTnsomemB+Gk+FlJTbxQBLIs9daY1h bHn+WFnzldAoxROqFpNNgcJ6jhW77pF6N3JmkVe8jE7MxJGv+3Tf1miWnLg7lQrEyJKI/1 rK9UOKf80Ean6wpDMrsmraJV1aydqnO1yEhtaBYWUw+7c8ygvJ0KOQyN/49U/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=18+mQ2llkB9U3sbXDOmMFyUyTatKEvGiAidOgz4eLe4=; b=V/RuffGqZTxLU7XrXofzZmAF8kHQGwL18t6IukaYgkTdL9EKH4ZMeS30OlZ7trUBfKVZ9D 3BBQMsG06oXvjOrmFDM0bW1wiQjed/6yqRiEPfkckiDxQ1x08Uid7G3o3dLnetha80Jg5E unX2kZGInNRZSST5r6sJGOYZ3ls8gdb5QLeu3ckgpw15WOC4r0BgxAmPn/RnS2yYHByLwZ eYIJKmHKDJ1OOK0u00jwzNkUj03uRu9C/NnmKFqFMKn/761F53R1oxjhPPLDSpzy/7UpTq pILd+oqGF/xwukcMgL8nEYpcJIbJVI45xtA4mG6l5LqwwitrIpu9jmiC5JFnqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQK5z9jzFgC; Thu, 4 Apr 2024 11:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd5NM060247; Thu, 4 Apr 2024 11:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd5ew060244; Thu, 4 Apr 2024 11:39:05 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:05 GMT Message-Id: <202404041139.434Bd5ew060244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 8934e4a17e94 - stable/13 - install: Prefer strsnvis() to strsvis(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8934e4a17e945fbd37b4e97fc42f83d000b74d9a Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8934e4a17e945fbd37b4e97fc42f83d000b74d9a commit 8934e4a17e945fbd37b4e97fc42f83d000b74d9a Author: Dag-Erling Smørgrav AuthorDate: 2024-03-27 10:03:59 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:51:06 +0000 install: Prefer strsnvis() to strsvis(). MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44514 (cherry picked from commit 2cab4be46b0eeb64b8ade010bc16245151af5ccd) --- usr.bin/xinstall/xinstall.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 3bcc44d08b81..f1fe1a969377 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1507,15 +1507,18 @@ metadata_log(const char *path, const char *type, struct timespec *ts, static const char extra[] = { ' ', '\t', '\n', '\\', '#', '\0' }; const char *p; char *buf; - size_t destlen; + size_t buflen, destlen; struct flock metalog_lock; if (!metafp) return; - /* Buffer for strsvis(3). */ - buf = (char *)malloc(4 * strlen(path) + 1); - if (buf == NULL) { - warnx("%s", strerror(ENOMEM)); + /* Buffer for strsnvis(3), used for both path and slink. */ + buflen = strlen(path); + if (slink && strlen(slink) > buflen) + buflen = strlen(slink); + buflen = 4 * buflen + 1; + if ((buf = malloc(buflen)) == NULL) { + warn(NULL); return; } @@ -1540,7 +1543,7 @@ metadata_log(const char *path, const char *type, struct timespec *ts, } while (*p && *p == '/') p++; - strsvis(buf, p, VIS_OCTAL, extra); + strsnvis(buf, buflen, p, VIS_OCTAL, extra); p = buf; /* Print details. */ fprintf(metafp, ".%s%s type=%s", *p ? "/" : "", p, type); @@ -1550,14 +1553,14 @@ metadata_log(const char *path, const char *type, struct timespec *ts, fprintf(metafp, " gname=%s", group); fprintf(metafp, " mode=%#o", mode); if (slink) { - strsvis(buf, slink, VIS_CSTYLE, extra); /* encode link */ + strsnvis(buf, buflen, slink, VIS_CSTYLE, extra); fprintf(metafp, " link=%s", buf); } if (*type == 'f') /* type=file */ fprintf(metafp, " size=%lld", (long long)size); if (ts != NULL && dopreserve) fprintf(metafp, " time=%lld.%09ld", - (long long)ts[1].tv_sec, ts[1].tv_nsec); + (long long)ts[1].tv_sec, ts[1].tv_nsec); if (digestresult && digest) fprintf(metafp, " %s=%s", digest, digestresult); if (fflags) From nobody Thu Apr 4 11:39:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9KQM2pHgz5GrS7; Thu, 4 Apr 2024 11:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9KQM0gyzz57rx; Thu, 4 Apr 2024 11:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TR6izutHBXhgHTDXsSl6WCAQIp/kWeRNyq3No5haSI=; b=ERHjwZJTlUq8kkUtqfCjapRe30reQGbRQWvnwN5vD9EGBLOkkxw6cTo1sBWzcOTvb7U/X6 mdYxLbbUgTW0xJLwHAk4/K6n/9ri2P2XmyY29y9L3ClXzdbx1jgaW9lFDkwQf6+zswgsCX FIpgNrySfHY08owe1zF6hifhK1ozisjMcT5y/pS8pN0JtWGesMd37q8bfZtheE/cjq4WZz Vrm9snuTaDy9zjW/JgKV1VtbiM+C2jfKJHk9RbeyaU0kK2g6rdI7dvtylbtnh0JXbxBlvg 09JqL6z3odDpxX9IfhM6wC7XDIcYPAFoNM7Nt9X+i5Lb+WdMAm2qrktKlR5DTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712230747; a=rsa-sha256; cv=none; b=OPuTyNve5346e0pjnkTanMdPZpS/EZjG7baY3tAfBdtzVgvI/xRr+o6yvzPZjvbrOYlsjk tm5lJWIr54DyjJRp2Itnp9FAe4Ez9uLqGDaDtT0GUhHaqWETnlJf+8U1MjbQJSmAV+dOMF 0iPjWH2DP0thOyVKrmunwF41jRHdzlMbJATSF7RoLSrwh1XJ6TNZ9poBy+8mp9Wu+1CHu9 NqTuP12DuX5RnVbz3Gq5GEE3sPJltJ60hoVoiyncF0n6LabIh8r8hc1KBozW/Jr7DooiCC zdeMtE/fz5sGY2rPTnTXOUsImlpHX+FE+GPR4anwF72sSl/LNMBbtbSNXfClFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712230747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/TR6izutHBXhgHTDXsSl6WCAQIp/kWeRNyq3No5haSI=; b=Hevo1yD8DzKXWfWjmyZNilhquqwo5rTCCcclkNzrGS5lPgiDm7jZO5+mPUizAPEtmXBqT2 Q8vcPtjAKDUeZPTp8Pqpx/zcnggNcvOG5xBjtnDmhw0vsxekmW8WayPOl5QRuJeLt/DRui x65kmjkfUyFtdDtQFjqv6l41+l9xfizUPb8cmWuz8oqPYwfn0/S6KR1wnclGaTDPGHseyt 93MEr9ttuvgndw5VYtmwtNsjUu5B8LOkBNoDhZZCH61zcGT3LfTJDZ19ZoRiwsG5nb3CYz 5Ub4AAg94wLItBZfUhMFqQJQ8/hMHkAb0frCLsxslF7QEOXe+hfUTx1BbeFg0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9KQM02cpzFJN; Thu, 4 Apr 2024 11:39:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434Bd6If060295; Thu, 4 Apr 2024 11:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434Bd6jp060292; Thu, 4 Apr 2024 11:39:06 GMT (envelope-from git) Date: Thu, 4 Apr 2024 11:39:06 GMT Message-Id: <202404041139.434Bd6jp060292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 6895133fe293 - stable/13 - lorder: Clean up and improve robustness. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6895133fe293902f19a060c0cf229ea9b23bb555 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6895133fe293902f19a060c0cf229ea9b23bb555 commit 6895133fe293902f19a060c0cf229ea9b23bb555 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-28 15:37:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 09:55:25 +0000 lorder: Clean up and improve robustness. * Properly parse (no) command-line options. * Ensure that errors go to stderr and result in a non-zero exit. * Drop the special-case code for a single argument, as it will produce the wrong outcome if the file does not exist or is corrupted. * Don't print anything until after we've collected all the data. * Always create all temporary files before setting the trap. This ensures that the trap can safely fire at any moment, regardless of any previous definition of `T`. * Use a temporary file rather than a pipe between `nm` and `sed` to ensure proper termination if `nm` fails due to a missing or invalid input. * The check for self-referential entries was conditional on testing our argument list against a regex looking for archives. This was a needless and unreliable optimization; make the check unconditional. * Document that lorder will not work properly if any of its inputs have spaces in their name. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44133 (cherry picked from commit 5c7b986c21ed47545203e8f630fe2281b83112d2) lorder: Add unit tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44134 (cherry picked from commit 96da41b6dbf383436018f11ad8a672faab2d3789) lorder: Undeprecate. While lorder is not required by our current toolchain (or any toolchain we've used in the past decade or two), it still occasionally shows up in build systems of third party software, including The Open Group's UNIX conformance test suite, and the maintenance cost is negligible. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, emaste Differential Revision: https://reviews.freebsd.org/D44135 (cherry picked from commit cf4d9bf8b38819da12c6d686d5cf6dbd6353cd61) lorder: Don't rely on legacy syntax. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44155 (cherry picked from commit aedb37dc49319a7cd1faf34f312a8a9fc01e611d) lorder: Tweak invalid file test. Different implementations of `nm` have different ways of telling you that your file is not a valid object or library, but they all seem to have “not recognized” as a common substring. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44154 (cherry picked from commit aa80cfadff0bb715ca090cbd1b3561a1619251d5) usr.bin: Make lorder conditional on MK_TOOLCHAIN. MFC after: 1 week Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D44558 (cherry picked from commit 125c4560bc70971b950d035cfcd2255b89984011) --- etc/mtree/BSD.tests.dist | 2 + tools/build/mk/OptionalObsoleteFiles.inc | 6 ++ usr.bin/Makefile | 2 +- usr.bin/lorder/Makefile | 5 ++ usr.bin/lorder/lorder.1 | 37 +++++------ usr.bin/lorder/lorder.sh | 94 ++++++++++++++++---------- usr.bin/lorder/tests/Makefile | 4 ++ usr.bin/lorder/tests/lorder_test.sh | 111 +++++++++++++++++++++++++++++++ 8 files changed, 203 insertions(+), 58 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 7c9b2464724c..82c77c6d43c7 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1061,6 +1061,8 @@ .. lockf .. + lorder + .. m4 .. mkimg diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 4b78c655f73c..e068ad8b5f91 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -8982,6 +8982,12 @@ OLD_FILES+=usr/share/man/man3/elftc_set_timestamps.3.gz OLD_FILES+=usr/share/man/man3/elftc_timestamp.3.gz OLD_FILES+=usr/share/man/man3/elftc_string_table_create.3.gz OLD_FILES+=usr/share/man/man3/elftc_version.3.gz +# usr.bin/lorder +OLD_FILES+=usr/bin/lorder +OLD_FILES+=usr/tests/usr.bin/lorder/Kyuafile +OLD_FILES+=usr/tests/usr.bin/lorder/lorder_test +OLD_DIRS+=usr/tests/usr.bin/lorder +# usr.bin/yacc OLD_FILES+=usr/tests/usr.bin/yacc/Kyuafile OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 54b45dca0e24..f3150691003c 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -82,7 +82,6 @@ SUBDIR= alias \ logins \ logname \ look \ - lorder \ lsvfs \ lzmainfo \ m4 \ @@ -275,6 +274,7 @@ SUBDIR.${MK_TOOLCHAIN}+= file2c SUBDIR.${MK_TOOLCHAIN}+= gprof SUBDIR.${MK_TOOLCHAIN}+= indent SUBDIR.${MK_TOOLCHAIN}+= lex +SUBDIR.${MK_TOOLCHAIN}+= lorder SUBDIR.${MK_TOOLCHAIN}+= mkstr SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef diff --git a/usr.bin/lorder/Makefile b/usr.bin/lorder/Makefile index a94860b51c6a..112dd5df2a1e 100644 --- a/usr.bin/lorder/Makefile +++ b/usr.bin/lorder/Makefile @@ -1,6 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + SCRIPTS=lorder.sh MAN= lorder.1 +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests + .include diff --git a/usr.bin/lorder/lorder.1 b/usr.bin/lorder/lorder.1 index e268f81d7254..478b7f493e03 100644 --- a/usr.bin/lorder/lorder.1 +++ b/usr.bin/lorder/lorder.1 @@ -27,17 +27,12 @@ .\" .\" @(#)lorder.1 8.2 (Berkeley) 4/28/95 .\" -.Dd March 21, 2023 +.Dd February 27, 2024 .Dt LORDER 1 .Os .Sh NAME .Nm lorder .Nd list dependencies for object files -.Sh DEPRECATION NOTICE -.Nm -is obsolete and may not be present in -.Fx 14 -and later. .Sh SYNOPSIS .Nm .Ar @@ -46,13 +41,10 @@ The .Nm utility uses .Xr nm 1 -to determine interdependencies in the list of object files -and library archives -specified on the command line. -The -.Nm -utility outputs a list of file names where the first file contains a symbol -which is defined by the second file. +to determine interdependencies between object files and library +archives listed on its command line. +It then outputs a list of pairs of file names such that the first file +in each pair references at least one symbol defined by the second. .Pp The output is normally used with .Xr tsort 1 @@ -60,18 +52,16 @@ when a library is created to determine the optimum ordering of the object modules so that all references may be resolved in a single pass of the loader. .Pp -When linking static binaries, +Similarly, when linking static binaries, .Nm and .Xr tsort 1 -can be used to properly order library archives automatically. +can be used to sort libraries in order of dependency. .Pp -The use of -.Nm -is not required by contemporary linkers, and -.Nm -may be removed from a future version of -.Fx . +While contemporary linkers no longer require the use of +.Nm , +it is provided for the benefit of legacy code bases and build +systems which still insist on it. .Sh ENVIRONMENT .Bl -tag -width indent .It Ev NM @@ -99,3 +89,8 @@ A .Nm utility appeared in .At v7 . +.Sh CAVEATS +The +.Nm +utility will not work properly if given file names with spaces or +newlines in them. diff --git a/usr.bin/lorder/lorder.sh b/usr.bin/lorder/lorder.sh index 640e128b0cb9..c0a7dbbd43e6 100644 --- a/usr.bin/lorder/lorder.sh +++ b/usr.bin/lorder/lorder.sh @@ -33,35 +33,50 @@ # # -# only one argument is a special case, just output the name twice -case $# in - 0) - echo "usage: lorder file ..."; - exit ;; - 1) - echo $1 $1; - exit ;; -esac +export LC_CTYPE=C +export LC_COLLATE=C +set -e -# temporary files +usage() { + echo "usage: lorder file ..." >&2 + exit 1 +} + +while getopts "" opt ; do + case $opt in + *) + usage + ;; + esac +done +shift $(($OPTIND - 1)) +if [ $# -eq 0 ] ; then + usage +fi + +# +# Create temporary files. +# +N=$(mktemp -t _nm_) R=$(mktemp -t _reference_) S=$(mktemp -t _symbol_) +T=$(mktemp -t _temp_) NM=${NM:-nm} -# remove temporary files on HUP, INT, QUIT, PIPE, TERM -trap "rm -f $R $S $T; exit 1" 1 2 3 13 15 - -# make sure all the files get into the output -for i in $*; do - echo $i $i -done +# +# Remove temporary files on termination. +# +trap "rm -f $N $R $S $T" EXIT 1 2 3 13 15 -# if the line has " [RTDW] " it's a globally defined symbol, put it -# into the symbol file. # -# if the line has " U " it's a globally undefined symbol, put it into -# the reference file. -${NM} ${NMFLAGS} -go $* | sed " +# A line matching " [RTDW] " indicates that the input defines a symbol +# with external linkage; put it in the symbol file. +# +# A line matching " U " indicates that the input references an +# undefined symbol; put it in the reference file. +# +${NM} ${NMFLAGS} -go "$@" >$N +sed -e " / [RTDW] / { s/:.* [RTDW] / / w $S @@ -72,21 +87,28 @@ ${NM} ${NMFLAGS} -go $* | sed " w $R } d -" +" <$N -export LC_ALL=C -# eliminate references that can be resolved by the same library. -if [ $(expr "$*" : '.*\.a[[:>:]]') -ne 0 ]; then - sort -u -o $S $S - sort -u -o $R $R - T=$(mktemp -t _temp_) - comm -23 $R $S >$T - mv $T $R -fi +# +# Elide entries representing a reference to a symbol from within the +# library that defines it. +# +sort -u -o $S $S +sort -u -o $R $R +comm -23 $R $S >$T +mv $T $R + +# +# Make sure that all inputs get into the output. +# +for i ; do + echo "$i" "$i" +done -# sort references and symbols on the second field (the symbol), -# join on that field, and print out the file names. +# +# Sort references and symbols on the second field (the symbol), join +# on that field, and print out the file names. +# sort -k 2 -o $R $R sort -k 2 -o $S $S -join -j 2 -o 1.1 2.1 $R $S -rm -f $R $S +join -j 2 -o 1.1 -o 2.1 $R $S diff --git a/usr.bin/lorder/tests/Makefile b/usr.bin/lorder/tests/Makefile new file mode 100644 index 000000000000..21207f413a8d --- /dev/null +++ b/usr.bin/lorder/tests/Makefile @@ -0,0 +1,4 @@ +PACKAGE= tests +ATF_TESTS_SH= lorder_test + +.include diff --git a/usr.bin/lorder/tests/lorder_test.sh b/usr.bin/lorder/tests/lorder_test.sh new file mode 100644 index 000000000000..a4276b2dcfe6 --- /dev/null +++ b/usr.bin/lorder/tests/lorder_test.sh @@ -0,0 +1,111 @@ +# +# Copyright (c) 2024 Klara, Inc. +# +# SPDX-License-Identifier: BSD-2-Clause +# + +atf_test_case noargs +noargs_head() { + atf_set descr "No arguments" +} +noargs_body() { + atf_check -s exit:1 -e match:"^usage:" \ + lorder +} + +atf_test_case onearg +onearg_head() { + atf_set descr "One argument" +} +onearg_body() { + echo "void a(void) { }" >a.c + cc -o a.o -c a.c + echo "a.o a.o" >output + atf_check -o file:output \ + lorder *.o +} + +atf_test_case dashdash +dashdash_head() { + atf_set descr "One argument" +} +dashdash_body() { + echo "void a(void) { }" >a.c + cc -o a.o -c a.c + echo "a.o a.o" >output + atf_check -o file:output \ + lorder -- *.o +} + +atf_test_case nonexistent +nonexistent_head() { + atf_set descr "Nonexistent file" +} +nonexistent_body() { + atf_check -s not-exit:0 -e match:"No such file" -o empty \ + lorder nonexistent.o +} + +atf_test_case invalid +invalid_head() { + atf_set descr "Invalid file" +} +invalid_body() { + echo "not an object file" >invalid.o + atf_check -s not-exit:0 -e match:"not recognized" -o empty \ + lorder invalid.o +} + +atf_test_case objects +objects_head() { + atf_set descr "Order objects" +} +objects_body() { + echo "void a(void) { }" >a.c + echo "void a(void); void b(void) { a(); }" >b.c + echo "void b(void); void c(void) { b(); }" >c.c + for n in a b c ; do + cc -o $n.o -c $n.c + echo "$n.o $n.o" + done >output + echo "b.o a.o" >>output + echo "c.o b.o" >>output + atf_check -o file:output \ + lorder *.o +} + +atf_test_case archives +archives_head() { + atf_set descr "Order archives" +} +archives_body() { + echo "void a(void) { }" >a.c + echo "void a(void); void b(void) { a(); }" >b.c + echo "void b(void); void c(void) { b(); }" >c.c + echo "void e(void); void d(void) { e(); }" >d.c + echo "void d(void); void e(void) { d(); }" >e.c + for n in a b c d e ; do + cc -o $n.o -c $n.c + done + for n in a b c ; do + ar -crs $n.a $n.o + echo "$n.a $n.a" + done >output + ar -crs z.a d.o e.o + echo "z.a z.a" >>output + echo "b.a a.a" >>output + echo "c.a b.a" >>output + atf_check -o file:output \ + lorder *.a +} + +atf_init_test_cases() +{ + atf_add_test_case noargs + atf_add_test_case onearg + atf_add_test_case dashdash + atf_add_test_case nonexistent + atf_add_test_case invalid + atf_add_test_case objects + atf_add_test_case archives +} From nobody Thu Apr 4 12:07:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9L363sbTz5GtMH; Thu, 4 Apr 2024 12:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9L362xqxz42BT; Thu, 4 Apr 2024 12:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712232450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hHc5suySQvs/JQ7uTen5WQVxpOHaV9kl9nfqzRMAYB0=; b=LzBFBkleaUSJv34784So8w1CuK9NUhDyeAaBdrxUnsc6zRZf2DDU8LlqJCnxZg2dWG4oMC dzj+zOp6oln4bSsmVE5PaclI0n88WTGbqmcfdVnTI57ecRNz2cFotu4uMOgjN8A9k59a+o zPIdEmii1XJL/MAxGA0r34MhrKICrkXZkh1n7EKIbuDs9tQDTwpynRAfFn1vgONqTgswXP rpP3AVdxHRC2gsm7TYMBle8kHdj7qWbXgYPLUtEjetI+WlKsqG3MCInbHIj0b1trQ9uQpX eAAC/PMj6JUYNWzqg5GewKxhjdxwPi2NcuM5CDJLtLCuHrQYgm+P7VV2H4DZVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712232450; a=rsa-sha256; cv=none; b=W2d0Ib2bAp6jVsWzHNx88nDRCPfYK7sSgaNlCSajmM6eM0LxdgiidPPPax7yc4ELeiqnck yFR0SA+cbm1iui1JrmLaN1LwcbRVHGhfnpdc5QgM5OHuavvSrveJQPdi4Oy2Ozz4deXWcx ElIld3x+DECg1A6opJrb2GqqkX0iypUatoUNEqBNO9En4m2EsIaqXWXYzugJvgnNog9PsT zPiO/TWTnvPqX9T1JCs41VdFVcQDKPk6vhQ/KvWAryx9eC/VonZfXwXtfgFCg+gZR8sczv xCC0P6CHU6d4l3kHFsP9gPsrKvNfe+HKUVXnvpSpSoGQNge3wlSqv3T9NWbsJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712232450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hHc5suySQvs/JQ7uTen5WQVxpOHaV9kl9nfqzRMAYB0=; b=CeW41dsU8MQQ7Jn1Otu/gEUm+45cB6WOoRtgjA94qgIX1UVi1VOK3A8BbrwUuGl8xsxzxc R2u9uNi7DlM9dn9ZeQYtZS47Eswf/+BS3qh8SWugF/gXWHI66O4g7bNp8sgUXvtT5jySk3 97AYAzdlIhzUTW9K3YonOhCcoc3UjDQd6iMz/sEUApebzfOuaivbkS/u2WHxWByBBhXNxf vcFAFzwwCGsw8vLxBlMpIxyeQphFYb4U4e1ocnMTQ9Nineyq1M3PNv4N7GYco+BiKTsnvf LozbVmH5oDdyMWG4RR3dfaoGXQrey23FQvh1crTWzwXhj5bw5rtI/l61UQ44fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9L362R2szFwT; Thu, 4 Apr 2024 12:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 434C7UU7011426; Thu, 4 Apr 2024 12:07:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 434C7UIb011423; Thu, 4 Apr 2024 12:07:30 GMT (envelope-from git) Date: Thu, 4 Apr 2024 12:07:30 GMT Message-Id: <202404041207.434C7UIb011423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b9e32d8c8f51 - stable/13 - Clean up botched merge. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b9e32d8c8f51f053988e45b61d90f3bc9cb77fb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b9e32d8c8f51f053988e45b61d90f3bc9cb77fb0 commit b9e32d8c8f51f053988e45b61d90f3bc9cb77fb0 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-04 12:07:00 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-04 12:07:00 +0000 Clean up botched merge. Fixes: 6895133fe293902f19a060c0cf229ea9b23bb555 --- etc/mtree/BSD.tests.dist | 5 ----- 1 file changed, 5 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 82c77c6d43c7..98450e1cafbd 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1105,13 +1105,8 @@ .. tar .. -<<<<<<< HEAD -======= - tftp - .. touch .. ->>>>>>> 74a4aa9b1517 (touch: Add unit tests.) tr .. truncate From nobody Fri Apr 5 10:43:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V9w7l6vNqz5GBLL; Fri, 5 Apr 2024 10:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V9w7l6Gfdz4k6p; Fri, 5 Apr 2024 10:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712313811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntG+0yTRmtEaBPwyFaPDesfyGpvNiKvH5ydPCMpJL9c=; b=ur+9wHnCO86JsDFDK1wWxdonYALH3/n9Cj5vfuv9If70zQjMnvwGeUnNGLyWgrF4pgPf68 3S78pN834Fg0CZwDkQZcJtbP2HrrxbJpF1BnNLAEqdV606oTkHTrBKNF+yeDn97EjX7AnC SroodWKFDb3bK7pZIuxryaeB/1wCZLsTcOPGBhl5Xx4f4Io4yVrltARQKpgckDVFpaSBvu v26y6uv8tZFnmTiP7kw/T301EpSdLwo2oVxkecxoU52UTh4WBCTUX3bz3+gWERaBSwj7aD q4yr08s8Vy7CS6Lv/G7kOLaKpcBD8npJRrPiar7v7bSTfPDOdaw17mjLlDH2Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712313811; a=rsa-sha256; cv=none; b=qb5b4AASkJyoARjRSyyOdAnFpLF/PF7VArCAtSSUV14TaYeG0XbPxpYoXed0BcV4JHOQe8 Tm017++ypMhNdV55sWX6Eak4vo5pVizzMDzqaZPG7ny8YO/T41F2ycGduo43oxk9rT2Zms rEIbLjgakLqExyVCkSyCqUrExKt/umnacyV+t1+aT/Og/kZSka+fo7a7C+9jKVsS79RDwx 8OAYnlrDx2Jysed32Csh3073OpcKZM+HJtbSA2Ucz/cjN5vLcnJ47QCxbaIJlQMWSHZeDP 5zm6BBsyomJjZ5CPsaIPVyzvTbbrYYhdlAWjwvgjoQEWwzm4OfvOL9FghdvmTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712313811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntG+0yTRmtEaBPwyFaPDesfyGpvNiKvH5ydPCMpJL9c=; b=qsl649xfxgqjZVkmdbu+Rcj8+RlqTNso7QzIg6HTiFHAjVcZ3UF089x+WX0VftiNfYWrcZ LpnkPvrkOlesXv3/PtrGRxXOp3guon1WScIiN1Nq+n9m3D26pXNbX6X9bVAE6lGQ6GUb7g Ij1NlhMYzlmfRr0xInATbAnTOPxpLjOox8vqGYegTEFwlbki4KMWhFreMEY+9NFeV8B47n qeI7Nv+CuF0cn59ajZVSM+Ud7bH3/8V73avmWyr1gIer0hh9726dPAFYe15ltMnEv3lLVO ToXifsNhwdv85I/6XFUcDVUbZien/9jb24tOWNo08nRhOMePsH5mvgeDaArf/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V9w7l5syszx1w; Fri, 5 Apr 2024 10:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 435AhVVJ019636; Fri, 5 Apr 2024 10:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435AhVSu019633; Fri, 5 Apr 2024 10:43:31 GMT (envelope-from git) Date: Fri, 5 Apr 2024 10:43:31 GMT Message-Id: <202404051043.435AhVSu019633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 13952fbca7cd - stable/14 - pcm.4: Showcase default device change using mixer(8) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 13952fbca7cd3ce3ea3925465edeac298614f0d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=13952fbca7cd3ce3ea3925465edeac298614f0d4 commit 13952fbca7cd3ce3ea3925465edeac298614f0d4 Author: Christos Margiolis AuthorDate: 2024-03-29 15:59:55 +0000 Commit: Christos Margiolis CommitDate: 2024-04-05 10:43:24 +0000 pcm.4: Showcase default device change using mixer(8) Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44556 (cherry picked from commit d46a6a77e8e14177d07e3a53f68b428e5d1cb416) --- share/man/man4/pcm.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index cd0d29519f0c..17ac499e6bb3 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -614,7 +614,7 @@ This is handy if there are multiple .Nm devices available: .Pp -.Dl sysctl hw.snd.default_unit=1 +.Dl mixer -d pcm1 .Sh DIAGNOSTICS .Bl -diag .It pcm%d:play:%d:dsp%d.p%d: play interrupt timeout, channel dead From nobody Sat Apr 6 16:39:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBgzj21qdz5Gwxw; Sat, 6 Apr 2024 16:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBgzj1WKbz3ynQ; Sat, 6 Apr 2024 16:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712421553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=67lHTLGc8fjL/jSt1ZdUXOD59kRPBLLld1PSZG8GmRc=; b=YP1WBmTIWE+kjoxgT2H804nK/RPrT5YfjygcZD0bQTS6ECIWgZiWLqVFGzPvr8DAJULsa7 ViQowm4om5STEb5xNqlE96mPfLVFsocIoLFRKXc2kK5ntSscFMRzH3P6dJB46zMUyqihfM uXi25OXz9joXGkd95AQhGbOYTg8NedIZ/ROz073fTrpQ3ExAvujOc0XJDM+GdvCZx1K6qA GgZHs2+qaAomhAYLkcpukf7eWWGB8yN/o5Hr8dw/XFt8WuRy6gwEJrv6DJwsm4f3z2Vpk+ FAgEG24fp9aqcSXxJ/1X+h4cb3s7Q/fzG+UIvHTZN2Z7v6ULxasiG9KjE9rEhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712421553; a=rsa-sha256; cv=none; b=l0I2KeCOfh+SfklmRuLHuF0vdNaa0xYfjRD51JtDXF8MCYrMW0yaH0lJnfKw9HLhKYhSJ0 J3rZa96+VZsxnHRcQfJVzwCkf7uBXPoLRS5fRNkN9SgP8BNH4HiBJe4/QfkoorkpxJ7Cvt 7pdPCD1ixyk3+Ymy5O+RqbBdbCbJa/J4Kzle/ZwJUYHFP8hSnMZmQBxttnQSNwtJSawuKg SzNuqHzVoef5BZHd2jD5ySvDYoIBhklbmbnXex4LXy/x/kJ9Cpn2zuev/eoT3TjM4FU/s4 g19AZ5b9ah7jxb8YCLa9l8c7upr8lwTuQdLdhj1qUmj5Fv0xDx9AsZQ3HiTqZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712421553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=67lHTLGc8fjL/jSt1ZdUXOD59kRPBLLld1PSZG8GmRc=; b=E0m2IsYTBpnu2zRO1p13gMR84zyDykEFzo0X9o1JfYTq52sP9a02QZk/w+2wTeu62bsJRf yUFycoMsJhd1jiLCCGgZO7rmrnld+ob3qceFD6uvhSpswiTcAE6hFhXpfLrgydwHYomeoJ B0bntYDIc3Hb5PYxp5C3WsDl5Ban0pki0oMJmGisik5Wo/ANU3H7Qec3uAEUc4iGFlON5s iB0nwW8aInnxsXpRiidzfpFzchL8ofrqta0evWrj0+SWRuJhC1sZgPBDkkCcQe9Hao6hcu YnVH2glCNRjQEyYz0yheEgoLfhhbLpabFv6J5gFT8c5mtIJuzeK2pMC3NR3AYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VBgzj10mCzrDB; Sat, 6 Apr 2024 16:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 436GdDcd057712; Sat, 6 Apr 2024 16:39:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 436GdCXc057709; Sat, 6 Apr 2024 16:39:12 GMT (envelope-from git) Date: Sat, 6 Apr 2024 16:39:12 GMT Message-Id: <202404061639.436GdCXc057709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 18ec7a900324 - stable/14 - OptionalObsoleteFiles: add missed cuda wrappers include files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18ec7a900324939ffd8056ff871e55296b0a9745 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=18ec7a900324939ffd8056ff871e55296b0a9745 commit 18ec7a900324939ffd8056ff871e55296b0a9745 Author: Olivier Cochard AuthorDate: 2024-04-02 20:43:05 +0000 Commit: Dimitry Andric CommitDate: 2024-04-06 16:36:36 +0000 OptionalObsoleteFiles: add missed cuda wrappers include files Files introduced since clang 17.0.2. Approved by: dim Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44597 (cherry picked from commit a9275714690942e973ae69a3c179e3a435cf50dd) --- tools/build/mk/OptionalObsoleteFiles.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 506f3877883e..86b068a09b82 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -990,6 +990,8 @@ OLD_FILES+=usr/lib/clang/17/include/cmpccxaddintrin.h OLD_FILES+=usr/lib/clang/17/include/cpuid.h OLD_FILES+=usr/lib/clang/17/include/crc32intrin.h OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/basic_string.h +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/basic_string.tcc OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/shared_ptr_base.h OLD_DIRS+=usr/lib/clang/17/include/cuda_wrappers/bits OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/cmath From nobody Sat Apr 6 16:39:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBh0R46DLz5GxJ0; Sat, 6 Apr 2024 16:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBh0R23Vyz40ND; Sat, 6 Apr 2024 16:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712421591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ChmJFPmPmFVLpb44Ss0zN5y1sH2lTPuPlMw5aasKRTs=; b=IhK5L9tbUq58WN0pMqpNfHnD3hESyBrB4yQ/1H00rx/3GPlZdZ6R/Fd7hvFVlAasHterXQ jTvmE1rUbquEPtkEzpN6CKHCbwJSm89z9kikpokW7OHNK+WRz1ywkjgQqmplF0oCzvOT7W z1k8xH9PikkBjHvt6XszrA8AZXjaumZkfAiwCToOmQuAxelpNlr9nSvfzelv+/SQ4qhFAl py+5yizn7qLAQjKFF/o4/HryMWQw+OA0rL/gQ3Iof+RYWmJATNcp9khajP8KSY1+8UA8mL HoyTXQmjmVXHfDLee8Yc5b9juDir1hfmkmnWlmy7ALQvS2xvAGRlhbK7KoPmtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712421591; a=rsa-sha256; cv=none; b=x20/RTxrFLJ1+VAIzZn6dhJFK9k26IcR9NOJyuySdxoWXdDyOm6v92Uyv37LQ+S2jGvgNG DI4VezGGe1igaQH7LMhMUN1nKEK1vVzOLqqzZkNooGzWMRtn+c3lu3wzixFHZEVMoOKlxU O/6N5UD+nKSXHYOQnSYeQSHR54iUwvtozqj7dhUtWr0RQRb2LF9E2QWjoBkahfHfqCmrx7 Wd27O1T+2jXCExIkwbsKrXbVayRZ7x/9KqNOfz1X29LE3qhtddI1ErIJfVoEsp7Odf6XcU MdLNqJS8XItfu7C6VG4b3x/VycRnJPNYFbfsJPdJRVuBiCJSonA18+sf0P+lRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712421591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ChmJFPmPmFVLpb44Ss0zN5y1sH2lTPuPlMw5aasKRTs=; b=DUll5ySdbkWm+kGFNEKDcbA7i5BGPhdkSsYVOEvBLy5XQBOruXPBjFGXnGV5bDsxbbmzO3 sbinu0iaPNcJraTxU/43lxveYHBTgjJPkQG2L+7S84GVEtdqFQGfSRf9qt/0B/3Ms0wH37 eU1ji4aY3guIi81WjUUR8DYX9zt6OO8443uI8fSURvTa/2lbK7nv3k5KIMHukWl6ZND8fC cNKCaoDVCjuR3PB8Ecl8hWL1BHJFFTeQHmZVrsizjtYHgleKD1bQKO2aqQm+BV+Ge1kWsj xnw2r+x7iy4RX5CW3zoDKi2WNitRehLXI4lPBrzhIDkIBgQQ/8ybMJDKn94eZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VBh0R0dwTzr9P; Sat, 6 Apr 2024 16:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 436GdoAf057921; Sat, 6 Apr 2024 16:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 436GdouM057918; Sat, 6 Apr 2024 16:39:50 GMT (envelope-from git) Date: Sat, 6 Apr 2024 16:39:50 GMT Message-Id: <202404061639.436GdouM057918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1fd6ef0cb29e - stable/13 - OptionalObsoleteFiles: add missed cuda wrappers include files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fd6ef0cb29e5938f57a540b00df85ffd592785f Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1fd6ef0cb29e5938f57a540b00df85ffd592785f commit 1fd6ef0cb29e5938f57a540b00df85ffd592785f Author: Olivier Cochard AuthorDate: 2024-04-02 20:43:05 +0000 Commit: Dimitry Andric CommitDate: 2024-04-06 16:38:08 +0000 OptionalObsoleteFiles: add missed cuda wrappers include files Files introduced since clang 17.0.2. Approved by: dim Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44597 (cherry picked from commit a9275714690942e973ae69a3c179e3a435cf50dd) --- tools/build/mk/OptionalObsoleteFiles.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index e068ad8b5f91..d7a9aa46ae57 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1275,6 +1275,8 @@ OLD_FILES+=usr/lib/clang/17/include/cmpccxaddintrin.h OLD_FILES+=usr/lib/clang/17/include/cpuid.h OLD_FILES+=usr/lib/clang/17/include/crc32intrin.h OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/basic_string.h +OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/basic_string.tcc OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/bits/shared_ptr_base.h OLD_DIRS+=usr/lib/clang/17/include/cuda_wrappers/bits OLD_FILES+=usr/lib/clang/17/include/cuda_wrappers/cmath From nobody Sun Apr 7 00:31:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBtSl4xVxz5Fhpm; Sun, 7 Apr 2024 00:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBtSl4N3Yz3wb0; Sun, 7 Apr 2024 00:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712449895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ikBrpbGaWqzshh950gcKgGRgS6Us3+vaNGgNjxj+Qu0=; b=ZhoLK2X28pnrM90klKFyj82s1AIDuMk0He328AZJkdm2n6QbDbCEXRcIjWKAOFMXGco31G TgkQFv5n3QycqtycdE1YndiHGB6l3or/aYodshlNZJg4uROTGSkkE2YsqwA9hUZaAmlwfl XdokzX3sbm/j+wUy74HCptd7ed8qSANum4YDY7b36m4iLLykcWPCLgNIXFDlWPditjyIgC c/6Ee4bsiLB5X/AxApceTlEHmXyZegobpxC35XXusdF2Pl5f6t76N9qChxTWn7JzHZe6za eKBWhXzuGqWY2sXeRn5+nTsX2dZ+uGFyEkesPgFlwYcVWEcmR+8ocuhPfNp1tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712449895; a=rsa-sha256; cv=none; b=bc0d26mY34EwapcsIX/6/fF/aYzQIGkbJ2R/002d71l+Zc4HiTVNL22q3MHAjS8BRdj6fC Lvs5Ua4E7f1sC72X4/BYGms9rMti0UOqWsJoTqfMq5NzyYvH4HsnKOFzmb0bOK/0P0ZVqM Wn7uwUT0dalkQtLqJmxdn57JZJHAG+s1DTWXSs81CcYOMJBBxlDDBmzaa2UNdg+Ge/bbIU ni5GfbhcQZ0OQTAdhwYjlZPcumjRXnhNth47L4jdkl2IgjwK4vdRMJm1rHMTxHFZBee5k2 aVjJY5elCx0ppFXyaHO0qM5msPzNrVzpnGbx7p2oBvRaEjk4m56bed99qdfdWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712449895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ikBrpbGaWqzshh950gcKgGRgS6Us3+vaNGgNjxj+Qu0=; b=Ft/pK51MsLrtmQN8dOrfXjaej6dikuUTESe56XPd7hERihd5lLHDR+UyhC5tWxZJL1iWad QlWMXEQzOa9mtwfRvQ+Gjm6NG1BcPSP7hnSM7yAKu1V44EURpYATp3s+pAeWBUDO0VqzgD B2MEqqe8C8Ev1yI5AwxmNcN7jCc5B48nAxNJuAaCTwOh0ofwlC/VAQ5TRqFUEvJK9+TYy7 Mo6MziVyvnLjDsLDyxGQjv/H5rgH0sXdb7ZFurRBMF6hup9afqNZ/k+lHRuZ9ofGAIyIWw titinHInoNxvJR1gGvMIUUVLsyKme6MZXV7aNNNdtmqrFMmzHzEQRIy1eNTxSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VBtSl3yyNz156Q; Sun, 7 Apr 2024 00:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4370VZdu067882; Sun, 7 Apr 2024 00:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4370VZPV067879; Sun, 7 Apr 2024 00:31:35 GMT (envelope-from git) Date: Sun, 7 Apr 2024 00:31:35 GMT Message-Id: <202404070031.4370VZPV067879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: 7b86d14bfccb - stable/14 - unionfs: implement VOP_UNP_* and remove special VSOCK vnode handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b86d14bfccb589612cbc6b2e54b405da9839232 Auto-Submitted: auto-generated The branch stable/14 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=7b86d14bfccb589612cbc6b2e54b405da9839232 commit 7b86d14bfccb589612cbc6b2e54b405da9839232 Author: Jason A. Harmening AuthorDate: 2024-02-03 17:17:58 +0000 Commit: Jason A. Harmening CommitDate: 2024-04-07 00:27:00 +0000 unionfs: implement VOP_UNP_* and remove special VSOCK vnode handling unionfs has a bunch of clunky special-case code to avoid creating unionfs wrapper vnodes for AF_UNIX sockets. This was added in 2008 to address PR 118346, but in the intervening years the VOP_UNP_* operations have been added to provide a clean interface to allow sockets to work in the presence of stacked filesystems. PR: 275871 Reviewed by: kib (prior version), olce Tested by: Karlo Miličević Differential Revision: https://reviews.freebsd.org/D44288 (cherry picked from commit eee6217b40df5877674df1d9aec7d5bd04202876) --- sys/fs/unionfs/union_vnops.c | 173 +++++++++++++++++++++---------------------- 1 file changed, 84 insertions(+), 89 deletions(-) diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index d74d6736e580..5a2d4751ed4f 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -300,27 +300,8 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) error = lerror; if (error != 0) goto unionfs_lookup_cleanup; - /* - * get socket vnode. - */ - if (uvp != NULLVP && uvp->v_type == VSOCK) { - vp = uvp; - vref(vp); - if (cnp->cn_lkflags & LK_TYPE_MASK) - vn_lock(vp, cnp->cn_lkflags | LK_RETRY); - } - else if (lvp != NULLVP && lvp->v_type == VSOCK) { - vp = lvp; - vref(vp); - if (cnp->cn_lkflags & LK_TYPE_MASK) - vn_lock(vp, cnp->cn_lkflags | LK_RETRY); - } - /* - * get unionfs vnode. - */ - else - error = unionfs_nodeget(dvp->v_mount, uvp, lvp, - dvp, &vp, cnp); + error = unionfs_nodeget(dvp->v_mount, uvp, lvp, + dvp, &vp, cnp); if (error != 0) { UNIONFSDEBUG( "unionfs_lookup: Unable to create unionfs vnode."); @@ -333,7 +314,7 @@ unionfs_lookup(struct vop_cachedlookup_args *ap) *(ap->a_vpp) = vp; - if ((cnflags & MAKEENTRY) && vp->v_type != VSOCK) + if (cnflags & MAKEENTRY) cache_enter(dvp, vp, cnp); unionfs_lookup_cleanup: @@ -381,9 +362,7 @@ unionfs_create(struct vop_create_args *ap) lkflags)) && error == 0) { error = ENOENT; } - if (error == 0 && vp->v_type == VSOCK) - *(ap->a_vpp) = vp; - else if (error == 0) { + if (error == 0) { VOP_UNLOCK(vp); error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP, ap->a_dvp, ap->a_vpp, cnp); @@ -464,9 +443,7 @@ unionfs_mknod(struct vop_mknod_args *ap) lkflags)) && error == 0) { error = ENOENT; } - if (error == 0 && vp->v_type == VSOCK) - *(ap->a_vpp) = vp; - else if (error == 0) { + if (error == 0) { VOP_UNLOCK(vp); error = unionfs_nodeget(ap->a_dvp->v_mount, vp, NULLVP, ap->a_dvp, ap->a_vpp, cnp); @@ -1059,9 +1036,7 @@ unionfs_remove(struct vop_remove_args *ap) struct vnode *udvp; struct vnode *uvp; struct vnode *lvp; - struct vnode *vp; struct componentname *cnp; - struct componentname cn; struct thread *td; int error; int pathlen; @@ -1069,71 +1044,34 @@ unionfs_remove(struct vop_remove_args *ap) UNIONFS_INTERNAL_DEBUG("unionfs_remove: enter\n"); KASSERT_UNIONFS_VNODE(ap->a_dvp); + KASSERT_UNIONFS_VNODE(ap->a_vp); error = 0; dunp = VTOUNIONFS(ap->a_dvp); udvp = dunp->un_uppervp; cnp = ap->a_cnp; td = curthread; - unp = NULL; - - if (ap->a_vp->v_op != &unionfs_vnodeops) { - if (ap->a_vp->v_type != VSOCK) - return (EINVAL); - ump = NULL; - vp = uvp = lvp = NULLVP; - /* search vnode */ - VOP_UNLOCK(ap->a_vp); - error = unionfs_relookup(udvp, &vp, cnp, &cn, td, - cnp->cn_nameptr, cnp->cn_namelen, DELETE); - if (error != 0 && error != ENOENT) { - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); - return (error); - } - if (error == 0 && vp == ap->a_vp) { - /* target vnode in upper */ - uvp = vp; - vrele(vp); - } else { - /* target vnode in lower */ - if (vp != NULLVP) { - if (udvp == vp) - vrele(vp); - else - vput(vp); - } - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY); - lvp = ap->a_vp; - } - path = cnp->cn_nameptr; - pathlen = cnp->cn_namelen; - } else { - ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount); - unp = VTOUNIONFS(ap->a_vp); - uvp = unp->un_uppervp; - lvp = unp->un_lowervp; - path = unp->un_path; - pathlen = unp->un_pathlen; - } + ump = MOUNTTOUNIONFSMOUNT(ap->a_vp->v_mount); + unp = VTOUNIONFS(ap->a_vp); + uvp = unp->un_uppervp; + lvp = unp->un_lowervp; + path = unp->un_path; + pathlen = unp->un_pathlen; if (udvp == NULLVP) return (EROFS); if (uvp != NULLVP) { - /* - * XXX: if the vnode type is VSOCK, it will create whiteout - * after remove. - */ int udvp_lkflags, uvp_lkflags; if (ump == NULL || ump->um_whitemode == UNIONFS_WHITE_ALWAYS || lvp != NULLVP) cnp->cn_flags |= DOWHITEOUT; unionfs_forward_vop_start_pair(udvp, &udvp_lkflags, - ((unp == NULL) ? NULL : uvp), &uvp_lkflags); + uvp, &uvp_lkflags); error = VOP_REMOVE(udvp, uvp, cnp); unionfs_forward_vop_finish_pair(ap->a_dvp, udvp, udvp_lkflags, - ((unp == NULL) ? NULL : ap->a_vp), uvp, uvp_lkflags); + ap->a_vp, uvp, uvp_lkflags); } else if (lvp != NULLVP) error = unionfs_mkwhiteout(ap->a_dvp, udvp, cnp, td, path, pathlen); @@ -1171,22 +1109,18 @@ unionfs_link(struct vop_link_args *ap) if (udvp == NULLVP) return (EROFS); - if (ap->a_vp->v_op != &unionfs_vnodeops) - uvp = ap->a_vp; - else { - unp = VTOUNIONFS(ap->a_vp); + unp = VTOUNIONFS(ap->a_vp); - if (unp->un_uppervp == NULLVP) { - if (ap->a_vp->v_type != VREG) - return (EOPNOTSUPP); + if (unp->un_uppervp == NULLVP) { + if (ap->a_vp->v_type != VREG) + return (EOPNOTSUPP); - error = unionfs_copyfile(unp, 1, cnp->cn_cred, td); - if (error != 0) - return (error); - needrelookup = 1; - } - uvp = unp->un_uppervp; + error = unionfs_copyfile(unp, 1, cnp->cn_cred, td); + if (error != 0) + return (error); + needrelookup = 1; } + uvp = unp->un_uppervp; if (needrelookup != 0) error = unionfs_relookup_for_create(ap->a_tdvp, cnp, td); @@ -2835,6 +2769,64 @@ unionfs_unset_text(struct vop_unset_text_args *ap) return (0); } +static int +unionfs_unp_bind(struct vop_unp_bind_args *ap) +{ + struct vnode *tvp; + struct unionfs_node *unp; + + ASSERT_VOP_LOCKED(ap->a_vp, __func__); + unp = VTOUNIONFS(ap->a_vp); + tvp = unp->un_uppervp != NULL ? unp->un_uppervp : unp->un_lowervp; + VOP_UNP_BIND(tvp, ap->a_unpcb); + return (0); +} + +static int +unionfs_unp_connect(struct vop_unp_connect_args *ap) +{ + struct vnode *tvp; + struct unionfs_node *unp; + + ASSERT_VOP_LOCKED(ap->a_vp, __func__); + unp = VTOUNIONFS(ap->a_vp); + tvp = unp->un_uppervp != NULL ? unp->un_uppervp : unp->un_lowervp; + VOP_UNP_CONNECT(tvp, ap->a_unpcb); + return (0); +} + +static int +unionfs_unp_detach(struct vop_unp_detach_args *ap) +{ + struct vnode *tvp; + struct unionfs_node *unp; + + tvp = NULL; + /* + * VOP_UNP_DETACH() is not guaranteed to be called with the unionfs + * vnode locked, so we take the interlock to prevent a concurrent + * unmount from freeing the unionfs private data. + */ + VI_LOCK(ap->a_vp); + unp = VTOUNIONFS(ap->a_vp); + if (unp != NULL) { + tvp = unp->un_uppervp != NULL ? + unp->un_uppervp : unp->un_lowervp; + /* + * Hold the target vnode to prevent a concurrent unionfs + * unmount from causing it to be recycled once the interlock + * is dropped. + */ + vholdnz(tvp); + } + VI_UNLOCK(ap->a_vp); + if (tvp != NULL) { + VOP_UNP_DETACH(tvp); + vdrop(tvp); + } + return (0); +} + struct vop_vector unionfs_vnodeops = { .vop_default = &default_vnodeops, @@ -2888,5 +2880,8 @@ struct vop_vector unionfs_vnodeops = { .vop_vput_pair = unionfs_vput_pair, .vop_set_text = unionfs_set_text, .vop_unset_text = unionfs_unset_text, + .vop_unp_bind = unionfs_unp_bind, + .vop_unp_connect = unionfs_unp_connect, + .vop_unp_detach = unionfs_unp_detach, }; VFS_VOP_VECTOR_REGISTER(unionfs_vnodeops); From nobody Sun Apr 7 16:34:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCHqz07Syz5H6BQ; Sun, 7 Apr 2024 16:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCHqy6dzDz4JNK; Sun, 7 Apr 2024 16:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=viUMl0+MNrviHKMcCoXUH+x1ALc5yYOgO9N3mTzXN0Y=; b=n17XW0Tk4KgIlYKpiTuc1e1aXHWbmk9DPvoQomRqPbmXLP32X3gKQpQe+X+QHjfFt55ZRT 7oQBOXauXBkSRzkutAOX3RwQW3gn9+T7JS0e85F+aX1z/or8QD+Qi1EcA7w+z53OpN3rPL z5JepXAeSRnN3ASCchyToBQPn2JBUxPtSJ05gd/fjPqfHHMI73Z4rgzqdY+orUykib/536 TXRjnuNxhM3itZ+PJkfxExJ+eEwnKwNi+FJqZD1QtUULC0WSiSFuJcoYS2mRKkWiSSw7rg JfzX6VRj9H1bDRwB+Y/7lVBmi8P+w4+PHKRmTF+zx9bZXXWmfNmCNb6OwirbEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712507678; a=rsa-sha256; cv=none; b=IRsnzxYYNAildPdOWgX/ZsHwUcT0Ryl1gcSHJvaUCLii4rYKjGp8vsCwESu3jbYhmOmBo5 A5qT4dLJC2cXVJjEuFVqDyVy/lWPOKjSiSsj95qns3vE67UIRKmAN3EtF1u0aBr62MqXON hlwdBKlqJnd1tHgYTZzk7BOstiKQMC5EvKazQNTuc+PUsXp3kGTu7WU0lsb3p9AwDPBXun iqm/r4b7du0kj2QcCweM0BeR8hAHTqrz6SxV53kxeG6GI+K+BQWEDPqtNMWP5DybQyKHOP GP4XIX76U709JE68jFRClqeBqWKDml4tsxUDNP5lZgyDmNRQC02Z9dDXitsBzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=viUMl0+MNrviHKMcCoXUH+x1ALc5yYOgO9N3mTzXN0Y=; b=CkNg2p+Lpe70QGVM6Z+WNV6Yl446zj+TZFl7+SAi0E/5V0vbQ6P4QtYD74ym2POLQktwvX WBIzpYF5k4swlT3rQuFe8r6sxviUrE+lMViQZ6xTBKlrx29y4FF1KFS6J4eAECBgjfensF UCx9nqf+UeUtvhmlN4pFUr7G0APXysK91KGQ9T7u65pizIMtvcKKh8o9iQv5YsgeHsNTaz egVl1Rnk31KY7xWbHpC+G8b9KZBZPTfn46VMxOf7S+V+5qr94VqtdLKza/sf5n4q0CwZo+ ecsGw7sOy4ZbIr2N1s7M73QMCmwVC2zCMyCG1t/Lse5XOV3RSZZHVE1Iyq0+zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCHqy6F6xzb3v; Sun, 7 Apr 2024 16:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 437GYcfV092006; Sun, 7 Apr 2024 16:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 437GYcKt092003; Sun, 7 Apr 2024 16:34:38 GMT (envelope-from git) Date: Sun, 7 Apr 2024 16:34:38 GMT Message-Id: <202404071634.437GYcKt092003@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: bedc8daace26 - stable/14 - dma.conf: Fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: bedc8daace2692efa9aad232c3eeff61f2c954c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bedc8daace2692efa9aad232c3eeff61f2c954c9 commit bedc8daace2692efa9aad232c3eeff61f2c954c9 Author: Mikael Urankar AuthorDate: 2024-03-27 09:36:33 +0000 Commit: Ed Maste CommitDate: 2024-04-07 16:34:04 +0000 dma.conf: Fix typo Pull Request: https://github.com/freebsd/freebsd-src/pull/1150 (cherry picked from commit c92400a6f690a82ab84eb0b97cc8bf169e44e4e8) --- libexec/dma/dmagent/dma.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/dma/dmagent/dma.conf b/libexec/dma/dmagent/dma.conf index e11fd67cd254..bb28306e342e 100644 --- a/libexec/dma/dmagent/dma.conf +++ b/libexec/dma/dmagent/dma.conf @@ -15,7 +15,7 @@ # SMTP authentication #AUTHPATH /etc/dma/auth.conf -# Uncomment if yout want TLS/SSL support +# Uncomment if you want TLS/SSL support #SECURETRANSFER # Uncomment if you want STARTTLS support (only used in combination with From nobody Sun Apr 7 16:34:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCHr1409Tz5H6DN; Sun, 7 Apr 2024 16:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCHr11XQzz4Jky; Sun, 7 Apr 2024 16:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mC4BkJePOnETBZWT3Jpy1Opl820if8/+ue6YAupkGk0=; b=xE2fihupmg5RDwo/yIh0P9f+08YPxtp4T89N+rbX2+P/mjLK6PNGv5HKYDlGV4Gk1SXHC+ mVslwbt8Mq6I6KQqcGupZKhbdwovcuXrmG0P1cj9Rnc/vtIeXFVD0JbGlHQ7h/7TowBJuK df868bDyBcbzOAzNX721kP4oYhugbW1EcdttLIbKc9c2I3pU8ATJQ15JiwcZB1y8RnTOrt 6NDsFa3cnzR3xhiDOrWK/LSdoUlSJ0h5BI2W33/SEMkWj9FnxNSZoTiaAec2JaYq3oSNlQ HTgb9EA+UnKe/2UF5xUa3KTBhb2ukGWkIrHF7h46TloUWhMdOiegLA2UO6K76w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712507681; a=rsa-sha256; cv=none; b=ADMbLANkVJQP9yiUO/ViqavcWZnvCNwtmLm0EwUFLY5PLVdFUJpUNTHbEmMB+HjV6qctXD lgGQVh6gS8BudjtNp0S6nbzKhED96CpmuOAKScqnFWAf/J8Cf8RA7JN3H5b1tYmqa79JxY cEXniBM4viJUCvr5brtAJI06mhiY0PWkQSHrtXJj50yGhbfSVs/bSry3CEzi/7BoMZiasp OlBb0tYe5lldxDCOR53U2poQvtCBtj/+mqLFlR3f+P/uDaCW74r2/IIlMIeQtQceNTKRDf nbSU20OhoFfLJr+Xy/WGPCntnZptLZ4uTqguV28Y1PeeF+nAEUPKKCmkw983fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mC4BkJePOnETBZWT3Jpy1Opl820if8/+ue6YAupkGk0=; b=YW8sdR2bMXokJhQLGeBXjm7RoHGkU560qS2yc4fPDUWTNRPlL4NgxCgC19Nz9LUEiUtVeU acIWNAS2vKwi36AwIh+xqPdrv1wm/4HKFrTJUPCXkgK7yZuzZxuwCsXKrYLg1MYSgXcm3B 7JM7WSL8wVY3tHseJ2PYPL7YBlwShiC4bEKsfCZNBO3rcIBqgtcQ7Y6suySDBF7L36tTV7 3R5RDfbA4IlF2M8KDGZc2fIw9MU8PQxflt8OTaEQ3msbsRr/LXb74qdKQFW09djYYc1y3Q icW9wPi+ha40COKrOtaWrsrnzkXeHXoiqpAMLn/H9C5d/sb31zJxL8beY25Eag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCHr117w7zbGV; Sun, 7 Apr 2024 16:34:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 437GYf3p092109; Sun, 7 Apr 2024 16:34:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 437GYfas092106; Sun, 7 Apr 2024 16:34:41 GMT (envelope-from git) Date: Sun, 7 Apr 2024 16:34:41 GMT Message-Id: <202404071634.437GYfas092106@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: 6ac10e8a72a7 - stable/14 - rights.4: add note about rights not being simple bitmasks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 6ac10e8a72a730e9078738e317f5c3e2475bd7bd Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6ac10e8a72a730e9078738e317f5c3e2475bd7bd commit 6ac10e8a72a730e9078738e317f5c3e2475bd7bd Author: Ed Maste AuthorDate: 2024-03-22 13:47:57 +0000 Commit: Ed Maste CommitDate: 2024-04-07 16:34:04 +0000 rights.4: add note about rights not being simple bitmasks PR: 277057 Reviewed by: oshogbo, asomers Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44473 (cherry picked from commit 537bdafbc25d39b4bb3dce124691913f86c08288) --- share/man/man4/rights.4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rights.4 b/share/man/man4/rights.4 index 770f9ea5c979..2d44a1060006 100644 --- a/share/man/man4/rights.4 +++ b/share/man/man4/rights.4 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 28, 2019 +.Dd March 22, 2024 .Dt RIGHTS 4 .Os .Sh NAME @@ -68,6 +68,12 @@ The .Xr cap_rights_init 3 family of functions should be used to manage the structure. .Sh RIGHTS +Note that rights are not simple bitmasks (and cannot be bitwise-ORed together). +See +.Xr cap_rights_init 3 +for details. +.Pp +The following rights are available: .Bl -tag -width CAP_RENAMEAT_SOURCE .It Dv CAP_ACCEPT Permit From nobody Sun Apr 7 16:34:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCHr032vGz5H6Wv; Sun, 7 Apr 2024 16:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCHr02DlQz4JFh; Sun, 7 Apr 2024 16:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOp/jsdchqkfelgfhI5JFDWwP1/RqXnWhCEBhgjxxpc=; b=YJJdqNerlSVVuC3ZXnuy8fTybrEQRuhAIOJHJ9AGN0mVzGW4COrVmvC7dsGnEqZqQywUaA 61maXu/6eSEoieCOkSTjKMn7D3puIGK2J6jVzyVQW+89xVAllrqKbHV9jN+XnU9DzoU642 OjkdoXAl5BNcuqCFhReklgwk24spBHPc2R1oN91qyqP6LIsZK8pCsbMFk9urKvGxCZj02Y O3sGgY4lw0lH8qQiuuLh+GQxLHLBirKUv8vfhgXInO53/UXcvr/L9rmEi3cgdGChdRb31N Rd9MDYPyMqD0Yz8MvVIrSYqI5Smn6IBWZjcW0FMjpANwCu/mYIDO0Q963W9T0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712507680; a=rsa-sha256; cv=none; b=fHnkZ7jaKxd81gYoPBpRbrIOD6K7+DeXydFl7M6nW9Q+dAJuZpVU5U6FgHxrKp1Uvsl3FB bJTzSsRSyS4XLk5V9aV8zYChwLVrfxA7nemhmO1yIopuX8ScSTr57lzak1bL6xMOhQRPkO 2nqV2dInIJ5U3FSbMki9itxqdHR09qUi/vZ9zkic8+8TyPm9VS0b6arPpBgvKeGzTLvBLY +NH+sFx4TAMFYT34r7HgEdkK8gsZPifHEym6GcnEhc1sL20emrYBSqqCq+A76jfyrYL+6u BcGfYqz2Wv5hXgXSDG+D43AGWcls1WH1B7qdv5u4H0sswX6NVmbS7gxkyFi6YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712507680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOp/jsdchqkfelgfhI5JFDWwP1/RqXnWhCEBhgjxxpc=; b=k+fLbWewc++PXSabfH+xdpLwct+I3Q5jKi95q6C5kN7Cxvn+T+pIc/6BcTCBvyw7fk98oc Iu7OVeBHluX8hovzvcxivexvguXmNrzmRbmGQxSSPRmJp1Z26RLbCQG6VkOFi5oOQXfW4C Y/jcWVhiZyL6/WI3Ngiu8TNkfMnAeAl3CT21o928e37gUAthkPLkF4rb/V9PzcnQipzgaa UfwLXLo+AIrXwcS3ITHxQHKnE1Y00b60dRZFEhkt4/Z3WwaVWKnps7NUybRS/Uw4tOmZBW f4MVHg5pq+yTb9zIakbX55pSIk6Et1HzI2tbQ0wGpbjKMv0h8S7ow+qSReuH7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCHr007XJzb6k; Sun, 7 Apr 2024 16:34:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 437GYdxt092048; Sun, 7 Apr 2024 16:34:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 437GYdCO092045; Sun, 7 Apr 2024 16:34:39 GMT (envelope-from git) Date: Sun, 7 Apr 2024 16:34:39 GMT Message-Id: <202404071634.437GYdCO092045@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: 507e18dfc324 - stable/14 - freebsd-update: Fix typo in comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 507e18dfc32491d2617488b470c2208db88977e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=507e18dfc32491d2617488b470c2208db88977e2 commit 507e18dfc32491d2617488b470c2208db88977e2 Author: a-biardi AuthorDate: 2024-04-02 12:28:52 +0000 Commit: Ed Maste CommitDate: 2024-04-07 16:34:04 +0000 freebsd-update: Fix typo in comment s/patchname expansion/pathname expansion/ Signed-off-by: a.biardi@tiscali.it Pull-request: https://github.com/freebsd/freebsd-src/pull/1152 (cherry picked from commit 91811711625482f3a5778939e9999f53a0bea22a) --- usr.sbin/freebsd-update/freebsd-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 9af6e8d711ed..b6a8911e64b7 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2895,7 +2895,7 @@ backup_kernel () { (cd ${BASEDIR}/${KERNELDIR} && find . -type f $FINDFILTER -exec \ cp -pl '{}' ${BASEDIR}/${BACKUPKERNELDIR}/'{}' \;) - # Re-enable patchname expansion. + # Re-enable pathname expansion. set +f } From nobody Sun Apr 7 16:59:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCJN52Tfgz5H8Bc; Sun, 7 Apr 2024 16:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCJN51fNXz4Lyb; Sun, 7 Apr 2024 16:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712509141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79DjXCIoj87STZs9cdammnVM8APR4lXBq7sX3n3X8g0=; b=RgD3dURYqZaSn5686vzLnJtjUEAb06syQhcQXr0rc7OMfVSAvyrlKKRu/VEdiKHCkrHgAY bWMirZevbHmq02bcqHk3bntu/qmFNcumdpEbn0DWr4E45bI5Seldfu/dJ8vXRy6GsrMGuf rusSpL4UuS+tujPMmT682xbh4x8Y3l6/k4jirPMLWQw5TsgayKDjJMLkqBKAFwyyKLyIBa 9MTHxY4Rr2bRrzYoDSabHPFGufUUtfC/w01qYl/DXmjKHg9oWZLBqh3e/0xbcfWQL+oPEa QTWciL5mjXTY76UI4FGo9ngm8FZkL4CTGQJSoPVNYFoTNWWw2M5BcpOhs244cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712509141; a=rsa-sha256; cv=none; b=shd5Tw/VHId7aTgmRJnzMWATEgsXam8DmCrYcyOAM3k47bd9uQ1EBDbzKps9Xr92CwxiE3 GwR3k+BED/svEGHFOKoZ7pnnBzEUc4HqUrJxBs+tLAV8O0Ctbjh8rwl7zOjN3bzwdTfAdD Y8hUO5A/OjvBQndRmt9XcL5+GZcNoiClei4CYHBuz1PXL6lkvUY6fpYTy+p6nFg46D9REZ 6+YobmkXW59W0q3AEHBMMlDq9GteBVhbaVbzu1vjJs9FmQBnolG9rt6rzdIxcWwNyLpNcv E+JR0iv8kqnJR3am1XQwZEJ/YVBYCp2ePlsFBjtGALcqWoPTD7tzAKuBaz0V3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712509141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=79DjXCIoj87STZs9cdammnVM8APR4lXBq7sX3n3X8g0=; b=L6ECGNaNmlzUF3IJMMrlbOAZ93wVzbzdnPjcqDq5S2jXKV/PdcDAz/9aCgFF28RyO3sbBB 1VDZJnkzRYA4YBl38etcyDa849hRnU6XXGUfqltqkkfhTIWPpvcQXT/L8/CpwBbyMRR7CO E/zejEYdypZoO3a2osBB1M3ZlXwH1mwa6WaXwctvQ+fgqZa4Hk6Ubg3P7WR3hS8krAWDwU yg0XLmKH/GPdtqvvX8BN1EgXgNPlB3Aqq+urmDfXGOFoC4IYwyOLAF80QoAT4J4+tMfXZ/ tkHE43FRkPEdEXX35pxrdyoVGdRV7Vze18fN0xrr7xuN3eTFn0cwNGMtYV5wKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCJN51FlczbnJ; Sun, 7 Apr 2024 16:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 437Gx1F5025948; Sun, 7 Apr 2024 16:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 437Gx18K025945; Sun, 7 Apr 2024 16:59:01 GMT (envelope-from git) Date: Sun, 7 Apr 2024 16:59:01 GMT Message-Id: <202404071659.437Gx18K025945@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: a2ce5a2dc95f - stable/13 - tar: make error reporting more robust and use correct errno List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: a2ce5a2dc95f7ce0de644abd963bd77edfb86fc3 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a2ce5a2dc95f7ce0de644abd963bd77edfb86fc3 commit a2ce5a2dc95f7ce0de644abd963bd77edfb86fc3 Author: Ed Maste AuthorDate: 2024-03-31 14:37:38 +0000 Commit: Ed Maste CommitDate: 2024-04-07 16:58:50 +0000 tar: make error reporting more robust and use correct errno Apply upstream pull request 2101. (cherry picked from commit d68c68693e110353f70b5c04f8de416cf5766eca) (cherry picked from commit bade279b8106e9d4166ef2430b4bdbcf17be9953) --- contrib/libarchive/tar/read.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/libarchive/tar/read.c b/contrib/libarchive/tar/read.c index 2a907518d7cb..94616f279e65 100644 --- a/contrib/libarchive/tar/read.c +++ b/contrib/libarchive/tar/read.c @@ -372,8 +372,9 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) if (r != ARCHIVE_OK) { if (!bsdtar->verbose) safe_fprintf(stderr, "%s", archive_entry_pathname(entry)); - fprintf(stderr, ": %s: ", archive_error_string(a)); - fprintf(stderr, "%s", strerror(errno)); + safe_fprintf(stderr, ": %s: %s", + archive_error_string(a), + strerror(archive_errno(a))); if (!bsdtar->verbose) fprintf(stderr, "\n"); bsdtar->return_value = 1; From nobody Sun Apr 7 16:59:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCJN63HN3z5H862; Sun, 7 Apr 2024 16:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCJN62g6qz4Lsl; Sun, 7 Apr 2024 16:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712509142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CL/meVK3J9U4YXmK/yKJF5PjqzSj0Ot0FCuAyoXIiJc=; b=p4u6nQCRV3uzjSZ5qs4GrdsPJLdp7uteup9RkgbQhbxmbWAhBQfHy8xwYG3ea7aYB7QfZ/ w5hWY9vCpdXJsiCFiPJU/pDv/nTyT6S3odw5zQ490v2q12oOGpq3+4PpwA2XRE/NVEzOFt CT7FtdLvFYWYayAOy0/by43g76IusmIqBW/anLw+rYIZ9nbtCh0akpcdCulrXJzHdawgmY JUC+o4G9XBIIfagXZX0Wt7314gEq8V9f836YTOd4yTTgk6HxvN7po0cVpvLK4H1JWQjgLi XYIuqzcQANVRYBkTIdugENmCPRkHnWASLCMxGzUikPI5vwjMzHE9kuOgr00zEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712509142; a=rsa-sha256; cv=none; b=T1wpH00qbW0emFx3O43wOSZl1oBxQRIl2JILGFZfwja6ryan2adPYsLuMwUy9cbsRxLj2z IHI/9WV599mqhiISgb7qNGlTvHnFl7PKrRXNAl1hgwWbbC0eAyF/etGHFU7QtJeLL2WmI1 DwbVw4qUforMcFvIEsYLJedUBCB4uI3CrIt/MS6SAOCaQUGZrtJoIS5G1iT+HMz672qCfh g0Nb2T3MRSv7bHIdMeWZ5YgmZpBMx4JZ3AdUuDk2HUotl1RQYbtJ6LLStnBMnLj93TmibG wDepLbdqQnL4fgrmoVm+/pWuRMHJRHFIBc55/N0Su1ynW5iP9iPpDT5UojgTyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712509142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CL/meVK3J9U4YXmK/yKJF5PjqzSj0Ot0FCuAyoXIiJc=; b=h09OkYEafoeMq3Vb2upxF+rvaPmN/FW+5jTdYh/e1QJA/tLxfIsJUL0nLpmi2VCT/CScLF v5BWuJmQzfPn5VvH+VYwiN+peCgeYZH3uNBuMAJVfE1VawKZ4lsQ3+oQ0cI5KoL/UhZvJe KsIalokQdGVjQNao7LoT9wzINX4GC25j5O5+IGCCIpw8DLniNLZcz9/QAkQgtrH4WyahqQ 4tH+BvkNYeu37Ym+81R0Ppv9jgW4Ipijo0RW6LaBtvhh7Pf+FL/NWfQeuzr0xpuoPfsFbL tm9wwFBHhyx5JQqZGpGl6nXpzf0rWAyEYLG55dtsvoIOpZbvJShjSo0v+BTSFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCJN62H5Zzc2X; Sun, 7 Apr 2024 16:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 437Gx2Ge026002; Sun, 7 Apr 2024 16:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 437Gx21m025999; Sun, 7 Apr 2024 16:59:02 GMT (envelope-from git) Date: Sun, 7 Apr 2024 16:59:02 GMT Message-Id: <202404071659.437Gx21m025999@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: 9031978083ce - stable/13 - rights.4: add note about rights not being simple bitmasks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 9031978083ce158f54fb5dadc0e1c683bbad762b Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9031978083ce158f54fb5dadc0e1c683bbad762b commit 9031978083ce158f54fb5dadc0e1c683bbad762b Author: Ed Maste AuthorDate: 2024-03-22 13:47:57 +0000 Commit: Ed Maste CommitDate: 2024-04-07 16:58:50 +0000 rights.4: add note about rights not being simple bitmasks PR: 277057 Reviewed by: oshogbo, asomers Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44473 (cherry picked from commit 537bdafbc25d39b4bb3dce124691913f86c08288) (cherry picked from commit 6ac10e8a72a730e9078738e317f5c3e2475bd7bd) --- share/man/man4/rights.4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/rights.4 b/share/man/man4/rights.4 index 770f9ea5c979..2d44a1060006 100644 --- a/share/man/man4/rights.4 +++ b/share/man/man4/rights.4 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 28, 2019 +.Dd March 22, 2024 .Dt RIGHTS 4 .Os .Sh NAME @@ -68,6 +68,12 @@ The .Xr cap_rights_init 3 family of functions should be used to manage the structure. .Sh RIGHTS +Note that rights are not simple bitmasks (and cannot be bitwise-ORed together). +See +.Xr cap_rights_init 3 +for details. +.Pp +The following rights are available: .Bl -tag -width CAP_RENAMEAT_SOURCE .It Dv CAP_ACCEPT Permit